[CMake] Install COMPONENT bug?

Bill Lorensen bill.lorensen at gmail.com
Wed Jun 20 23:17:41 EDT 2012


According to the documentation, an install command like this:
INSTALL (
    TARGETS myTarget
    EXPORT myExportedTargets
    RUNTIME DESTINATION bin COMPONENT component1
    LIBRARY DESTINATION lib COMPONENT component2
    ARCHIVE DESTINATION bin COMPONENT component3
  )

should produce 3 components. And I've seen this pattern in a number of
cmake files. Yet, it only produces one (the first) component.

This cmake file illustrates the problem:


cmake_minimum_required(VERSION 2.8)
project(bug)

add_executable(myTarget a.cxx)
target_link_libraries(myTarget -lm)
INSTALL (
    TARGETS myTarget
    EXPORT myExportedTargets
    RUNTIME DESTINATION bin COMPONENT component1
    LIBRARY DESTINATION lib COMPONENT component2
    ARCHIVE DESTINATION bin COMPONENT component3
  )

get_cmake_property(PROPS COMPONENTS)
message(STATUS "COMPONENTS: ${PROPS}")

-------------------------
the message produces:
-- COMPONENTS: component1


More information about the CMake mailing list