Browse Source

Fix clearing of the INCLUDE_DIRECTORIES DIRECTORY property.

This was broken by commit 18a3195a (Keep track of INCLUDE_DIRECTORIES
as a vector of structs., 2012-11-19).
Stephen Kelly 12 years ago
parent
commit
5a5e0fa9d3
2 changed files with 15 additions and 0 deletions
  1. 4 0
      Source/cmMakefile.cxx
  2. 11 0
      Tests/IncludeDirectories/CMakeLists.txt

+ 4 - 0
Source/cmMakefile.cxx

@@ -3458,6 +3458,10 @@ void cmMakefile::SetProperty(const char* prop, const char* value)
   if (propname == "INCLUDE_DIRECTORIES")
     {
     this->IncludeDirectoriesEntries.clear();
+      if (!value)
+        {
+        return;
+        }
     cmListFileBacktrace lfbt;
     this->GetBacktrace(lfbt);
     this->IncludeDirectoriesEntries.push_back(

+ 11 - 0
Tests/IncludeDirectories/CMakeLists.txt

@@ -47,3 +47,14 @@ else()
 endif()
 
 add_subdirectory(TargetIncludeDirectories)
+
+set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES "${CMAKE_BINARY_DIR}")
+get_property(propContent DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
+if (NOT propContent STREQUAL "${CMAKE_BINARY_DIR}")
+  message(SEND_ERROR "Setting DIRECTORY property failed.")
+endif()
+set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
+get_property(propContentAfter DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
+if (NOT propContentAfter STREQUAL "")
+  message(SEND_ERROR "Clearing DIRECTORY property failed.")
+endif()