[cmake-developers] [PATCH] FindCUDA: Wrap keyword in if() string comparison

Brad King brad.king at kitware.com
Mon Sep 22 10:07:23 EDT 2014


On 09/21/2014 02:48 PM, Adam Strzelecki wrote:
> FYI unfortunately this solution does not work for CMakeFiles.txt
> with cmake_minimum_required(VERSION 2.6.1) or earlier because of
> CMP0011 that does implicit PUSH/POP does not work there. So
> setting cmake_policy(SET CMP0054 NEW) is internal modules will
> cause this policy to be not popped and carried out of the module.
> 
> I do not have any idea how to solve this in some elegant fashion

This is one reason I just fixed the warnings with the "super ugly"
approach on some of the other modules.  It is a cost we pay upstream
to support older clients, but the policy will still allow cleaner
code in applications.

Or, one could add the explicit PUSH/POP in modules, e.g.

 cmake_policy(PUSH)
 cmake_policy(SET CMP0054 NEW)
 ... module code ...
 cmake_policy(POP)

-Brad




More information about the cmake-developers mailing list