Notes |
|
(0010850)
|
muhkuh
|
2008-03-18 21:45
|
|
Additionally it would be a good idea to make a difference between C and CXX flags. These target properties would be nice:
CXX_FLAGS_DEBUG
CXX_FLAGS_RELEASE
CXX_FLAGS_MINSIZEREL
CXX_FLAGS_RELWITHDEBINFO
C_FLAGS_DEBUG
C_FLAGS_RELEASE
C_FLAGS_MINSIZEREL
C_FLAGS_RELWITHDEBINFO |
|
|
(0011446)
|
Egon Kocjan
|
2008-04-21 04:46
|
|
Separate compiler flags are an absolute necessity for me, so I created a simple hack to add COMPILE_FLAGS_<CONFIG> for Visual Studio generator (patch is attached). I am quite new to cmake, so I don't know how to make it for xcode and makefiles yet, maybe my coworkers will figure it out later when they port the new cmake based build system. It would be nice to have a comment on this feature from cmake developers, before we make too many CMakeLists.txt depend on our hacks ;) |
|
|
(0012066)
|
Egon Kocjan
|
2008-05-22 07:09
|
|
I've attached a patch to add COMPILE_FLAGS_<CONFIG> for Makefile generator. |
|
|
(0012695)
|
Slavoj Písek
|
2008-07-14 10:46
|
|
Honestly muhkuh is not the only one who would appreciate COMPILE_FLAGS_<CONFIG>. I need it as well.
Unfortunatelly the patches ekojcan has uploaded are not complete. It does not work for VS6 and newly introduced COMPILE_FLAGS_<CONFIG> works for targets only. To be consistent it is necessary to have COMPILE_FLAGS_<CONFIG> even for source file properties.
I have made and uploaded a new patch. And I hope cmake developers will review it and they will find it useful and integrate it to cmake sources. It would be nice to have it in the next CMake release. |
|
|
(0013821)
|
Brad King
|
2008-10-09 15:37
|
|
FYI, I've been working on a solution for this on-and-off for a couple months. Instead of extending the COMPILE_FLAGS property, which is space-separated for historical reasons, I am creating a new COMPILE_OPTIONS property which is semicolon-separated like everything else in CMake. Unfortunately doing this right (and providing per-config, per-directory, per-target versions) is a bit of a can of worms. It requires some refactoring and cleanup of the VS and Xcode generators. I'm working on it, but it's not done yet. |
|
|
(0016818)
|
Lluís Batlle
|
2009-07-07 03:44
|
|
Any update on this? We would also like the brad.king work upstream.
Thank you. |
|
|
(0017655)
|
Taras
|
2009-09-19 23:36
|
|
|
|
(0018131)
|
Steve Wilson
|
2009-10-20 17:16
|
|
I'ld like to add myself to the list of those people that are keen to see this change implemented. |
|
|
(0021558)
|
Jeremy Coulon
|
2010-07-29 13:47
(edited on: 2010-07-29 13:50) |
|
I am very interested by this feature !
Is it going to be implemented anytime soon ?
I don't really want to recompile my own patched version of CMake.
So, I tried this workaround but it doesn't work :
set (CMAKE_CXX_FLAGS_DEBUG_BACKUP ${CMAKE_CXX_FLAGS_DEBUG})
set (CMAKE_CXX_FLAGS_DEBUG "/MTd")
add_library (...)
set (CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG_BACKUP})
|
|
|
(0021559)
|
Brad King
|
2010-07-29 14:20
|
|
|
|
(0021589)
|
Jeremy Coulon
|
2010-08-01 06:52
|
|
I tried your branch and it works fine with VS 2003. |
|
|
(0021590)
|
Brad King
|
2010-08-01 15:22
|
|
Great, thanks for trying it. Note that the head of the branch is actually from 2 years ago.
There is a bunch of work needed before we can include these changes. We need at least the following:
- Rebase on current master (will need conflict resolution)
- Implement support for all platforms (partially complete)
- Add tests
- Documentation of the properties |
|
|
(0025624)
|
AndrewF
|
2011-03-02 18:09
|
|
I'll just throw in a bump for this issue. We just ran into this limitation when trying to provide the option for setting the /MDd /MD /MTd or /MT flags, for a mixture of static and dynamic library builds, on a cmake generated project in Visual Studio.
It looks like configuration dependent compile flags are by far the best way to make this happen. COMPILE_DEFINITIONS_ don't cut it since it implies an automatic /D infront of the parameters passed in. |
|
|
(0027016)
|
jens.koehler@mobotix.com
|
2011-07-07 10:14
|
|
I'ld like to add myself to the list of those people that are keen to see this change implemented. |
|
|
(0027125)
|
Brad King
|
2011-07-29 18:04
|
|
Moving to backlog as I have no time to continue work on this now.
Comment 0006493:0021590 describes additional work required. If anyone wants to step forward please post.
|
|
|
(0027142)
|
David Cole
|
2011-08-01 11:19
|
|
Brad just put this one in the backlog... I'm not going to put it on the roadmap for 2.8.6 unless somebody else steps forward with more work on this, as noted by Brad in his previous comments here. |
|
|
(0031338)
|
viktor11111
|
2012-10-25 18:32
(edited on: 2012-10-25 18:35) |
|
this feature is very necessary, please take this time.
updated the old patch for the latest revision
used "0001-COMPILE_FLAGS_-CONFIG.patch"
|
|
|
(0032191)
|
Paris
|
2013-02-04 10:07
|
|
Any update on this one?
Strange that such a basic feature is not worked out since 5 years now... |
|
|
(0032208)
|
Sylwester Arabas
|
2013-02-07 09:05
|
|
I concur - this would be very useful! |
|
|
(0032269)
|
David Manura
|
2013-02-13 14:35
|
|
|
|
(0033214)
|
Stephen Kelly
|
2013-06-03 12:52
|
|
This is now possible by populating the COMPILE_OPTIONS target property with generator expressions. A target_compile_options command has been added as an abstraction to populating the property. |
|
|
(0034355)
|
Robert Maynard
|
2013-11-04 09:33
|
|
Closing resolved issues that have not been updated in more than 4 months. |
|