On Wednesday 22 February 2012, Brad King wrote:
> On 2/22/2012 4:30 PM, Alexander Neundorf wrote:
> > On Wednesday 22 February 2012, Brad King wrote:
> >> I think that's too complicated for now.  It is much simpler to just
> >> put the keywords at the same place as NO_MODULE currently goes.
> > 
> > Yes, probably. I will think a bit more about it...
> 
> Actually thinking more about the signature I like the package-first
> approach better even when the CONFIG or MODULE keyword is used.  Let's
> not bike-shed this anymore.  We're just adding more names like NO_MODULE.
> 
> I'd rather focus on the error message wording which is more important.

I updated the FindPackage_ModeWarning branch.
It should now have everything as discussed here, please review.

The FindPackageTest now also tries to list more or less all possible failure 
messages, the output is attached.

Alex
----------------------------------------------------
Listing find_package() error messages
---------- No keyword ------------------------------
CMake Warning at CMakeLists.txt:313 (find_package):
  By not providing "FindNotHere.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "NotHere", but
  CMake did not find one.

  Could not find a package configuration file provided by "NotHere" with any
  of the following names:

    NotHereConfig.cmake
    nothere-config.cmake

  Add the installation prefix of "NotHere" to CMAKE_PREFIX_PATH or set
  "NotHere_DIR" to a directory containing one of the above files.  If
  "NotHere" provides a separate development package or SDK, be sure it has
  been installed.


---------- MODULE ----------------------------------
CMake Warning (dev) at CMakeLists.txt:315 (find_package):
  Keyword MODULE used in find_package(), but required CMake version 2.6 is
  less than 2.8.8.  Consider using the NO_MODULE keyword instead.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning at CMakeLists.txt:315 (find_package):
  No "FindNotHere.cmake" found in CMAKE_MODULE_PATH.


CMake Warning (dev) at CMakeLists.txt:315 (find_package):
  FindNotHere.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
  its source tree.

  Or it must be installed by a package which has already been found via
  find_package().  In this case make sure that package has indeed been found
  and adjust CMAKE_MODULE_PATH to contain the location where that package has
  installed FindNotHere.cmake.  This must be a location provided by that
  package.  This error in general means that the buildsystem of this project
  is relying on a Find-module without ensuring that it is actually available.

This warning is for project developers.  Use -Wno-dev to suppress it.

---------- NO_MODULE -------------------------------
CMake Warning at CMakeLists.txt:317 (find_package):
  Could not find a package configuration file provided by "NotHere" with any
  of the following names:

    NotHereConfig.cmake
    nothere-config.cmake

  Add the installation prefix of "NotHere" to CMAKE_PREFIX_PATH or set
  "NotHere_DIR" to a directory containing one of the above files.  If
  "NotHere" provides a separate development package or SDK, be sure it has
  been installed.


---------- CONFIG ----------------------------------
CMake Warning (dev) at CMakeLists.txt:319 (find_package):
  Keyword CONFIG used in find_package(), but required CMake version 2.6 is
  less than 2.8.8.  Consider using the NO_MODULE keyword instead.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning at CMakeLists.txt:319 (find_package):
  Could not find a package configuration file provided by "NotHere" with any
  of the following names:

    NotHereConfig.cmake
    nothere-config.cmake

  Add the installation prefix of "NotHere" to CMAKE_PREFIX_PATH or set
  "NotHere_DIR" to a directory containing one of the above files.  If
  "NotHere" provides a separate development package or SDK, be sure it has
  been installed.


---------- 1 name ----------------------------------
CMake Warning (dev) at CMakeLists.txt:321 (find_package):
  Keyword CONFIG used in find_package(), but required CMake version 2.6 is
  less than 2.8.8.  Consider using the NO_MODULE keyword instead.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning at CMakeLists.txt:321 (find_package):
  Could not find a package configuration file named
  "NotHereWithOneName.cmake" provided by package "NotHere".

  Add the installation prefix of "NotHere" to CMAKE_PREFIX_PATH or set
  "NotHere_DIR" to a directory containing one of the above files.  If
  "NotHere" provides a separate development package or SDK, be sure it has
  been installed.


