-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
43 lines (36 loc) · 1.3 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
cmake_minimum_required(VERSION 3.15.4)
project(
jegp
VERSION 5.0.0
DESCRIPTION "Generic library components for JohelEGP's C++ projects."
HOMEPAGE_URL https://github.com/johelegp/jegp
LANGUAGES CXX)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/)
include(JEGPOptions)
include(JEGPFindDependencies)
add_library(jegp INTERFACE)
add_library(jegp::jegp ALIAS jegp)
target_compile_features(jegp INTERFACE cxx_std_20)
target_include_directories(jegp INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
install(TARGETS jegp EXPORT jegp-targets)
export(EXPORT jegp-targets NAMESPACE jegp::)
file(COPY cmake/jegp-config.cmake DESTINATION .)
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
jegp-config-version.cmake
VERSION ${jegp_VERSION}
COMPATIBILITY SameMajorVersion)
install(
EXPORT jegp-targets
DESTINATION lib/cmake/jegp
NAMESPACE jegp::)
install(FILES cmake/jegp-config.cmake ${CMAKE_CURRENT_BINARY_DIR}/jegp-config-version.cmake DESTINATION lib/cmake/jegp)
install(DIRECTORY include/ DESTINATION include)
include(CTest)
if(BUILD_TESTING AND JEGP_TEST)
add_subdirectory(test)
endif()
if(JEGP_DOC_PDF OR JEGP_DOC_HTML)
add_subdirectory(doc)
endif()