diff options
-rw-r--r-- | Help/command/string.rst | 23 | ||||
-rw-r--r-- | Modules/CPack.cmake | 44 | ||||
-rw-r--r-- | Modules/CheckCSourceRuns.cmake | 2 | ||||
-rw-r--r-- | Modules/CheckCXXSourceRuns.cmake | 2 | ||||
-rw-r--r-- | Modules/CheckOBJCSourceRuns.cmake | 2 | ||||
-rw-r--r-- | Modules/CheckOBJCXXSourceRuns.cmake | 2 | ||||
-rw-r--r-- | Modules/FindBoost.cmake | 10 | ||||
-rw-r--r-- | Modules/Internal/CheckSourceRuns.cmake | 7 | ||||
-rw-r--r-- | Tests/RunCMake/CheckSourceRuns/UnknownArgument-stderr.txt | 15 | ||||
-rw-r--r-- | Tests/RunCMake/CheckSourceRuns/UnknownArgument.cmake | 4 |
10 files changed, 80 insertions, 31 deletions
diff --git a/Help/command/string.rst b/Help/command/string.rst index 0c2f57e..51f8d82 100644 --- a/Help/command/string.rst +++ b/Help/command/string.rst @@ -491,6 +491,16 @@ JSON Functionality for querying a JSON string. +.. note:: + In each of the following JSON-related subcommands, if the optional + ``ERROR_VARIABLE`` argument is given, errors will be reported in + ``<error-variable>`` and the ``<out-var>`` will be set to + ``<member|index>-[<member|index>...]-NOTFOUND`` with the path elements + up to the point where the error occurred, or just ``NOTFOUND`` if there + is no relevant path. If an error occurs but the ``ERROR_VARIABLE`` + option is not present, a fatal error message is generated. If no error + occurs, the ``<error-variable>`` will be set to ``NOTFOUND``. + .. _GET: .. code-block:: cmake @@ -563,13 +573,6 @@ The contents of ``<value>`` should be valid JSON. EQUAL <json-string1> <json-string2>) Compare the two JSON objects given by ``<json-string1>`` and ``<json-string2>`` -for equality - - -If the optional ``ERROR_VARIABLE`` argument is given, errors will be -reported in ``<error-variable>``. If no error occurs, the ``<error-variable>`` -will be set to ``NOTFOUND``. If ``ERROR_VARIABLE`` is not set a CMake error -will be issued. -When an error occurs the ``<out-var>`` will be set to -``<member|index>-[<member|index>...]-NOTFOUND`` with the path elements up to -the point where the error occurred. +for equality. The contents of ``<json-string1>`` and ``<json-string2>`` +should be valid JSON. The ``<out-var>`` will be set to a true value if the +JSON objects are considered equal, or a false value otherwise. diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake index 8a0ef30..7529a1f 100644 --- a/Modules/CPack.cmake +++ b/Modules/CPack.cmake @@ -357,7 +357,7 @@ The following variables are for advanced uses of CPack: .. variable:: CPACK_INSTALL_SCRIPTS Extra CMake scripts executed by CPack during its local staging - installation, which is done right before packaging the files. + installation. They are executed before installing the files to be packaged. The scripts are not called by a standalone install (e.g.: ``make install``). For every script, the following variables will be set: :variable:`CMAKE_CURRENT_SOURCE_DIR`, :variable:`CMAKE_CURRENT_BINARY_DIR` @@ -366,6 +366,33 @@ The following variables are for advanced uses of CPack: an alternative variable for historical reasons, but its value is ignored if ``CMAKE_INSTALL_SCRIPTS`` is set and a warning will be issued. + See also :variable:`CPACK_PRE_BUILD_SCRIPTS` and + :variable:`CPACK_POST_BUILD_SCRIPTS` which can be used to specify scripts + to be executed later in the packaging process. + +.. variable:: CPACK_PRE_BUILD_SCRIPTS + + List of CMake scripts to execute after CPack has installed the files to + be packaged into a staging directory and before producing the package(s) + from those files. See also :variable:`CPACK_INSTALL_SCRIPTS` and + :variable:`CPACK_POST_BUILD_SCRIPTS`. + +.. variable:: CPACK_POST_BUILD_SCRIPTS + + List of CMake scripts to execute after CPack has produced the resultant + packages and before copying them back to the build directory. + See also :variable:`CPACK_INSTALL_SCRIPTS`, + :variable:`CPACK_PRE_BUILD_SCRIPTS` and :variable:`CPACK_PACKAGE_FILES`. + +.. variable:: CPACK_PACKAGE_FILES + + List of package files created in the staging directory, with each file + provided as a full absolute path. This variable is populated by CPack + just before invoking the post-build scripts listed in + :variable:`CPACK_POST_BUILD_SCRIPTS`. It is the preferred way for the + post-build scripts to know the set of package files to operate on. + Projects should not try to set this variable themselves. + .. variable:: CPACK_INSTALLED_DIRECTORIES Extra directories to install. @@ -390,21 +417,6 @@ The following variables are for advanced uses of CPack: select the CPack generator(s) to be used when building the ``package`` target or when running :manual:`cpack <cpack(1)>` without the ``-G`` option. -.. variable:: CPACK_PRE_BUILD_SCRIPTS - - List of CMake scripts to execute after CPack has installed the files to - be packed into a staging directory and before producing the result - packages. - -.. variable:: CPACK_POST_BUILD_SCRIPTS - - List of CMake scripts to execute after CPack has produced the result - packages and before copying them back to a build directory. - -.. variable:: CPACK_PACKAGE_FILES - - List of resulting package files passed to the ``CPACK_POST_BUILD_SCRIPTS``. - #]=======================================================================] # Define this var in order to avoid (or warn) concerning multiple inclusion diff --git a/Modules/CheckCSourceRuns.cmake b/Modules/CheckCSourceRuns.cmake index 258b1a0..a99e47e 100644 --- a/Modules/CheckCSourceRuns.cmake +++ b/Modules/CheckCSourceRuns.cmake @@ -68,5 +68,7 @@ include_guard(GLOBAL) include(Internal/CheckSourceRuns) macro(CHECK_C_SOURCE_RUNS SOURCE VAR) + set(_CheckSourceRuns_old_signature 1) cmake_check_source_runs(C "${SOURCE}" ${VAR} ${ARGN}) + unset(_CheckSourceRuns_old_signature) endmacro() diff --git a/Modules/CheckCXXSourceRuns.cmake b/Modules/CheckCXXSourceRuns.cmake index 246c873..c8ff3d7 100644 --- a/Modules/CheckCXXSourceRuns.cmake +++ b/Modules/CheckCXXSourceRuns.cmake @@ -68,5 +68,7 @@ include_guard(GLOBAL) include(Internal/CheckSourceRuns) macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR) + set(_CheckSourceRuns_old_signature 1) cmake_check_source_runs(CXX "${SOURCE}" ${VAR} ${ARGN}) + unset(_CheckSourceRuns_old_signature) endmacro() diff --git a/Modules/CheckOBJCSourceRuns.cmake b/Modules/CheckOBJCSourceRuns.cmake index 9894180..dd03309 100644 --- a/Modules/CheckOBJCSourceRuns.cmake +++ b/Modules/CheckOBJCSourceRuns.cmake @@ -70,5 +70,7 @@ include_guard(GLOBAL) include(Internal/CheckSourceRuns) macro(CHECK_OBJC_SOURCE_RUNS SOURCE VAR) + set(_CheckSourceRuns_old_signature 1) cmake_check_source_runs(OBJC "${SOURCE}" ${VAR} ${ARGN}) + unset(_CheckSourceRuns_old_signature) endmacro() diff --git a/Modules/CheckOBJCXXSourceRuns.cmake b/Modules/CheckOBJCXXSourceRuns.cmake index 43d514f..05a5e4c 100644 --- a/Modules/CheckOBJCXXSourceRuns.cmake +++ b/Modules/CheckOBJCXXSourceRuns.cmake @@ -70,5 +70,7 @@ include_guard(GLOBAL) include(Internal/CheckSourceRuns) macro(CHECK_OBJCXX_SOURCE_RUNS SOURCE VAR) + set(_CheckSourceRuns_old_signature 1) cmake_check_source_runs(OBJCXX "${SOURCE}" ${VAR} ${ARGN}) + unset(_CheckSourceRuns_old_signature) endmacro() diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index 77868f4..00e4ff1 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -450,13 +450,19 @@ if (NOT Boost_NO_BOOST_CMAKE) # Do the same find_package call but look specifically for the CMake version. # Note that args are passed in the Boost_FIND_xxxxx variables, so there is no # need to delegate them to this find_package call. - cmake_policy(PUSH) if(BOOST_ROOT AND NOT Boost_ROOT) + # Honor BOOST_ROOT by setting Boost_ROOT with CMP0074 NEW behavior. + cmake_policy(PUSH) cmake_policy(SET CMP0074 NEW) set(Boost_ROOT "${BOOST_ROOT}") + set(_Boost_ROOT_FOR_CONFIG 1) endif() find_package(Boost QUIET NO_MODULE ${_boost_FIND_PACKAGE_ARGS}) - cmake_policy(POP) + if(_Boost_ROOT_FOR_CONFIG) + unset(_Boost_ROOT_FOR_CONFIG) + unset(Boost_ROOT) + cmake_policy(POP) + endif() if (DEFINED Boost_DIR) mark_as_advanced(Boost_DIR) endif () diff --git a/Modules/Internal/CheckSourceRuns.cmake b/Modules/Internal/CheckSourceRuns.cmake index c667245..3a4b758 100644 --- a/Modules/Internal/CheckSourceRuns.cmake +++ b/Modules/Internal/CheckSourceRuns.cmake @@ -51,7 +51,12 @@ function(CMAKE_CHECK_SOURCE_RUNS _lang _source _var) set(_SRC_EXT "${arg}") set(_key "") else() - message(FATAL_ERROR "Unknown argument:\n ${arg}\n") + set(message_type FATAL_ERROR) + if (_CheckSourceRuns_old_signature) + set(message_type AUTHOR_WARNING) + endif () + message("${message_type}" "Unknown argument:\n ${arg}\n") + unset(message_type) endif() endforeach() diff --git a/Tests/RunCMake/CheckSourceRuns/UnknownArgument-stderr.txt b/Tests/RunCMake/CheckSourceRuns/UnknownArgument-stderr.txt index 9b576b5..6824e72 100644 --- a/Tests/RunCMake/CheckSourceRuns/UnknownArgument-stderr.txt +++ b/Tests/RunCMake/CheckSourceRuns/UnknownArgument-stderr.txt @@ -1,4 +1,17 @@ -^CMake Error at [^ +^CMake Warning \(dev\) at [^ +]*/Modules/Internal/CheckSourceRuns.cmake:[0-9]+ \(message\): + Unknown argument: + + BAD + +Call Stack \(most recent call first\): + [^ +]*/Modules/CheckCSourceRuns.cmake:[0-9]+ \(cmake_check_source_runs\) + UnknownArgument.cmake:[0-9]+ \(check_c_source_runs\) + CMakeLists.txt:[0-9]+ \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. + +CMake Error at [^ ]*/Modules/Internal/CheckSourceRuns.cmake:[0-9]+ \(message\): Unknown argument: diff --git a/Tests/RunCMake/CheckSourceRuns/UnknownArgument.cmake b/Tests/RunCMake/CheckSourceRuns/UnknownArgument.cmake index 6e50fa7..927a6b0 100644 --- a/Tests/RunCMake/CheckSourceRuns/UnknownArgument.cmake +++ b/Tests/RunCMake/CheckSourceRuns/UnknownArgument.cmake @@ -1,5 +1,7 @@ enable_language (C) +include(CheckCSourceRuns) include(CheckSourceRuns) -check_source_runs(C "int main() {return 0;}" SHOULD_BUILD SRC_EXT C BAD) +check_c_source_runs("int main() {return 0;}" C_SHOULD_BUILD BAD) +check_source_runs(C "int main() {return 0;}" SHOULD_BUILD SRC_EXT c BAD) |