-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
55 lines (42 loc) · 1.58 KB
/
CMakeLists.txt
File metadata and controls
55 lines (42 loc) · 1.58 KB
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
# don't allow in-source project generation
if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(WARNING "\n\nCMake generation is not allowed within the source directory!\n")
message(STATUS "Cancelling CMake and cleaning up source tree...")
execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_BINARY_DIR}/CMakeFiles")
math(EXPR Crash 0/0)
message(FATAL_ERROR "CMake should have crashed - this is a failsafe in case the call used to trigger the crash gets fixed.")
endif()
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
project(stationapi VERSION 1.1)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(ModernCpp)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
if (EXISTS "${PROJECT_SOURCE_DIR}/externals/udplibrary/CMakeLists.txt")
message(STATUS "Detected udplibrary")
set(HAVE_UDPLIBRARY 1)
else()
message(FATAL_ERROR "udplibrary required... copy from swg source to the externals directory")
endif()
add_definitions(-DBOOST_ALL_NO_LIB)
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
find_package(Boost COMPONENTS program_options REQUIRED)
find_package(SQLite3 REQUIRED)
add_subdirectory(externals)
add_subdirectory(src)
add_subdirectory(tests)
install(FILES
extras/logger.cfg.dist
DESTINATION etc/stationapi
RENAME logger.cfg)
install(FILES
extras/swgchat.cfg.dist
DESTINATION etc/stationapi
RENAME swgchat.cfg)
install(FILES
extras/stationchat.db.dist
DESTINATION var/stationapi
RENAME stationchat.db)
install(FILES
extras/init_database.sql
DESTINATION share/stationapi)