---------- No keyword, version----------------------
CMake Warning at CMakeLists.txt:324 (find_package):
  By not providing "FindNotHere.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "NotHere", but
  CMake did not find one.

  Could not find a package configuration file provided by "NotHere"
  (requested version 1.0) with any of the following names:

    NotHereConfig.cmake
    nothere-config.cmake

  Add the installation prefix of "NotHere" to CMAKE_PREFIX_PATH or set
  "NotHere_DIR" to a directory containing one of the above files.  If
  "NotHere" provides a separate development package or SDK, be sure it has
  been installed.


---------- MODULE, version -------------------------
CMake Warning (dev) at CMakeLists.txt:326 (find_package):
  Keyword MODULE used in find_package(), but required CMake version 2.6 is
  less than 2.8.8.  Consider using the NO_MODULE keyword instead.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning at CMakeLists.txt:326 (find_package):
  No "FindNotHere.cmake" found in CMAKE_MODULE_PATH.


CMake Warning (dev) at CMakeLists.txt:326 (find_package):
  FindNotHere.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
  its source tree.

  Or it must be installed by a package which has already been found via
  find_package().  In this case make sure that package has indeed been found
  and adjust CMAKE_MODULE_PATH to contain the location where that package has
  installed FindNotHere.cmake.  This must be a location provided by that
  package.  This error in general means that the buildsystem of this project
  is relying on a Find-module without ensuring that it is actually available.

This warning is for project developers.  Use -Wno-dev to suppress it.

---------- NO_MODULE, version ----------------------
CMake Warning at CMakeLists.txt:328 (find_package):
  Could not find a package configuration file provided by "NotHere"
  (requested version 2.0) with any of the following names:

    NotHereConfig.cmake
    nothere-config.cmake

  Add the installation prefix of "NotHere" to CMAKE_PREFIX_PATH or set
  "NotHere_DIR" to a directory containing one of the above files.  If
  "NotHere" provides a separate development package or SDK, be sure it has
  been installed.


---------- CONFIG, version -------------------------
CMake Warning (dev) at CMakeLists.txt:330 (find_package):
  Keyword CONFIG used in find_package(), but required CMake version 2.6 is
  less than 2.8.8.  Consider using the NO_MODULE keyword instead.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning at CMakeLists.txt:330 (find_package):
  Could not find a package configuration file provided by "NotHere"
  (requested version 3.0) with any of the following names:

    NotHereConfig.cmake
    nothere-config.cmake

  Add the installation prefix of "NotHere" to CMAKE_PREFIX_PATH or set
  "NotHere_DIR" to a directory containing one of the above files.  If
  "NotHere" provides a separate development package or SDK, be sure it has
  been installed.


---------- 1 name, version -------------------------
CMake Warning (dev) at CMakeLists.txt:332 (find_package):
  Keyword CONFIG used in find_package(), but required CMake version 2.6 is
  less than 2.8.8.  Consider using the NO_MODULE keyword instead.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning at CMakeLists.txt:332 (find_package):
  Could not find a package configuration file named
  "NotHereWithOneName.cmake" provided by package "NotHere" (requested version
  5.0).

  Add the installation prefix of "NotHere" to CMAKE_PREFIX_PATH or set
  "NotHere_DIR" to a directory containing one of the above files.  If
  "NotHere" provides a separate development package or SDK, be sure it has
  been installed.


---------- Bad version, no keyword, dev warning ----
CMake Warning (dev) at CMakeLists.txt:340 (find_package):
  find_package() did not find a FindBaz.cmake and is searching a package
  configuration file.  If this is done intentionally, consider adding the
  NO_MODULE keyword to the find_package() call to avoid ambiguities.Otherwise
  adjust CMAKE_MODULE_PATH etc.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning at CMakeLists.txt:340 (find_package):
  Could not find a configuration file for package "Baz" that is compatible
  with requested version "2.0".

  The following configuration files were considered but not accepted:

    /home/alex/src/CMake/CMake-git/Tests/FindPackageTest/Baz 1.1/BazConfig.cmake, version: 1.1
    /home/alex/src/CMake/CMake-git/Tests/FindPackageTest/Baz 1.1/BazConfig.cmake, version: 1.1
    /home/alex/src/CMake/CMake-git/Tests/FindPackageTest/Baz 1.2/CMake/BazConfig.cmake, version: 1.2



