[CMake] Howto use targets from several directories in the install clause?

Dmytro Ovdiienko dmitriy.ovdienko at gmail.com
Tue May 19 08:21:35 EDT 2009


Hi all,

I'm trying to write install instruction for my main project (DLL) that
consists from several projects (LIBs). This instruction should copy all
public headers from all dependent targets to the destination directory.

I expected to use following sample but it is erroneous:

install (
    TARGETS
        utils
        system
        types
    PUBLIC_HEADER DESTINATION ${${PROJECT_NAME}_BINARY_DIR}/install/headers
    )


So, I've written code like following. It works but it is little ugly.

get_target_property( public_headers utils PUBLIC_HEADER )
install( FILES ${public_headers} DESTINATION
${${PROJECT_NAME}_BINARY_DIR}/install/headers )

get_target_property( public_headers system PUBLIC_HEADER )
install( FILES ${public_headers} DESTINATION
${${PROJECT_NAME}_BINARY_DIR}/install/headers )

get_target_property( public_headers types PUBLIC_HEADER )
install( FILES ${public_headers} DESTINATION
${${PROJECT_NAME}_BINARY_DIR}/install/headers )



The question is how to make first snippet worked?


Thanks.

Dima
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090519/7cb0f1ad/attachment.htm>


More information about the CMake mailing list