CMakeLists.txt 799 B

12345678910111213141516171819202122232425262728293031
  1. cmake_minimum_required(VERSION 3.24)
  2. project(cxx_modules_internal_partitions CXX)
  3. include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake")
  4. include(GenerateExportHeader)
  5. add_library(internal-partitions)
  6. generate_export_header(internal-partitions)
  7. target_sources(internal-partitions
  8. PUBLIC
  9. FILE_SET HEADERS
  10. BASE_DIRS
  11. "${CMAKE_CURRENT_BINARY_DIR}"
  12. FILES
  13. "${CMAKE_CURRENT_BINARY_DIR}/internal-partitions_export.h"
  14. FILE_SET CXX_MODULES
  15. BASE_DIRS
  16. "${CMAKE_CURRENT_SOURCE_DIR}"
  17. FILES
  18. importable.cxx
  19. partition.cxx)
  20. target_compile_features(internal-partitions PUBLIC cxx_std_20)
  21. add_executable(exe)
  22. target_link_libraries(exe PRIVATE internal-partitions)
  23. target_sources(exe
  24. PRIVATE
  25. main.cxx)
  26. add_test(NAME exe COMMAND exe)