View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007643CMakeModulespublic2008-09-09 20:252016-06-10 14:30
ReporterPreston A. Elder 
Assigned ToBrad King 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionmoved 
PlatformOSOS Version
Product VersionCMake-2-6 
Target VersionFixed in Version 
Summary0007643: Cmake should add expanded compiler flag support.
DescriptionFrom the email chain:

>> As I said, there are other things that need to be done such as:
>> - Adjusting warning levels (CMAKE_WARN_LEVEL=(None|Full|Standard) )
>> - Forcing a 32-bit or 64-bit compile
>> - Allowing for platform-specific builds if possible (ie. don't maintain
>> i386 compatibility, compile specifically for i686).
>>
>> Most of these can be done in all supported compilers, but the flags for
>> doing so are different per-compiler. Since the Platform directory
>> exists (thanks for pointing it out, I didn't see it before), is there
>> any thoughts on an effort to expand this to more than just optimization
>> and debug flags?

I've been wanting to implement something like this for years, but
haven't had the time to actually do it. The feature would work in terms
of directory, target, and source file properties. It would be similar
to the COMPILE_DEFINITIONS properties:

http://www.cmake.org/Wiki/CMake_2.6_Notes#Preprocessor_Definitions [^]
http://www.cmake.org/HTML/cmake-2.6.html#prop_dir:COMPILE_DEFINITIONS [^]
http://www.cmake.org/HTML/cmake-2.6.html#prop_tgt:COMPILE_DEFINITIONS [^]
http://www.cmake.org/HTML/cmake-2.6.html#prop_sf:COMPILE_DEFINITIONS [^]

and their per-configuration equivalents. Such a property might accept
one out of an enumerated list of pre-defined possible values. Each
value would map to the appropriate flag for the native tool.

It might look something like this:

# Apply to all targets in this directory and below.
set_directory_properties(PROPERTIES
  OPTIMIZATION_LEVEL_DEBUG none # no optimizations for Debug
  OPTIMIZATION_LEVEL_RELEASE max # max optimizations for Release
  OPTIMIZATION_LEVEL default # compiler default for other configs
  WARNING_LEVEL none # disable all warnings in all configurations
  )
# apply to 'tiny' executable, overriding directory default
set_property(TARGET tiny PROPERTY
  OPTIMIZATION_LEVEL size # optimize for size in all configurations
  )

Of course we could create commands or macros to shorten the syntax for
common cases.

-Brad
TagsNo tags attached.
Attached Files

 Relationships
related to 0003811closedBrad King Add portable flag to treat warnings as errors 

  Notes
(0015901)
MrDoomMaster (reporter)
2009-04-03 12:23

I would like to add my vote for this list of functionality. I've been needing to set optimization and warning levels via CMake but it has been far from intuitive or sometimes not even possible.

I would really love to see this in version 2.6.4 if possible! Thanks for hearing the community on this!
(0030495)
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.
(0041449)
Kitware Robot (administrator)
2016-06-10 14:27

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2008-09-09 20:25 Preston A. Elder New Issue
2008-09-11 10:20 Bill Hoffman Status new => assigned
2008-09-11 10:20 Bill Hoffman Assigned To => Brad King
2009-04-03 12:23 MrDoomMaster Note Added: 0015901
2012-08-13 10:36 Brad King Status assigned => backlog
2012-08-13 10:36 Brad King Note Added: 0030495
2013-11-02 11:22 Stephen Kelly Relationship added related to 0003811
2016-06-10 14:27 Kitware Robot Note Added: 0041449
2016-06-10 14:27 Kitware Robot Status backlog => resolved
2016-06-10 14:27 Kitware Robot Resolution open => moved
2016-06-10 14:30 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team