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

This commit is contained in:
Andy Cedilnik 2006-07-05 16:27:44 -04:00
parent cf80510ac5
commit 24e6ffae36
4 changed files with 11 additions and 1 deletions

View File

@ -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)

View File

@ -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

View File

@ -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;
}

View File

@ -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"
)