View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013755CMakeModulespublic2012-11-28 17:202012-11-29 03:25
ReporterNick Hutchinson 
Assigned ToAlex Neundorf 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformLinuxOSUbuntuOS Version12.10
Product VersionCMake 2.8.10.2 
Target VersionFixed in Version 
Summary0013755: find_package_handle_standard_args(XX DEFAULT_MSG XX_FOUND) always succeeds
DescriptionThe following CMakeList.txt file always succeeds with "--Found XX: TRUE". It ought not to; XX_FOUND has not been declared anywhere. I would expect find_package_handle_standard_args() to report that XX could not be found, and to set XX_FOUND to false.

~~~~
cmake_minimum_required(VERSION 2.8.8)
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args(XX DEFAULT_MSG XX_FOUND)
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0031754)
Alex Neundorf (developer)
2012-11-29 02:46

That's a nice one ;-)
This is the cmake code:

set(${_NAME_UPPER}_FOUND TRUE)
# check if all passed variables are valid
foreach(_CURRENT_VAR ${FPHSA_REQUIRED_VARS})
   if(NOT ${_CURRENT_VAR})
      set(${_NAME_UPPER}_FOUND FALSE)
      set(MISSING_VARS "${MISSING_VARS} ${_CURRENT_VAR}")
   endif()
endforeach()

So the _FOUND variable is initially set to TRUE, and only set to FALSE if something is missing. But since the _FOUND variable is the only thing which is checked, and this has been preset to TRUE, it is not missing...
(0031755)
Alex Neundorf (developer)
2012-11-29 03:24

This is now fixed in next and should be in 2.8.11.
(0031756)
Alex Neundorf (developer)
2012-11-29 03:25

...just for adding a comment
(0031757)
Alex Neundorf (developer)
2012-11-29 03:25

It is the branch MinorFixFPHSA_13755, containing just this one commit:
4809cad FPHSA: don't succeed if only checking for XX_FOUND (0013755)

 Issue History
Date Modified Username Field Change
2012-11-28 17:20 Nick Hutchinson New Issue
2012-11-29 02:46 Alex Neundorf Note Added: 0031754
2012-11-29 02:46 Alex Neundorf Assigned To => Alex Neundorf
2012-11-29 02:46 Alex Neundorf Status new => confirmed
2012-11-29 03:24 Alex Neundorf Note Added: 0031755
2012-11-29 03:24 Alex Neundorf Status confirmed => closed
2012-11-29 03:24 Alex Neundorf Resolution open => fixed
2012-11-29 03:25 Alex Neundorf Note Added: 0031756
2012-11-29 03:25 Alex Neundorf Status closed => feedback
2012-11-29 03:25 Alex Neundorf Resolution fixed => reopened
2012-11-29 03:25 Alex Neundorf Note Added: 0031757
2012-11-29 03:25 Alex Neundorf Status feedback => closed
2012-11-29 03:25 Alex Neundorf Resolution reopened => fixed


Copyright © 2000 - 2018 MantisBT Team