<div dir="ltr">I forgot to mention that, by contrast, elsewhere I have the following working code. So install(FILES) seems to work fine with multiple calls for different configurations.<div><br></div><div><div>install(</div><div>    FILES "$<TARGET_FILE_DIR:corelib>/some_file.txt"</div><div>    COMPONENT platform</div><div>    DESTINATION "${${PROJECT_NAME}_INSTALL_RUNTIME_RELEASE}"</div><div>    CONFIGURATIONS Release RelWithDebInfo MinSizeRel)</div><div>install(</div><div>    FILES "$<TARGET_FILE_DIR:corelib>/some_file.txt"</div><div>    COMPONENT platform</div><div>    DESTINATION "${${PROJECT_NAME}_INSTALL_RUNTIME_DEBUG}"</div><div>    CONFIGURATIONS Debug PDebug)</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 8 June 2015 at 18:32, Alessio <span dir="ltr"><<a href="mailto:masariello+cmake.org@gmail.com" target="_blank">masariello+cmake.org@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi</div><div><br></div><div>The below CMake code is causing my targets to get installed twice in the same tarball when I invoke cpack with the following command line</div><div><br></div><div>    "${CPACK_COMMAND}" -G ${cpack_gen} --config "${CMAKE_CURRENT_BINARY_DIR}/${package_cfg_file}" -C "$<CONFIGURATION>"</div><div><br></div><div>The generated cmake_install.cmake in fact contains two fiel(INSTALL) sections for every target like the one at the bottom.</div><div><br></div><div>Using \${CMAKE_INSTALL_CONFIG_NAME} as suggested in reference (1) does not quite work for me. I would like the installed directory to have a name of my choosing, rather than relying on the name of the configuration.</div><div><br></div><div>Can this be done at all? Is there a single-call install(TARGETS) signature that gives me what I want?</div><div><br></div><div>Thank you very much for any light you can shed on this.</div><div>-alessio</div><div><br></div><div><br></div><div>THE CMAKE INSTALL CODE WITH THE PROBLEM</div><div>---------------------------------------</div><div>    set(${PROJECT_NAME}_INSTALL_RUNTIME_RELEASE        "release")</div><div>    set(${PROJECT_NAME}_INSTALL_RUNTIME_DEBUG          "debug")</div><div><br></div><div>    install(TARGETS ${target}</div><div>        COMPONENT ${component}</div><div>        RUNTIME DESTINATION "${${PROJECT_NAME}_INSTALL_RUNTIME_RELEASE}"</div><div>        LIBRARY DESTINATION "${${PROJECT_NAME}_INSTALL_RUNTIME_RELEASE}"</div><div>        CONFIGURATIONS Release MinSizeRel RelWithDebInfo)</div><div>    install(TARGETS ${target}</div><div>        COMPONENT ${component}</div><div>        RUNTIME DESTINATION "${${PROJECT_NAME}_INSTALL_RUNTIME_DEBUG}"</div><div>        LIBRARY DESTINATION "${${PROJECT_NAME}_INSTALL_RUNTIME_DEBUG}"</div><div>        CONFIGURATIONS Debug PDebug)</div><div><br></div><div><br></div><div><br></div><div>SAMPLE cmake_install.cmake SECTION</div><div>----------------------------------</div><div>if(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "platform")</div><div>  if("${CMAKE_INSTALL_CONFIG_NAME}" MATCHES "^([Dd][Ee][Bb][Uu][Gg])$")</div><div>    file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/release" TYPE SHARED_LIBRARY FILES "E:/Views/build/testapp/Debug/testapp-d.dll")</div><div>  elseif("${CMAKE_INSTALL_CONFIG_NAME}" MATCHES "^([Rr][Ee][Ll][Ee][Aa][Ss][Ee])$")</div><div>    file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/release" TYPE SHARED_LIBRARY FILES "E:/Views/build/testapp/Release/testapp.dll")</div><div>  elseif("${CMAKE_INSTALL_CONFIG_NAME}" MATCHES "^([Mm][Ii][Nn][Ss][Ii][Zz][Ee][Rr][Ee][Ll])$")</div><div>    file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/release" TYPE SHARED_LIBRARY FILES "E:/Views/build/testapp/MinSizeRel/testapp-ms.dll")</div><div>  elseif("${CMAKE_INSTALL_CONFIG_NAME}" MATCHES "^([Rr][Ee][Ll][Ww][Ii][Tt][Hh][Dd][Ee][Bb][Ii][Nn][Ff][Oo])$")</div><div>    file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/release" TYPE SHARED_LIBRARY FILES "E:/Views/build/testapp/RelWithDebInfo/testapp-rd.dll")</div><div>  elseif("${CMAKE_INSTALL_CONFIG_NAME}" MATCHES "^([Pp][Dd][Ee][Bb][Uu][Gg])$")</div><div>    file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/release" TYPE SHARED_LIBRARY FILES "E:/Views/build/testapp/PDebug/testapp-pd.dll")</div><div>  endif()</div><div>endif()</div><div><br></div><div><br></div><div>REFERENCES</div><div>----------</div><div>(1) <a href="http://www.cmake.org/pipermail/cmake/2010-May/036979.html" target="_blank">http://www.cmake.org/pipermail/cmake/2010-May/036979.html</a></div></div>
</blockquote></div><br></div>