-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
133 lines (116 loc) · 4.42 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
cmake_minimum_required(VERSION 3.20)
project(hyperion_mpl LANGUAGES CXX VERSION 0.8.6)
include(CTest)
option(HYPERION_ENABLE_TRACY "Enables Profiling with Tracy" OFF)
option(HYPERION_USE_FETCH_CONTENT "Enables FetchContent usage for getting dependencies" ON)
set(HYPERION_ENABLE_TRACY
${HYPERION_ENABLE_TRACY}
CACHE
INTERNAL
"force dependencies's `HYPERION_ENABLE_TRACY` to the value of this top-level project")
set(HYPERION_USE_FETCH_CONTENT
${HYPERION_USE_FETCH_CONTENT}
CACHE
INTERNAL
"force depedencies's `HYPERION_USE_FETCH_CONTENT` to the value of this top-level project")
if(HYPERION_USE_FETCH_CONTENT)
include(FetchContent)
endif()
if(${HYPERION_USE_FETCH_CONTENT})
FetchContent_Declare(hyperion_platform
GIT_REPOSITORY "https://github.com/braxtons12/hyperion_platform"
GIT_TAG "v0.5.3"
SYSTEM
)
FetchContent_MakeAvailable(hyperion_platform)
else()
find_package(hyperion_platform REQUIRED)
endif()
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/hyperion_compiler_settings.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/hyperion_enable_warnings.cmake)
set(HYPERION_MPL_INCLUDE_DIRECTORIES
"${CMAKE_CURRENT_SOURCE_DIR}/include"
)
set(HYPERION_MPL_INCLUDE_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/include/hyperion"
)
set(HYPERION_MPL_HEADERS
"${HYPERION_MPL_INCLUDE_PATH}/mpl.h"
"${HYPERION_MPL_INCLUDE_PATH}/mpl/list.h"
"${HYPERION_MPL_INCLUDE_PATH}/mpl/metapredicates.h"
"${HYPERION_MPL_INCLUDE_PATH}/mpl/metatypes.h"
"${HYPERION_MPL_INCLUDE_PATH}/mpl/pair.h"
"${HYPERION_MPL_INCLUDE_PATH}/mpl/type.h"
"${HYPERION_MPL_INCLUDE_PATH}/mpl/value.h"
"${HYPERION_MPL_INCLUDE_PATH}/mpl/concepts.h"
"${HYPERION_MPL_INCLUDE_PATH}/mpl/concepts/comparable.h"
"${HYPERION_MPL_INCLUDE_PATH}/mpl/concepts/operator_able.h"
"${HYPERION_MPL_INCLUDE_PATH}/mpl/concepts/std_supplemental.h"
"${HYPERION_MPL_INCLUDE_PATH}/mpl/type_traits.h"
"${HYPERION_MPL_INCLUDE_PATH}/mpl/type_traits/is_comparable.h"
"${HYPERION_MPL_INCLUDE_PATH}/mpl/type_traits/is_operator_able.h"
"${HYPERION_MPL_INCLUDE_PATH}/mpl/type_traits/std_supplemental.h"
)
add_library(hyperion_mpl INTERFACE)
add_library(hyperion::mpl ALIAS hyperion_mpl)
target_include_directories(
hyperion_mpl
INTERFACE
${HYPERION_MPL_INCLUDE_DIRECTORIES}
)
target_sources(
hyperion_mpl
INTERFACE
${HYPERION_MPL_HEADERS}
)
target_link_libraries(
hyperion_mpl
INTERFACE
hyperion::platform
)
hyperion_compile_settings(hyperion_mpl)
hyperion_enable_warnings(hyperion_mpl)
add_executable(hyperion_mpl_main ${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp)
target_link_libraries(hyperion_mpl_main
PRIVATE
hyperion::mpl
)
hyperion_compile_settings(hyperion_mpl_main)
hyperion_enable_warnings(hyperion_mpl_main)
add_test(NAME hyperion_mpl_main
COMMAND hyperion_mpl_main)
set(HYPERION_MPL_DOXYGEN_OUTPUT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/docs/_build/html")
set(HYPERION_MPL_DOXYGEN_HTML "${HYPERION_MPL_DOXYGEN_OUTPUT_DIR}/index.html")
set(HYPERION_MPL_DOCS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/docs")
set(HYPERION_MPL_DOCS_FILES
"${HYPERION_MPL_DOCS_DIR}/index.rst"
"${HYPERION_MPL_DOCS_DIR}/quick_start.rst"
"${HYPERION_MPL_DOCS_DIR}/concepts.rst"
"${HYPERION_MPL_DOCS_DIR}/list.rst"
"${HYPERION_MPL_DOCS_DIR}/metapredicates.rst"
"${HYPERION_MPL_DOCS_DIR}/metatypes.rst"
"${HYPERION_MPL_DOCS_DIR}/pair.rst"
"${HYPERION_MPL_DOCS_DIR}/type.rst"
"${HYPERION_MPL_DOCS_DIR}/type_traits.rst"
"${HYPERION_MPL_DOCS_DIR}/value.rst"
"${HYPERION_MPL_DOCS_DIR}/concepts/comparable.rst"
"${HYPERION_MPL_DOCS_DIR}/concepts/operator_able.rst"
"${HYPERION_MPL_DOCS_DIR}/concepts/std_supplemental.rst"
"${HYPERION_MPL_DOCS_DIR}/type_traits/is_comparable.rst"
"${HYPERION_MPL_DOCS_DIR}/type_traits/is_operator_able.rst"
"${HYPERION_MPL_DOCS_DIR}/type_traits/std_supplemental.rst"
)
add_custom_command(
OUTPUT ${HYPERION_MPL_DOXYGEN_HTML}
DEPENDS ${HYPERION_MPL_HEADERS} ${DOCS_FILES}
COMMAND sphix-build -M html . _build
WORKING_DIRECTORY ${HYPERION_MPL_DOCS_DIR}
MAIN_DEPENDENCY
COMMENT "Generating documentation with doxygen, sphinx, and breathe"
VERBATIM
)
add_custom_target(hyperion_mpl_doxygen DEPENDS ${DOXYGEN_HTML})
include(GNUInstallDirs)
install(DIRECTORY ${HYPERION_MPL_DOXYGEN_OUTPUT_DIR} DESTINATION ${CMAKE_INSTALL_DOCDIR})
install(DIRECTORY include/ DESTINATION include)
install(TARGETS hyperion_mpl DESTINATION lib)