View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013603CMakeCMakepublic2012-10-24 07:122013-03-04 08:38
ReporterDavid Weese 
Assigned ToBrad King 
PriorityhighSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformAppleOSMac OS XOS Version10.8
Product VersionCMake 2.8.9 
Target VersionCMake 2.8.11Fixed in VersionCMake 2.8.11 
Summary0013603: Absolute path missing in ReRunCMake.make created by the Xcode generator
DescriptionHi all,

we observed a bug in the CMakeScripts created by the Xcode generator. It is related to subprojects that depend on another. The problem is a missing absolute path to CMakeFiles/cmake.check_cache in a makefile. As a result it is not possible to build a target from a subproject as the ZERO_CHECK target cannot find cmake.check_cache and always assumes that it needs to rerun cmake.

This bug only occurs in the makefiles created by the Xcode generator. The Unix Makefiles generator works fine.

I fixed the bug in the sources of cmake where the wrong Makefile is created and recompiled a binary which works for us. See the diff in the Additional Information below.

Cheers,
David


Bug details:

When cmake is called to create an Xcode project, it will create a CMakeFiles/cmake.check_cache in the root build-folder. It also creates for each subproject a CMakeScripts/ReRunCMake.make Makefile, e.g. core/CMakeScripts/ReRunCMake.make, which looks like:

# Generated by CMake, DO NOT EDIT
CMakeFiles/cmake.check_cache: \
/Users/weese/seqan2/core/demos/CMakeLists.txt\
/Users/weese/seqan2/core/demos/howto/CMakeLists.txt\
/Users/weese/seqan2/core/demos/howto/scores/CMakeLists.txt\
/Users/weese/seqan2/core/demos/tutorial/CMakeLists.txt\
...

The problem is that this makfile is not executed in the root build-folder, but in the subproject folder where there is no CMakeFiles/cmake.check_cache file. Appending an absolute path in front of "CMakeFiles/cmake.check_cache" fixes the problem, this is also done by the Unix Makefile generator.
Steps To ReproduceJust execute the following lines to check out SeqAn, generate an Xcode project, open the core/demos subproject:

svn co http://svn.seqan.de/seqan/trunk [^] seqan-trunk
mkdir seqan-trunk/xcode
cd seqan-trunk/xcode
cmake .. -G Xcode
open core/demos/seqan_core_demos.xcodeproj

Now select the "alignment" target and try to build. It will always rerun cmake and then interrupt. When opening the main project seqan.xcodeproj everything works fine.
Additional InformationI could fix the problem by adding the following line into Source/cmGlobalXCodeGenerator.cxx which prepends an absolute path to the root folder containing the CMakeFiles/cmake.check_cache target.

diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index e8ab38f..960eb2c 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -495,6 +495,7 @@ void cmGlobalXCodeGenerator::CreateReRunCMakeFile(
     (this->CurrentReRunCMakeMakefile.c_str());
   makefileStream.SetCopyIfDifferent(true);
   makefileStream << "# Generated by CMake, DO NOT EDIT\n";
+ makefileStream << mf->GetHomeOutputDirectory() << '/';
   makefileStream << cmake::GetCMakeFilesDirectoryPostSlash();
   makefileStream << "cmake.check_cache: ";
   for(std::vector<std::string>::const_iterator i = lfiles.begin();
TagsNo tags attached.
Attached Filespatch file icon 0001-Xcode-Fix-ReRunCMake.make-path-to-cmake.check_cache-.patch [^] (1,564 bytes) 2012-10-24 14:14 [Show Content]

 Relationships

  Notes
(0031306)
Brad King (manager)
2012-10-24 14:15

Please try "0001-Xcode-Fix-ReRunCMake.make-path-to-cmake.check_cache-.patch".
(0031330)
David Weese (reporter)
2012-10-25 14:39

Yes, your patch works as well.
(0031331)
Brad King (manager)
2012-10-25 15:17

Thanks for testing. Applied:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=388a3216 [^]
(0032491)
Robert Maynard (manager)
2013-03-04 08:38

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2012-10-24 07:12 David Weese New Issue
2012-10-24 13:35 Brad King Assigned To => Brad King
2012-10-24 13:35 Brad King Status new => assigned
2012-10-24 13:35 Brad King Target Version => CMake 2.8.11
2012-10-24 14:14 Brad King File Added: 0001-Xcode-Fix-ReRunCMake.make-path-to-cmake.check_cache-.patch
2012-10-24 14:15 Brad King Note Added: 0031306
2012-10-25 14:39 David Weese Note Added: 0031330
2012-10-25 15:17 Brad King Note Added: 0031331
2012-10-25 15:17 Brad King Status assigned => resolved
2012-10-25 15:17 Brad King Resolution open => fixed
2012-10-25 15:17 Brad King Fixed in Version => CMake 2.8.11
2013-03-04 08:38 Robert Maynard Note Added: 0032491
2013-03-04 08:38 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team