-
Notifications
You must be signed in to change notification settings - Fork 11
/
CMakeLists.txt
47 lines (39 loc) · 1.63 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
project(MPCLib CXX)
cmake_minimum_required(VERSION 3.0)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /opt/local/lib)
set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} /opt/local/include)
link_directories(/opt/local/lib)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Set build type: Release or Debug" FORCE)
endif(NOT CMAKE_BUILD_TYPE)
if (${CMAKE_BUILD_TYPE} MATCHES "Debug")
message(STATUS "Configuring project in debug mode. Set -DCMAKE_BUILD_TYPE=Release for release mode")
elseif(${CMAKE_BUILD_TYPE} MATCHES "Release")
message(STATUS "Configuring project in release mode. Set -DCMAKE_BUILD_TYPE=Debug for debug mode")
else(${CMAKE_BUILD_TYPE} MATCHES "Release")
message(STATUS "Configuring project in " ${CMAKE_BUILD_TYPE} " mode")
endif()
option(ENABLE_PROFILING "Enable execution timers to monitor the performance" OFF)
if (ENABLE_PROFILING)
message(STATUS "Enabling application profiling")
add_definitions(-DENABLE_PROFILING)
set(ENABLE_PROFILING OFF CACHE BOOL "" FORCE)
else()
message(STATUS "Profiling disabled. Use -DENABLE_PROFILING=ON to enable")
endif()
FIND_PACKAGE(GSL)
FIND_PACKAGE(Matheval)
FIND_PACKAGE(Config)
if (GSL_FOUND)
message(STATUS "Found GSL: enabling discretization support")
set(ENABLE_DISCRETIZATION TRUE)
add_definitions(-DENABLE_DISCRETIZATION)
if (LIBCONFIGPP_FOUND AND MATHEVAL_FOUND)
set(ENABLE_CONFIG_FILE TRUE)
add_definitions(-DENABLE_CONFIG_FILE)
endif()
else()
message(STATUS "GSL not found: discretization support not available")
endif()
add_subdirectory(src)