-
Notifications
You must be signed in to change notification settings - Fork 8
/
CMakeLists.txt
56 lines (43 loc) · 1.12 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
cmake_minimum_required(VERSION 3.1)
project(EcsPython)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W4")
elseif(MINGW)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -pedantic -Wall -Wextra -Wnon-virtual-dtor -Wno-unknown-pragmas")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -pthread -pedantic -Wall -Wextra -Wnon-virtual-dtor")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-register -Wno-gnu-zero-variadic-macro-arguments")
endif()
enable_testing()
find_package(PythonLibs 3.3 EXACT)
if(NOT ${PYTHONLIBS_FOUND})
find_package(PythonLibs 2.7 EXACT REQUIRED)
endif()
include_directories(
${CMAKE_SOURCE_DIR}/include
${PYTHON_INCLUDE_DIRS}
)
file(GLOB srcs src/*.cpp)
file(GLOB hdrs include/*.h)
add_library(
${PROJECT_NAME}
${srcs}
${hdrs}
)
target_link_libraries(
${PROJECT_NAME}
${PYTHON_LIBRARIES}
)
add_subdirectory(example)
add_subdirectory(tests)
install(
TARGETS ${PROJECT_NAME}
DESTINATION lib
)
install(
FILES ${hdrs}
DESTINATION include
)