-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
58 lines (38 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
cmake_minimum_required(VERSION 3.10)
project(pyapi-compat-if)
include (ExternalProject)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
if (NOT PACKAGES_DIR)
set(PACKAGES_DIR ${CMAKE_SOURCE_DIR}/packages)
# Testing is only enabled when this is a top-level project
set(ENABLE_TESTING 1)
endif()
if (WIN32)
set(PYTHON ${PACKAGES_DIR}/python/Scripts/python.exe)
else()
set(PYTHON ${PACKAGES_DIR}/python/bin/python)
endif()
execute_process(COMMAND ${PYTHON} -m ivpm share cmake OUTPUT_VARIABLE IVPM_CMAKE_PATH)
list(APPEND CMAKE_MODULE_PATH ${IVPM_CMAKE_PATH})
message("IVPM_CMAKE_PATH: ${IVPM_CMAKE_PATH} ${CMAKE_MODULE_PATH}")
include(ivpm)
Ivpm_AddPythonExtProject(debug-mgr debug_mgr)
if(NOT WIN32)
add_compile_options(-fPIC)
endif()
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_INSTALL_RPATH $ORIGIN)
#set(CMAKE_CXX_FLAGS "-Wall -Wextra")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
add_subdirectory(src)
if (ENABLE_TESTING)
enable_testing()
add_subdirectory(test)
endif()