[CMake] config-specific compiler definitions don't work properly

Nils Gladitz nilsgladitz at gmail.com
Fri Jul 17 09:33:20 EDT 2015


On 17.07.2015 15:08, Xi Yang wrote:
> I'm trying to use config-specific definitions, but it seems doesn't 
> work in VS2013.
>
> This is the CMakeLists.txt:
>
> cmake_minimum_required(VERSION 3.0)
>
> set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS_DEBUG
>     FOO
> )
>
> set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS_RELEASE
>     BAR
> )

When requiring CMake >= 3.0 those properties are ignored due to policy 
CMP0043:
     http://www.cmake.org/cmake/help/v3.0/policy/CMP0043.html

The documentation for the policy explains both reasoning for removal of 
these properties and what new code should do instead.

Nils
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150717/87faa91d/attachment.html>


More information about the CMake mailing list