forked from samp-incognito/samp-streamer-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
61 lines (46 loc) · 1.68 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
cmake_minimum_required(VERSION 3.0)
project(streamer)
set(PLUGIN_VERSION "2.9.6")
set(CMAKE_CXX_STANDARD 17)
if (MSVC)
add_definitions("/MP")
endif()
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/lib/cmake-modules")
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/lib/eigen/cmake")
set(SAMP_SDK_ROOT "${PROJECT_SOURCE_DIR}/lib/samp-plugin-sdk")
find_package(SAMPSDK REQUIRED)
include_directories(${SAMPSDK_DIR})
include_directories(${SAMPSDK_DIR}/amx)
include_directories(${PROJECT_SOURCE_DIR}/lib/boost)
if(EIGEN3_INCLUDE_DIR)
file(TO_CMAKE_PATH ${EIGEN3_INCLUDE_DIR} EIGEN3_INCLUDE_DIR)
list(APPEND CMAKE_MODULE_PATH "${EIGEN3_INCLUDE_DIR}/cmake")
else()
set(EIGEN3_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/lib/eigen")
endif()
find_package(Eigen3 3.3.4 REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIR})
set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY True)
set(CMAKE_SKIP_PACKAGE_ALL_DEPENDENCY True)
add_subdirectory(src)
set(CPACK_PACKAGE_VERSION ${PLUGIN_VERSION})
if(COMMIT_ID)
string(TIMESTAMP CURRENT_DATE "%Y%m%d")
set(PACKAGE_FILE_NAME streamer-${PLUGIN_VERSION}-${CURRENT_DATE}-${COMMIT_ID})
else()
set(PACKAGE_FILE_NAME streamer-${PLUGIN_VERSION})
endif()
set(CPACK_OUTPUT_FILE_PREFIX package/${PACKAGE_FILE_NAME})
if(WIN32)
set(CPACK_PACKAGE_FILE_NAME ${PACKAGE_FILE_NAME}-win32)
set(CPACK_GENERATOR ZIP)
else()
set(CPACK_PACKAGE_FILE_NAME ${PACKAGE_FILE_NAME}-linux)
set(CPACK_GENERATOR TGZ)
endif()
if(CPACK_OUTPUT_FILE_POSTFIX)
string(TOLOWER "${CPACK_OUTPUT_FILE_POSTFIX}" CPACK_OUTPUT_FILE_POSTFIX)
set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME}-${CPACK_OUTPUT_FILE_POSTFIX})
endif()
include(CPack)