-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
62 lines (52 loc) · 1.97 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
cmake_minimum_required(VERSION 3.15)
set(Herbert_ROOT ${CMAKE_CURRENT_LIST_DIR})
file(READ "${Herbert_ROOT}/VERSION" _version)
string(STRIP "${_version}" _version)
project("Herbert" VERSION "${_version}")
set(CMAKE_CXX_STANDARD 11)
# Sort our targets into folders
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Set our options
option(BUILD_TESTS "Build the C++ tests" OFF)
option(USE_HERBERT_MPI "Use MPI libraries provided with Herbert" ON)
# Add cmake directory to CMake's path
list(APPEND CMAKE_MODULE_PATH "${Herbert_ROOT}/cmake"
"${Herbert_ROOT}/cmake/external" "${Herbert_ROOT}/cmake/shared")
# This sets the destination for mex build artefacts (used in PACE_AddMex)
set(Herbert_DLL_DIRECTORY "${Herbert_ROOT}/herbert_core/DLL")
# This is the directory that contains herbert_init.m
set(Herbert_CORE "${CMAKE_CURRENT_LIST_DIR}/herbert_core")
# This will hold herbert_on.m and worker_v2.m. This directory will hold any
# files needed for "local initialization", the files mentioned are required
# for running tests. So we automatically add this path to the MATLABPATH when
# we run CTest.
set(LOCAL_INIT_DIR "${CMAKE_BINARY_DIR}/local_init")
# Look for packages early so we can exit if they're not found
include(herbert_FindMPI)
include(PACE_FindMatlab)
include(PACE_Version)
include(PACE_AddMex)
include(PACE_CodeAnalysis)
include(CTest)
if(BUILD_TESTING)
include(PACE_FindGTest)
enable_testing()
endif()
add_subdirectory("_LowLevelCode")
if(BUILD_TESTING)
add_subdirectory("_test")
endif()
add_subdirectory("admin")
add_subdirectory("cmake")
# =============================================================================
# Install commands
# =============================================================================
include(PACE_CPackConfig)
install(
DIRECTORY "herbert_core"
DESTINATION "Herbert"
USE_SOURCE_PERMISSIONS
PATTERN "*.m~" EXCLUDE
PATTERN "*.asv" EXCLUDE
PATTERN "*.gitignore" EXCLUDE)
install(FILES "LICENSE" "README.md" DESTINATION ".")