[CMake] Rebuild target when external library changes?

Per Rosengren perrose at kth.se
Wed Dec 3 08:03:19 EST 2008


Lezz Giles wrote:
>  
> 
> I have a project set up that imports libraries, and I want to relink if
> those imported libraries change;
> 
>  
> 
> For example, in a directory I have
> 
> hellow.c
> 
> libfred.a
> 
> CMakeLists.txt
> 
>  
> 
> where CMakeLists.txt contains:
> 
> -----------------------------------------
> 
> LINK_DIRECTORIES(.)
> 
> ADD_EXECUTABLE(hellow hellow.c)
> 
> TARGET_LINK_LIBRARIES(hellow fred)
> 
> -----------------------------------------
> 
> I run 'cmake .'
> 
>  
> 
> Now if I touch hellow.c, hellow rebuilds, but if I touch libfred.a then
> hellow doesn't rebuild.
> 

This is related to my question and partial solution in the thread
[CMake] To specify dependency to other library
started 29/11 2008
http://www.cmake.org/pipermail/cmake/2008-November/025661.html
http://www.cmake.org/pipermail/cmake/2008-December/025716.html

-------------- next part --------------
A non-text attachment was scrubbed...
Name: perrose.vcf
Type: text/x-vcard
Size: 375 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20081203/7433902c/attachment.vcf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
URL: <http://www.cmake.org/pipermail/cmake/attachments/20081203/7433902c/attachment.pgp>


More information about the CMake mailing list