[cmake-developers] find_package error wording
Alexander Neundorf
neundorf at kde.org
Fri Feb 17 17:45:42 EST 2012
On Friday 17 February 2012, Brad King wrote:
> On 2/17/2012 5:05 PM, Alexander Neundorf wrote:
> > I think the nicer MODULE_MODE and CONFIG_MODE keywords are not worth
> > breaking backward compatibility of users projects (not cmake) this way.
>
> We can add them and document them in the new version but not mention
> them in error messages for now.
This is what I have so far:
---------------------------------------------------------------------------
policy NEW, Find-module not found:
CMake Error at CMakeLists.txt:8 (find_package):
Could not find module Findecm.cmake.
Adjust CMAKE_MODULE_PATH to find Findecm.cmake.
Findecm.cmake must either be part of this project itself,
in this case adjust CMAKE_MODULE_PATH so that it points to the correct
location inside your source tree.
Or it must be installed by a package which has already been found via
find_package(). In this case make sure that this package has indeed been
found and adjust CMAKE_MODULE_PATH to contain the location where that
package has installed Findecm.cmake. This must be a
variable provided by that package or something similar, i.e. for instance
not your current CMAKE_INSTALL_PREFIX. This error in general means that
you are relying on a Find-module without ensuring that this Find-module
exists.
---------------------------------------------------------------------------
policy not set, nothing found:
CMake Warning (dev) at CMakeLists.txt:8 (find_package):
find_package() did not find Findecm.cmake and additionally
searched unsuccessfully for configuration files for the package
ecm, but it was not running in Config mode.
If this project intentionally uses the configuration file of
ecm and not a Find-module, add the NO_MODULE keyword to the
find_package() call to make this explicitly visible and compatible to
future (and past) CMake versions.
Policy CMP0018 is not set: find_package() Run "cmake --help-policy CMP0018"
for policy details. Use the cmake_policy command to set the policy and
suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Error at CMakeLists.txt:8 (find_package):
Could not find module Findecm.cmake or a configuration file
for package ecm (requested version 0.0.3) with one of the
following names:
ecmConfig.cmake
ecm-config.cmake
Adjust CMAKE_MODULE_PATH to find Findecm.cmake. To find
the configuration file, set CMAKE_PREFIX_PATH to the installation prefix of
ecm, or set ecm_DIR to the directory
containing a CMake configuration file for ecm.
---------------------------------------------------------------------------
policy OLD, nothing found:
CMake Error at CMakeLists.txt:8 (find_package):
Could not find module Findecm.cmake or a configuration file
for package ecm (requested version 0.0.3) with one of the
following names:
ecmConfig.cmake
ecm-config.cmake
Adjust CMAKE_MODULE_PATH to find Findecm.cmake. To find
the configuration file, set CMAKE_PREFIX_PATH to the installation prefix of
ecm, or set ecm_DIR to the directory
containing a CMake configuration file for ecm.
---------------------------------------------------------------------------
policy not set, no matching version found:
CMake Warning (dev) at CMakeLists.txt:8 (find_package):
find_package() did not find Findecm.cmake, but found
instead configuration files, which didn't match the required version, for
the package ecm, but it was not running in Config mode.
If this project intentionally uses the configuration file of
ecm and not a Find-module, add the NO_MODULE keyword to the
find_package() call to make this explicitly visible and compatible to
future (and past) CMake versions.
Policy CMP0018 is not set: find_package() Run "cmake --help-policy CMP0018"
for policy details. Use the cmake_policy command to set the policy and
suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Error at CMakeLists.txt:8 (find_package):
Could not find a configuration file for package "ecm" that
is compatible with requested version "0.0.4".
The following configuration files were considered but not accepted:
/opt/ecm/share/ecm-0.0.2/cmake/ecm-config.cmake, version: 0.0.2
/opt/ecm/share/ecm-0.0.3/cmake/ecm-config.cmake, version: 0.0.3
---------------------------------------------------------------------------
policy not set, config found:
CMake Warning (dev) at CMakeLists.txt:8 (find_package):
find_package() found the configuration file
/opt/ecm/share/ecm-0.0.3/cmake/ecm-config.cmake
for the package ecm, but it was not running in Config mode.
If this project intentionally uses the configuration file of
ecm and not a Find-module, add the NO_MODULE keyword to the
find_package() call to make this explicitly visible and compatible to
future (and past) CMake versions.
Policy CMP0018 is not set: find_package() Run "cmake --help-policy CMP0018"
for policy details. Use the cmake_policy command to set the policy and
suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
...
I haven't pushed this yet, still needs cleanups, line length etc.
Alex
More information about the cmake-developers
mailing list