-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
73 lines (54 loc) · 1.97 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
62
63
64
65
66
67
68
69
70
71
72
73
project(nmode)
cmake_minimum_required(VERSION 2.6)
ENABLE_TESTING()
cmake_policy(SET CMP0042 OLD)
set(Boost_USE_STATIC_LIBS OFF)
find_package(Boost REQUIRED system unit_test_framework)
# if(APPLE)
# set(CMAKE_CXX_COMPILER "/usr/local/Cellar/llvm/7.0.0/bin/clang++")
# set(CMAKE_CXX_COMPILER_FULLPATH "/usr/local/Cellar/llvm/7.0.0/bin/clang++")
# else(APPLE)
set(CMAKE_CXX_COMPILER "g++")
# endif(APPLE)
set(CMAKE_BUILD_TYPE "Release")
set(CMAKE_VERBOSE_MAKEFILE OFF)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
set(CMAKE_CXX_FLAGS_DISTRIBUTION "-O3")
# if(UNIX AND NOT APPLE)
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -fpermissive -pthread -std=c++11 -fPIC")
set(CMAKE_CXX_FLAGS_RELEASE " -O3 -fpermissive -pthread -std=c++11 -fPIC")
# endif(UNIX AND NOT APPLE)
# set(CMAKE_CXX_FLAGS "-stdlib=libc++")
if(USE_MAKE_MATRIX_VIDEO)
add_definitions(-DUSE_MATRIX_VIDEO)
endif(USE_MAKE_MATRIX_VIDEO)
set(CMAKE_BUILD_TYPE Debug)
find_package(PythonLibs 3)
IF(PYTHONLIBS_FOUND)
include_directories(${PYTHON_INCLUDE_PATH})
message("Python: ${PYTHON_INCLUDE_PATH}")
ENDIF(PYTHONLIBS_FOUND)
include_directories(${CMAKE_SOURCE_DIR}/src)
include_directories(/usr/local/include/yars)
include(cmake/IncludePackages.cmake)
add_subdirectory(src)
# add_subdirectory(contrib/yars2nmode)
option(USE_TESTS "use test cases" ON)
if(USE_TESTS)
add_subdirectory(tests)
endif(USE_TESTS)
CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
ADD_CUSTOM_TARGET(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/src/nmode/
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/nmode
CONFIGURATIONS Release Debug
PATTERN "*.cpp" EXCLUDE
PATTERN "*.txt" EXCLUDE
)