Просмотр исходного кода

BUG: Need to collapse path argument to get_directory_property. This addresses bug#3847.

Brad King 19 лет назад
Родитель
Сommit
30235517f8
2 измененных файлов с 8 добавлено и 0 удалено
  1. 4 0
      Source/cmGetDirectoryPropertyCommand.cxx
  2. 4 0
      Tests/OutOfSource/CMakeLists.txt

+ 4 - 0
Source/cmGetDirectoryPropertyCommand.cxx

@@ -53,6 +53,10 @@ bool cmGetDirectoryPropertyCommand::InitialPass(
       sd += "/";
       sd += *i;
       }
+
+    // The local generators are associated with collapsed paths.
+    sd = cmSystemTools::CollapseFullPath(sd.c_str());
+
     // lookup the makefile from the directory name
     cmLocalGenerator *lg = 
       this->Makefile->GetLocalGenerator()->GetGlobalGenerator()->

+ 4 - 0
Tests/OutOfSource/CMakeLists.txt

@@ -4,6 +4,10 @@ project (OutOfSource)
 add_subdirectory(SubDir)
 
 get_directory_property(ANIMAL DIRECTORY OutOfSourceSubdir DEFINITION WEASELS)
+get_directory_property(ANIMALREL DIRECTORY SubDir/../OutOfSourceSubdir DEFINITION WEASELS)
+IF(NOT "${ANIMAL}" STREQUAL "${ANIMALREL}")
+  MESSAGE(FATAL_ERROR "GET_DIRECTORY_PROPERTY does not seem to collapse paths.")
+ENDIF(NOT "${ANIMAL}" STREQUAL "${ANIMALREL}")
 
 configure_file(
   ${OutOfSource_SOURCE_DIR}/testdp.h.in