Path: blob/master/Help/guide/tutorial/Step10/SimpleTest/CMakeLists.txt
5018 views
# A very simple test framework for demonstrating how dependencies work1cmake_minimum_required(VERSION 3.23)23project(SimpleTest4VERSION 0.0.15)67add_library(SimpleTest INTERFACE)8target_sources(SimpleTest9INTERFACE10FILE_SET HEADERS11FILES12SimpleTest.h13)14target_compile_features(SimpleTest INTERFACE cxx_std_20)1516# TODO6: Find the TransitiveDep package with find_package. The SimpleTest17# build should fail if TransitiveDep cannot be found.1819# TODO7: Add the TransitiveDep::TransitiveDep target to the SimpleTest interface20# library's links. Remember that interface libraries can only have21# interface properties.2223include(GNUInstallDirs)24include(CMakePackageConfigHelpers)2526install(27TARGETS SimpleTest28EXPORT SimpleTestTargets29FILE_SET HEADERS30)3132install(33EXPORT SimpleTestTargets34DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/SimpleTest35NAMESPACE SimpleTest::36)3738write_basic_package_version_file(39${CMAKE_CURRENT_BINARY_DIR}/SimpleTestConfigVersion.cmake40COMPATIBILITY ExactVersion41ARCH_INDEPENDENT42)4344install(45FILES46cmake/simpletest_discover_impl.cmake47cmake/simpletest_discover_tests.cmake48cmake/SimpleTestConfig.cmake49${CMAKE_CURRENT_BINARY_DIR}/SimpleTestConfigVersion.cmake50DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/SimpleTest51)525354