Hello,
I am using CMake 2.8.10.2, on windows.
I am trying to use install(TARGETS ) and install(EXPORT ) both with NMake
makefiles and with the multi-configuration generator Visual studio.
I cannot get the same behavior when I want my binaries to be installed in a
subfolder that depends on the configuration, e.g. :
- Debug/bin/myLib.dll
- Release/bin/myLib.dll
If I do that :
#start
install(TARGETS "myLib" EXPORT " myTargets "
ARCHIVE DESTINATION "\${CMAKE_INSTALL_CONFIG_NAME}/lib"
LIBRARY DESTINATION "\${CMAKE_INSTALL_CONFIG_NAME}/lib"
RUNTIME DESTINATION "\${CMAKE_INSTALL_CONFIG_NAME}/bin"
)
install(EXPORT "myTargets" DESTINATION "cmake")
#end
This works find for NMake and Visual for install rules because
${CMAKE_INSTALL_CONFIG_NAME} will be evaluated at install time.
But in my myTargets-debug.cmake import files, ${CMAKE_INSTALL_CONFIG_NAME} will
not be evaluated correctly.
Now If I do that:
#start
install(TARGETS "myLib" EXPORT " myTargets "
ARCHIVE DESTINATION "Debug/lib"
LIBRARY DESTINATION "Debug/lib"
RUNTIME DESTINATION "Debug/bin"
CONFIGURATIONS Debug
)
install(TARGETS "myLib" EXPORT " myTargets "
ARCHIVE DESTINATION "Release/lib"
LIBRARY DESTINATION "Release/lib"
RUNTIME DESTINATION "Release/bin"
CONFIGURATIONS Release
)
install(EXPORT "myTargets" DESTINATION "cmake")
# end
CMake will complain that:
CMake Error: INSTALL(EXPORT " myTargets " ...) includes target " myLib " more
than once in the export set.
Is this a bug that CMake complains about a target being exported twice but with
different configurations?
Does anyone have a workaround?
Regards,
Gregoire
--
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake