View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006269CMakeCMakepublic2008-01-23 13:012013-10-07 10:03
ReporterLuke K 
Assigned ToStephen Kelly 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in VersionCMake 2.8.11 
Summary0006269: Some CMake commands should support Debug/Release configurations
DescriptionOur software team has encountered problems with some CMake commands that do not support build configurations (for project-based make systems like Visual Studio). This is inconsistent with many other similar CMake commands that do support build configurations. This does not apply to target-based make files for us because we have separate release and debug target names, which are unique by adding a "D" filename suffix for debug. We have situations where we would like to add include directories and link directories for Debug builds (for instance, to add a memory leak detector), and also have different compiler definitions for each configuration (e.g. Debug configurations may have definitions like _DEBUG that are only applicable for debug builds).

We spent a lot of time trying to use the CMAKE_CXX_FLAGS variables and SET_TARGET_PROPERTIES() to set the compiler flags manually. This worked for the most part, however, we ran into serious problems with this dealing with automatic #include dependency tracking when adding "include directory" switches manually. The makefiles generated did not account for our additional include directories, because we didn't use INCLUDE_DIRECTORIES() to add them, we just appended the "include directory" compiler arguments manually.

So now we are stuck with the decision between using the appropriate CMake commands that don't support build configurations, or adding compiler arguments manually, which may or may not work as advertised considering the include directory problem (as if we used the dedicated CMake commands).

Here's a list of some CMake command that are lacking the build configuration support:
  ADD_DEFINITIONS()
  INCLUDE_DIRECTORIES()
  LINK_DIRECTORIES()
  LINK_LIBRARIES()
  ADD_CUSTOM_COMMAND(TARGET)

Thank you for your continued support.
TagsNo tags attached.
Attached Files

 Relationships
related to 0006493closedStephen Kelly configuration dependent COMPILE_FLAGS for SET_TARGET_PROPERTIES 

  Notes
(0010238)
Luke K (reporter)
2008-01-23 13:02

Sorry, category should be CMake, not CCMake. I didn't notice that until I submitted. :-)
(0010344)
Brad King (manager)
2008-01-30 17:38

In CMake 2.6 (and currently in CVS CMake) there is a COMPILE_DEFINITIONS property with per-configuration versions at the directory, target, and source level. That takes care of your ADD_DEFINITIONS request. The others will still require more work.
(0010351)
Brad King (manager)
2008-01-30 18:14

Oops, I didn't mean to imply that CMake 2.6 has been released. I meant that the feature *will* be in 2.6 when it is released and it is currently available to try in CMake CVS.
(0027381)
David Cole (manager)
2011-09-06 14:50

Not enough time left to address this issue before the 2.8.6 release. Deferred until a future release.
(0027625)
yiding (reporter)
2011-10-22 21:34

This would be a very useful feature for us as well.
(0030477)
Brad King (manager)
2012-08-13 10:36

Sending issues I'm not actively working on to the backlog to await someone with time for them.

If an issue you care about is sent to the backlog when you feel it should have been addressed in a different manner, please bring it up on the CMake mailing list for discussion. Sign up for the mailing list here, if you're not already on it:

 http://www.cmake.org/mailman/listinfo/cmake [^]

It's easy to re-activate a bug here if you can find a CMake developer or contributor who has the bandwidth to take it on.
(0032606)
Stephen Kelly (developer)
2013-03-13 11:58

The COMPILE_DEFINITIONS, INCLUDE_DIRECTORIES, LINK_LIBRARIES properties can now all use configuration-specific generator expressions. They can be populated with the target_compile_definitions etc commands.

ADD_CUSTOM_TARGET can also use generator expressions, so that part should also be implemented. If not, please open a more-specific request related to that.

The link_directories can not currently be specified in a config-specific way, but I don't know if that would be useful or the right approach anyway. Please try the new features in CMake 2.8.11 and file a new more specific bug report if needed.
(0033999)
Robert Maynard (manager)
2013-10-07 10:03

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2008-01-23 13:01 Luke K New Issue
2008-01-23 13:02 Luke K Note Added: 0010238
2008-01-30 17:38 Brad King Note Added: 0010344
2008-01-30 18:14 Brad King Note Added: 0010351
2008-01-30 18:18 Brad King Status new => assigned
2008-01-30 18:18 Brad King Assigned To => Brad King
2008-08-19 14:35 Brad King Relationship added related to 0006994
2008-08-19 14:35 Brad King Relationship added related to 0006493
2008-08-19 14:35 Brad King Relationship deleted related to 0006994
2010-08-29 01:33 Kovarththanan Rajaratnam Category CCMake => CMake
2010-08-29 02:49 Kovarththanan Rajaratnam Severity major => feature
2011-08-01 11:43 David Cole Target Version => CMake 2.8.6
2011-09-06 14:50 David Cole Note Added: 0027381
2011-09-06 14:50 David Cole Target Version CMake 2.8.6 =>
2011-10-22 21:34 yiding Note Added: 0027625
2012-08-13 10:36 Brad King Status assigned => backlog
2012-08-13 10:36 Brad King Note Added: 0030477
2012-08-27 07:19 Stephen Kelly Assigned To Brad King => Stephen Kelly
2012-08-27 07:19 Stephen Kelly Status backlog => assigned
2013-03-13 11:58 Stephen Kelly Note Added: 0032606
2013-03-13 11:58 Stephen Kelly Status assigned => resolved
2013-03-13 11:58 Stephen Kelly Fixed in Version => CMake 2.8.11
2013-03-13 11:58 Stephen Kelly Resolution open => fixed
2013-10-07 10:03 Robert Maynard Note Added: 0033999
2013-10-07 10:03 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team