CMakeLists.txt 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # A very simple test framework for demonstrating how dependencies work
  2. cmake_minimum_required(VERSION 3.23)
  3. project(SimpleTest
  4. VERSION 0.0.1
  5. )
  6. add_library(SimpleTest INTERFACE)
  7. target_sources(SimpleTest
  8. INTERFACE
  9. FILE_SET HEADERS
  10. FILES
  11. SimpleTest.h
  12. )
  13. target_compile_features(SimpleTest INTERFACE cxx_std_20)
  14. # TODO6: Find the TransitiveDep package with find_package. The SimpleTest
  15. # build should fail if TransitiveDep cannot be found.
  16. # TODO7: Add the TransitiveDep::TransitiveDep target to the SimpleTest interface
  17. # library's links. Remember that interface libraries can only have
  18. # interface properties.
  19. include(GNUInstallDirs)
  20. include(CMakePackageConfigHelpers)
  21. install(
  22. TARGETS SimpleTest
  23. EXPORT SimpleTestTargets
  24. FILE_SET HEADERS
  25. )
  26. install(
  27. EXPORT SimpleTestTargets
  28. DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/SimpleTest
  29. NAMESPACE SimpleTest::
  30. )
  31. write_basic_package_version_file(
  32. ${CMAKE_CURRENT_BINARY_DIR}/SimpleTestConfigVersion.cmake
  33. COMPATIBILITY ExactVersion
  34. ARCH_INDEPENDENT
  35. )
  36. install(
  37. FILES
  38. cmake/simpletest_discover_impl.cmake
  39. cmake/simpletest_discover_tests.cmake
  40. cmake/SimpleTestConfig.cmake
  41. ${CMAKE_CURRENT_BINARY_DIR}/SimpleTestConfigVersion.cmake
  42. DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/SimpleTest
  43. )