From 5f93cf4afea05ffaf7b688bbc4080a3410a20bc3 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 22 Apr 2022 18:02:46 -0400 Subject: cmFileSet: support makefile-less error reporting of visibility --- Source/cmFileSet.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Source/cmFileSet.cxx b/Source/cmFileSet.cxx index 1d1d29e..d6665a2 100644 --- a/Source/cmFileSet.cxx +++ b/Source/cmFileSet.cxx @@ -45,9 +45,12 @@ cmFileSetVisibility cmFileSetVisibilityFromName(cm::string_view name, if (name == "PRIVATE"_s) { return cmFileSetVisibility::Private; } - mf->IssueMessage( - MessageType::FATAL_ERROR, - cmStrCat("File set visibility \"", name, "\" is not valid.")); + auto msg = cmStrCat("File set visibility \"", name, "\" is not valid."); + if (mf) { + mf->IssueMessage(MessageType::FATAL_ERROR, msg); + } else { + cmSystemTools::Error(msg); + } return cmFileSetVisibility::Private; } -- cgit v0.12 From 44a110eb80d3b0a2c04d7a0eac4f3d6bfba54ebd Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 22 Apr 2022 18:03:12 -0400 Subject: cmInstallGenerator: fix default argument comments --- Source/cmInstallGenerator.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/cmInstallGenerator.cxx b/Source/cmInstallGenerator.cxx index 00eb8c3..a33ad78 100644 --- a/Source/cmInstallGenerator.cxx +++ b/Source/cmInstallGenerator.cxx @@ -41,10 +41,10 @@ void cmInstallGenerator::CheckCMP0082(bool& haveSubdirectoryInstall, void cmInstallGenerator::AddInstallRule( std::ostream& os, std::string const& dest, cmInstallType type, std::vector const& files, bool optional /* = false */, - const char* permissions_file /* = 0 */, - const char* permissions_dir /* = 0 */, const char* rename /* = 0 */, - const char* literal_args /* = 0 */, Indent indent, - const char* files_var /* = 0 */) + const char* permissions_file /* = nullptr */, + const char* permissions_dir /* = nullptr */, + const char* rename /* = nullptr */, const char* literal_args /* = nullptr */, + Indent indent, const char* files_var /* = nullptr */) { // Use the FILE command to install the file. std::string stype; -- cgit v0.12 From 0513a1fe1065f0bfbf30c5c406dd47afd9dfbba4 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Wed, 27 Apr 2022 14:29:52 -0400 Subject: cmInstallGenerator: use CMake-private variables in generated code --- Source/cmInstallGenerator.cxx | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/Source/cmInstallGenerator.cxx b/Source/cmInstallGenerator.cxx index a33ad78..87110a9 100644 --- a/Source/cmInstallGenerator.cxx +++ b/Source/cmInstallGenerator.cxx @@ -91,21 +91,28 @@ void cmInstallGenerator::AddInstallRule( os << "\")\n"; } if (files_var) { - os << indent << "foreach(_f IN LISTS " << files_var << ")\n"; - os << indent.Next() << "get_filename_component(_fn \"${_f}\" NAME)\n"; + os << indent << "foreach(_cmake_abs_file IN LISTS " << files_var + << ")\n"; + os << indent.Next() + << "get_filename_component(_cmake_abs_file_name " + "\"${_cmake_abs_file}\" NAME)\n"; os << indent.Next() << "list(APPEND CMAKE_ABSOLUTE_DESTINATION_FILES \"" - << dest << "/${_fn}\")\n"; + << dest << "/${_cmake_abs_file_name}\")\n"; os << indent << "endforeach()\n"; + os << indent << "unset(_cmake_abs_file_name)\n"; + os << indent << "unset(_cmake_abs_file)\n"; } os << indent << "if(CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION)\n"; - os << indent.Next() << "message(WARNING \"ABSOLUTE path INSTALL " - << "DESTINATION : ${CMAKE_ABSOLUTE_DESTINATION_FILES}\")\n"; + os << indent.Next() + << "message(WARNING \"ABSOLUTE path INSTALL " + "DESTINATION : ${CMAKE_ABSOLUTE_DESTINATION_FILES}\")\n"; os << indent << "endif()\n"; os << indent << "if(CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION)\n"; - os << indent.Next() << "message(FATAL_ERROR \"ABSOLUTE path INSTALL " - << "DESTINATION forbidden (by caller): " - << "${CMAKE_ABSOLUTE_DESTINATION_FILES}\")\n"; + os << indent.Next() + << "message(FATAL_ERROR \"ABSOLUTE path INSTALL " + "DESTINATION forbidden (by caller): " + "${CMAKE_ABSOLUTE_DESTINATION_FILES}\")\n"; os << indent << "endif()\n"; } std::string absDest = ConvertToAbsoluteDestination(dest); -- cgit v0.12 From 499009b79cdb48646b87a661e18ca903a3ae7e0f Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 15 Apr 2022 13:50:41 -0400 Subject: cmTarget: avoid creating export entries if they don't exist --- Source/cmTarget.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 446964c..61b3e4d 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1291,7 +1291,12 @@ void cmTarget::AddInstallIncludeDirectories(cmTargetExport const& te, cmStringRange cmTarget::GetInstallIncludeDirectoriesEntries( cmTargetExport const& te) const { - return cmMakeRange(this->impl->InstallIncludeDirectoriesEntries[&te]); + auto i = this->impl->InstallIncludeDirectoriesEntries.find(&te); + if (i == this->impl->InstallIncludeDirectoriesEntries.end()) { + decltype(i->second) empty; + return cmMakeRange(empty); + } + return cmMakeRange(i->second); } cmBTStringRange cmTarget::GetIncludeDirectoriesEntries() const -- cgit v0.12 From 97a68198c9ef7dff197a61d40f2a4d52f1a793c1 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 19 Apr 2022 11:00:42 -0400 Subject: cmGlobalNinjaGenerator: escape `:` in module names Not all filesystems support `:` in the name, so replace it with `-`. As `-` is not otherwise allowed in module names anyways, there is no risk of conflict. --- Source/cmGlobalNinjaGenerator.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index bbc9c54..03db601 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -2550,7 +2550,9 @@ bool cmGlobalNinjaGenerator::WriteDyndepFile( } } else { // Assume the module file path matches the logical module name. - mod = cmStrCat(module_dir, p.LogicalName); + std::string safe_logical_name = p.LogicalName; + cmSystemTools::ReplaceString(safe_logical_name, ":", "-"); + mod = cmStrCat(module_dir, safe_logical_name); } mod_files[p.LogicalName] = mod; tm[p.LogicalName] = mod; -- cgit v0.12 From cc4e19710d4bc5ad5abe20121ac34e8003fae44e Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 19 Apr 2022 10:59:43 -0400 Subject: cmGlobalNinjaGenerator: use an extention based on the modmapfmt --- Source/cmGlobalNinjaGenerator.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 03db601..3726aa4 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -2534,6 +2534,11 @@ bool cmGlobalNinjaGenerator::WriteDyndepFile( } } + const char* module_ext = ""; + if (arg_modmapfmt == "gcc") { + module_ext = ".gcm"; + } + // Extend the module map with those provided by this target. // We do this after loading the modules provided by linked targets // in case we have one of the same name that must be preferred. @@ -2552,7 +2557,7 @@ bool cmGlobalNinjaGenerator::WriteDyndepFile( // Assume the module file path matches the logical module name. std::string safe_logical_name = p.LogicalName; cmSystemTools::ReplaceString(safe_logical_name, ":", "-"); - mod = cmStrCat(module_dir, safe_logical_name); + mod = cmStrCat(module_dir, safe_logical_name, module_ext); } mod_files[p.LogicalName] = mod; tm[p.LogicalName] = mod; -- cgit v0.12 From aaa18f15cf06ec8fd74e18875172b9215f17a088 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Wed, 27 Apr 2022 15:03:38 -0400 Subject: cmTarget: add support for querying all file set names --- Source/cmTarget.cxx | 11 +++++++++++ Source/cmTarget.h | 1 + 2 files changed, 12 insertions(+) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 61b3e4d..feb2ee3 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -2545,6 +2545,17 @@ std::string cmTarget::GetInterfaceFileSetsPropertyName(const std::string& type) return ""; } +std::vector cmTarget::GetAllFileSetNames() const +{ + std::vector result; + + for (auto const& it : this->impl->FileSets) { + result.push_back(it.first); + } + + return result; +} + std::vector cmTarget::GetAllInterfaceFileSets() const { std::vector result; diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 72497b3..5ed018e 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -292,6 +292,7 @@ public: const std::string& type, cmFileSetVisibility vis); + std::vector GetAllFileSetNames() const; std::vector GetAllInterfaceFileSets() const; static std::string GetFileSetsPropertyName(const std::string& type); -- cgit v0.12 From 64c15ec018b15ac250a151a58e8d6566b071855b Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Wed, 27 Apr 2022 10:34:05 -0400 Subject: cmNinjaTargetGenerator: add flags for scanning based on the fileset type --- Help/dev/experimental.rst | 5 ++++ Source/cmNinjaTargetGenerator.cxx | 52 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) diff --git a/Help/dev/experimental.rst b/Help/dev/experimental.rst index 2380de4..2943c7c 100644 --- a/Help/dev/experimental.rst +++ b/Help/dev/experimental.rst @@ -38,6 +38,11 @@ expected to process the translation unit, write preprocessor dependencies to the file specified by the ```` placeholder, and write module dependencies to the file specified by the ```` placeholder. +For tools which need to know the file set the source belongs to, the +``CMAKE_EXPERIMENTAL_CXX_MODULE_SOURCE_TYPE_FLAG_`` flag may +be provided so that different source types can be distinguished prior to +scanning. + The module dependencies should be written in the format described by the `P1689r4`_ paper. diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index e61b4b6..fa058d2 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -21,6 +21,7 @@ #include "cmComputeLinkInformation.h" #include "cmCustomCommandGenerator.h" +#include "cmFileSet.h" #include "cmGeneratedFileStream.h" #include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" @@ -28,6 +29,7 @@ #include "cmLocalGenerator.h" #include "cmLocalNinjaGenerator.h" #include "cmMakefile.h" +#include "cmMessageType.h" #include "cmNinjaNormalTargetGenerator.h" #include "cmNinjaUtilityTargetGenerator.h" #include "cmOutputConverter.h" @@ -39,6 +41,7 @@ #include "cmStateTypes.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" +#include "cmTarget.h" #include "cmValue.h" #include "cmake.h" @@ -252,6 +255,55 @@ std::string cmNinjaTargetGenerator::ComputeFlagsForObject( flags, genexInterpreter.Evaluate(pchOptions, COMPILE_OPTIONS)); } + if (this->NeedCxxModuleSupport(language, config)) { + auto const& path = source->GetFullPath(); + auto const* tgt = this->GeneratorTarget->Target; + + std::string file_set_type; + + for (auto const& name : tgt->GetAllFileSetNames()) { + auto const* file_set = tgt->GetFileSet(name); + if (!file_set) { + this->GetMakefile()->IssueMessage( + MessageType::INTERNAL_ERROR, + cmStrCat("Target `", tgt->GetName(), + "` is tracked to have file set `", name, + "`, but it was not found.")); + continue; + } + + auto fileEntries = file_set->CompileFileEntries(); + auto directoryEntries = file_set->CompileDirectoryEntries(); + auto directories = file_set->EvaluateDirectoryEntries( + directoryEntries, this->LocalGenerator, config, this->GeneratorTarget); + + std::map> files; + for (auto const& entry : fileEntries) { + file_set->EvaluateFileEntry(directories, files, entry, + this->LocalGenerator, config, + this->GeneratorTarget); + } + + for (auto const& it : files) { + for (auto const& filename : it.second) { + if (filename == path) { + file_set_type = file_set->GetType(); + break; + } + } + } + + if (!file_set_type.empty()) { + std::string source_type_var = cmStrCat( + "CMAKE_EXPERIMENTAL_CXX_MODULE_SOURCE_TYPE_FLAG_", file_set_type); + cmMakefile* mf = this->GetMakefile(); + if (cmValue source_type_flag = mf->GetDefinition(source_type_var)) { + this->LocalGenerator->AppendFlags(flags, *source_type_flag); + } + } + } + } + return flags; } -- cgit v0.12 From c107760417d5941202713fbaaa3e25e62d1dd12e Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Wed, 20 Apr 2022 12:32:16 -0400 Subject: cmNinjaTargetGenerator: support msvc-style deps discovery for scanning --- Help/dev/experimental.rst | 4 +++- Source/cmNinjaTargetGenerator.cxx | 31 +++++++++++++++++++++---------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/Help/dev/experimental.rst b/Help/dev/experimental.rst index 2943c7c..7638d22 100644 --- a/Help/dev/experimental.rst +++ b/Help/dev/experimental.rst @@ -36,7 +36,9 @@ For example, add code like the following to a test project: The tool specified by ``CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE`` is expected to process the translation unit, write preprocessor dependencies to the file specified by the ```` placeholder, and write module -dependencies to the file specified by the ```` placeholder. +dependencies to the file specified by the ```` placeholder. The +``CMAKE_EXPERIMENTAL_CXX_SCANDEP_DEPFILE_FORMAT`` file may be set to ``msvc`` +for scandep rules which use ``msvc``-style dependency reporting. For tools which need to know the file set the source belongs to, the ``CMAKE_EXPERIMENTAL_CXX_MODULE_SOURCE_TYPE_FLAG_`` flag may diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index fa058d2..3fac7f5 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -586,6 +586,7 @@ std::string GetScanCommand(const std::string& cmakeCmd, const std::string& tdi, // not perform explicit preprocessing too. cmNinjaRule GetScanRule( std::string const& ruleName, std::string const& ppFileName, + std::string const& deptype, cmRulePlaceholderExpander::RuleVariables const& vars, const std::string& responseFlag, const std::string& flags, cmRulePlaceholderExpander* const rulePlaceholderExpander, @@ -594,8 +595,13 @@ cmNinjaRule GetScanRule( { cmNinjaRule rule(ruleName); // Scanning always uses a depfile for preprocessor dependencies. - rule.DepType = ""; // no deps= for multiple outputs - rule.DepFile = "$DEP_FILE"; + if (deptype == "msvc"_s) { + rule.DepType = deptype; + rule.DepFile = ""; + } else { + rule.DepType = ""; // no deps= for multiple outputs + rule.DepFile = "$DEP_FILE"; + } cmRulePlaceholderExpander::RuleVariables scanVars; scanVars.CMTargetName = vars.CMTargetName; @@ -699,6 +705,9 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang, cmSystemTools::GetCMakeCommand(), cmLocalGenerator::SHELL); if (needDyndep) { + const auto& scanDepType = this->GetMakefile()->GetSafeDefinition( + cmStrCat("CMAKE_EXPERIMENTAL_", lang, "_SCANDEP_DEPFILE_FORMAT")); + // Rule to scan dependencies of sources that need preprocessing. { std::vector scanCommands; @@ -726,10 +735,10 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang, "$DYNDEP_INTERMEDIATE_FILE")); } - auto scanRule = - GetScanRule(scanRuleName, ppFileName, vars, responseFlag, flags, - rulePlaceholderExpander.get(), this->GetLocalGenerator(), - std::move(scanCommands), config); + auto scanRule = GetScanRule( + scanRuleName, ppFileName, scanDepType, vars, responseFlag, flags, + rulePlaceholderExpander.get(), this->GetLocalGenerator(), + std::move(scanCommands), config); scanRule.Comment = cmStrCat("Rule for generating ", lang, " dependencies."); @@ -757,9 +766,10 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang, scanCommands.emplace_back( GetScanCommand(cmakeCmd, tdi, lang, "$in", "$out")); - auto scanRule = GetScanRule( - scanRuleName, "", vars, "", flags, rulePlaceholderExpander.get(), - this->GetLocalGenerator(), std::move(scanCommands), config); + auto scanRule = + GetScanRule(scanRuleName, "", scanDepType, vars, "", flags, + rulePlaceholderExpander.get(), this->GetLocalGenerator(), + std::move(scanCommands), config); // Write the rule for generating dependencies for the given language. scanRule.Comment = cmStrCat("Rule for generating ", lang, @@ -1249,7 +1259,8 @@ cmNinjaBuild GetScanBuildStatement(const std::string& ruleName, scanBuild.Variables["PREPROCESSED_OUTPUT_FILE"] = ppFileName; } - // Scanning always uses a depfile for preprocessor dependencies. + // Scanning always provides a depfile for preprocessor dependencies. This + // variable is unused in `msvc`-deptype scanners. std::string const& depFileName = cmStrCat(scanBuild.Outputs.front(), ".d"); scanBuild.Variables["DEP_FILE"] = lg->ConvertToOutputFormat(depFileName, cmOutputConverter::SHELL); -- cgit v0.12 From c5b56b35c264664e897a2895e2561a5fb8287703 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 22 Apr 2022 18:13:55 -0400 Subject: cmInstallExportGenerator: expose the temporary directory This needs to be known so that C++ module properties for the install can be staged beside the other files. Always perform the MD5 transformation (in non-bootstrap builds) so that the path can be computed prior to generation (where it used the longest configuration name to detect too-long paths). Update tests to expect the always-present MD5 value. Note that this improves robustness of the test suite as testing in a too-long path may have triggered the MD5 conversion anyways. --- Source/cmInstallExportGenerator.cxx | 76 ++++++---------------- Source/cmInstallExportGenerator.h | 4 +- Tests/RunCMake/AndroidMK/AndroidMK-check.cmake | 2 +- .../FileAPI/codemodel-v2-data/directories/top.json | 2 +- .../install/EXPORT-TargetTwice-check.cmake | 4 +- 5 files changed, 25 insertions(+), 63 deletions(-) diff --git a/Source/cmInstallExportGenerator.cxx b/Source/cmInstallExportGenerator.cxx index eb7537d..f1ac656 100644 --- a/Source/cmInstallExportGenerator.cxx +++ b/Source/cmInstallExportGenerator.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmInstallExportGenerator.h" -#include #include #include #include @@ -54,73 +53,36 @@ bool cmInstallExportGenerator::Compute(cmLocalGenerator* lg) return true; } -void cmInstallExportGenerator::ComputeTempDir() +std::string cmInstallExportGenerator::TempDirCalculate() const { // Choose a temporary directory in which to generate the import // files to be installed. - this->TempDir = cmStrCat(this->LocalGenerator->GetCurrentBinaryDirectory(), - "/CMakeFiles/Export"); + std::string path = cmStrCat( + this->LocalGenerator->GetCurrentBinaryDirectory(), "/CMakeFiles/Export"); if (this->Destination.empty()) { - return; - } - this->TempDir += "/"; - - // Enforce a maximum length. - bool useMD5 = false; -#if defined(_WIN32) || defined(__CYGWIN__) - std::string::size_type const max_total_len = 250; -#else - std::string::size_type const max_total_len = 1000; -#endif - // Will generate files of the form "/-.". - std::string::size_type const len = this->TempDir.size() + 1 + - this->FileName.size() + 1 + this->GetMaxConfigLength(); - if (len < max_total_len) { - // Keep the total path length below the limit. - std::string::size_type const max_len = max_total_len - len; - if (this->Destination.size() > max_len) { - useMD5 = true; - } - } else { - useMD5 = true; + return path; } - if (useMD5) { - // Replace the destination path with a hash to keep it short. + #ifndef CMAKE_BOOTSTRAP - this->TempDir += cmSystemTools::ComputeStringMD5(this->Destination); + path += '/'; + // Replace the destination path with a hash to keep it short. + path += cmSystemTools::ComputeStringMD5(this->Destination); #endif - } else { - std::string dest = this->Destination; - // Avoid unix full paths. - if (dest[0] == '/') { - dest[0] = '_'; - } - // Avoid windows full paths by removing colons. - std::replace(dest.begin(), dest.end(), ':', '_'); - // Avoid relative paths that go up the tree. - cmSystemTools::ReplaceString(dest, "../", "__/"); - // Avoid spaces. - std::replace(dest.begin(), dest.end(), ' ', '_'); - this->TempDir += dest; - } + + return path; } -size_t cmInstallExportGenerator::GetMaxConfigLength() const +void cmInstallExportGenerator::ComputeTempDir() { - // Always use at least 8 for "noconfig". - size_t len = 8; - if (this->ConfigurationTypes->empty()) { - if (this->ConfigurationName.size() > 8) { - len = this->ConfigurationName.size(); - } - } else { - for (std::string const& c : *this->ConfigurationTypes) { - if (c.size() > len) { - len = c.size(); - } - } + this->TempDir = this->TempDirCalculate(); +} + +std::string cmInstallExportGenerator::GetTempDir() const +{ + if (this->TempDir.empty()) { + return this->TempDirCalculate(); } - return len; + return this->TempDir; } void cmInstallExportGenerator::GenerateScript(std::ostream& os) diff --git a/Source/cmInstallExportGenerator.h b/Source/cmInstallExportGenerator.h index 54c59f1..dc07d36 100644 --- a/Source/cmInstallExportGenerator.h +++ b/Source/cmInstallExportGenerator.h @@ -4,7 +4,6 @@ #include "cmConfigure.h" // IWYU pragma: keep -#include #include #include #include @@ -50,6 +49,7 @@ public: std::string const& GetDestination() const { return this->Destination; } std::string GetDestinationFile() const; std::string GetFileName() const { return this->FileName; } + std::string GetTempDir() const; protected: void GenerateScript(std::ostream& os) override; @@ -57,8 +57,8 @@ protected: void GenerateScriptActions(std::ostream& os, Indent indent) override; void GenerateImportFile(cmExportSet const* exportSet); void GenerateImportFile(const char* config, cmExportSet const* exportSet); + std::string TempDirCalculate() const; void ComputeTempDir(); - size_t GetMaxConfigLength() const; cmExportSet* const ExportSet; std::string const FilePermissions; diff --git a/Tests/RunCMake/AndroidMK/AndroidMK-check.cmake b/Tests/RunCMake/AndroidMK/AndroidMK-check.cmake index 691e326..03221c5 100644 --- a/Tests/RunCMake/AndroidMK/AndroidMK-check.cmake +++ b/Tests/RunCMake/AndroidMK/AndroidMK-check.cmake @@ -26,5 +26,5 @@ compare_file_to_expected( "${RunCMake_BINARY_DIR}/AndroidMK-build/Android.mk" "${RunCMake_TEST_SOURCE_DIR}/expectedBuildAndroidMK.txt") compare_file_to_expected( -"${RunCMake_BINARY_DIR}/AndroidMK-build/CMakeFiles/Export/share/ndk-modules/Android.mk" +"${RunCMake_BINARY_DIR}/AndroidMK-build/CMakeFiles/Export/c8a72b7cccded047a31c221a6b84dd48/Android.mk" "${RunCMake_TEST_SOURCE_DIR}/expectedInstallAndroidMK.txt") diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json index 22b4536..e7b146f 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json @@ -496,7 +496,7 @@ "type": "export", "destination": "lib/cmake/foo", "paths": [ - "^CMakeFiles/Export/lib/cmake/foo/FooTargets\\.cmake$" + "^CMakeFiles/Export/22ecfa717ccadd33cf3e4bcbabcbde6b/FooTargets\\.cmake$" ], "isExcludeFromAll": null, "isForAllComponents": null, diff --git a/Tests/RunCMake/install/EXPORT-TargetTwice-check.cmake b/Tests/RunCMake/install/EXPORT-TargetTwice-check.cmake index 97677ca..f1438dd 100644 --- a/Tests/RunCMake/install/EXPORT-TargetTwice-check.cmake +++ b/Tests/RunCMake/install/EXPORT-TargetTwice-check.cmake @@ -1,4 +1,4 @@ -set(pkg1_cmake "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/Export/pkg1/pkg1.cmake") +set(pkg1_cmake "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/Export/59965f5e1aafdb63698f8ae505daf864/pkg1.cmake") file(STRINGS "${pkg1_cmake}" pkg1_includes REGEX INTERFACE_INCLUDE_DIRECTORIES) set(pkg1_expect [[INTERFACE_INCLUDE_DIRECTORIES "\${_IMPORT_PREFIX}/pkg1/inc"]]) if(NOT pkg1_includes MATCHES "${pkg1_expect}") @@ -8,7 +8,7 @@ It does not match: ${pkg1_expect}") endif() -set(pkg2_cmake "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/Export/pkg2/pkg2.cmake") +set(pkg2_cmake "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/Export/72c00a5f9d34b6649110956cfc9f27e6/pkg2.cmake") file(STRINGS "${pkg2_cmake}" pkg2_includes REGEX INTERFACE_INCLUDE_DIRECTORIES) set(pkg2_expect [[INTERFACE_INCLUDE_DIRECTORIES "\${_IMPORT_PREFIX}/pkg2/inc"]]) if(NOT pkg2_includes MATCHES "${pkg2_expect}") -- cgit v0.12