-
Notifications
You must be signed in to change notification settings - Fork 35
/
CMakeLists.txt
103 lines (84 loc) · 2.82 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
project(ATF)
cmake_minimum_required(VERSION 3.11)
# Enable PIC as static libraries may be linked to shared objects
set (CMAKE_POSITION_INDEPENDENT_CODE TRUE)
set (CMAKE_CXX_STANDARD 11)
set (CMAKE_INCLUDE_CURRENT_DIR ON)
set (CMAKE_AUTOMOC ON)
# Append directories in the linker search path and outside the project
set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set (CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/bin" CACHE PATH "default install path" FORCE )
endif()
#
# Options
#
option(BUILD_TESTS
"Build unit BUILD_TESTS."
OFF)
option(BUILD_WITH_SERVER_LOGGING
"ALlow logging in the library for debug purposes."
ON)
option(BUILD_WITH_CLIENT_LOGGING
"ALlow logging in the library for debug purposes."
OFF)
if(BUILD_TESTS)
enable_testing()
endif()
find_package(Qt5 5.9 COMPONENTS Core Network WebSockets REQUIRED)
find_package(Lua 5.2 EXACT REQUIRED)
list(GET LUA_LIBRARIES 0 LUA_LIB)
list(GET LUA_LIBRARIES 1 LIBM_LIB)
message(STATUS "lualib : ${LUA_LIB}")
message(STATUS "libmlib : ${LIBM_LIB}")
add_library(lua::lua UNKNOWN IMPORTED GLOBAL)
set_target_properties(lua::lua PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${LUA_INCLUDE_DIR}"
IMPORTED_LOCATION ${LUA_LIB}
IMPORTED_LINK_DEPENDENT_LIBRARIES ${LIBM_LIB})
execute_process(COMMAND git submodule init WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
execute_process(COMMAND git submodule update WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_executable(${PROJECT_NAME}
src/network.cc
src/timers.cc
src/qtdynamic.cc
src/qtlua.cc
src/qdatetime.cc
src/marshal.cc
src/main.cc
src/lua_interpreter.cc)
target_link_libraries(${PROJECT_NAME}
Qt5::Core
Qt5::Network
Qt5::WebSockets
lua::lua)
include("BSON.cmake")
install(TARGETS ${PROJECT_NAME}
DESTINATION "${CMAKE_INSTALL_PREFIX}"
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
COMPONENT sdl_atf)
install(FILES ${LUA_BSON_LIBS_DIRECTORY}/bson4lua.so
DESTINATION "${CMAKE_INSTALL_PREFIX}/lib"
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
COMPONENT sdl_atf)
install(DIRECTORY "${CMAKE_SOURCE_DIR}/atf_parallels"
"${CMAKE_SOURCE_DIR}/data"
DESTINATION "${CMAKE_INSTALL_PREFIX}"
USE_SOURCE_PERMISSIONS
COMPONENT sdl_atf)
install(DIRECTORY "${CMAKE_SOURCE_DIR}/modules"
"${CMAKE_SOURCE_DIR}/data"
DESTINATION "${CMAKE_INSTALL_PREFIX}"
USE_SOURCE_PERMISSIONS
COMPONENT sdl_atf)
install(DIRECTORY "${CMAKE_SOURCE_DIR}/tools"
DESTINATION "${CMAKE_INSTALL_PREFIX}"
USE_SOURCE_PERMISSIONS
COMPONENT sdl_atf)
install(FILES "${CMAKE_SOURCE_DIR}/start.sh"
DESTINATION "${CMAKE_INSTALL_PREFIX}"
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
COMPONENT sdl_atf)
add_subdirectory(src/luaxml)
add_subdirectory(src/luaopenssl)
add_subdirectory(src/remote_adapter)