View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000979CMakepublic2004-07-12 03:452004-07-28 08:24
ReporterJan Woetzel 
Assigned ToBrad King 
PrioritylowSeverityfeatureReproducibilityalways
StatusclosedResolutionno change required 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000979: improve FIND_PACKAGE error message
DescriptionIt would be nice if the FIND_PACKAGE error message would point the user to both sources,
FindFoo.cmake and FooConfig.cmake.



FIND_PACKAGE(Foo)
will try to find:
(1) FindFoo.cmake, first
and if that fails:
(2) FooConfig.cmake.

But, if both were NOT found, the error message just complains about FooConfig and asks to set FOO_DIR.
It would be nice to have an additional hint about first try that failed - FindFoo.cmake.

Our users sometimes fail to set their CMAKE_MODULE_PATH variable correctly to find FindFoo.cmake.


Example if both failed:

"CMake Error:
FindFoo.cmake and FooConfig not found.
FOO_DIR not set. It must be set to the directory containing FooConfig.cmake in order to use Foo via FooConfig.cmake".
Or add path of FindFoo.cmake to CMAKE_MODULE_PATH.
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0001305)
Brad King (manager)
2004-07-28 08:23

The CMAKE_MODULE_PATH should be set by CMakeLists.txt code, not by users running CMake to build your project. This error message is intended to inform users running CMake to build a project that they need to tell CMake where to find something. If there is a FindFOO.cmake file that is supposed to be used by FIND_PACKAGE(FOO), then it is up to the author that wrote the CMakeLists.txt file containing the FIND_PACKAGE(FOO) call to make sure that the FindFOO.cmake can be found.

If FIND_PACKAGE finds a FindFOO.cmake file then it simply loads that file. It is up to the contents of the FindFOO.cmake file to produce an error message if FOO cannot be found. If FIND_PACKAGE does not find a FindFOO.cmake file then it assumes the package is a CMake-aware project that has exported a FOOConfig.cmake.

 Issue History
Date Modified Username Field Change


Copyright © 2000 - 2018 MantisBT Team