-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
65 lines (51 loc) · 2.14 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
cmake_minimum_required(VERSION 3.3)
project(SKM VERSION 0.3 LANGUAGES CXX)
# set build type
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release")
endif()
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
set(CMAKE_CXX_STANDARD 11)
add_compile_options(-std=c++11)
SET ( CMAKE_CXX_FLAGS "-std=c++11" CACHE STRING "compile flags" FORCE)
set(BUILD_ITK ON) # to get itk adapter of PGD library
set(SKM_NUM_SPACE_DIMENSIONS 3 CACHE INTEGRAL "Number of space dimensions (2 or 3)")
option(SKM_USE_WENDLAND_C0 "Use the combined kernel including wendland C0" ON )
# define project variables
set(SKM_TARGET_NAME ${PROJECT_NAME})
set(SKM_PACKAGE_NAME ${SKM_TARGET_NAME})
set(SKM_TARGETS_FILENAME "${SKM_PACKAGE_NAME}Targets.cmake")
set(SKM_CONFIG_IN_FILENAME "config.cmake.in")
set(SKM_CONFIG_FILENAME "${SKM_PACKAGE_NAME}Config.cmake")
set(SKM_CONFIGVERSION_FILENAME "${SKM_PACKAGE_NAME}ConfigVersion.cmake")
set(SKM_CONFIG_DESTINATION "cmake")
set(SKM_INCLUDE_DESTINATION "include")
set(SKM_LIBRARY_DESTINATION "lib")
set(SKM_BINARY_DESTINATION "bin")
add_definitions(-DSKM_VERSION="${PROJECT_VERSION}")
ADD_SUBDIRECTORY(include)
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(test)
INCLUDE(CTest)
# generate a config and config version file for the package
include(CMakePackageConfigHelpers)
configure_package_config_file(
${SKM_CONFIG_IN_FILENAME}
"${CMAKE_CURRENT_BINARY_DIR}/${SKM_CONFIG_FILENAME}"
INSTALL_DESTINATION ${SKM_CONFIG_DESTINATION}
PATH_VARS SKM_INCLUDE_DESTINATION SKM_LIBRARY_DESTINATION SKM_BINARY_DESTINATION
)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/${SKM_CONFIGVERSION_FILENAME}"
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/${SKM_CONFIG_FILENAME}"
"${CMAKE_CURRENT_BINARY_DIR}/${SKM_CONFIGVERSION_FILENAME}"
DESTINATION ${SKM_CONFIG_DESTINATION}
)
INCLUDE(CPack)