-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
66 lines (49 loc) · 1.67 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
cmake_minimum_required(VERSION 2.8.3)
project(ibex-geometry)
set(PACKAGE_VERSION "1.0.dev0")
# build type
IF(NOT CMAKE_BUILD_TYPE)
#SET(CMAKE_BUILD_TYPE "Release")
SET(CMAKE_BUILD_TYPE "DEBUG")
#SET(CMAKE_BUILD_TYPE "RELWITHDEBINFO")
#SET(CMAKE_BUILD_TYPE "MINSIZEREL")
ENDIF()
# option declaration
option(BUILD_TESTS "Build tests" ON)
option(WITH_PYTHON "Build python module" ON)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/)
if(NOT WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC" )
set(IbexLib_USE_STATIC 1)
endif()
FIND_PACKAGE(IbexLib)
if(IBEX_FOUND)
INCLUDE_DIRECTORIES(${IBEX_INCLUDE_DIRS})
SET(LIBS ${LIBS} ${IBEX_LIBRARIES} )
else()
MESSAGE(WARNING "Unable to find IbexLib. Maybe you need to set IBEX_ROOT ${IBEX_ROOT}")
MESSAGE(WARNING "If ibex is not installer run : \n\t sh travis_script/install_ibexlib.sh /path/to/your/install/dir")
#MESSAGE(FATAL_ERROR "where ")
endif()
set(HEADERS_DIR ${CMAKE_CURRENT_BINARY_DIR}/include)
file(MAKE_DIRECTORY ${HEADERS_DIR})
include_directories(${HEADERS_DIR})
add_subdirectory(src)
if (BUILD_TESTS)
ENABLE_TESTING()
include( CTest )
add_subdirectory(tests)
endif(BUILD_TESTS)
if (WITH_PYTHON)
add_subdirectory(pybind11)
add_subdirectory(python)
endif()
#
# if (BUILD_EXAMPLE)
# add_subdirectory(examples)
# endif(BUILD_EXAMPLE)
#########################################################################
### Uninstall ###
#########################################################################
configure_file("${CMAKE_HOME_DIRECTORY}/CMakeModules/cmake_uninstall.cmake.in" "cmake_uninstall.cmake" IMMEDIATE @ONLY)
add_custom_target(uninstall "${CMAKE_COMMAND}" -P "cmake_uninstall.cmake")