[Cmake-commits] CMake branch, next, updated. v2.8.10.1-872-gea76f0a

Brad King brad.king at kitware.com
Tue Nov 13 13:36:51 EST 2012


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  ea76f0a7aba95a52bf13943af70c814afc88adf1 (commit)
       via  a41d3a40bea01cd4e45579832ac131a0329afc1d (commit)
       via  de760c1fa39ba6d052344dc1052b4b47086998ae (commit)
       via  0a34433dfbd001c5144a2a5889a35a98579f9760 (commit)
       via  9b66c8faf5a2c0d482c5565056ce844b7b4570ad (commit)
       via  2619f4d87a0080cbe6e739529913bf28c0d93d12 (commit)
      from  eeee49521712dc800d9059fa2695e891af466967 (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=ea76f0a7aba95a52bf13943af70c814afc88adf1
commit ea76f0a7aba95a52bf13943af70c814afc88adf1
Merge: eeee495 a41d3a4
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Nov 13 13:36:50 2012 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Nov 13 13:36:50 2012 -0500

    Merge topic 'only-git-fetch-when-necessary' into next
    
    a41d3a4 ExternalProjectUpdateTest: Only support Git 1.6.5 and greater.
    de760c1 ExternalProject: Verify when a fetch occurs during update test.
    0a34433 ExternalProject: Make sure the ExternalProjectUpdate setup is available.
    9b66c8f ExternalProject: Always do a git fetch for a remote ref.
    2619f4d ExternalProject: Add tests for UPDATE_COMMAND.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a41d3a40bea01cd4e45579832ac131a0329afc1d
commit a41d3a40bea01cd4e45579832ac131a0329afc1d
Author:     Matt McCormick <matt.mccormick at kitware.com>
AuthorDate: Fri Nov 9 13:45:52 2012 +0000
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Nov 13 13:35:09 2012 -0500

    ExternalProjectUpdateTest: Only support Git 1.6.5 and greater.

diff --git a/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake b/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake
index 080dd4a..5a6af57 100644
--- a/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake
+++ b/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake
@@ -61,7 +61,25 @@ was expected."
 endmacro()
 
 find_package(Git)
+set(do_git_tests 0)
 if(GIT_EXECUTABLE)
+  set(do_git_tests 1)
+
+  execute_process(
+    COMMAND "${GIT_EXECUTABLE}" --version
+    OUTPUT_VARIABLE ov
+    OUTPUT_STRIP_TRAILING_WHITESPACE
+    )
+  string(REGEX REPLACE "^git version (.+)$" "\\1" git_version "${ov}")
+  message(STATUS "git_version='${git_version}'")
+
+  if(git_version VERSION_LESS 1.6.5)
+    message(STATUS "No ExternalProject git tests with git client less than version 1.6.5")
+    set(do_git_tests 0)
+  endif()
+endif()
+
+if(do_git_tests)
   check_a_tag(origin/master 5842b503ba4113976d9bb28d57b5aee1ad2736b7 1)
   check_a_tag(tag1          d1970730310fe8bc07e73f15dc570071f9f9654a 1)
   # With the Git UPDATE_COMMAND performance patch, this will not required a

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=de760c1fa39ba6d052344dc1052b4b47086998ae
commit de760c1fa39ba6d052344dc1052b4b47086998ae
Author:     Matt McCormick <matt.mccormick at kitware.com>
AuthorDate: Thu Nov 1 20:21:29 2012 +0000
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Nov 13 13:35:07 2012 -0500

    ExternalProject: Verify when a fetch occurs during update test.
    
    The performance feature of only performing a git fetch when needed
    during the ExternalProject update step is verified during the test.
    A fetch is identified by removing the FETCH_HEAD file and checking for
    its reincarnation.

diff --git a/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake b/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake
index 0f9a999..080dd4a 100644
--- a/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake
+++ b/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake
@@ -1,7 +1,15 @@
 # Set the ExternalProject GIT_TAG to desired_tag, and make sure the
-# resulting checked out version is resulting_sha and a rebuild.
-# This check's the viability of the ExternalProject UPDATE_COMMAND.
-macro(check_a_tag desired_tag resulting_sha)
+# resulting checked out version is resulting_sha and rebuild.
+# This check's the correct behavior of the ExternalProject UPDATE_COMMAND.
+# Also verify that a fetch only occurs when fetch_expected is 1.
+macro(check_a_tag desired_tag resulting_sha fetch_expected)
+  message( STATUS "Checking ExternalProjectUpdate to tag: ${desired_tag}" )
+
+  # Remove the FETCH_HEAD file, so we can check if it gets replaced with a 'git
+  # fetch'.
+  set( FETCH_HEAD_file ${ExternalProjectUpdate_BINARY_DIR}/CMakeExternals/Source/TutorialStep1-GIT/.git/FETCH_HEAD )
+  file( REMOVE ${FETCH_HEAD_file} )
+
   # Configure
   execute_process(COMMAND ${CMAKE_COMMAND}
     -G ${CMAKE_TEST_GENERATOR}
@@ -43,18 +51,26 @@ when
 was expected."
     )
   endif()
+
+  if( NOT EXISTS ${FETCH_HEAD_file} AND ${fetch_expected})
+    message( FATAL_ERROR "Fetch did NOT occur when it was expected.")
+  endif()
+  if( EXISTS ${FETCH_HEAD_file} AND NOT ${fetch_expected})
+    message( FATAL_ERROR "Fetch DID occur when it was not expected.")
+  endif()
 endmacro()
 
 find_package(Git)
 if(GIT_EXECUTABLE)
-  check_a_tag(origin/master 5842b503ba4113976d9bb28d57b5aee1ad2736b7)
-  check_a_tag(tag1          d1970730310fe8bc07e73f15dc570071f9f9654a)
+  check_a_tag(origin/master 5842b503ba4113976d9bb28d57b5aee1ad2736b7 1)
+  check_a_tag(tag1          d1970730310fe8bc07e73f15dc570071f9f9654a 1)
   # With the Git UPDATE_COMMAND performance patch, this will not required a
   # 'git fetch'
-  check_a_tag(tag1          d1970730310fe8bc07e73f15dc570071f9f9654a)
-  check_a_tag(tag2          5842b503ba4113976d9bb28d57b5aee1ad2736b7)
-  check_a_tag(d19707303     d1970730310fe8bc07e73f15dc570071f9f9654a)
-  check_a_tag(origin/master 5842b503ba4113976d9bb28d57b5aee1ad2736b7)
+  check_a_tag(tag1          d1970730310fe8bc07e73f15dc570071f9f9654a 0)
+  check_a_tag(tag2          5842b503ba4113976d9bb28d57b5aee1ad2736b7 1)
+  check_a_tag(d19707303     d1970730310fe8bc07e73f15dc570071f9f9654a 1)
+  check_a_tag(d19707303     d1970730310fe8bc07e73f15dc570071f9f9654a 0)
+  check_a_tag(origin/master 5842b503ba4113976d9bb28d57b5aee1ad2736b7 1)
   # This is a remote symbolic ref, so it will always trigger a 'git fetch'
-  check_a_tag(origin/master 5842b503ba4113976d9bb28d57b5aee1ad2736b7)
+  check_a_tag(origin/master 5842b503ba4113976d9bb28d57b5aee1ad2736b7 1)
 endif()

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0a34433dfbd001c5144a2a5889a35a98579f9760
commit 0a34433dfbd001c5144a2a5889a35a98579f9760
Author:     Matt McCormick <matt.mccormick at kitware.com>
AuthorDate: Thu Nov 1 15:50:58 2012 +0000
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Nov 13 13:34:44 2012 -0500

    ExternalProject: Make sure the ExternalProjectUpdate setup is available.
    
    This prepares the numberous tests that occur in the ExternalProjectUpdate
    test.  The tests were passing previously because a fresh build was not performed.

diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 311a6d8..c394fc6 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -982,7 +982,23 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
   set_tests_properties(ExternalProject PROPERTIES
     TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT})
 
