forked from zhouforme0318/GAMPII-GOOD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists_Linux.txt
43 lines (36 loc) · 1.55 KB
/
CMakeLists_Linux.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
#Minimum requirement of CMake version : 3.0.0
cmake_minimum_required(VERSION 3.0.0)
#Project name and version number
project(run_GOOD VERSION 3.0)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "-std=c++11 -O0 -fPIC") #设置c++的编译选项
set(CMAKE_CXX_FLAGS "-msse3")
set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -g")
set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -ggdb")
add_executable(${PROJECT_NAME} src/run_GOOD.cpp)
target_link_libraries(${PROJECT_NAME} core)
add_subdirectory("src/core")
# yaml-cpp
find_package(yaml-cpp REQUIRED)
target_link_libraries(${PROJECT_NAME} ${YAML_CPP_LIBRARIES})
# Choose different compilation configurations according to VS compilation
if(CMAKE_BUILD_TYPE MATCHES "Release")
add_compile_options(-O3)
set(CMAKE_BUILD_POSTFIX "${CMAKE_RELEASE_POSTFIX}")
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin_release)
elseif(CMAKE_BUILD_TYPE MATCHES "Debug")
add_compile_options(-O0)
set(CMAKE_BUILD_POSTFIX "${CMAKE_DEBUG_POSTFIX}")
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin_debug)
endif()
add_compile_options(-w)
add_compile_options(-m64)
add_compile_options(-lz)
add_compile_options(-lstdc++)
# Output Messages for debug the Cmake
message(STATUS "operation system is : ${CMAKE_SYSTEM}")
message(STATUS "current platform is : ${CMAKE_SYSTEM_NAME}")
message(STATUS "CMake version is : ${CMAKE_SYSTEM_VERSION}")
message(STATUS "C compiler is : ${CMAKE_C_COMPILER}")
message(STATUS "C++ compiler is : ${CMAKE_CXX_COMPILER}")
message(STATUS "The program main directory is : ${PROJECT_SOURCE_DIR}")