[CMake] Install same files to multiple destination

Jérôme Reybert jreybert at gmail.com
Wed Jul 4 03:41:11 EDT 2012


Hi,

I need to install the same files (actually a directory, it doesn't change
anything) to several destination. Typically, I need to install the same
header files to "include" and "sys-include" (no question about that, this
is mandatory).

I thought I could specify multiple DESTINATION flags in intall command, like

install (DIRECTORY ${PROJECT_SOURCE_DIR}/include/sys/${SYSTEM}/
    DESTINATION ${INCLUDE_DEST1} DESTINATION ${INCLUDE_DEST2}
    PATTERN "private" EXCLUDE)

but CMake doesn't like that.

Easy solution would be to make two install commands, or include this
command in a macro to avoid code copy. Do you see a better way?

BTW, I am using cmake 2.6

Thanks,

-- 
Jérôme
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120704/586eae31/attachment.htm>


More information about the CMake mailing list