View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0016069CMakeCMakepublic2016-04-16 03:492016-06-10 14:21
ReporterCraig Scott 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionno change required 
PlatformAppleOSOSXOS Version10.10
Product VersionCMake 3.5.2 
Target VersionFixed in Version 
Summary0016069: Behaviour does not match documentation for policy CMP0048
DescriptionThe policy documentation for CMP0048 says this:

"This policy was introduced in CMake version 3.0. CMake version 3.5.2 warns when the policy is not set and uses OLD behavior. Use the cmake_policy command to set it to OLD or NEW explicitly."

In my testing, however, no such warning is issued and the default appears to be NEW, not OLD.
Steps To ReproduceThe following minimal CMakeLists.txt demonstrates the problem:

cmake_minimum_required(VERSION 3.5.2)
cmake_policy(GET CMP0048 isOn)
message("isOn = ${isOn}")
project(proj VERSION 1.2.3)

Changing the minimum required version doesn't seem to make any difference.
Additional InformationIf you explicitly set the policy for CMP0048 to OLD, then the expected error does occur when the project() command includes a VERSION specification.
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0040879)
Brad King (manager)
2016-04-18 08:28

The call to cmake_minimum_required(VERSION):

 https://cmake.org/cmake/help/v3.5/command/cmake_minimum_required.html [^]

implies a call to cmake_policy(VERSION) which sets the policy to NEW because the min req version specified is at least 3.0. Once the policy is set the NEW behavior is used without any warning.
(0040880)
Brad King (manager)
2016-04-18 08:29

For reference, this behavior of cmake_minimum_required has been clarified in post-3.5 documentation updates:

 Help: Organize and clarify `cmake_minimum_required` documentation
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1dc8486b [^]
(0041190)
Kitware Robot (administrator)
2016-06-10 14:21

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2016-04-16 03:49 Craig Scott New Issue
2016-04-18 08:28 Brad King Note Added: 0040879
2016-04-18 08:28 Brad King Status new => resolved
2016-04-18 08:28 Brad King Resolution open => no change required
2016-04-18 08:29 Brad King Note Added: 0040880
2016-06-10 14:21 Kitware Robot Note Added: 0041190
2016-06-10 14:21 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team