View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015750CMakeCMakepublic2015-09-17 10:132016-02-01 09:10
ReporterCarlPoirier 
Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionno change required 
PlatformVisual Studio 2008OSWindows 7OS Versionx64
Product VersionCMake 3.3.1 
Target VersionFixed in Version 
Summary0015750: setting COMPILE_DEFINITIONS_<CONFIG> is broken
DescriptionSetting 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)
Steps To Reproduce1. 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.
Additional InformationSetting the compile definitions for all configurations does work, though:

set_property(TARGET ${PrjName0} PROPERTY COMPILE_DEFINITIONS SOMEDEFINE)
TagsNo tags attached.
Attached Fileszip file icon CMakeTest.zip [^] (830 bytes) 2015-09-17 10:13

 Relationships

  Notes
(0039437)
Brad King (manager)
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 (reporter)
2015-09-17 10:23

Thank you very much for the quick response.
(0040409)
Robert Maynard (manager)
2016-02-01 09:10

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

 Issue History
Date Modified Username Field Change
2015-09-17 10:13 CarlPoirier New Issue
2015-09-17 10:13 CarlPoirier File Added: CMakeTest.zip
2015-09-17 10:17 Brad King Note Added: 0039437
2015-09-17 10:17 Brad King Status new => resolved
2015-09-17 10:17 Brad King Resolution open => no change required
2015-09-17 10:23 CarlPoirier Note Added: 0039438
2016-02-01 09:10 Robert Maynard Note Added: 0040409
2016-02-01 09:10 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team