summaryrefslogtreecommitdiffstats
path: root/Tests/ObjectLibrary
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2012-08-03 12:58:48 (GMT)
committerBrad King <brad.king@kitware.com>2012-08-03 14:17:49 (GMT)
commitb237dbd8c35c2ec7b43161612fd03e89d85756e6 (patch)
tree905b00efcc80c1e24576ae6c02bd7e8cdd6d4684 /Tests/ObjectLibrary
parent896524e13f4989e85398e28850221f2fa93293f5 (diff)
downloadCMake-b237dbd8c35c2ec7b43161612fd03e89d85756e6.zip
CMake-b237dbd8c35c2ec7b43161612fd03e89d85756e6.tar.gz
CMake-b237dbd8c35c2ec7b43161612fd03e89d85756e6.tar.bz2
Xcode: Fix object library references in multi-project trees (#13452)
In cmGlobalXCodeGenerator::Generate we generate a .xcodeproj for each directory in the tree containing a project() command. First we iteratively use SetGenerationRoot to add "ALL_BUILD" and other targets to each project. This leaves "CurrentProject" set to the last project when we invoke cmGlobalGenerator::Generate, which is not the same as the top-level project if any subdirectories invoke the project() command. When cmGlobalGenerator::Generate reaches CreateGeneratorTargets it constructs cmGeneratorTarget and calls ComputeTargetObjects exactly once per target. In this context the value of CurrentProject is undefined so we cannot pass it to GetObjectsNormalDirectory. Use "$(PROJECT_NAME)" instead so it will adapt automatically to each project. Also teach Tests/ObjectLibrary to cover this case.
Diffstat (limited to 'Tests/ObjectLibrary')
-rw-r--r--Tests/ObjectLibrary/A/CMakeLists.txt1
-rw-r--r--Tests/ObjectLibrary/B/CMakeLists.txt1
2 files changed, 2 insertions, 0 deletions
diff --git a/Tests/ObjectLibrary/A/CMakeLists.txt b/Tests/ObjectLibrary/A/CMakeLists.txt
index 121a8ac..04ab02f 100644
--- a/Tests/ObjectLibrary/A/CMakeLists.txt
+++ b/Tests/ObjectLibrary/A/CMakeLists.txt
@@ -1,3 +1,4 @@
+project(ObjectLibraryA)
# Add -fPIC so objects can be used in shared libraries.
# TODO: Need property for this.
if(CMAKE_SHARED_LIBRARY_C_FLAGS AND NOT WATCOM)
diff --git a/Tests/ObjectLibrary/B/CMakeLists.txt b/Tests/ObjectLibrary/B/CMakeLists.txt
index 67172d1..4b0b07d 100644
--- a/Tests/ObjectLibrary/B/CMakeLists.txt
+++ b/Tests/ObjectLibrary/B/CMakeLists.txt
@@ -1,3 +1,4 @@
+project(ObjectLibraryB)
if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6")
# VS 6 generator does not use per-target object locations.
set(vs6 _vs6)