[cmake-developers] [CMake 0015352]: find_package_handle_standard_args generates inadequate error message when last item in a list is unavailable

Mantis Bug Tracker mantis at public.kitware.com
Wed Jan 14 13:11:03 EST 2015


The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=15352 
====================================================================== 
Reported By:                Joachim Wuttke
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15352
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2015-01-14 13:11 EST
Last Modified:              2015-01-14 13:11 EST
====================================================================== 
Summary:                    find_package_handle_standard_args generates
inadequate error message when last item in a list is unavailable
Description: 
Code 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)

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2015-01-14 13:11 Joachim Wuttke New Issue                                    
======================================================================



More information about the cmake-developers mailing list