[CMake] Multiple install section from the same base folder

Laszlo Papp lpapp at kde.org
Mon Jul 11 23:04:45 EDT 2011


Hi,

I have just realized this snippet in my CMakeLists.txt file:

install(FILES
    atticamanager.h
    authentication.h

    DESTINATION ${INCLUDE_INSTALL_DIR}/gluon/player/lib
    COMPONENT Devel
)

install(FILES
    archive/archive.h

    DESTINATION ${INCLUDE_INSTALL_DIR}/gluon/player/lib/archive
    COMPONENT Devel
)

install(FILES
    models/commentitemsmodel.h
    models/gameitemsmodel.h
    models/highscoresmodel.h
    DESTINATION ${INCLUDE_INSTALL_DIR}/gluon/player/lib/models
    COMPONENT Devel
)

I wonder whether it could be done smarter. In the example above, there
are subfolders like archive, models. It could also contain 5-10
subfolders (even more) and we install the headers this way: one
separate install section for each subfolder even if we explicitely
write the subfolders all the time, like "archive/archive.h",
"models/commentitemsmodel.h", et cetera.

Are we doing it wrong and there is already a smarter cmake option for
this ? I find it useful if there is just one section for those things,
but if it is technically not possible or against the design, please
let me know.

Best Regards,
Laszlo Papp


More information about the CMake mailing list