forked from llnl/Adiak
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
62 lines (50 loc) · 1.94 KB
/
CMakeLists.txt
File metadata and controls
62 lines (50 loc) · 1.94 KB
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.8)
project (Adiak
LANGUAGES CXX C
VERSION 0.4.1)
set(BLT_CXX_STD "c++11" CACHE STRING "Version of C++ standard")
if (NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR lib)
endif()
set(BLT_EXPORT_THIRDPARTY ON CACHE BOOL "")
if (DEFINED BLT_SOURCE_DIR)
# Support having a shared BLT outside of the repository if given a BLT_SOURCE_DIR
if (NOT EXISTS ${BLT_SOURCE_DIR}/SetupBLT.cmake)
message(FATAL_ERROR "Given BLT_SOURCE_DIR does not contain SetupBLT.cmake")
endif()
else()
# Use internal BLT if no BLT_SOURCE_DIR is given
set(BLT_SOURCE_DIR "${PROJECT_SOURCE_DIR}/blt" CACHE PATH "")
if (NOT EXISTS ${BLT_SOURCE_DIR}/SetupBLT.cmake)
message(FATAL_ERROR
"The BLT git submodule is not present. "
"Either run the following two commands in your git repository: \n"
" git submodule init\n"
" git submodule update\n"
"Or add -DBLT_SOURCE_DIR=/path/to/blt to your CMake command." )
endif()
endif()
include(${BLT_SOURCE_DIR}/SetupBLT.cmake)
add_subdirectory(src)
if (ENABLE_TESTS)
add_subdirectory(tests)
endif()
if (ENABLE_DOCS)
add_subdirectory(docs)
endif()
include(CMakePackageConfigHelpers)
# Configure adiak-config-version.cmake
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/adiak-config-version.cmake"
VERSION ${LIBTOOL_INTERFACE}.${LIBTOOL_REVISION}.${LIBTOOL_AGE}
COMPATIBILITY SameMajorVersion)
set(adiak_INSTALL_INCLUDE_DIR include/)
# Configure adiak-config.cmake
configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/config.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/adiak-config.cmake"
INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/adiak"
PATH_VARS adiak_INSTALL_INCLUDE_DIR)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/adiak-config.cmake" "${CMAKE_CURRENT_BINARY_DIR}/adiak-config-version.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/adiak")