diff options
author | Brad King <brad.king@kitware.com> | 2023-10-17 13:49:57 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-10-17 13:50:06 (GMT) |
commit | 84ac583bc6307eb73042762f40e381126199d972 (patch) | |
tree | 17a800f5a83af232bcfd4667ea63168952fd2153 /Tests/RunCMake | |
parent | ec916350db5e45dbd423b7ab93f17004d06b1e7c (diff) | |
parent | 0f36156740aaea82795444c8468fbfd5dc1e3810 (diff) | |
download | CMake-84ac583bc6307eb73042762f40e381126199d972.zip CMake-84ac583bc6307eb73042762f40e381126199d972.tar.gz CMake-84ac583bc6307eb73042762f40e381126199d972.tar.bz2 |
Merge topic 'cxxmodules-export-fileset-info' into release-3.28
0f36156740 cxxmodules: include `INCLUDES DESTINATION` directories
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8886
Diffstat (limited to 'Tests/RunCMake')
6 files changed, 29 insertions, 4 deletions
diff --git a/Tests/RunCMake/CXXModules/examples/export-include-directories-build/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-include-directories-build/CMakeLists.txt index 560994e..dd35c1f 100644 --- a/Tests/RunCMake/CXXModules/examples/export-include-directories-build/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-include-directories-build/CMakeLists.txt @@ -4,7 +4,8 @@ project(cxx_modules_export_include_directories CXX) include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") add_library(export_include_directories STATIC - include/include.h) + include/include.h + includes/includes.h) target_sources(export_include_directories PRIVATE forward.cxx @@ -25,7 +26,8 @@ target_sources(export_include_directories target_compile_features(export_include_directories PUBLIC cxx_std_20) target_include_directories(export_include_directories PRIVATE - "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>") + "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>" + "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/includes>") add_library(no_modules STATIC no_modules.cxx) diff --git a/Tests/RunCMake/CXXModules/examples/export-include-directories-build/importable.cxx b/Tests/RunCMake/CXXModules/examples/export-include-directories-build/importable.cxx index 6a1d83e..2c29683 100644 --- a/Tests/RunCMake/CXXModules/examples/export-include-directories-build/importable.cxx +++ b/Tests/RunCMake/CXXModules/examples/export-include-directories-build/importable.cxx @@ -6,6 +6,12 @@ module; # error "include define not found" #endif +#include "includes/includes.h" + +#ifndef includes_h_included +# error "includes define not found" +#endif + export module importable; extern "C++" { diff --git a/Tests/RunCMake/CXXModules/examples/export-include-directories-build/includes/includes.h b/Tests/RunCMake/CXXModules/examples/export-include-directories-build/includes/includes.h new file mode 100644 index 0000000..96bf33b --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/export-include-directories-build/includes/includes.h @@ -0,0 +1,3 @@ +#pragma once + +#define includes_h_included diff --git a/Tests/RunCMake/CXXModules/examples/export-include-directories-install/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-include-directories-install/CMakeLists.txt index 3d4e687..3e447f5 100644 --- a/Tests/RunCMake/CXXModules/examples/export-include-directories-install/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/export-include-directories-install/CMakeLists.txt @@ -4,7 +4,8 @@ project(cxx_modules_export_include_directories CXX) include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") add_library(export_include_directories STATIC - include/include.h) + include/include.h + includes/includes.h) target_sources(export_include_directories PRIVATE forward.cxx @@ -26,15 +27,19 @@ target_compile_features(export_include_directories PUBLIC cxx_std_20) target_include_directories(export_include_directories PRIVATE "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>" + "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/includes>" "$<INSTALL_INTERFACE:include>") add_library(no_modules STATIC no_modules.cxx) install(TARGETS export_include_directories no_modules EXPORT CXXModules - FILE_SET modules DESTINATION "lib/cxx/miu") + FILE_SET modules DESTINATION "lib/cxx/miu" + INCLUDES DESTINATION "elsewhere") install(DIRECTORY include DESTINATION "include") +install(DIRECTORY includes + DESTINATION "elsewhere") install(EXPORT CXXModules NAMESPACE CXXModules:: DESTINATION "lib/cmake/export_include_directories" diff --git a/Tests/RunCMake/CXXModules/examples/export-include-directories-install/importable.cxx b/Tests/RunCMake/CXXModules/examples/export-include-directories-install/importable.cxx index 6a1d83e..2c29683 100644 --- a/Tests/RunCMake/CXXModules/examples/export-include-directories-install/importable.cxx +++ b/Tests/RunCMake/CXXModules/examples/export-include-directories-install/importable.cxx @@ -6,6 +6,12 @@ module; # error "include define not found" #endif +#include "includes/includes.h" + +#ifndef includes_h_included +# error "includes define not found" +#endif + export module importable; extern "C++" { diff --git a/Tests/RunCMake/CXXModules/examples/export-include-directories-install/includes/includes.h b/Tests/RunCMake/CXXModules/examples/export-include-directories-install/includes/includes.h new file mode 100644 index 0000000..96bf33b --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/export-include-directories-install/includes/includes.h @@ -0,0 +1,3 @@ +#pragma once + +#define includes_h_included |