install() command with RUNTIME/LIBRARY/ARCHIVE DESTINATION ignores CONFIGURATIONS setting
While the following works:
add_library(MyPlugin SHARED MyPlugin.cpp)
install(TARGETS MyPlugin
DESTINATION lib/myplugins
CONFIGURATIONS Debug)
install(TARGETS MyPlugin
DESTINATION lib/myplugins-d
CONFIGURATIONS "" None Release RelWithDebInfo MinSizeRel)
and properly installs lib/myplugins/MyPlugin.so
on Release build and lib/myplugins-d/MyPlugin.so
on Debug build, when combined with RUNTIME
/LIBRARY
/ARCHIVE
it breaks and ignores the CONFIGURATIONS
settings:
add_library(MyPlugin SHARED MyPlugin.cpp)
install(TARGETS MyPlugin
RUNTIME DESTINATION bin/myplugins
LIBRARY DESTINATION lib/myplugins
ARCHIVE DESTINATION lib/myplugins
CONFIGURATIONS Debug)
install(TARGETS MyPlugin
RUNTIME DESTINATION bin/myplugins-d
LIBRARY DESTINATION lib/myplugins-d
ARCHIVE DESTINATION lib/myplugins-d
CONFIGURATIONS "" None Release RelWithDebInfo MinSizeRel)
resulting in both lib/myplugins/MyPlugin.so
and lib/myplugins-d/MyPlugin.so
being installed, regardless of which configuration type is used.
Interestingly, when specifying CONFIGURATIONS
before all DESTINATION
parameters, it works:
add_library(MyPlugin SHARED MyPlugin.cpp)
install(TARGETS MyPlugin
CONFIGURATIONS Debug
RUNTIME DESTINATION bin/myplugins
LIBRARY DESTINATION lib/myplugins
ARCHIVE DESTINATION lib/myplugins)
install(TARGETS MyPlugin
CONFIGURATIONS "" None Release RelWithDebInfo MinSizeRel
RUNTIME DESTINATION bin/myplugins-d
LIBRARY DESTINATION lib/myplugins-d
ARCHIVE DESTINATION lib/myplugins-d)
I find this inconsistent and thus a bug (because the simple case on top works properly regardless of order) and this fact is mentioned nowhere in the documentation. From a brief look in the docs it doesn't even seem that such reordering is possible.
Probably related: #14329 (closed)