2022-03-05 12:44:06 +02:00
|
|
|
cmake_minimum_required(VERSION 3.8)
|
|
|
|
|
|
|
|
project(game CXX)
|
|
|
|
|
|
|
|
file(GLOB_RECURSE sources
|
|
|
|
src/*.cpp src/*.h
|
|
|
|
)
|
|
|
|
|
2022-03-06 00:01:03 +02:00
|
|
|
include_directories(${PROJECT_BINARY_DIR}/src/)
|
2022-03-05 12:44:06 +02:00
|
|
|
|
|
|
|
include_directories(src/)
|
|
|
|
|
|
|
|
# Find dependencies
|
|
|
|
find_package(libmysql REQUIRED)
|
|
|
|
find_package(Boost COMPONENTS system REQUIRED)
|
|
|
|
find_package(DevIL REQUIRED)
|
|
|
|
find_package(LZO REQUIRED)
|
2022-03-06 00:01:03 +02:00
|
|
|
find_package(cryptopp CONFIG REQUIRED)
|
2022-03-05 12:44:06 +02:00
|
|
|
|
|
|
|
add_executable(${PROJECT_NAME} ${sources})
|
|
|
|
|
|
|
|
# Link dependencies if found
|
2022-03-06 00:01:03 +02:00
|
|
|
target_link_libraries (${PROJECT_NAME} ${MYSQL_LIBRARIES})
|
|
|
|
|
|
|
|
# Crypto++
|
|
|
|
target_link_libraries (${PROJECT_NAME} cryptopp-static)
|
|
|
|
|
|
|
|
# Boost
|
|
|
|
include_directories(${Boost_INCLUDE_DIR})
|
|
|
|
target_link_libraries (${PROJECT_NAME} ${Boost_LIBRARIES})
|
2022-03-05 12:44:06 +02:00
|
|
|
|
|
|
|
if (IL_FOUND)
|
|
|
|
include_directories(${IL_INCLUDE_DIR})
|
|
|
|
target_link_libraries (${PROJECT_NAME} ${IL_LIBRARIES})
|
|
|
|
endif (IL_FOUND)
|
|
|
|
|
|
|
|
if (LZO_FOUND)
|
|
|
|
include_directories(${LZO_INCLUDE_DIR})
|
|
|
|
target_link_libraries (${PROJECT_NAME} ${LZO_LIBRARIES})
|
|
|
|
endif (LZO_FOUND)
|
|
|
|
|
|
|
|
|
|
|
|
# Pthreads
|
|
|
|
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
|
|
|
find_package (Threads REQUIRED)
|
|
|
|
target_link_libraries (${PROJECT_NAME} Threads::Threads)
|
|
|
|
|
|
|
|
target_link_libraries(${PROJECT_NAME} libgame libpoly libsql libthecore liblua)
|
|
|
|
|