[cmake-developers] [CMake 0013603]: Absolute path missing in ReRunCMake.make created by the Xcode generator

Mantis Bug Tracker mantis at public.kitware.com
Wed Oct 24 07:12:24 EDT 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=13603 
====================================================================== 
Reported By:                David Weese
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   13603
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   high
Status:                     new
====================================================================== 
Date Submitted:             2012-10-24 07:12 EDT
Last Modified:              2012-10-24 07:12 EDT
====================================================================== 
Summary:                    Absolute path missing in ReRunCMake.make created by
the Xcode generator
Description: 
Hi 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 Reproduce: 
Just 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 Information: 
I 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();

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-10-24 07:12 David Weese    New Issue                                    
======================================================================




More information about the cmake-developers mailing list