From 24e6ffae3605f54c4ef75a151206fec14ab06ec0 Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Wed, 5 Jul 2006 16:27:44 -0400 Subject: BUG: If the source file specified is not in a source tree, do not use full path to the file --- Source/CMakeLists.txt | 1 + Source/cmLocalUnixMakefileGenerator3.cxx | 5 +++++ Tests/BundleTest/BundleLib.cxx | 4 +++- Tests/BundleTest/CMakeLists.txt | 2 ++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 3f8bb1a..3da7ef5 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -962,6 +962,7 @@ IF(BUILD_TESTING) --build-target install # --build-target package --build-options "-DCMAKE_INSTALL_PREFIX:PATH=${BundleTestInstallDir}" + "-DCMake_SOURCE_DIR:PATH=${CMAKE_SOURCE_DIR}" --test-command ${BundleTestInstallDir}/Application/BundleTestExe.app/Contents/MacOS/BundleTestExe) diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 3f5be33..81a2c62 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1674,6 +1674,11 @@ cmLocalUnixMakefileGenerator3 { 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 diff --git a/Tests/BundleTest/BundleLib.cxx b/Tests/BundleTest/BundleLib.cxx index bc757b1..4f353fb 100644 --- a/Tests/BundleTest/BundleLib.cxx +++ b/Tests/BundleTest/BundleLib.cxx @@ -51,8 +51,10 @@ int foo(char *exec) { int res1 = findBundleFile(exec, "Resources/randomResourceFile.plist"); int res2 = findBundleFile(exec, "MacOS/SomeRandomFile.txt"); + int res3 = findBundleFile(exec, "MacOS/ChangeLog.txt"); if ( !res1 || - !res2 ) + !res2 || + !res3 ) { return 1; } diff --git a/Tests/BundleTest/CMakeLists.txt b/Tests/BundleTest/CMakeLists.txt index 57ebd24..0c742b0 100644 --- a/Tests/BundleTest/CMakeLists.txt +++ b/Tests/BundleTest/CMakeLists.txt @@ -16,6 +16,7 @@ SET_SOURCE_FILES_PROPERTIES( SET_SOURCE_FILES_PROPERTIES( SomeRandomFile.txt + "${CMake_SOURCE_DIR}/ChangeLog.txt" PROPERTIES MACOSX_PACKAGE_LOCATION MacOS ) @@ -28,6 +29,7 @@ ADD_EXECUTABLE(BundleTest MACOSX_BUNDLE BundleTest.cxx SomeRandomFile.txt + "${CMake_SOURCE_DIR}/ChangeLog.txt" "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist" ) -- cgit v0.12