-  add_test(ExternalProjectUpdate ${CMAKE_CMAKE_COMMAND}
+  add_test(ExternalProjectUpdateSetup ${CMAKE_CTEST_COMMAND}
+    --build-and-test
+    "${CMake_SOURCE_DIR}/Tests/ExternalProjectUpdate"
+    "${CMake_BINARY_DIR}/Tests/ExternalProjectUpdate"
+    --build-generator ${CMAKE_TEST_GENERATOR}
+    --build-project ExternalProjectUpdateTest
+    --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+    --build-exe-dir "${CMake_BINARY_DIR}/Tests/ExternalProjectUpdate"
+    --force-new-ctest-process
+    --test-command ${CMAKE_CTEST_COMMAND} -V
+    )
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProjectUpdate")
+  set_tests_properties(ExternalProjectUpdateSetup PROPERTIES
+    TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT})
+
+  add_test(NAME ExternalProjectUpdate
+    COMMAND ${CMAKE_CMAKE_COMMAND}
     -DExternalProjectUpdate_SOURCE_DIR:PATH=${CMake_SOURCE_DIR}/Tests/ExternalProjectUpdate
     -DExternalProjectUpdate_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/ExternalProjectUpdate
     -DCMAKE_TEST_GENERATOR=${CMAKE_TEST_GENERATOR}
@@ -994,7 +1010,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
   set_tests_properties(ExternalProjectUpdate PROPERTIES
     TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT}
     WORKING_DIRECTORY ${CMake_SOURCE_DIR}/Tests/ExternalProjectUpdate
-    )
+    DEPENDS ExternalProjectUpdateSetup )
 
   # do each of the tutorial steps
   foreach(STP RANGE 1 7)
