forked from PEBBL/pebbl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
60 lines (47 loc) · 1.92 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
cmake_minimum_required(VERSION 3.5)
project(PEBBL CXX)
include(CMakePackageConfigHelpers)
set(include_install_dir "include" CACHE PATH "Relative location where to install headers.")
set(pebbl_header_install_dir ${include_install_dir}/pebbl)
set(lib_install_dir "lib" CACHE PATH "Relative location where to install libraries.")
set(package_install_dir ${lib_install_dir}/pebbl)
option(enable_mpi "Enable MPI build. Will require MPI wrappers for compilers." OFF)
option(enable_serializer "Enable serializer funtionality." OFF)
option(enable_examples "Enable example programs." ON)
option(enable_validation "Enable validation features." OFF)
if(CMAKE_BUILD_TYPE STREQUAL "")
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Set by default in PEBBL" FORCE)
endif()
if(enable_examples)
enable_testing()
endif()
if(enable_mpi)
message("MPI enabled.")
find_package(MPI REQUIRED)
include_directories(SYSTEM ${MPI_CXX_INCLUDE_PATH})
set(ACRO_HAVE_MPI 1)
set(UTILIB_HAVE_MPI 1)
endif()
string(TOLOWER ${CMAKE_BUILD_TYPE} build_type_lower)
if(build_type_lower MATCHES debug)
message("Debug mode enabled.")
set(UTILIB_YES_DEBUGPR 1)
endif()
if(enable_validation)
set(ACRO_VALIDATING 1)
set(UTILIB_VALIDATING 1)
endif()
if(enable_serializer)
set(HAVE_SERIALIZER 1)
endif()
if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/packages/pebbl/etc/monomial)
set(monomial_test_dir ${CMAKE_CURRENT_SOURCE_DIR}/packages/pebbl/etc/monomial)
endif()
if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/packages/pebbl/etc/knapsack/problems)
set(knapsack_test_dir ${CMAKE_CURRENT_SOURCE_DIR}/packages/pebbl/etc/knapsack/problems)
endif()
add_subdirectory(src)
configure_package_config_file(cmake/pebbl-config.cmake.in pebbl-config.cmake
INSTALL_DESTINATION ${package_install_dir}
PATH_VARS include_install_dir)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pebbl-config.cmake DESTINATION ${package_install_dir})