blob: 296eb16be49317093ca079b37ef9fa1bf990186a (
plain)
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
|
# Build configuration
# install paths
set(BINARY_DESTINATION bin)
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(PLUGIN_DESTINATION bin/plugins)
else()
set(PLUGIN_DESTINATION lib/smolbote)
endif()
# executable name
set(poi_NAME poi)
# version information
if (EXISTS "${PROJECT_SOURCE_DIR}/.git")
execute_process(COMMAND git describe --tags --abbrev=0 WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE VerTag OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND git describe --tags WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE VerDescribe OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND git rev-parse HEAD WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE VerCommit OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND git rev-parse --abbrev-ref HEAD WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE VerBranch OUTPUT_STRIP_TRAILING_WHITESPACE)
else()
set(VerTag "0.2.2")
set(VerDescribe "0.2.2-unknown")
set(VerCommit "00000000")
set(VerBranch "unknown")
endif()
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -O2")
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -O2 -march=native")
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
endif()
|