[CMake] Inter-project dependencies

Brad King brad.king at kitware.com
Wed May 21 20:04:08 EDT 2008


Emmanuel Blot wrote:
> I tried the importing target feature, but unfortunately, it does not 
> seem to work as (I ?) expected.
[snip]
> "touching" the libfoo.a never leads to relink the executable file.

You've got everything setup right AFAICS.  Rebuilding should work correctly, 
but it looks like the dependencies implementation was not quite finished for 
the Makefiles generator (Xcode and VS work).  I've committed a fix to CMake 
HEAD in CVS:

http://www.cmake.org/cgi-bin/viewcvs.cgi/Source/cmMakefileTargetGenerator.cxx?root=CMake&r1=1.100&r2=1.101

I like when fixes are a net -31 lines long :)

We'll include the fix in 2.6.1, but if you can please try HEAD to make sure 
it works for you.

> As a side note,
>> http://www.cmake.org/Wiki/CMake_2.6_Notes#Exporting_and_Importing_Targets
> uses the following example:
> add_library(foo IMPORTED)
> but it seems that this statement is not valid: the type of the library 
> is required (STATIC, SHARED, etc) such as in
> add_library(foo STATIC IMPORTED)

Fixed.

Thanks,
-Brad


More information about the CMake mailing list