forked from metin2/server
32 lines
850 B
CMake
32 lines
850 B
CMake
cmake_minimum_required(VERSION 3.8)
|
|
|
|
project(db CXX)
|
|
|
|
file(GLOB_RECURSE sources
|
|
src/*.cpp src/*.h
|
|
)
|
|
|
|
# Add the src directory to the include path
|
|
include_directories(src/)
|
|
|
|
add_executable(${PROJECT_NAME} ${sources})
|
|
|
|
# Find dependencies
|
|
find_package(Boost REQUIRED)
|
|
include_directories(${Boost_INCLUDE_DIRS})
|
|
target_link_libraries (${PROJECT_NAME} PRIVATE ${Boost_LIBRARIES} ${Boost_SYSTEM_LIBRARY})
|
|
|
|
# Pthreads
|
|
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
|
find_package(Threads REQUIRED)
|
|
target_link_libraries(${PROJECT_NAME} PRIVATE Threads::Threads)
|
|
|
|
# Libevent
|
|
find_package(Libevent CONFIG REQUIRED)
|
|
target_link_libraries(${PROJECT_NAME} PRIVATE libevent::core libevent::extra libevent::pthreads)
|
|
|
|
target_link_libraries(${PROJECT_NAME} PRIVATE libpoly libsql libthecore)
|
|
|
|
# Memory debugging
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -g")
|