Преглед на файлове

BUG: If the source file specified is not in a source tree, do not use full path to the file

Andy Cedilnik преди 19 години
родител
ревизия
24e6ffae36
променени са 4 файла, в които са добавени 11 реда и са изтрити 1 реда
  1. 1 0
      Source/CMakeLists.txt
  2. 5 0
      Source/cmLocalUnixMakefileGenerator3.cxx
  3. 3 1
      Tests/BundleTest/BundleLib.cxx
  4. 2 0
      Tests/BundleTest/CMakeLists.txt

+ 1 - 0
Source/CMakeLists.txt

@@ -962,6 +962,7 @@ IF(BUILD_TESTING)
       --build-target install
       --build-target install
 #     --build-target package
 #     --build-target package
       --build-options "-DCMAKE_INSTALL_PREFIX:PATH=${BundleTestInstallDir}"
       --build-options "-DCMAKE_INSTALL_PREFIX:PATH=${BundleTestInstallDir}"
+       "-DCMake_SOURCE_DIR:PATH=${CMAKE_SOURCE_DIR}"
       --test-command
       --test-command
       ${BundleTestInstallDir}/Application/BundleTestExe.app/Contents/MacOS/BundleTestExe)
       ${BundleTestInstallDir}/Application/BundleTestExe.app/Contents/MacOS/BundleTestExe)
 
 

+ 5 - 0
Source/cmLocalUnixMakefileGenerator3.cxx

@@ -1674,6 +1674,11 @@ cmLocalUnixMakefileGenerator3
       {
       {
       objectName = relFromSource;
       objectName = relFromSource;
       }
       }
+    else
+      {
+      // This is not relative to source or binary, so make it no path at all
+      objectName = cmSystemTools::GetFilenameName(objectName.c_str());
+      }
     }
     }
 
 
   // Replace the original source file extension with the object file
   // Replace the original source file extension with the object file

+ 3 - 1
Tests/BundleTest/BundleLib.cxx

@@ -51,8 +51,10 @@ int foo(char *exec)
 {
 {
   int res1 = findBundleFile(exec, "Resources/randomResourceFile.plist");
   int res1 = findBundleFile(exec, "Resources/randomResourceFile.plist");
   int res2 = findBundleFile(exec, "MacOS/SomeRandomFile.txt");
   int res2 = findBundleFile(exec, "MacOS/SomeRandomFile.txt");
+  int res3 = findBundleFile(exec, "MacOS/ChangeLog.txt");
   if ( !res1 ||
   if ( !res1 ||
-    !res2 )
+    !res2 ||
+    !res3 )
     {
     {
     return 1;
     return 1;
     }
     }

+ 2 - 0
Tests/BundleTest/CMakeLists.txt

@@ -16,6 +16,7 @@ SET_SOURCE_FILES_PROPERTIES(
 
 
 SET_SOURCE_FILES_PROPERTIES(
 SET_SOURCE_FILES_PROPERTIES(
   SomeRandomFile.txt
   SomeRandomFile.txt
+  "${CMake_SOURCE_DIR}/ChangeLog.txt"
   PROPERTIES
   PROPERTIES
   MACOSX_PACKAGE_LOCATION MacOS
   MACOSX_PACKAGE_LOCATION MacOS
   )
   )
@@ -28,6 +29,7 @@ ADD_EXECUTABLE(BundleTest
   MACOSX_BUNDLE
   MACOSX_BUNDLE
   BundleTest.cxx
   BundleTest.cxx
   SomeRandomFile.txt
   SomeRandomFile.txt
+  "${CMake_SOURCE_DIR}/ChangeLog.txt"
   "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist"
   "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist"
   )
   )