<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>