-
Notifications
You must be signed in to change notification settings - Fork 8
/
CMakeLists.txt
60 lines (45 loc) · 1.16 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
cmake_minimum_required(VERSION 3.0)
# -
# Plugin
# -
if (NOT PLUGIN_VERSION)
set(PLUGIN_VERSION "0.2.0")
endif()
project(samp-node VERSION ${PLUGIN_VERSION})
# -
# Paths
# -
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/test/plugins)
set(CMAKE_INSTALL_PREFIX ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
set(CMAKE_BUILD_WITH_INSTALL_RPATH true)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/deps/cmake-modules")
if(MSVC)
foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES})
string(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
endforeach(OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES)
endif()
# -
# Compiler Flags
# -
if(UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32 -std=c++14")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS OFF)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.so;.so.64")
add_link_options(
"-static-libgcc"
"-static-libstdc++"
)
set(CPACK_SYSTEM_NAME "linux")
endif()
if(WIN32)
add_definitions(
-D_CRT_SECURE_NO_WARNINGS
-DWIN32_LEAN_AND_MEAN
)
endif()
# -
# Directories
# -
add_subdirectory(src)