---------- Bad version, MODULE ---------------------
CMake Warning (dev) at CMakeLists.txt:342 (find_package):
  Keyword MODULE used in find_package(), but required CMake version 2.6 is
  less than 2.8.8.  Consider using the NO_MODULE keyword instead.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning at CMakeLists.txt:342 (find_package):
  No "FindBaz.cmake" found in CMAKE_MODULE_PATH.


CMake Warning (dev) at CMakeLists.txt:342 (find_package):
  FindBaz.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
  its source tree.

  Or it must be installed by a package which has already been found via
  find_package().  In this case make sure that package has indeed been found
  and adjust CMAKE_MODULE_PATH to contain the location where that package has
  installed FindBaz.cmake.  This must be a location provided by that package.
  This error in general means that the buildsystem of this project is relying
  on a Find-module without ensuring that it is actually available.

This warning is for project developers.  Use -Wno-dev to suppress it.

---------- Bad version, CONFIG ---------------------
CMake Warning (dev) at CMakeLists.txt:344 (find_package):
  Keyword CONFIG used in find_package(), but required CMake version 2.6 is
  less than 2.8.8.  Consider using the NO_MODULE keyword instead.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning at CMakeLists.txt:344 (find_package):
  Could not find a configuration file for package "Baz" that is compatible
  with requested version "2.0".

  The following configuration files were considered but not accepted:

    /home/alex/src/CMake/CMake-git/Tests/FindPackageTest/Baz 1.1/BazConfig.cmake, version: 1.1
    /home/alex/src/CMake/CMake-git/Tests/FindPackageTest/Baz 1.2/CMake/BazConfig.cmake, version: 1.2



---------- Bad version, 1 name ---------------------
CMake Warning (dev) at CMakeLists.txt:346 (find_package):
  Keyword CONFIG used in find_package(), but required CMake version 2.6 is
  less than 2.8.8.  Consider using the NO_MODULE keyword instead.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning at CMakeLists.txt:346 (find_package):
  Could not find a configuration file for package "Baz" that is compatible
  with requested version "2.0".

  The following configuration files were considered but not accepted:

    /home/alex/src/CMake/CMake-git/Tests/FindPackageTest/Baz 1.1/BazConfig.cmake, version: 1.1
    /home/alex/src/CMake/CMake-git/Tests/FindPackageTest/Baz 1.2/CMake/BazConfig.cmake, version: 1.2



---------- FPHSA, no keyword -----------------------
Could NOT find NotHere (missing:  NOTHERE_LIBRARY NOTHERE_INCLUDE_DIR) 
---------- FPHSA, MODULE ---------------------------
CMake Warning (dev) at CMakeLists.txt:354 (find_package):
  Keyword MODULE used in find_package(), but required CMake version 2.6 is
  less than 2.8.8.  Consider using the NO_MODULE keyword instead.
This warning is for project developers.  Use -Wno-dev to suppress it.

Could NOT find NotHere (missing:  NOTHERE_LIBRARY NOTHERE_INCLUDE_DIR) 
---------- FPHSA, no keyword, version --------------
Could NOT find NotHere (missing:  NOTHERE_LIBRARY NOTHERE_INCLUDE_DIR) (Required is at least version "1.0")
---------- FPHSA CONFIG_MODE, no keyword -----------
Could NOT find NotHereConf: found neither NotHereConfConfig.cmake nor nothereconf-config.cmake 
---------- FPHSA CONFIG_MODE, no keyword, version --
Could NOT find NotHereConf: found neither NotHereConfConfig.cmake nor nothereconf-config.cmake (Required is at least version "1.0")
---------- FPHSA CONFIG_MODE no keyword, bad version
Could NOT find Baz (Required is at least version "2.0"), checked the following files:
    /home/alex/src/CMake/CMake-git/Tests/FindPackageTest/Baz 1.1/BazConfig.cmake (version 1.1)
    /home/alex/src/CMake/CMake-git/Tests/FindPackageTest/Baz 1.2/CMake/BazConfig.cmake (version 1.2)

---------- FPHSA CONFIG_MODE, no keyword, version --
Found Baz: /home/alex/src/CMake/CMake-git/Tests/FindPackageTest/Baz 1.1/BazConfig.cmake (found suitable version "1.1", required is "1.0")
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to