MantisBT - CMake
View Issue Details
0015750CMakeCMakepublic2015-09-17 10:132016-02-01 09:10
CarlPoirier 
 
normalmajoralways
closedno change required 
Visual Studio 2008Windows 7x64
CMake 3.3.1 
 
0015750: setting COMPILE_DEFINITIONS_<CONFIG> is broken
Setting the compile definitions for a particular configuration does not work using the following command, which should according to http://www.cmake.org/Wiki/CMake_2.6_Notes: [^]

set_property(TARGET ${PrjName0} PROPERTY COMPILE_DEFINITIONS_DEBUG SOMEDEFINE)
1. Unzip the included hello world project.
2. Run "cmake -G "Visual Studio 9 2008" .
3. Open the project in Visual Studio 2008.
4. Go to project properties -> C/C++ -> Preprocessor and see that the definition did not apply.
Setting the compile definitions for all configurations does work, though:

set_property(TARGET ${PrjName0} PROPERTY COMPILE_DEFINITIONS SOMEDEFINE)
No tags attached.
zip CMakeTest.zip (830) 2015-09-17 10:13
https://public.kitware.com/Bug/file/5530/CMakeTest.zip
Issue History
2015-09-17 10:13CarlPoirierNew Issue
2015-09-17 10:13CarlPoirierFile Added: CMakeTest.zip
2015-09-17 10:17Brad KingNote Added: 0039437
2015-09-17 10:17Brad KingStatusnew => resolved
2015-09-17 10:17Brad KingResolutionopen => no change required
2015-09-17 10:23CarlPoirierNote Added: 0039438
2016-02-01 09:10Robert MaynardNote Added: 0040409
2016-02-01 09:10Robert MaynardStatusresolved => closed

Notes
(0039437)
Brad King   
2015-09-17 10:17   
This is documented behavior:

 http://www.cmake.org/cmake/help/v3.3/prop_tgt/COMPILE_DEFINITIONS_CONFIG.html [^]
 Ignored. See CMake Policy CMP0043.

 http://www.cmake.org/cmake/help/v3.3/policy/CMP0043.html [^]

Your example does

 cmake_minimum_required(VERSION 3.3)

which sets CMP0043 to NEW.
(0039438)
CarlPoirier   
2015-09-17 10:23   
Thank you very much for the quick response.
(0040409)
Robert Maynard   
2016-02-01 09:10   
Closing resolved issues that have not been updated in more than 4 months.