View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015352CMakeCMakepublic2015-01-14 13:112015-11-02 09:13
ReporterJoachim Wuttke 
Assigned ToBrad King 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
Platformamd64OSDebianOS Versionjessie
Product VersionCMake 3.0.2 
Target VersionCMake 3.3Fixed in VersionCMake 3.3 
Summary0015352: FPHSA: Document the kind of variable that should be given to REQUIRED_VARS
DescriptionCode example:

set (FOO_LIBRARIES ${FOO_LIB_A} ${FOO_LIB_B})
find_package_handle_standard_args (FOO DEFAULT_MSG FOO_LIBRARIES FOO_INCLUDE_DIR)

If lib A is missing, I get the error message:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
FOO_LIB_A

However, if lib B (or more generally, the last item in FOO_LIBRARIES) is missing, I get the less informative:

CMake Error at /usr/share/cmake-3.0/Modules/FindPackageHandleStandardArgs.cmake:136 (message):
  Could NOT find Foo (missing: FOO_LIBRARIES)
Call Stack (most recent call first):
  /usr/share/cmake-3.0/Modules/FindPackageHandleStandardArgs.cmake:343 (_FPHSA_FAILURE_MESSAGE)
  my_cmake_modules/FindFoo.cmake:84 (find_package_handle_standard_args)
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0037695)
Brad King (manager)
2015-01-15 07:31

The FOO_LIBRARIES is not the correct variable to give to FPHSA. Instead it should be FOO_LIB_A and FOO_LIB_B. The idea is that FPHSA checks if all the variables are set and if not then gives a user-facing error message that lists the ones that are not set. Therefore they should be the variables (actually cache entries) that the user is capable of modifying.
(0038527)
Brad King (manager)
2015-04-15 14:47
edited on: 2015-04-17 10:48

After revising and cleaning up the documentation:

 FPHSA: Revise and format documentation
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a3ad275c [^]

I've added an explicit note about what is mentioned in 0015352:0037695:

 FPHSA: Document REQUIRED_VARS recommendation (0015352)
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=84f06d0c [^]

(0039778)
Robert Maynard (manager)
2015-11-02 09:13

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

 Issue History
Date Modified Username Field Change
2015-01-14 13:11 Joachim Wuttke New Issue
2015-01-14 16:42 Brad King Status new => acknowledged
2015-01-14 16:42 Brad King Steps to Reproduce Updated
2015-01-15 07:31 Brad King Note Added: 0037695
2015-04-15 14:47 Brad King Assigned To => Brad King
2015-04-15 14:47 Brad King Status acknowledged => assigned
2015-04-15 14:47 Brad King Target Version => CMake 3.3
2015-04-15 14:47 Brad King Summary find_package_handle_standard_args generates inadequate error message when last item in a list is unavailable => FPHSA: Document the kind of variable that should be given to REQUIRED_VARS
2015-04-15 14:47 Brad King Note Added: 0038527
2015-04-15 14:48 Brad King Status assigned => resolved
2015-04-15 14:48 Brad King Resolution open => fixed
2015-04-15 14:48 Brad King Fixed in Version => CMake 3.3
2015-04-17 10:48 Brad King Note Edited: 0038527
2015-11-02 09:13 Robert Maynard Note Added: 0039778
2015-11-02 09:13 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team