[CMake] XCODE_DEPEND_HELPER dependency issues

David Cole david.cole at kitware.com
Fri Dec 21 09:09:36 EST 2007


What do you mean when you say LIB2 depends on EXE1...?

Does EXE1 generate some code that is built into LIB2 or is it something
else? Normally libs don't depend on exes in the CMake TARGET sense...


On 12/21/07, Nicolas Tisserand <nicolas.tisserand at gmail.com> wrote:
>
> Hi,
>
> 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.
>
>
> Finally, here are my questions:
>
> Is there a nicer solution to my problem?
> Is this a known bug?
> Are there any plans for fixing it?
> Would 2.4.7 solve my problems? (I checked the ChangeLogs but did not
> see any mention of it)
>
> Sorry for the bad ascii-art :-)
> --
> Nicolas
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20071221/f549b223/attachment.htm


More information about the CMake mailing list