[CMake] Debug problem with component install

Andreas Pakulat apaku at gmx.de
Fri Jul 26 18:39:27 EDT 2013


Hi,

I'm having a project here where cmake refuses to recognize the "COMPONENT"
option for the install() command for certain targets.

Within the project there are several subdirs, the top-level CMakeLists.txt
has a component-install rule like this:

INSTALL(DIRECTORY ${PROJECT_BINARY_DIR}/doc/html DESTINATION
share/doc/myapp COMPONENT documentation)

which generates the expected output in the cmake_install.cmake file.
However several subdirectories contain executable targets for which the
cmake_install.cmake file uses the "Unspecified" component. The executable
target files look like this:

SET(SOURCES
        main.cpp object.cpp)

SET(MOCABLES
        object.h)

QT4_WRAP_CPP(MOC_SOURCES ${MOCABLES})

ADD_EXECUTABLE(myapp ${SOURCES} ${MOC_SOURCES})
TARGET_LINK_LIBRARIES(myapp ${QT_LIBRARIES})

# Installation
INSTALL(TARGETS myapp RUNTIME DESTINATION bin
                       ARCHIVE DESTINATION lib
                       LIBRARY DESTINATION lib
                       COMPONENT applications)

I can't seem to find a reason for this misbehaviour using cmake --trace or
cmake --debug-output. Are there any other ways (short of patching +
compiling cmake) to find out what goes wrong here? And if not, can someone
give me a hint where to start patching?

I'm using cmake 2.8.11.2 on Debian/GNU Linux.

In a very small example with just an executable target in a single cmake
file everything works fine, but minimizing the real codebase is quite a bit
harder than I thought.

Andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130727/f934aef3/attachment.htm>


More information about the CMake mailing list