diff --git a/Tests/ExternalProjectUpdate/CMakeLists.txt b/Tests/ExternalProjectUpdate/CMakeLists.txt
index cb3a94e..c33e90b 100644
--- a/Tests/ExternalProjectUpdate/CMakeLists.txt
+++ b/Tests/ExternalProjectUpdate/CMakeLists.txt
@@ -41,7 +41,7 @@ endif()
 
 # This should be specified from the command line.
 if(NOT TEST_GIT_TAG)
-  message(FATAL_ERROR "TEST_GIT_TAG must be specified.")
+  set(TEST_GIT_TAG origin/master)
 endif()
 
 if(do_git_tests)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9b66c8faf5a2c0d482c5565056ce844b7b4570ad
commit 9b66c8faf5a2c0d482c5565056ce844b7b4570ad
Author:     Matt McCormick <matt.mccormick at kitware.com>
AuthorDate: Fri Jul 27 17:38:01 2012 +0000
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Nov 13 13:34:43 2012 -0500

    ExternalProject: Always do a git fetch for a remote ref.
    
    Remote git refs always require a git fetch, because the remote may move around
    where the ref points.

diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 7a8aa5f..2355dac 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -418,6 +418,19 @@ if(error_code)
   message(FATAL_ERROR \"Failed to get the hash for HEAD\")
 endif()
 
+execute_process(
+  COMMAND \"${git_EXECUTABLE}\" show-ref ${git_tag}
+  WORKING_DIRECTORY \"${work_dir}\"
+  OUTPUT_VARIABLE show_ref_output
+  )
+# If a remote ref is asked for, which can possibly move around,
+# we must always do a fetch and checkout.
+if(\"\${show_ref_output}\" MATCHES \"remotes\")
+  set(is_remote_ref 1)
+else()
+  set(is_remote_ref 0)
+endif()
+
 # This will fail if the tag does not exist (it probably has not been fetched
 # yet).
 execute_process(
@@ -428,7 +441,7 @@ execute_process(
   )
 
 # Is the hash checkout out that we want?
-if(error_code OR NOT (\"\${tag_sha}\" STREQUAL \"\${head_sha}\"))
+if(error_code OR is_remote_ref OR NOT (\"\${tag_sha}\" STREQUAL \"\${head_sha}\"))
   execute_process(
     COMMAND \"${git_EXECUTABLE}\" fetch
     WORKING_DIRECTORY \"${work_dir}\"
diff --git a/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake b/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake
index fed40ef..0f9a999 100644
--- a/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake
+++ b/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake
@@ -29,12 +29,12 @@ macro(check_a_tag desired_tag resulting_sha)
     WORKING_DIRECTORY ${ExternalProjectUpdate_BINARY_DIR}/CMakeExternals/Source/TutorialStep1-GIT
     RESULT_VARIABLE error_code
     OUTPUT_VARIABLE tag_sha
+    OUTPUT_STRIP_TRAILING_WHITESPACE
     )
   if(error_code)
     message(FATAL_ERROR "Could not check the sha.")
   endif()
 
-  string(STRIP "${tag_sha}" tag_sha)
   if(NOT (${tag_sha} STREQUAL ${resulting_sha}))
     message(FATAL_ERROR "UPDATE_COMMAND produced
   ${tag_sha}
@@ -55,4 +55,6 @@ if(GIT_EXECUTABLE)
   check_a_tag(tag2          5842b503ba4113976d9bb28d57b5aee1ad2736b7)
   check_a_tag(d19707303     d1970730310fe8bc07e73f15dc570071f9f9654a)
   check_a_tag(origin/master 5842b503ba4113976d9bb28d57b5aee1ad2736b7)
+  # This is a remote symbolic ref, so it will always trigger a 'git fetch'
+  check_a_tag(origin/master 5842b503ba4113976d9bb28d57b5aee1ad2736b7)
 endif()

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2619f4d87a0080cbe6e739529913bf28c0d93d12
commit 2619f4d87a0080cbe6e739529913bf28c0d93d12
Author:     Matt McCormick <matt.mccormick at kitware.com>
AuthorDate: Fri Jul 27 16:26:28 2012 +0000
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Nov 13 13:34:22 2012 -0500

    ExternalProject: Add tests for UPDATE_COMMAND.
    
    Tests are added for UPDATE_COMMAND to ensure it is working properly.  Testing
    infrastructure is added along with tests for Git, but tests for other version
    control systems could easily be added in the future.

diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index b404333..311a6d8 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -982,6 +982,20 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
   set_tests_properties(ExternalProject PROPERTIES
     TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT})
 
+  add_test(ExternalProjectUpdate ${CMAKE_CMAKE_COMMAND}
+    -DExternalProjectUpdate_SOURCE_DIR:PATH=${CMake_SOURCE_DIR}/Tests/ExternalProjectUpdate
+    -DExternalProjectUpdate_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/ExternalProjectUpdate
+    -DCMAKE_TEST_GENERATOR=${CMAKE_TEST_GENERATOR}
+    -DCMAKE_TEST_MAKEPROGRAM=${CMAKE_TEST_MAKEPROGRAM}
+    -DCMAKE_CTEST_COMMAND=${CMAKE_CTEST_COMMAND}
+    -P ${CMake_SOURCE_DIR}/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake
+    )
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProjectUpdate")
+  set_tests_properties(ExternalProjectUpdate PROPERTIES
+    TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT}
+    WORKING_DIRECTORY ${CMake_SOURCE_DIR}/Tests/ExternalProjectUpdate
+    )
+
   # do each of the tutorial steps
   foreach(STP RANGE 1 7)
     add_test(TutorialStep${STP} ${CMAKE_CTEST_COMMAND}
diff --git a/Tests/ExternalProjectUpdate/CMakeLists.txt b/Tests/ExternalProjectUpdate/CMakeLists.txt
new file mode 100644
index 0000000..cb3a94e
--- /dev/null
+++ b/Tests/ExternalProjectUpdate/CMakeLists.txt
@@ -0,0 +1,94 @@
+cmake_minimum_required(VERSION 2.8)
+project(ExternalProjectUpdateTest NONE)
+
+include(ExternalProject)
+
+find_package(Git)
+
+option(ExternalProjectUpdateTest_USE_FOLDERS "Enable folder grouping in IDEs." ON)
+if(ExternalProjectUpdateTest_USE_FOLDERS)
+  set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+else()
+  set_property(GLOBAL PROPERTY USE_FOLDERS OFF)
+endif()
+
+set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER
+  "CMakePredefinedTargets-in-ExternalProjectUpdateTest")
+
+set(base "${CMAKE_BINARY_DIR}/CMakeExternals")
+set(binary_base "${base}/Build")
+set_property(DIRECTORY PROPERTY EP_BASE ${base})
+set_property(DIRECTORY PROPERTY EP_STEP_TARGETS configure build test)
+
+set(do_git_tests 0)
+
+if(GIT_EXECUTABLE)
+  set(do_git_tests 1)
+
+  execute_process(
+    COMMAND "${GIT_EXECUTABLE}" --version
+    OUTPUT_VARIABLE ov
+    OUTPUT_STRIP_TRAILING_WHITESPACE
+    )
+  string(REGEX REPLACE "^git version (.+)$" "\\1" git_version "${ov}")
+  message(STATUS "git_version='${git_version}'")
+
+  if(git_version VERSION_LESS 1.6.5)
+    message(STATUS "No ExternalProject git tests with git client less than version 1.6.5")
+    set(do_git_tests 0)
+  endif()
+endif()
+
+# This should be specified from the command line.
+if(NOT TEST_GIT_TAG)
+  message(FATAL_ERROR "TEST_GIT_TAG must be specified.")
+endif()
+
+if(do_git_tests)
+  set(local_git_repo "../../LocalRepositories/GIT")
+
+  # Unzip/untar the git repository in our source folder so that other
+  # projects below may use it to test git args of ExternalProject_Add
+  #
+  set(proj SetupLocalGITRepository)
+  ExternalProject_Add(${proj}
+    SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/LocalRepositories/GIT
+    URL ${CMAKE_CURRENT_SOURCE_DIR}/gitrepo.tgz
+    BUILD_COMMAND ""
+    CONFIGURE_COMMAND "${GIT_EXECUTABLE}" --version
+    INSTALL_COMMAND ""
+  )
+  set_property(TARGET ${proj}
+    PROPERTY FOLDER "SetupRepos/Local/Deeply/Nested/For/Testing")
+
+  set(proj TutorialStep1-GIT)
+  ExternalProject_Add(${proj}
+    GIT_REPOSITORY "${local_git_repo}"
+    GIT_TAG ${TEST_GIT_TAG}
+    CMAKE_GENERATOR "${CMAKE_GENERATOR}"
+    CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+    INSTALL_COMMAND ""
+    DEPENDS "SetupLocalGITRepository"
+  )
+  set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
+endif()
+
+
+# Test the testable built/installed products:
+#
+enable_testing()
+
+
+# Do at least a smoke test of a built executable from each
+# project's build directory...
+#
+# BuildTree tests:
+#
+
+if(do_git_tests)
+  add_test(TutorialStep1-GIT
+    "${binary_base}/TutorialStep1-GIT/Tutorial" 81)
+endif()
+
+message(STATUS "do_git_tests='${do_git_tests}'")
+message(STATUS "GIT_EXECUTABLE='${GIT_EXECUTABLE}'")
diff --git a/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake b/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake
new file mode 100644
index 0000000..fed40ef
--- /dev/null
+++ b/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake
@@ -0,0 +1,58 @@
+# Set the ExternalProject GIT_TAG to desired_tag, and make sure the
+# resulting checked out version is resulting_sha and a rebuild.
+# This check's the viability of the ExternalProject UPDATE_COMMAND.
+macro(check_a_tag desired_tag resulting_sha)
+  # Configure
+  execute_process(COMMAND ${CMAKE_COMMAND}
+    -G ${CMAKE_TEST_GENERATOR}
+    -DTEST_GIT_TAG:STRING=${desired_tag}
+    ${ExternalProjectUpdate_SOURCE_DIR}
+    WORKING_DIRECTORY ${ExternalProjectUpdate_BINARY_DIR}
+    RESULT_VARIABLE error_code
+    )
+  if(error_code)
+    message(FATAL_ERROR "Could not configure the project.")
+  endif()
+
+  # Build
+  execute_process(COMMAND ${CMAKE_COMMAND}
+    --build ${ExternalProjectUpdate_BINARY_DIR}
+    RESULT_VARIABLE error_code
+    )
+  if(error_code)
+    message(FATAL_ERROR "Could not build the project.")
+  endif()
+
+  # Check the resulting SHA
+  execute_process(COMMAND ${GIT_EXECUTABLE}
+    rev-list --max-count=1 HEAD
+    WORKING_DIRECTORY ${ExternalProjectUpdate_BINARY_DIR}/CMakeExternals/Source/TutorialStep1-GIT
+    RESULT_VARIABLE error_code
+    OUTPUT_VARIABLE tag_sha
+    )
+  if(error_code)
+    message(FATAL_ERROR "Could not check the sha.")
+  endif()
+
+  string(STRIP "${tag_sha}" tag_sha)
+  if(NOT (${tag_sha} STREQUAL ${resulting_sha}))
+    message(FATAL_ERROR "UPDATE_COMMAND produced
+  ${tag_sha}
+when
+  ${resulting_sha}
+was expected."
+    )
+  endif()
+endmacro()
+
+find_package(Git)
+if(GIT_EXECUTABLE)
+  check_a_tag(origin/master 5842b503ba4113976d9bb28d57b5aee1ad2736b7)
+  check_a_tag(tag1          d1970730310fe8bc07e73f15dc570071f9f9654a)
+  # With the Git UPDATE_COMMAND performance patch, this will not required a
+  # 'git fetch'
+  check_a_tag(tag1          d1970730310fe8bc07e73f15dc570071f9f9654a)
+  check_a_tag(tag2          5842b503ba4113976d9bb28d57b5aee1ad2736b7)
+  check_a_tag(d19707303     d1970730310fe8bc07e73f15dc570071f9f9654a)
+  check_a_tag(origin/master 5842b503ba4113976d9bb28d57b5aee1ad2736b7)
+endif()
diff --git a/Tests/ExternalProjectUpdate/gitrepo.tgz b/Tests/ExternalProjectUpdate/gitrepo.tgz
new file mode 100644
index 0000000..87090ab
Binary files /dev/null and b/Tests/ExternalProjectUpdate/gitrepo.tgz differ

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list