[cmake-developers] [CMake 0012543]: Cannot specify link_libraries per configuration when using custom configurations
Mantis Bug Tracker
mantis at public.kitware.com
Thu Oct 27 19:00:11 EDT 2011
The following issue has been SUBMITTED.
======================================================================
http://public.kitware.com/Bug/view.php?id=12543
======================================================================
Reported By: Tony Bridges
Assigned To:
======================================================================
Project: CMake
Issue ID: 12543
Category: CMake
Reproducibility: always
Severity: feature
Priority: high
Status: new
======================================================================
Date Submitted: 2011-10-27 19:00 EDT
Last Modified: 2011-10-27 19:00 EDT
======================================================================
Summary: Cannot specify link_libraries per configuration when
using custom configurations
Description:
Related to 0012124, added to refine the requirement.
In my project, I need to build a particular shared project a number of different
ways (Debug/Release Shared/Static MBCS/Unicode in all combinations). These are
implemented as multiple configurations via CMAKE_CONFIGURATION_TYPES. (Debug,
Debug-Shared, Debug-Shared-Unicode for example)
At the project level, I need to specify different support libraries by name,
based on the configuration. For example, for static debug I reference
cppunitd.lib, and for shared debug I reference cppunitd-sh.lib.
The support for conditional libraries in the target_link_libraries command is
limited to the standard configurations, Debug, Release, Optimized. Custom
configurations are not recognized here.
What is needed is the ability to use custom configurations in the
target_link_libraries command to set library names per configuration.
The same argument applies to setting the library path (and to a lesser extent,
the include path). Currently, these can only be set per-configuration at the
solution level (via set(CMAKE_CXX_FLAGS_DEBUG_SHARED_UNICODE) ), which requires
that the conditional paths for all libraries in the solution be set globally.
This results in a potentially dangerous superset of LIBPATHS being pushed into
every project in the solution, and loss of control over order and precedence.
Additional Information:
to summarize, looking for features as follows :
target_link_libraries ( {MyCustomConfigName} {MyLibByConfigName} )
link_directories ( {MyCustomConfigName} {MyLibPath} )
include_directories ( {MyCustomConfigName} {MyIncPath} )
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
2011-10-27 19:00 Tony Bridges New Issue
======================================================================
More information about the cmake-developers
mailing list