forked from DarkstarProject/darkstar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
44 lines (35 loc) · 1.1 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
cmake_minimum_required(VERSION 3.9)
project(darkstar)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(compiler)
if(UNIX)
find_package(PkgConfig REQUIRED)
include(FindThreads)
pkg_search_module(MYSQLCLIENT mariadb)
if(NOT MYSQLCLIENT_FOUND)
pkg_search_module(MYSQLCLIENT REQUIRED mysqlclient)
endif()
pkg_search_module(ZMQ REQUIRED libzmq)
pkg_search_module(LUAJIT REQUIRED luajit)
else()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(platform_suffix "64")
set(spacer "_")
set(lib_dir lib64)
elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(platform_suffix "")
set(spacer "")
set(lib_dir lib)
endif()
link_directories(${lib_dir})
if(CMAKE_CONFIGURATION_TYPES STREQUAL Debug)
set(lib_debug "-d")
else()
set(lib_debug "")
endif()
endif()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_SOURCE_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR})
add_subdirectory(src)