View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006193CMakeCMakepublic2007-12-21 09:212008-01-10 15:18
ReporterNicolas Tisserand 
Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0006193: XCode generator produces projects that do not handle correctly handle certain dependency patterns
DescriptionHi,

I'm working on a C++ project that's been happily using CMake as a
cross-platform (mac/pc/linux) build tool for a year now.

We're using CMake 2.4.6 on all platforms.

Recently, some changes in our build system lead to the following
dependency graph:

LIB1 <- EXE1 <- LIB2 <- EXE2
  ^ |
   `---------------------'

(LIB* are static libraries, and EXE* executables)

EXE1 is a tool that generates input source files for LIB2, hence the
extra-dependency.

Everything works nice and smooth with the Linux / Make, MacOS X / Make
and WIN32 / VC80 generators.

Trouble is, on the mac, the XCODE_DEPEND_HELPER (XDH) is added to all
final (executable, dynamic libraries and modules) targets by the XCode
generator:

  .-----------------------------
  v \
LIB1 <-------. |
              EXE1 <- LIB2 <- EXE2
XDH <-------' |
  ^------------------------------'

When EXE2 (or ALL_BUILD) is the active target and LIB2 needs a
rebuild, the following happens:

* The XCODE_DEPEND_HELPER make command is run, doing nothing.
* EXE1 is left alone
* LIB2 gets correctly rebuilt
* EXE2 does not get relinked because when XCODE_DEPEND_HELPER was run,
EXE2 was still up-to-date with LIB2 :-(

This is very annoying.

Here's the only sort-of workaround I could come up with:

* remove the EXE1 <- LIB2 dependency, so that EXE2 gets correctly
relinked when the active target is EXE2
* exclude EXE1 from the build (using EXCLUDE_FROM_ALL), so that EXE2
gets correctly relinked when the active target is ALL_BUILD

But this forces XCode users to rebuild EXE1 manually.
Additional InformationPlease find attached a minimal example project that you can use to reproduce the behavior. There is a README.txt inside the archive, with detailed instructions.
TagsNo tags attached.
Attached Filesgz file icon CMakeBug.tar.gz [^] (1,155 bytes) 2007-12-21 09:21

 Relationships

  Notes
(0010052)
Bill Hoffman (manager)
2008-01-02 18:03

I think the trick maybe to remove the XCODE_DEPEND_HELPER target, and make a Run script that runs after each target is built that runs the make command to check the depends. I did this by hand and it seemed to work. I will try and implement it soon in CMake.
(0010106)
Bill Hoffman (manager)
2008-01-10 15:18

OK, I fixed this in CVS CMake. It won't make it into 2.4.8, but will be in 2.6. Thanks for the complete bug report. If you use CVS CMake, your test should work now.

 Issue History
Date Modified Username Field Change
2007-12-21 09:21 Nicolas Tisserand New Issue
2007-12-21 09:21 Nicolas Tisserand File Added: CMakeBug.tar.gz
2008-01-02 18:03 Bill Hoffman Note Added: 0010052
2008-01-10 15:18 Bill Hoffman Note Added: 0010106
2008-01-10 15:18 Bill Hoffman Status new => closed
2008-01-10 15:18 Bill Hoffman Resolution open => fixed


Copyright © 2000 - 2018 MantisBT Team