------------------------------

Message: 2
Date: Fri, 17 Jan 2014 23:46:45 +0400
From: ZZ ZZ <[email protected]>
To: [email protected]
Subject: [CMake] export(TARGETS for multi-configuration
Message-ID: <[email protected]>
Content-Type: text/plain; charset=koi8-r

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.

In install case you can use install(EXPORT ...) command:

  install(TARGETS foo EXPORT FooTargets)
  install(EXPORT FooTargets)

debug will produce: FooTargets.cmake and FooTargets-debug.cmake
release will produce: FooTargets.cmake and FooTargets-release.cmake
Both debug/release versions of FooTargets.cmake are equal.

Take a look at this mini-project: https://github.com/forexample/package-example

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to