Hello,
Can someone help me with this issue, see description below.
I had to disable install(EXPORT ...) when using multi-configuration generators.
This leads to errors for people using one of them.
Issue is that I cannot export targets that are installed in different locations
(one for debug, another one for release) with multi-conf generators.
Regards,
Gregoire
From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of
Gregoire Aujay
Sent: lundi 7 janvier 2013 18:57
To: cmake@cmake.org
Subject: [CMake] install(EXPORT ...) behavior for multi-configuration generators
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 DESTINATIONDebug/lib
RUNTIME DESTINATION Debug/bin
CONFIGURATIONS Debug
)
install(TARGETS myLib EXPORT myTargets
ARCHIVE DESTINATION Release/lib
LIBRARY DESTINATIONRelease/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