forked from hegner/kseta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
78 lines (66 loc) · 3.22 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
67
68
69
70
71
72
73
74
75
76
77
78
# - Define the minimum CMake version
# HSF recommends 3.3 to support C/C++ compile features for C/C++11 across all
# platforms
cmake_minimum_required(VERSION 3.3)
# - Call project() to setup system
# From CMake 3, we can set the project version easily in one go
project(kseta VERSION 0.1.0)
#--- Define basic build settings -----------------------------------------------
# - Use GNU-style hierarchy for installing build products
include(GNUInstallDirs)
# - Define a default build type when using a single-mode tool like make/ninja
# If you're using a build tool that supports multiple modes (Visual Studio,
# Xcode), this setting has no effect.
# HSF recommend RelWithDebInfo (optimized with debugging symbols) as this is
# generally the mode used by system packaging (rpm, deb, spack, macports).
# However, it can be overriden by passing ``-DCMAKE_BUILD_TYPE=<type>`` when
# invoking CMake
if(NOT CMAKE_CONFIGURATION_TYPES)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo
CACHE STRING "Choose the type of build, options are: None Release MinSizeRel Debug RelWithDebInfo"
FORCE
)
else()
set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}"
CACHE STRING "Choose the type of build, options are: None Release MinSizeRel Debug RelWithDebInfo"
FORCE
)
endif()
endif()
# - Define the C++ Standard to use (Simplest Possible)
# This will add any compiler flags needed to compile against the required standard
# without any vendor extensions
# NOTE: It *does not* guarantee that the compiler in use supports the complete
# standard. Nor does it inform clients of the project what standard was used.
# Both of these issues can be resolved using CMake's compile features, see
#
# - https://cmake.org/cmake/help/v3.3/manual/cmake-compile-features.7.html
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
#--- Declare options -----------------------------------------------------------
option(kseta_documentation "Whether or not to create doxygen doc target.")
#--- enable unit testing capabilities ------------------------------------------
include(CTest)
#--- enable CPack --------------------------------------------------------------
include(cmake/ksetaCPack.cmake)
#--- target for Doxygen documentation ------------------------------------------
if(kseta_documentation)
include(cmake/ksetaDoxygen.cmake)
endif()
#--- add version files ---------------------------------------------------------
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ksetaVersion.h
${CMAKE_CURRENT_BINARY_DIR}/ksetaVersion.h )
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ksetaVersion.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/kseta )
#--- add CMake infrastructure --------------------------------------------------
include(cmake/ksetaCreateConfig.cmake)
#--- add license files ---------------------------------------------------------
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE
${CMAKE_CURRENT_SOURCE_DIR}/NOTICE
DESTINATION ${CMAKE_INSTALL_DOCDIR})
#--- project specific subdirectories -------------------------------------------
add_subdirectory(mail)
#--- create uninstall target ---------------------------------------------------
include(cmake/ksetaUninstall.cmake)