-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
47 lines (32 loc) · 1.23 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
cmake_minimum_required(VERSION 3.12)
if (POLICY CMP0042) # use of @rpath
cmake_policy(SET CMP0042 NEW)
endif (POLICY CMP0042)
if (NOT DEFINED CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type")
endif ()
if (NOT DEFINED GUM_RANDOMSEED)
set(GUM_RANDOMSEED 0)
endif ()
#workaround : cmake force the value of CMAKE_INSTALL_PREFIX
set(BACKUP_CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
include("VERSION.txt")
set(AGRUM_VERSION "${AGRUM_VERSION_MAJOR}.${AGRUM_VERSION_MINOR}.${AGRUM_VERSION_PATCH}")
cmake_policy(SET CMP0048 NEW) # VERSION arg in 'project'
project(agrum VERSION ${AGRUM_VERSION})
set(CMAKE_INSTALL_PREFIX ${BACKUP_CMAKE_INSTALL_PREFIX})
# options
option(BUILD_SHARED_LIBS "build shared|static libs" ON)
option(BUILD_PYTHON "build python bindings" OFF)
option(BUILD_JAVA "build java bindings (experimental)" OFF) ## Very experimental for now.
option(USE_OPENMP "use openmp" ON)
set(AGRUM_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
set(AGRUM_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/src/cmake)
set(LIBAGRUM "agrum")
include(CompilOptions.agrum)
if (USE_OPENMP)
include(openMP)
endif ()
add_subdirectory(src)
add_subdirectory(wrappers)