[CMake] Two issues...

Michael Wild themiwi at gmail.com
Wed Apr 14 01:29:19 EDT 2010


On 14. Apr, 2010, at 24:57 , J Decker wrote:
> [...]
> Also, there's no way to just get the list of target outputs that a
> executable or library was linked with?
> 
> TARGET_LINK_LIBRARIES( ${PROJECT_NAME} libxyz )
> 
> I tried to use
> 
> 
>  GET_TARGET_PROPERTY(LIBS2 ${proj} IMPORTED_LINK_INTERFACE_LIBRARIES )
>  message( "libs: ${LIBS2}" )
>  GET_TARGET_PROPERTY(LIBS ${proj} IMPORTED_LINK_DEPENDENT_LIBRARIES )
>  message( "libs: ${LIBS}" )
> 
> but the results are LIBS-NOTFOUND and LIBS2-NOTFOUND ....
> 
> This CMAKE installation steps seem to be unix-centric, in expecting to
> target a consistant /usr/local/bin or /usr/bin etc for installation
> targets.   This particular tree that I'm slowly migrating actually has
> about a dozen individual targets, and each final installation needs to
> include the program itslef, maybe some data associated with it and all
> of the libraries it requires to link.  Each product needs to be self
> contained, and I would think that cmake would have the target names of
> all products built available that I could just get that list to copy
> all of those into a final installation directory?


Have a look at the GetPrerequisites module. It does exactly what you need.


Michael


More information about the CMake mailing list