Can't export Debug configuration with cmake
I am trying to export some targets I have in a project, and I've been using the install command for that. I need to export and install both Debug and Release configurations since I need to export some of the targets to clients that will use them in development and need to do debugging. However I can't get the my_export-debug.cmake no matter what I do.
What I'm doing is basically the pseudo-code bellow:
install(TARGETS ${my_targets} EXPORT my_export CONFIGURATIONS Debug;Release Runtime DESTINATION ${CMAKE_INSTALL_LIBDIR} CONFIGURATIONS Debug;Release ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} CONFIGURATIONS Debug;Release)
install(EXPORT my_export DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake CONFIGURATIONS Debug;Release)
However, once I install I only get the my_export.cmake and my_export-release.cmake files, and when I try to use them in the installation the Debug version does not work (since there are no Debug imported targets, only the release ones).
In the my_export.cmake I see the code
file(GLOB _cmake_config_files "{CMAKE_CURRENT_LIST_DIR}/my_export-*.cmake") foreach(_cmake_config_file IN LISTS _cmake_config_files) include("
{_cmake_config_file}") endforeach()
so if I had the my_export-debug.cmake file I would have the debug exported targets. Why is this happening and how can I export debug targets?