Define variable CMAKE_FIND_PACKAGE_WARN_NO_MODULE for use by a project
that wants to use an explicit mode in every call to find_package in
order to generate more specific failure messages. Word the warning
using the new CONFIG and MODULE mode keywords when the minimum required
version of CMake is new enough to have them. Otherwise word the warning
using the old NO_MODULE mode keyword.
Inspired-by: Alex Neundorf <neundorf@kde.org>
Explain exactly why CMake is looking for a package configuration file
and who is expected to provide what:
CMake Error at CMakeLists.txt:7 (find_package):
By not providing "Find<pkg>.cmake" in CMAKE_MODULE_PATH the caller
has asked CMake to find a package configuration file provided by
"<pkg>", but CMake did not find one.
Could not find a package configuration file provided by "<pkg>"
with any of the names:
<pkg>Config.cmake
<pkg>-config.cmake
Add the installation prefix of "<pkg>" to CMAKE_PREFIX_PATH or
set "<pkg>_DIR" to a directory containing one of the above files.
If "<pkg>" provides separate development package or SDK be sure
it has been installed.
The first paragraph explains how CMake is interpreting the intention of
the caller. This puts the blame or credit at the call site in the
project code where it belongs both when it is a bug and when it is
intentional. It can be dropped in NO_MODULE mode.
Suggested-by: Brad King <brad.king@kitware.com>
In commit 41c2895b (Added version support to Config mode of find_package
command, 2008-01-28) the error message was computed but was not
reported. Add the SetError call to report it.
The purpose of the TargetType enumeration was overloaded for install
type because install rules were once recorded as targets. Factor the
install types out into their own enumeration.
There are versions out there that neither understand --version nor -V. Try a
completely different approach: execute a small python script that prints the
version number (and only that) in an easily reusable way using
sys.version_info. This is documented to work since Python 2.0. Use sys.version
for older versions, which is documented to exist since 1.5. If even that
doesn't work then simply assume we are on 1.4.0.
${CMake_SOURCE_DIR} and ${CMake_BINARY_DIR} cannot be embedded into regex
directly. If they contain special regex metacharacters like +, the regex
will break. So just escape such metacharacters with a backslash before
embedding the path into the regex.
The issue affected the following tests: CTestTestConfigFileInBuildDir1 and
CTestTestConfigFileInBuildDir2.
Remove variable documentation from the template in order to
avoid multiple location for doc update. Users can now retrieve
CPACK_xxx variable documentation from the command line.
This concerns all variables common to all CPack generators.
Variables mainly used and/or set in CPack.cmake are documented
therein. C++ built-in variables are documented in
cmCPackDocumentVariables.cxx.
Convert the block open and close matching expressions to be explicitly
insensitive to case. This way it will not matter whether Emacs is
sensitive to case when evaluating 'string-match'.
Use CMAKE_<LANG>_COMPILER_VERSION instead of calling the compiler. This macro
predates those useful variables. This also fixes the issue that g++ version
detection was not working if C language was not enabled.