diff options
author | Brad King <brad.king@kitware.com> | 2023-09-27 15:25:10 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-09-27 15:25:22 (GMT) |
commit | 6bb05172acc8519a174a4f6294dd96d82c846d4c (patch) | |
tree | 5c4c29e5905a1a73e47539e3399561e27fda849e | |
parent | 2a12a83037dead14173fcf0219f4669229c67147 (diff) | |
parent | 42654cc8183af23a0d570355571d0a9d52a9d84d (diff) | |
download | CMake-6bb05172acc8519a174a4f6294dd96d82c846d4c.zip CMake-6bb05172acc8519a174a4f6294dd96d82c846d4c.tar.gz CMake-6bb05172acc8519a174a4f6294dd96d82c846d4c.tar.bz2 |
Merge topic 'cxxmodules-export-dirs-with-prefix'
42654cc818 Tests/CXXModules: add tests for modules with include requirements
7217cb78cf Tests/CXXModules: relax line number matching in stderr
b3d1bbbbcc cmExportFileGenerator: relocate include directories for C++ modules
349ff8b080 cmGeneratorTarget: remove not-INTERFACE assertion
681a763425 cmGeneratorTarget: use a character literal
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8838
70 files changed, 395 insertions, 87 deletions
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 5a12297..dae061b 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -1256,6 +1256,18 @@ void cmExportFileGenerator::GenerateImportedFileChecksCode( os << ")\n\n"; } +enum class PropertyType +{ + Strings, + Paths, +}; + +struct ModulePropertyTable +{ + cm::static_string_view Name; + PropertyType Type; +}; + bool cmExportFileGenerator::PopulateCxxModuleExportProperties( cmGeneratorTarget const* gte, ImportPropertyMap& properties, cmGeneratorExpression::PreprocessContext ctx, std::string& errorMessage) @@ -1279,14 +1291,14 @@ bool cmExportFileGenerator::PopulateCxxModuleExportProperties( } } - const cm::static_string_view exportedModuleProperties[] = { - "INCLUDE_DIRECTORIES"_s, - "COMPILE_DEFINITIONS"_s, - "COMPILE_OPTIONS"_s, - "COMPILE_FEATURES"_s, + const ModulePropertyTable exportedModuleProperties[] = { + { "INCLUDE_DIRECTORIES"_s, PropertyType::Paths }, + { "COMPILE_DEFINITIONS"_s, PropertyType::Strings }, + { "COMPILE_OPTIONS"_s, PropertyType::Strings }, + { "COMPILE_FEATURES"_s, PropertyType::Strings }, }; - for (auto const& propName : exportedModuleProperties) { - auto const propNameStr = std::string(propName); + for (auto const& propEntry : exportedModuleProperties) { + auto const propNameStr = std::string(propEntry.Name); cmValue prop = gte->Target->GetComputedProperty( propNameStr, *gte->Target->GetMakefile()); if (!prop) { @@ -1294,9 +1306,14 @@ bool cmExportFileGenerator::PopulateCxxModuleExportProperties( } if (prop) { auto const exportedPropName = - cmStrCat("IMPORTED_CXX_MODULES_", propName); + cmStrCat("IMPORTED_CXX_MODULES_", propEntry.Name); properties[exportedPropName] = cmGeneratorExpression::Preprocess(*prop, ctx); + if (ctx == cmGeneratorExpression::InstallInterface && + propEntry.Type == PropertyType::Paths) { + this->ReplaceInstallPrefix(properties[exportedPropName]); + prefixItems(properties[exportedPropName]); + } } } diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 181ffd1..04d7bb1 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -1292,13 +1292,12 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory( const std::string& dir, const std::string& config, const std::string& language) const { - assert(this->GetType() != cmStateEnums::INTERFACE_LIBRARY); std::string config_upper; if (!config.empty()) { config_upper = cmSystemTools::UpperCase(config); } - std::string key = cmStrCat(config_upper, "/", language); + std::string key = cmStrCat(config_upper, '/', language); auto iter = this->SystemIncludesCache.find(key); if (iter == this->SystemIncludesCache.end()) { diff --git a/Tests/RunCMake/CXXModules/ExportBuildCxxModules-stderr.txt b/Tests/RunCMake/CXXModules/ExportBuildCxxModules-stderr.txt index a82791b..49e869a 100644 --- a/Tests/RunCMake/CXXModules/ExportBuildCxxModules-stderr.txt +++ b/Tests/RunCMake/CXXModules/ExportBuildCxxModules-stderr.txt @@ -1,6 +1,6 @@ -CMake Warning \(dev\) at ExportBuildCxxModules.cmake:5 \(target_sources\): +CMake Warning \(dev\) at ExportBuildCxxModules.cmake:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. Call Stack \(most recent call first\): - CMakeLists.txt:6 \(include\) + CMakeLists.txt:[0-9]+ \(include\) This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/ExportInstallCxxModules-stderr.txt b/Tests/RunCMake/CXXModules/ExportInstallCxxModules-stderr.txt index db02227..4a6969d 100644 --- a/Tests/RunCMake/CXXModules/ExportInstallCxxModules-stderr.txt +++ b/Tests/RunCMake/CXXModules/ExportInstallCxxModules-stderr.txt @@ -1,6 +1,6 @@ -CMake Warning \(dev\) at ExportInstallCxxModules.cmake:5 \(target_sources\): +CMake Warning \(dev\) at ExportInstallCxxModules.cmake:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. Call Stack \(most recent call first\): - CMakeLists.txt:6 \(include\) + CMakeLists.txt:[0-9]+ \(include\) This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/FileSetModulesInterface-stderr.txt b/Tests/RunCMake/CXXModules/FileSetModulesInterface-stderr.txt index dfcdbec..cb21e2c 100644 --- a/Tests/RunCMake/CXXModules/FileSetModulesInterface-stderr.txt +++ b/Tests/RunCMake/CXXModules/FileSetModulesInterface-stderr.txt @@ -1,12 +1,12 @@ -CMake Warning \(dev\) at FileSetModulesInterface.cmake:2 \(target_sources\): +CMake Warning \(dev\) at FileSetModulesInterface.cmake:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. Call Stack \(most recent call first\): - CMakeLists.txt:6 \(include\) + CMakeLists.txt:[0-9]+ \(include\) This warning is for project developers. Use -Wno-dev to suppress it. -CMake Error at FileSetModulesInterface.cmake:2 \(target_sources\): +CMake Error at FileSetModulesInterface.cmake:[0-9]+ \(target_sources\): target_sources File set TYPE "CXX_MODULES" may not have "INTERFACE" visibility Call Stack \(most recent call first\): - CMakeLists.txt:6 \(include\) + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/CXXModules/FileSetModulesInterfaceImported-stderr.txt b/Tests/RunCMake/CXXModules/FileSetModulesInterfaceImported-stderr.txt index 4420bbc..aae763b 100644 --- a/Tests/RunCMake/CXXModules/FileSetModulesInterfaceImported-stderr.txt +++ b/Tests/RunCMake/CXXModules/FileSetModulesInterfaceImported-stderr.txt @@ -1,6 +1,6 @@ -CMake Warning \(dev\) at FileSetModulesInterfaceImported.cmake:2 \(target_sources\): +CMake Warning \(dev\) at FileSetModulesInterfaceImported.cmake:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. Call Stack \(most recent call first\): - CMakeLists.txt:6 \(include\) + CMakeLists.txt:[0-9]+ \(include\) This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/FileSetModulesPrivate-stderr.txt b/Tests/RunCMake/CXXModules/FileSetModulesPrivate-stderr.txt index 0c82ccc..a6e778a 100644 --- a/Tests/RunCMake/CXXModules/FileSetModulesPrivate-stderr.txt +++ b/Tests/RunCMake/CXXModules/FileSetModulesPrivate-stderr.txt @@ -1,6 +1,6 @@ -CMake Warning \(dev\) at FileSetModulesPrivate.cmake:5 \(target_sources\): +CMake Warning \(dev\) at FileSetModulesPrivate.cmake:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. Call Stack \(most recent call first\): - CMakeLists.txt:6 \(include\) + CMakeLists.txt:[0-9]+ \(include\) This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/FileSetModulesPublic-stderr.txt b/Tests/RunCMake/CXXModules/FileSetModulesPublic-stderr.txt index a27a28e..7fa8aa4 100644 --- a/Tests/RunCMake/CXXModules/FileSetModulesPublic-stderr.txt +++ b/Tests/RunCMake/CXXModules/FileSetModulesPublic-stderr.txt @@ -1,6 +1,6 @@ -CMake Warning \(dev\) at FileSetModulesPublic.cmake:5 \(target_sources\): +CMake Warning \(dev\) at FileSetModulesPublic.cmake:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. Call Stack \(most recent call first\): - CMakeLists.txt:6 \(include\) + CMakeLists.txt:[0-9]+ \(include\) This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/InstallBMI-stderr.txt b/Tests/RunCMake/CXXModules/InstallBMI-stderr.txt index fc3c7db..0f50963 100644 --- a/Tests/RunCMake/CXXModules/InstallBMI-stderr.txt +++ b/Tests/RunCMake/CXXModules/InstallBMI-stderr.txt @@ -1,6 +1,6 @@ -CMake Warning \(dev\) at InstallBMI.cmake:8 \(install\): +CMake Warning \(dev\) at InstallBMI.cmake:[0-9]+ \(install\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. Call Stack \(most recent call first\): - CMakeLists.txt:6 \(include\) + CMakeLists.txt:[0-9]+ \(include\) This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/InstallBMIGenericArgs-stderr.txt b/Tests/RunCMake/CXXModules/InstallBMIGenericArgs-stderr.txt index 44c961f..52b9c35 100644 --- a/Tests/RunCMake/CXXModules/InstallBMIGenericArgs-stderr.txt +++ b/Tests/RunCMake/CXXModules/InstallBMIGenericArgs-stderr.txt @@ -1,6 +1,6 @@ -CMake Warning \(dev\) at InstallBMIGenericArgs.cmake:8 \(install\): +CMake Warning \(dev\) at InstallBMIGenericArgs.cmake:[0-9]+ \(install\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. Call Stack \(most recent call first\): - CMakeLists.txt:6 \(include\) + CMakeLists.txt:[0-9]+ \(include\) This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/InstallBMIIgnore-stderr.txt b/Tests/RunCMake/CXXModules/InstallBMIIgnore-stderr.txt index d9d2c2d..bfff34c 100644 --- a/Tests/RunCMake/CXXModules/InstallBMIIgnore-stderr.txt +++ b/Tests/RunCMake/CXXModules/InstallBMIIgnore-stderr.txt @@ -1,6 +1,6 @@ -CMake Warning \(dev\) at InstallBMIIgnore.cmake:5 \(install\): +CMake Warning \(dev\) at InstallBMIIgnore.cmake:[0-9]+ \(install\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. Call Stack \(most recent call first\): - CMakeLists.txt:6 \(include\) + CMakeLists.txt:[0-9]+ \(include\) This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/NinjaDependInfoBMIInstall-stderr.txt b/Tests/RunCMake/CXXModules/NinjaDependInfoBMIInstall-stderr.txt index 9a7c1f9..e5bd1ec 100644 --- a/Tests/RunCMake/CXXModules/NinjaDependInfoBMIInstall-stderr.txt +++ b/Tests/RunCMake/CXXModules/NinjaDependInfoBMIInstall-stderr.txt @@ -1,6 +1,6 @@ -CMake Warning \(dev\) at NinjaDependInfoBMIInstall.cmake:13 \(target_sources\): +CMake Warning \(dev\) at NinjaDependInfoBMIInstall.cmake:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. Call Stack \(most recent call first\): - CMakeLists.txt:6 \(include\) + CMakeLists.txt:[0-9]+ \(include\) This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/NinjaDependInfoExport-stderr.txt b/Tests/RunCMake/CXXModules/NinjaDependInfoExport-stderr.txt index b66005b..ce0e55a 100644 --- a/Tests/RunCMake/CXXModules/NinjaDependInfoExport-stderr.txt +++ b/Tests/RunCMake/CXXModules/NinjaDependInfoExport-stderr.txt @@ -1,6 +1,6 @@ -CMake Warning \(dev\) at NinjaDependInfoExport.cmake:13 \(target_sources\): +CMake Warning \(dev\) at NinjaDependInfoExport.cmake:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. Call Stack \(most recent call first\): - CMakeLists.txt:6 \(include\) + CMakeLists.txt:[0-9]+ \(include\) This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/NinjaDependInfoFileSet-stderr.txt b/Tests/RunCMake/CXXModules/NinjaDependInfoFileSet-stderr.txt index 949b7af..055e741 100644 --- a/Tests/RunCMake/CXXModules/NinjaDependInfoFileSet-stderr.txt +++ b/Tests/RunCMake/CXXModules/NinjaDependInfoFileSet-stderr.txt @@ -1,6 +1,6 @@ -CMake Warning \(dev\) at NinjaDependInfoFileSet.cmake:13 \(target_sources\): +CMake Warning \(dev\) at NinjaDependInfoFileSet.cmake:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. Call Stack \(most recent call first\): - CMakeLists.txt:6 \(include\) + CMakeLists.txt:[0-9]+ \(include\) This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/NoCXX-stderr.txt b/Tests/RunCMake/CXXModules/NoCXX-stderr.txt index 148fa2d..c261e8c 100644 --- a/Tests/RunCMake/CXXModules/NoCXX-stderr.txt +++ b/Tests/RunCMake/CXXModules/NoCXX-stderr.txt @@ -1,8 +1,8 @@ -CMake Warning \(dev\) at NoCXX.cmake:4 \(target_sources\): +CMake Warning \(dev\) at NoCXX.cmake:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. Call Stack \(most recent call first\): - CMakeLists.txt:6 \(include\) + CMakeLists.txt:[0-9]+ \(include\) This warning is for project developers. Use -Wno-dev to suppress it. CMake Error in CMakeLists.txt: diff --git a/Tests/RunCMake/CXXModules/NoCXX20-stderr.txt b/Tests/RunCMake/CXXModules/NoCXX20-stderr.txt index dd25689..aba0c89 100644 --- a/Tests/RunCMake/CXXModules/NoCXX20-stderr.txt +++ b/Tests/RunCMake/CXXModules/NoCXX20-stderr.txt @@ -1,8 +1,8 @@ -CMake Warning \(dev\) at NoCXX20.cmake:4 \(target_sources\): +CMake Warning \(dev\) at NoCXX20.cmake:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. Call Stack \(most recent call first\): - CMakeLists.txt:6 \(include\) + CMakeLists.txt:[0-9]+ \(include\) This warning is for project developers. Use -Wno-dev to suppress it. CMake Error in CMakeLists.txt: diff --git a/Tests/RunCMake/CXXModules/NoCXX20ModuleFlag-stderr.txt b/Tests/RunCMake/CXXModules/NoCXX20ModuleFlag-stderr.txt index c2dc0b6..06174b5 100644 --- a/Tests/RunCMake/CXXModules/NoCXX20ModuleFlag-stderr.txt +++ b/Tests/RunCMake/CXXModules/NoCXX20ModuleFlag-stderr.txt @@ -1,8 +1,8 @@ -CMake Warning \(dev\) at NoCXX20ModuleFlag.cmake:6 \(target_sources\): +CMake Warning \(dev\) at NoCXX20ModuleFlag.cmake:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. Call Stack \(most recent call first\): - CMakeLists.txt:6 \(include\) + CMakeLists.txt:[0-9]+ \(include\) This warning is for project developers. Use -Wno-dev to suppress it. CMake Error in CMakeLists.txt: diff --git a/Tests/RunCMake/CXXModules/NoDyndepSupport-stderr.txt b/Tests/RunCMake/CXXModules/NoDyndepSupport-stderr.txt index c82a35a..8d15c19 100644 --- a/Tests/RunCMake/CXXModules/NoDyndepSupport-stderr.txt +++ b/Tests/RunCMake/CXXModules/NoDyndepSupport-stderr.txt @@ -1,8 +1,8 @@ -CMake Warning \(dev\) at NoDyndepSupport.cmake:9 \(target_sources\): +CMake Warning \(dev\) at NoDyndepSupport.cmake:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. Call Stack \(most recent call first\): - CMakeLists.txt:6 \(include\) + CMakeLists.txt:[0-9]+ \(include\) This warning is for project developers. Use -Wno-dev to suppress it. (CMake Error: diff --git a/Tests/RunCMake/CXXModules/NotCXXSourceModules-stderr.txt b/Tests/RunCMake/CXXModules/NotCXXSourceModules-stderr.txt index 78d3dc6..d73ff98 100644 --- a/Tests/RunCMake/CXXModules/NotCXXSourceModules-stderr.txt +++ b/Tests/RunCMake/CXXModules/NotCXXSourceModules-stderr.txt @@ -1,8 +1,8 @@ -CMake Warning \(dev\) at NotCXXSourceModules.cmake:6 \(target_sources\): +CMake Warning \(dev\) at NotCXXSourceModules.cmake:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. Call Stack \(most recent call first\): - CMakeLists.txt:6 \(include\) + CMakeLists.txt:[0-9]+ \(include\) This warning is for project developers. Use -Wno-dev to suppress it. CMake Error in CMakeLists.txt: diff --git a/Tests/RunCMake/CXXModules/NotCompiledSourceModules-stderr.txt b/Tests/RunCMake/CXXModules/NotCompiledSourceModules-stderr.txt index 52f4072..c963ce7 100644 --- a/Tests/RunCMake/CXXModules/NotCompiledSourceModules-stderr.txt +++ b/Tests/RunCMake/CXXModules/NotCompiledSourceModules-stderr.txt @@ -1,8 +1,8 @@ -CMake Warning \(dev\) at NotCompiledSourceModules.cmake:5 \(target_sources\): +CMake Warning \(dev\) at NotCompiledSourceModules.cmake:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. Call Stack \(most recent call first\): - CMakeLists.txt:6 \(include\) + CMakeLists.txt:[0-9]+ \(include\) This warning is for project developers. Use -Wno-dev to suppress it. (CMake Error in CMakeLists.txt: diff --git a/Tests/RunCMake/CXXModules/RunCMakeTest.cmake b/Tests/RunCMake/CXXModules/RunCMakeTest.cmake index f27eef8..f111b74 100644 --- a/Tests/RunCMake/CXXModules/RunCMakeTest.cmake +++ b/Tests/RunCMake/CXXModules/RunCMakeTest.cmake @@ -188,6 +188,7 @@ endif () if ("export_bmi" IN_LIST CMake_TEST_MODULE_COMPILATION) run_cxx_module_test(export-interface-no-properties-build) run_cxx_module_test(export-interface-build) + run_cxx_module_test(export-include-directories-build) run_cxx_module_test(export-usage-build) run_cxx_module_test(export-bmi-and-interface-build) @@ -199,6 +200,9 @@ if ("export_bmi" IN_LIST CMake_TEST_MODULE_COMPILATION) set(test_suffix export-interface-no-properties-build) run_cxx_module_test(import-modules "import-modules-${test_suffix}" "-DCMAKE_PREFIX_PATH=${RunCMake_BINARY_DIR}/examples/${test_suffix}-build" -DNO_PROPERTIES=1) + set(test_suffix export-include-directories-build) + run_cxx_module_test(import-modules "import-modules-${test_suffix}" "-DCMAKE_PREFIX_PATH=${RunCMake_BINARY_DIR}/examples/${test_suffix}-build" -DINCLUDE_PROPERTIES=1) + set(test_suffix export-bmi-and-interface-build) run_cxx_module_test(import-modules "import-modules-${test_suffix}" "-DCMAKE_PREFIX_PATH=${RunCMake_BINARY_DIR}/examples/${test_suffix}-build" -DWITH_BMIS=1) endif () @@ -215,6 +219,7 @@ if ("install_bmi" IN_LIST CMake_TEST_MODULE_COMPILATION) if ("export_bmi" IN_LIST CMake_TEST_MODULE_COMPILATION) run_cxx_module_test(export-interface-no-properties-install) run_cxx_module_test(export-interface-install) + run_cxx_module_test(export-include-directories-install) run_cxx_module_test(export-usage-install) run_cxx_module_test(export-bmi-and-interface-install) @@ -227,6 +232,9 @@ if ("install_bmi" IN_LIST CMake_TEST_MODULE_COMPILATION) set(test_suffix export-interface-no-properties-install) run_cxx_module_test(import-modules "import-modules-${test_suffix}" "-DCMAKE_PREFIX_PATH=${RunCMake_BINARY_DIR}/examples/${test_suffix}-install" -DNO_PROPERTIES=1) + set(test_suffix export-include-directories-install) + run_cxx_module_test(import-modules "import-modules-${test_suffix}" "-DCMAKE_PREFIX_PATH=${RunCMake_BINARY_DIR}/examples/${test_suffix}-install" -DINCLUDE_PROPERTIES=1) + set(test_suffix export-bmi-and-interface-install) run_cxx_module_test(import-modules "import-modules-${test_suffix}" "-DCMAKE_PREFIX_PATH=${RunCMake_BINARY_DIR}/examples/${test_suffix}-install" -DWITH_BMIS=1) set(RunCMake_CXXModules_INSTALL 1) diff --git a/Tests/RunCMake/CXXModules/examples/circular-stderr.txt b/Tests/RunCMake/CXXModules/examples/circular-stderr.txt index 78bdf2b..be89b8c 100644 --- a/Tests/RunCMake/CXXModules/examples/circular-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/circular-stderr.txt @@ -1,4 +1,4 @@ -CMake Warning \(dev\) at CMakeLists.txt:7 \(target_sources\): +CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/deep-chain-stderr.txt b/Tests/RunCMake/CXXModules/examples/deep-chain-stderr.txt index 659414d..be89b8c 100644 --- a/Tests/RunCMake/CXXModules/examples/deep-chain-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/deep-chain-stderr.txt @@ -1,4 +1,4 @@ -CMake Warning \(dev\) at CMakeLists.txt:15 \(target_sources\): +CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/duplicate-stderr.txt b/Tests/RunCMake/CXXModules/examples/duplicate-stderr.txt index 78bdf2b..be89b8c 100644 --- a/Tests/RunCMake/CXXModules/examples/duplicate-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/duplicate-stderr.txt @@ -1,4 +1,4 @@ -CMake Warning \(dev\) at CMakeLists.txt:7 \(target_sources\): +CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/export-compile-commands-stderr.txt b/Tests/RunCMake/CXXModules/examples/export-compile-commands-stderr.txt index e868787..be89b8c 100644 --- a/Tests/RunCMake/CXXModules/examples/export-compile-commands-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/export-compile-commands-stderr.txt @@ -1,4 +1,4 @@ -CMake Warning \(dev\) at CMakeLists.txt:9 \(target_sources\): +CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/export-include-directories-build-stderr.txt b/Tests/RunCMake/CXXModules/examples/export-include-directories-build-stderr.txt new file mode 100644 index 0000000..28a7b1f --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/export-include-directories-build-stderr.txt @@ -0,0 +1,4 @@ +CMake Warning \(dev\) at CMakeLists.txt:[0-9] \(target_sources\): + CMake's C\+\+ module support is experimental. It is meant only for + experimentation and feedback to CMake developers. +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/export-include-directories-build/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-include-directories-build/CMakeLists.txt new file mode 100644 index 0000000..bc2ae7f --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/export-include-directories-build/CMakeLists.txt @@ -0,0 +1,63 @@ +cmake_minimum_required(VERSION 3.24) +project(cxx_modules_export_include_directories CXX) + +include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") + +add_library(export_include_directories STATIC + include/include.h) +target_sources(export_include_directories + PRIVATE + forward.cxx + PRIVATE + FILE_SET modules_private TYPE CXX_MODULES + BASE_DIRS + "${CMAKE_CURRENT_SOURCE_DIR}" + FILES + private.cxx + PUBLIC + FILE_SET modules TYPE CXX_MODULES + BASE_DIRS + "${CMAKE_CURRENT_SOURCE_DIR}" + FILES + importable.cxx + subdir/importable.cxx + ) +target_compile_features(export_include_directories PUBLIC cxx_std_20) +target_include_directories(export_include_directories + PRIVATE + "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/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") +export(EXPORT CXXModules + NAMESPACE CXXModules:: + FILE "${CMAKE_CURRENT_BINARY_DIR}/export_include_directories-targets.cmake" + CXX_MODULES_DIRECTORY "export_include_directories-cxx-modules") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/export_include_directories-config.cmake" + "include(\"\${CMAKE_CURRENT_LIST_DIR}/export_include_directories-targets.cmake\") +set(\${CMAKE_FIND_PACKAGE_NAME}_FOUND 1) +") + +set(generator + -G "${CMAKE_GENERATOR}") +if (CMAKE_GENERATOR_TOOLSET) + list(APPEND generator + -T "${CMAKE_GENERATOR_TOOLSET}") +endif () +if (CMAKE_GENERATOR_PLATFORM) + list(APPEND generator + -A "${CMAKE_GENERATOR_PLATFORM}") +endif () + +add_test(NAME export_include_directories_build + COMMAND + "${CMAKE_COMMAND}" + "-Dexpected_source_dir=${CMAKE_CURRENT_SOURCE_DIR}" + "-Dexpected_binary_dir=${CMAKE_CURRENT_BINARY_DIR}" + "-Dexport_include_directories_DIR=${CMAKE_CURRENT_BINARY_DIR}" + ${generator} + -S "${CMAKE_CURRENT_SOURCE_DIR}/test" + -B "${CMAKE_CURRENT_BINARY_DIR}/test") diff --git a/Tests/RunCMake/CXXModules/examples/export-include-directories-build/forward.cxx b/Tests/RunCMake/CXXModules/examples/export-include-directories-build/forward.cxx new file mode 100644 index 0000000..7f53271 --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/export-include-directories-build/forward.cxx @@ -0,0 +1,6 @@ +import priv; + +int forwarding() +{ + return from_private(); +} diff --git a/Tests/RunCMake/CXXModules/examples/export-include-directories-build/importable.cxx b/Tests/RunCMake/CXXModules/examples/export-include-directories-build/importable.cxx new file mode 100644 index 0000000..6a1d83e --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/export-include-directories-build/importable.cxx @@ -0,0 +1,18 @@ +module; + +#include "include/include.h" + +#ifndef include_h_included +# error "include define not found" +#endif + +export module importable; + +extern "C++" { +int forwarding(); +} + +export int from_import() +{ + return forwarding(); +} diff --git a/Tests/RunCMake/CXXModules/examples/export-include-directories-build/include/include.h b/Tests/RunCMake/CXXModules/examples/export-include-directories-build/include/include.h new file mode 100644 index 0000000..e3eee34 --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/export-include-directories-build/include/include.h @@ -0,0 +1,3 @@ +#pragma once + +#define include_h_included diff --git a/Tests/RunCMake/CXXModules/examples/export-include-directories-build/no_modules.cxx b/Tests/RunCMake/CXXModules/examples/export-include-directories-build/no_modules.cxx new file mode 100644 index 0000000..eea854f --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/export-include-directories-build/no_modules.cxx @@ -0,0 +1,3 @@ +void no_modules() +{ +} diff --git a/Tests/RunCMake/CXXModules/examples/export-include-directories-build/private.cxx b/Tests/RunCMake/CXXModules/examples/export-include-directories-build/private.cxx new file mode 100644 index 0000000..c5b719a --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/export-include-directories-build/private.cxx @@ -0,0 +1,6 @@ +export module priv; + +export int from_private() +{ + return 0; +} diff --git a/Tests/RunCMake/CXXModules/examples/export-include-directories-build/subdir/importable.cxx b/Tests/RunCMake/CXXModules/examples/export-include-directories-build/subdir/importable.cxx new file mode 100644 index 0000000..07d6af6 --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/export-include-directories-build/subdir/importable.cxx @@ -0,0 +1,6 @@ +export module subdir_importable; + +export int from_subdir() +{ + return 0; +} diff --git a/Tests/RunCMake/CXXModules/examples/export-include-directories-build/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-include-directories-build/test/CMakeLists.txt new file mode 100644 index 0000000..f5bdfd4 --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/export-include-directories-build/test/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.24) +project(cxx_modules_library NONE) + +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "ac01f462-0f5f-432a-86aa-acef252918a6") + +find_package(export_include_directories REQUIRED) + +if (NOT TARGET CXXModules::export_include_directories) + message(FATAL_ERROR + "Missing imported target") +endif () + +get_property(include_directories TARGET CXXModules::export_include_directories + PROPERTY IMPORTED_CXX_MODULES_INCLUDE_DIRECTORIES) +foreach (include_directory IN LISTS include_directories) + if (NOT EXISTS "${include_directory}") + message(FATAL_ERROR + "Missing include directory in C++ module interface CXXModules::export_include_directories:\n ${include_directory}") + endif () +endforeach () diff --git a/Tests/RunCMake/CXXModules/examples/export-include-directories-install-stderr.txt b/Tests/RunCMake/CXXModules/examples/export-include-directories-install-stderr.txt new file mode 100644 index 0000000..be89b8c --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/export-include-directories-install-stderr.txt @@ -0,0 +1,4 @@ +CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): + CMake's C\+\+ module support is experimental. It is meant only for + experimentation and feedback to CMake developers. +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/export-include-directories-install/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-include-directories-install/CMakeLists.txt new file mode 100644 index 0000000..444882d --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/export-include-directories-install/CMakeLists.txt @@ -0,0 +1,69 @@ +cmake_minimum_required(VERSION 3.24) +project(cxx_modules_export_include_directories CXX) + +include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") + +add_library(export_include_directories STATIC + include/include.h) +target_sources(export_include_directories + PRIVATE + forward.cxx + PRIVATE + FILE_SET modules_private TYPE CXX_MODULES + BASE_DIRS + "${CMAKE_CURRENT_SOURCE_DIR}" + FILES + private.cxx + PUBLIC + FILE_SET modules TYPE CXX_MODULES + BASE_DIRS + "${CMAKE_CURRENT_SOURCE_DIR}" + FILES + importable.cxx + subdir/importable.cxx + ) +target_compile_features(export_include_directories PUBLIC cxx_std_20) +target_include_directories(export_include_directories + PRIVATE + "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>" + "$<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") +install(DIRECTORY include + DESTINATION "include") +install(EXPORT CXXModules + NAMESPACE CXXModules:: + DESTINATION "lib/cmake/export_include_directories" + FILE "export_include_directories-targets.cmake" + CXX_MODULES_DIRECTORY "export_include_directories-cxx-modules") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/export_include_directories-config.cmake" + "include(\"\${CMAKE_CURRENT_LIST_DIR}/export_include_directories-targets.cmake\") +set(\${CMAKE_FIND_PACKAGE_NAME}_FOUND 1) +") +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/export_include_directories-config.cmake" + DESTINATION "lib/cmake/export_include_directories") + +set(generator + -G "${CMAKE_GENERATOR}") +if (CMAKE_GENERATOR_TOOLSET) + list(APPEND generator + -T "${CMAKE_GENERATOR_TOOLSET}") +endif () +if (CMAKE_GENERATOR_PLATFORM) + list(APPEND generator + -A "${CMAKE_GENERATOR_PLATFORM}") +endif () + +add_test(NAME export_include_directories_build + COMMAND + "${CMAKE_COMMAND}" + "-Dexpected_source_dir=${CMAKE_INSTALL_PREFIX}/lib/cxx/miu" + "-Dexpected_binary_dir=${CMAKE_INSTALL_PREFIX}/lib/cxx/bmi" + "-Dexport_include_directories_DIR=${CMAKE_INSTALL_PREFIX}/lib/cmake/export_include_directories" + ${generator} + -S "${CMAKE_CURRENT_SOURCE_DIR}/test" + -B "${CMAKE_CURRENT_BINARY_DIR}/test") diff --git a/Tests/RunCMake/CXXModules/examples/export-include-directories-install/forward.cxx b/Tests/RunCMake/CXXModules/examples/export-include-directories-install/forward.cxx new file mode 100644 index 0000000..7f53271 --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/export-include-directories-install/forward.cxx @@ -0,0 +1,6 @@ +import priv; + +int forwarding() +{ + return from_private(); +} diff --git a/Tests/RunCMake/CXXModules/examples/export-include-directories-install/importable.cxx b/Tests/RunCMake/CXXModules/examples/export-include-directories-install/importable.cxx new file mode 100644 index 0000000..6a1d83e --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/export-include-directories-install/importable.cxx @@ -0,0 +1,18 @@ +module; + +#include "include/include.h" + +#ifndef include_h_included +# error "include define not found" +#endif + +export module importable; + +extern "C++" { +int forwarding(); +} + +export int from_import() +{ + return forwarding(); +} diff --git a/Tests/RunCMake/CXXModules/examples/export-include-directories-install/include/include.h b/Tests/RunCMake/CXXModules/examples/export-include-directories-install/include/include.h new file mode 100644 index 0000000..e3eee34 --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/export-include-directories-install/include/include.h @@ -0,0 +1,3 @@ +#pragma once + +#define include_h_included diff --git a/Tests/RunCMake/CXXModules/examples/export-include-directories-install/no_modules.cxx b/Tests/RunCMake/CXXModules/examples/export-include-directories-install/no_modules.cxx new file mode 100644 index 0000000..eea854f --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/export-include-directories-install/no_modules.cxx @@ -0,0 +1,3 @@ +void no_modules() +{ +} diff --git a/Tests/RunCMake/CXXModules/examples/export-include-directories-install/private.cxx b/Tests/RunCMake/CXXModules/examples/export-include-directories-install/private.cxx new file mode 100644 index 0000000..c5b719a --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/export-include-directories-install/private.cxx @@ -0,0 +1,6 @@ +export module priv; + +export int from_private() +{ + return 0; +} diff --git a/Tests/RunCMake/CXXModules/examples/export-include-directories-install/subdir/importable.cxx b/Tests/RunCMake/CXXModules/examples/export-include-directories-install/subdir/importable.cxx new file mode 100644 index 0000000..07d6af6 --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/export-include-directories-install/subdir/importable.cxx @@ -0,0 +1,6 @@ +export module subdir_importable; + +export int from_subdir() +{ + return 0; +} diff --git a/Tests/RunCMake/CXXModules/examples/export-include-directories-install/test/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/export-include-directories-install/test/CMakeLists.txt new file mode 100644 index 0000000..9cdb7ff --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/export-include-directories-install/test/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.24) +project(cxx_modules_library NONE) + +set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "ac01f462-0f5f-432a-86aa-acef252918a6") + +find_package(export_include_directories REQUIRED) + +if (NOT TARGET CXXModules::export_include_directories) + message(FATAL_ERROR + "Missing imported target") +endif () + +get_property(file_sets TARGET CXXModules::export_include_directories + PROPERTY INTERFACE_CXX_MODULE_SETS) +if (NOT file_sets STREQUAL "modules") + message(FATAL_ERROR + "Incorrect exported file sets in CXXModules::export_include_directories:\n ${file_sets}") +endif () diff --git a/Tests/RunCMake/CXXModules/examples/export-usage-build-stderr.txt b/Tests/RunCMake/CXXModules/examples/export-usage-build-stderr.txt index 78bdf2b..be89b8c 100644 --- a/Tests/RunCMake/CXXModules/examples/export-usage-build-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/export-usage-build-stderr.txt @@ -1,4 +1,4 @@ -CMake Warning \(dev\) at CMakeLists.txt:7 \(target_sources\): +CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/export-usage-install-stderr.txt b/Tests/RunCMake/CXXModules/examples/export-usage-install-stderr.txt index 78bdf2b..be89b8c 100644 --- a/Tests/RunCMake/CXXModules/examples/export-usage-install-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/export-usage-install-stderr.txt @@ -1,4 +1,4 @@ -CMake Warning \(dev\) at CMakeLists.txt:7 \(target_sources\): +CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/generated-stderr.txt b/Tests/RunCMake/CXXModules/examples/generated-stderr.txt index 06160ce..be89b8c 100644 --- a/Tests/RunCMake/CXXModules/examples/generated-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/generated-stderr.txt @@ -1,4 +1,4 @@ -CMake Warning \(dev\) at CMakeLists.txt:16 \(target_sources\): +CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/import-modules-export-bmi-and-interface-build-stderr.txt b/Tests/RunCMake/CXXModules/examples/import-modules-export-bmi-and-interface-build-stderr.txt index 71ee795..e2970ec 100644 --- a/Tests/RunCMake/CXXModules/examples/import-modules-export-bmi-and-interface-build-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/import-modules-export-bmi-and-interface-build-stderr.txt @@ -1,7 +1,7 @@ -CMake Warning \(dev\) at .*/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build-build/export_bmi_and_interfaces-targets.cmake:[0-9]* \(target_sources\): +CMake Warning \(dev\) at .*/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build-build/export_bmi_and_interfaces-targets.cmake:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. Call Stack \(most recent call first\): - .*/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build-build/export_bmi_and_interfaces-config.cmake:1 \(include\) - CMakeLists.txt:15 \(find_package\) + .*/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-build-build/export_bmi_and_interfaces-config.cmake:[0-9]+ \(include\) + CMakeLists.txt:[0-9]+ \(find_package\) This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/import-modules-export-bmi-and-interface-install-stderr.txt b/Tests/RunCMake/CXXModules/examples/import-modules-export-bmi-and-interface-install-stderr.txt index d22b2a1..ec5dd1f 100644 --- a/Tests/RunCMake/CXXModules/examples/import-modules-export-bmi-and-interface-install-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/import-modules-export-bmi-and-interface-install-stderr.txt @@ -1,7 +1,7 @@ -CMake Warning \(dev\) at .*/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install-install/lib/cmake/export_bmi_and_interfaces/export_bmi_and_interfaces-targets.cmake:[0-9]* \(target_sources\): +CMake Warning \(dev\) at .*/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install-install/lib/cmake/export_bmi_and_interfaces/export_bmi_and_interfaces-targets.cmake:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. Call Stack \(most recent call first\): - .*/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install-install/lib/cmake/export_bmi_and_interfaces/export_bmi_and_interfaces-config.cmake:1 \(include\) - CMakeLists.txt:15 \(find_package\) + .*/Tests/RunCMake/CXXModules/examples/export-bmi-and-interface-install-install/lib/cmake/export_bmi_and_interfaces/export_bmi_and_interfaces-config.cmake:[0-9]+ \(include\) + CMakeLists.txt:[0-9]+ \(find_package\) This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/import-modules-export-include-directories-build-stderr.txt b/Tests/RunCMake/CXXModules/examples/import-modules-export-include-directories-build-stderr.txt new file mode 100644 index 0000000..4ea3679 --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/import-modules-export-include-directories-build-stderr.txt @@ -0,0 +1,7 @@ +CMake Warning \(dev\) at .*/Tests/RunCMake/CXXModules/examples/export-include-directories-build-build/export_include_directories-targets.cmake:[0-9]+ \(target_sources\): + CMake's C\+\+ module support is experimental. It is meant only for + experimentation and feedback to CMake developers. +Call Stack \(most recent call first\): + .*/Tests/RunCMake/CXXModules/examples/export-include-directories-build-build/export_include_directories-config.cmake:[0-9]+ \(include\) + CMakeLists.txt:[0-9]+ \(find_package\) +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/import-modules-export-include-directories-install-stderr.txt b/Tests/RunCMake/CXXModules/examples/import-modules-export-include-directories-install-stderr.txt new file mode 100644 index 0000000..50ad6b9 --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/import-modules-export-include-directories-install-stderr.txt @@ -0,0 +1,7 @@ +CMake Warning \(dev\) at .*/Tests/RunCMake/CXXModules/examples/export-include-directories-install-install/lib/cmake/export_include_directories/export_include_directories-targets.cmake:[0-9]+ \(target_sources\): + CMake's C\+\+ module support is experimental. It is meant only for + experimentation and feedback to CMake developers. +Call Stack \(most recent call first\): + .*/Tests/RunCMake/CXXModules/examples/export-include-directories-install-install/lib/cmake/export_include_directories/export_include_directories-config.cmake:[0-9]+ \(include\) + CMakeLists.txt:[0-9]+ \(find_package\) +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/import-modules-export-interface-build-stderr.txt b/Tests/RunCMake/CXXModules/examples/import-modules-export-interface-build-stderr.txt index f79abbc..10404c6 100644 --- a/Tests/RunCMake/CXXModules/examples/import-modules-export-interface-build-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/import-modules-export-interface-build-stderr.txt @@ -1,7 +1,7 @@ -CMake Warning \(dev\) at .*/Tests/RunCMake/CXXModules/examples/export-interface-build-build/export_interfaces-targets.cmake:[0-9]* \(target_sources\): +CMake Warning \(dev\) at .*/Tests/RunCMake/CXXModules/examples/export-interface-build-build/export_interfaces-targets.cmake:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. Call Stack \(most recent call first\): - .*/Tests/RunCMake/CXXModules/examples/export-interface-build-build/export_interfaces-config.cmake:1 \(include\) - CMakeLists.txt:15 \(find_package\) + .*/Tests/RunCMake/CXXModules/examples/export-interface-build-build/export_interfaces-config.cmake:[0-9]+ \(include\) + CMakeLists.txt:[0-9]+ \(find_package\) This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/import-modules-export-interface-install-stderr.txt b/Tests/RunCMake/CXXModules/examples/import-modules-export-interface-install-stderr.txt index 32f9452..04124cd 100644 --- a/Tests/RunCMake/CXXModules/examples/import-modules-export-interface-install-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/import-modules-export-interface-install-stderr.txt @@ -1,7 +1,7 @@ -CMake Warning \(dev\) at .*/Tests/RunCMake/CXXModules/examples/export-interface-install-install/lib/cmake/export_interfaces/export_interfaces-targets.cmake:[0-9]* \(target_sources\): +CMake Warning \(dev\) at .*/Tests/RunCMake/CXXModules/examples/export-interface-install-install/lib/cmake/export_interfaces/export_interfaces-targets.cmake:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. Call Stack \(most recent call first\): - .*/Tests/RunCMake/CXXModules/examples/export-interface-install-install/lib/cmake/export_interfaces/export_interfaces-config.cmake:1 \(include\) - CMakeLists.txt:15 \(find_package\) + .*/Tests/RunCMake/CXXModules/examples/export-interface-install-install/lib/cmake/export_interfaces/export_interfaces-config.cmake:[0-9]+ \(include\) + CMakeLists.txt:[0-9]+ \(find_package\) This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/import-modules-export-interface-no-properties-build-stderr.txt b/Tests/RunCMake/CXXModules/examples/import-modules-export-interface-no-properties-build-stderr.txt index 9254936..dcf6498 100644 --- a/Tests/RunCMake/CXXModules/examples/import-modules-export-interface-no-properties-build-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/import-modules-export-interface-no-properties-build-stderr.txt @@ -1,7 +1,7 @@ -CMake Warning \(dev\) at .*/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build-build/export_interfaces_no_properties-targets.cmake:[0-9]* \(target_sources\): +CMake Warning \(dev\) at .*/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build-build/export_interfaces_no_properties-targets.cmake:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. Call Stack \(most recent call first\): - .*/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build-build/export_interfaces_no_properties-config.cmake:1 \(include\) - CMakeLists.txt:15 \(find_package\) + .*/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-build-build/export_interfaces_no_properties-config.cmake:[0-9]+ \(include\) + CMakeLists.txt:[0-9]+ \(find_package\) This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/import-modules-export-interface-no-properties-install-stderr.txt b/Tests/RunCMake/CXXModules/examples/import-modules-export-interface-no-properties-install-stderr.txt index 71269f4..7073b4a 100644 --- a/Tests/RunCMake/CXXModules/examples/import-modules-export-interface-no-properties-install-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/import-modules-export-interface-no-properties-install-stderr.txt @@ -1,7 +1,7 @@ -CMake Warning \(dev\) at .*/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install-install/lib/cmake/export_interfaces_no_properties/export_interfaces_no_properties-targets.cmake:[0-9]* \(target_sources\): +CMake Warning \(dev\) at .*/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install-install/lib/cmake/export_interfaces_no_properties/export_interfaces_no_properties-targets.cmake:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. Call Stack \(most recent call first\): - .*/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install-install/lib/cmake/export_interfaces_no_properties/export_interfaces_no_properties-config.cmake:1 \(include\) - CMakeLists.txt:15 \(find_package\) + .*/Tests/RunCMake/CXXModules/examples/export-interface-no-properties-install-install/lib/cmake/export_interfaces_no_properties/export_interfaces_no_properties-config.cmake:[0-9]+ \(include\) + CMakeLists.txt:[0-9]+ \(find_package\) This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/import-modules/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/import-modules/CMakeLists.txt index 3e6f379..946792c 100644 --- a/Tests/RunCMake/CXXModules/examples/import-modules/CMakeLists.txt +++ b/Tests/RunCMake/CXXModules/examples/import-modules/CMakeLists.txt @@ -7,6 +7,8 @@ if (NO_PROPERTIES) set(package_name "export_interfaces_no_properties") elseif (WITH_BMIS) set(package_name "export_bmi_and_interfaces") +elseif (INCLUDE_PROPERTIES) + set(package_name "export_include_directories") else () set(package_name "export_interfaces") endif () diff --git a/Tests/RunCMake/CXXModules/examples/import-modules/use.cxx b/Tests/RunCMake/CXXModules/examples/import-modules/use.cxx index feb38d2..2da1913 100644 --- a/Tests/RunCMake/CXXModules/examples/import-modules/use.cxx +++ b/Tests/RunCMake/CXXModules/examples/import-modules/use.cxx @@ -1,3 +1,9 @@ +#if defined(__has_include) +# if __has_include(<include/include.h>) +# error "include directories leaked from private module requirements" +# endif +#endif + import importable; int main(int argc, char* argv[]) diff --git a/Tests/RunCMake/CXXModules/examples/install-bmi-and-interfaces-stderr.txt b/Tests/RunCMake/CXXModules/examples/install-bmi-and-interfaces-stderr.txt index 78bdf2b..be89b8c 100644 --- a/Tests/RunCMake/CXXModules/examples/install-bmi-and-interfaces-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/install-bmi-and-interfaces-stderr.txt @@ -1,4 +1,4 @@ -CMake Warning \(dev\) at CMakeLists.txt:7 \(target_sources\): +CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/install-bmi-stderr.txt b/Tests/RunCMake/CXXModules/examples/install-bmi-stderr.txt index 78bdf2b..be89b8c 100644 --- a/Tests/RunCMake/CXXModules/examples/install-bmi-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/install-bmi-stderr.txt @@ -1,4 +1,4 @@ -CMake Warning \(dev\) at CMakeLists.txt:7 \(target_sources\): +CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/internal-partitions-stderr.txt b/Tests/RunCMake/CXXModules/examples/internal-partitions-stderr.txt index 79c5637..be89b8c 100644 --- a/Tests/RunCMake/CXXModules/examples/internal-partitions-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/internal-partitions-stderr.txt @@ -1,4 +1,4 @@ -CMake Warning \(dev\) at CMakeLists.txt:10 \(target_sources\): +CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/library-shared-stderr.txt b/Tests/RunCMake/CXXModules/examples/library-shared-stderr.txt index 79c5637..be89b8c 100644 --- a/Tests/RunCMake/CXXModules/examples/library-shared-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/library-shared-stderr.txt @@ -1,4 +1,4 @@ -CMake Warning \(dev\) at CMakeLists.txt:10 \(target_sources\): +CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/library-static-stderr.txt b/Tests/RunCMake/CXXModules/examples/library-static-stderr.txt index 79c5637..be89b8c 100644 --- a/Tests/RunCMake/CXXModules/examples/library-static-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/library-static-stderr.txt @@ -1,4 +1,4 @@ -CMake Warning \(dev\) at CMakeLists.txt:10 \(target_sources\): +CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/object-library-stderr.txt b/Tests/RunCMake/CXXModules/examples/object-library-stderr.txt index 4709399..be89b8c 100644 --- a/Tests/RunCMake/CXXModules/examples/object-library-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/object-library-stderr.txt @@ -1,4 +1,4 @@ -CMake Warning \(dev\) at CMakeLists.txt:[0-9]* \(target_sources\): +CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/partitions-stderr.txt b/Tests/RunCMake/CXXModules/examples/partitions-stderr.txt index 79c5637..be89b8c 100644 --- a/Tests/RunCMake/CXXModules/examples/partitions-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/partitions-stderr.txt @@ -1,4 +1,4 @@ -CMake Warning \(dev\) at CMakeLists.txt:10 \(target_sources\): +CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/public-req-private-stderr.txt b/Tests/RunCMake/CXXModules/examples/public-req-private-stderr.txt index 78bdf2b..be89b8c 100644 --- a/Tests/RunCMake/CXXModules/examples/public-req-private-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/public-req-private-stderr.txt @@ -1,4 +1,4 @@ -CMake Warning \(dev\) at CMakeLists.txt:7 \(target_sources\): +CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/req-private-other-target-stderr.txt b/Tests/RunCMake/CXXModules/examples/req-private-other-target-stderr.txt index 78bdf2b..be89b8c 100644 --- a/Tests/RunCMake/CXXModules/examples/req-private-other-target-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/req-private-other-target-stderr.txt @@ -1,4 +1,4 @@ -CMake Warning \(dev\) at CMakeLists.txt:7 \(target_sources\): +CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/same-src-name-stderr.txt b/Tests/RunCMake/CXXModules/examples/same-src-name-stderr.txt index 78bdf2b..be89b8c 100644 --- a/Tests/RunCMake/CXXModules/examples/same-src-name-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/same-src-name-stderr.txt @@ -1,4 +1,4 @@ -CMake Warning \(dev\) at CMakeLists.txt:7 \(target_sources\): +CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/scan_properties-stderr.txt b/Tests/RunCMake/CXXModules/examples/scan_properties-stderr.txt index 34f3f85..be89b8c 100644 --- a/Tests/RunCMake/CXXModules/examples/scan_properties-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/scan_properties-stderr.txt @@ -1,4 +1,4 @@ -CMake Warning \(dev\) at CMakeLists.txt:25 \(target_sources\): +CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/simple-stderr.txt b/Tests/RunCMake/CXXModules/examples/simple-stderr.txt index 78bdf2b..be89b8c 100644 --- a/Tests/RunCMake/CXXModules/examples/simple-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/simple-stderr.txt @@ -1,4 +1,4 @@ -CMake Warning \(dev\) at CMakeLists.txt:7 \(target_sources\): +CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(target_sources\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/try-compile-stderr.txt b/Tests/RunCMake/CXXModules/examples/try-compile-stderr.txt index 571bb9c..a121e86 100644 --- a/Tests/RunCMake/CXXModules/examples/try-compile-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/try-compile-stderr.txt @@ -1,4 +1,4 @@ -CMake Warning \(dev\) at CMakeLists.txt:[0-9]* \(try_compile\): +CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(try_compile\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CXXModules/examples/try-run-stderr.txt b/Tests/RunCMake/CXXModules/examples/try-run-stderr.txt index 508db55..8eea7a6 100644 --- a/Tests/RunCMake/CXXModules/examples/try-run-stderr.txt +++ b/Tests/RunCMake/CXXModules/examples/try-run-stderr.txt @@ -1,4 +1,4 @@ -CMake Warning \(dev\) at CMakeLists.txt:[0-9]* \(try_run\): +CMake Warning \(dev\) at CMakeLists.txt:[0-9]+ \(try_run\): CMake's C\+\+ module support is experimental. It is meant only for experimentation and feedback to CMake developers. This warning is for project developers. Use -Wno-dev to suppress it. |