The following issue has been SUBMITTED. ====================================================================== http://www.cmake.org/Bug/view.php?id=15142 ====================================================================== Reported By: Daniele E. Domenichelli Assigned To: ====================================================================== Project: CMake Issue ID: 15142 Category: CMake Reproducibility: always Severity: minor Priority: normal Status: new ====================================================================== Date Submitted: 2014-09-08 14:20 EDT Last Modified: 2014-09-08 14:20 EDT ====================================================================== Summary: Cannot set different INTERFACE_COMPILE_DEFINITIONS for different IMPORTED_CONFIGURATIONS Description: The INTERFACE_COMPILE_DEFINITIONS target property does not have an IMPORTED_CONFIGURATIONS_<CONFIG> analogue.
This means that it is not possible for imported libraries to use different definitions depending on the configuration of the library being used. Steps to Reproduce: In my opinion it should be possible to do something like this: add_library(FOO::FOO IMPORTED UNKNOWN) set_property(TARGET FOO::FOO PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${FOO_INCLUDE_DIRS}") if(FOO_LIBRARY_RELEASE) set_property(TARGET FOO::FOO APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) set_property(TARGET FOO::FOO PROPERTY IMPORTED_LOCATION_RELEASE "${FOO_LIBRARY_RELEASE}") set_property(TARGET FOO::FOO APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS_RELEASE FOO_RELEASE) endif() if(FOO_LIBRARY_DEBUG) set_property(TARGET FOO::FOO APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) set_property(TARGET FOO::FOO PROPERTY IMPORTED_LOCATION_DEBUG "${FOO_LIBRARY_DEBUG}") set_property(TARGET FOO::FOO APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS_DEBUG FOO_DEBUG) endif() And depending on the configuration of the library being used, it should automatically add -DFOO_RELEASE or -DFOO_DEBUG. ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 2014-09-08 14:20 Daniele E. DomenichelliNew Issue ====================================================================== -- 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://public.kitware.com/mailman/listinfo/cmake-developers