Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Kitware
GitHub Repository: Kitware/CMake
Path: blob/master/Help/guide/tutorial/Step10/SimpleTest/CMakeLists.txt
5018 views
1
# A very simple test framework for demonstrating how dependencies work
2
cmake_minimum_required(VERSION 3.23)
3
4
project(SimpleTest
5
VERSION 0.0.1
6
)
7
8
add_library(SimpleTest INTERFACE)
9
target_sources(SimpleTest
10
INTERFACE
11
FILE_SET HEADERS
12
FILES
13
SimpleTest.h
14
)
15
target_compile_features(SimpleTest INTERFACE cxx_std_20)
16
17
# TODO6: Find the TransitiveDep package with find_package. The SimpleTest
18
# build should fail if TransitiveDep cannot be found.
19
20
# TODO7: Add the TransitiveDep::TransitiveDep target to the SimpleTest interface
21
# library's links. Remember that interface libraries can only have
22
# interface properties.
23
24
include(GNUInstallDirs)
25
include(CMakePackageConfigHelpers)
26
27
install(
28
TARGETS SimpleTest
29
EXPORT SimpleTestTargets
30
FILE_SET HEADERS
31
)
32
33
install(
34
EXPORT SimpleTestTargets
35
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/SimpleTest
36
NAMESPACE SimpleTest::
37
)
38
39
write_basic_package_version_file(
40
${CMAKE_CURRENT_BINARY_DIR}/SimpleTestConfigVersion.cmake
41
COMPATIBILITY ExactVersion
42
ARCH_INDEPENDENT
43
)
44
45
install(
46
FILES
47
cmake/simpletest_discover_impl.cmake
48
cmake/simpletest_discover_tests.cmake
49
cmake/SimpleTestConfig.cmake
50
${CMAKE_CURRENT_BINARY_DIR}/SimpleTestConfigVersion.cmake
51
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/SimpleTest
52
)
53
54