[Cmake-commits] CMake branch, next, updated. v2.8.11.2-3524-g1237c22

Brad King brad.king at kitware.com
Wed Jul 31 08:45:28 EDT 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  1237c224c6aa96ab5d3773b34431e60eb01f8fef (commit)
       via  9349d69abf69795e115329475d56ff0583b6c79c (commit)
      from  f717142ce5db3ca731707606781266cb3878887a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1237c224c6aa96ab5d3773b34431e60eb01f8fef
commit 1237c224c6aa96ab5d3773b34431e60eb01f8fef
Merge: f717142 9349d69
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jul 31 08:45:26 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Jul 31 08:45:26 2013 -0400

    Merge topic 'add-cmake_reset_check_state' into next
    
    9349d69 Add cmake_reset_check_state() macro


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9349d69abf69795e115329475d56ff0583b6c79c
commit 9349d69abf69795e115329475d56ff0583b6c79c
Author:     Vadim Zhukov <persgray at gmail.com>
AuthorDate: Sun Jul 28 14:11:51 2013 +0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Jul 31 08:43:22 2013 -0400

    Add cmake_reset_check_state() macro
    
    It's acknowledged that check state should not generally nest,
    so it should be cleared when used, for example, in Find* module.
    
    Also, add optional RESET argument to cmake_push_check_state().

diff --git a/Modules/CMakePushCheckState.cmake b/Modules/CMakePushCheckState.cmake
index 08809bf..b37b706 100644
--- a/Modules/CMakePushCheckState.cmake
+++ b/Modules/CMakePushCheckState.cmake
@@ -1,8 +1,10 @@
-# This module defines two macros:
+# This module defines three macros:
 # CMAKE_PUSH_CHECK_STATE()
-# and
 # CMAKE_POP_CHECK_STATE()
-# These two macros can be used to save and restore the state of the variables
+# and
+# CMAKE_RESET_CHECK_STATE()
+# These macros can be used to save, restore and reset (i.e., clear contents)
+# the state of the variables
 # CMAKE_REQUIRED_FLAGS, CMAKE_REQUIRED_DEFINITIONS, CMAKE_REQUIRED_LIBRARIES
 # and CMAKE_REQUIRED_INCLUDES used by the various Check-files coming with CMake,
 # like e.g. check_function_exists() etc.
@@ -11,9 +13,16 @@
 # but after the Find-module has been executed they should have the same value
 # as they had before.
 #
+# CMAKE_PUSH_CHECK_STATE() macro receives optional argument RESET. Whether it's specified,
+# CMAKE_PUSH_CHECK_STATE() will set all CMAKE_REQUIRED_* variables to empty values, same
+# as CMAKE_RESET_CHECK_STATE() call will do.
+#
 # Usage:
-#   cmake_push_check_state()
-#   set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -DSOME_MORE_DEF)
+#   cmake_push_check_state(RESET)
+#   set(CMAKE_REQUIRED_DEFINITIONS -DSOME_MORE_DEF)
+#   check_function_exists(...)
+#   cmake_reset_check_state()
+#   set(CMAKE_REQUIRED_DEFINITIONS -DANOTHER_DEF)
 #   check_function_exists(...)
 #   cmake_pop_check_state()
 
@@ -31,6 +40,15 @@
 #  License text for the above reference.)
 
 
+macro(CMAKE_RESET_CHECK_STATE)
+
+   set(CMAKE_REQUIRED_INCLUDES)
+   set(CMAKE_REQUIRED_DEFINITIONS)
+   set(CMAKE_REQUIRED_LIBRARIES)
+   set(CMAKE_REQUIRED_FLAGS)
+
+endmacro()
+
 macro(CMAKE_PUSH_CHECK_STATE)
 
    if(NOT DEFINED _CMAKE_PUSH_CHECK_STATE_COUNTER)
@@ -43,6 +61,11 @@ macro(CMAKE_PUSH_CHECK_STATE)
    set(_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_DEFINITIONS})
    set(_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}   ${CMAKE_REQUIRED_LIBRARIES})
    set(_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}       ${CMAKE_REQUIRED_FLAGS})
+
+   if (ARGC GREATER 0 AND ARGV0 STREQUAL "RESET")
+      cmake_reset_check_state()
+   endif()
+
 endmacro()
 
 macro(CMAKE_POP_CHECK_STATE)

-----------------------------------------------------------------------

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list