diff options
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 12 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 4 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0026/RunCMakeTest.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0026/clear-cached-information-dir/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0026/clear-cached-information.cmake | 14 |
5 files changed, 25 insertions, 8 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index fb5805b..555c437 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -2218,7 +2218,7 @@ cmGeneratorTarget::GetIncludeDirectories(const std::string& config, "INCLUDE_DIRECTORIES") != debugProperties.end(); - if (this->Makefile->IsConfigured()) + if (this->GlobalGenerator->GetConfigureDoneCMP0026()) { this->DebugIncludesDone = true; } @@ -2365,7 +2365,7 @@ void cmGeneratorTarget::GetCompileOptions(std::vector<std::string> &result, "COMPILE_OPTIONS") != debugProperties.end(); - if (this->Makefile->IsConfigured()) + if (this->GlobalGenerator->GetConfigureDoneCMP0026()) { this->DebugCompileOptionsDone = true; } @@ -2435,7 +2435,7 @@ void cmGeneratorTarget::GetCompileFeatures(std::vector<std::string> &result, "COMPILE_FEATURES") != debugProperties.end(); - if (this->Makefile->IsConfigured()) + if (this->GlobalGenerator->GetConfigureDoneCMP0026()) { this->DebugCompileFeaturesDone = true; } @@ -2503,7 +2503,7 @@ void cmGeneratorTarget::GetCompileDefinitions(std::vector<std::string> &list, "COMPILE_DEFINITIONS") != debugProperties.end(); - if (this->Makefile->IsConfigured()) + if (this->GlobalGenerator->GetConfigureDoneCMP0026()) { this->DebugCompileDefinitionsDone = true; } @@ -3937,7 +3937,7 @@ cmGeneratorTarget::ReportPropertyOrigin(const std::string &p, p) != debugProperties.end(); - if (this->Target->GetMakefile()->IsConfigured()) + if (this->GlobalGenerator->GetConfigureDoneCMP0026()) { this->DebugCompatiblePropertiesDone[p] = true; } @@ -4504,7 +4504,7 @@ void cmGeneratorTarget::GetLanguages(std::set<std::string>& languages, std::vector<cmGeneratorTarget*> objectLibraries; std::vector<cmSourceFile const*> externalObjects; - if (!this->Makefile->IsConfigured()) + if (!this->GlobalGenerator->GetConfigureDoneCMP0026()) { std::vector<cmTarget*> objectTargets; this->Target->GetObjectLibrariesCMP0026(objectTargets); diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 2dfa19c..13e0d7e 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -636,7 +636,7 @@ void cmTarget::GetSourceFiles(std::vector<std::string> &files, { assert(this->GetType() != INTERFACE_LIBRARY); - if (!this->Makefile->IsConfigured()) + if (!this->GetMakefile()->GetGlobalGenerator()->GetConfigureDoneCMP0026()) { // At configure-time, this method can be called as part of getting the // LOCATION property or to export() a file to be include()d. However @@ -682,7 +682,7 @@ void cmTarget::GetSourceFiles(std::vector<std::string> &files, "SOURCES") != debugProperties.end(); - if (this->Makefile->IsConfigured()) + if (this->GetMakefile()->GetGlobalGenerator()->GetConfigureDoneCMP0026()) { this->DebugSourcesDone = true; } diff --git a/Tests/RunCMake/CMP0026/RunCMakeTest.cmake b/Tests/RunCMake/CMP0026/RunCMakeTest.cmake index fc58ea5..6331717 100644 --- a/Tests/RunCMake/CMP0026/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMP0026/RunCMakeTest.cmake @@ -11,3 +11,4 @@ run_cmake(CMP0026-LOCATION-CONFIG-OLD) run_cmake(CMP0026-LOCATION-CONFIG-WARN) run_cmake(ObjlibNotDefined) run_cmake(LOCATION-and-TARGET_OBJECTS) +run_cmake(clear-cached-information) diff --git a/Tests/RunCMake/CMP0026/clear-cached-information-dir/CMakeLists.txt b/Tests/RunCMake/CMP0026/clear-cached-information-dir/CMakeLists.txt new file mode 100644 index 0000000..c51e883 --- /dev/null +++ b/Tests/RunCMake/CMP0026/clear-cached-information-dir/CMakeLists.txt @@ -0,0 +1,2 @@ + +add_executable(Hello ${CMAKE_CURRENT_BINARY_DIR}/main.c) diff --git a/Tests/RunCMake/CMP0026/clear-cached-information.cmake b/Tests/RunCMake/CMP0026/clear-cached-information.cmake new file mode 100644 index 0000000..dd2dd72 --- /dev/null +++ b/Tests/RunCMake/CMP0026/clear-cached-information.cmake @@ -0,0 +1,14 @@ + +enable_language(C) + +cmake_policy(SET CMP0026 OLD) + +add_subdirectory(clear-cached-information-dir) + +# Critical: this needs to happen in root CMakeLists.txt and not inside +# the subdir. +get_target_property(mypath Hello LOCATION) +# Now we create the file later, so you can see, ultimately no error should +# happen e.g. during generate phase: +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/clear-cached-information-dir/main.c) +set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/clear-cached-information-dir/main.c PROPERTIES GENERATED TRUE) |