-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
58 lines (44 loc) · 1.77 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
cmake_minimum_required(VERSION 3.16.3 FATAL_ERROR)
project(
logaddexp
LANGUAGES C
VERSION 2.1.14)
set(PROJECT_DESCRIPTION "Logarithm of the sum of exponentiations.")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_EXTENSIONS OFF)
include(cmake/sanitizers.cmake)
include(cmake/warnings.cmake)
add_library(logaddexp INTERFACE)
add_library(LOGADDEXP::logaddexp ALIAS logaddexp)
target_include_directories(
logaddexp INTERFACE $<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>)
target_link_libraries(logaddexp INTERFACE $<$<BOOL:${UNIX}>:m>)
set_target_properties(logaddexp PROPERTIES VERSION ${PROJECT_VERSION})
target_compile_options(logaddexp PRIVATE ${WARNING_FLAGS})
install(TARGETS logaddexp EXPORT logaddexp-targets)
install(DIRECTORY include/logaddexp/ DESTINATION include/logaddexp)
export(
TARGETS logaddexp
NAMESPACE LOGADDEXP::
FILE logaddexp-targets.cmake)
install(
EXPORT logaddexp-targets
NAMESPACE LOGADDEXP::
DESTINATION lib/cmake/logaddexp)
install(FILES ${PROJECT_SOURCE_DIR}/README.md ${PROJECT_SOURCE_DIR}/LICENSE.md
DESTINATION share/docs/logaddexp)
include(CMakePackageConfigHelpers)
set(project_config ${PROJECT_BINARY_DIR}/logaddexp-config.cmake)
set(version_config ${PROJECT_BINARY_DIR}/logaddexp-config-version.cmake)
configure_package_config_file(logaddexp-config.cmake.in ${project_config}
INSTALL_DESTINATION lib/cmake/logaddexp)
write_basic_package_version_file(${version_config}
COMPATIBILITY SameMajorVersion)
install(FILES ${project_config} ${version_config}
DESTINATION lib/cmake/logaddexp)
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
enable_testing()
add_subdirectory(test)
endif()