[CMake] export(TARGETS for multi-configuration

ZZ ZZ zero-zip at yandex.ru
Fri Jan 17 14:46:45 EST 2014


Hi all,

Our CMakeLists.txt contains with the following command:

export(TARGETS ${OpenCVModules_TARGETS} FILE "${CMAKE_BINARY_DIR}/OpenCVModules.cmake")

For release configuration it generates Relase imports

set_property(TARGET opencv_legacy APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(opencv_legacy PROPERTIES
  IMPORTED_IMPLIB_RELEASE "E:/opencv24_vs2008_x64/lib/opencv_legacy248.lib"
  IMPORTED_LOCATION_RELEASE "E:/opencv24_vs2008_x64/bin/opencv_legacy248.dll"
  )

For debug configuration Debug ones:

# Import target "opencv_legacy" for configuration "Debug"
set_property(TARGET opencv_legacy APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(opencv_legacy PROPERTIES
  IMPORTED_IMPLIB_DEBUG "E:/opencv24_vs2008_x64/lib/opencv_legacy248d.lib"
  IMPORTED_LOCATION_DEBUG "E:/opencv24_vs2008_x64/bin/opencv_legacy248d.dll"
  )

My question is how to generate export file which contains both of Debug and Release target properties?
I can't write to different files for Releae and Debug and include both - the files contain guards again multiple includes.


More information about the CMake mailing list