[Cmake-commits] CMake branch, next, updated. v3.2.2-2716-ge446de7

Brad King brad.king at kitware.com
Thu May 14 10:18:44 EDT 2015


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  e446de702c6c4585b387f5127c299092826fad34 (commit)
       via  d430cb7c36e7739a70da7897465badba62be7989 (commit)
       via  332ee3e305f017a2991b2ae348644141d1539f61 (commit)
      from  85333e13fc6b2089d9540069d1a9f4bf216f6894 (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=e446de702c6c4585b387f5127c299092826fad34
commit e446de702c6c4585b387f5127c299092826fad34
Merge: 85333e1 d430cb7
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu May 14 10:18:43 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu May 14 10:18:43 2015 -0400

    Merge topic 'fix-tests-in-usr-local' into next
    
    d430cb7c Tests: Fix failures when running under the default install prefix (#15566)
    332ee3e3 Tests: Fix CheckSourceTree test when build is under source (#15566)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d430cb7c36e7739a70da7897465badba62be7989
commit d430cb7c36e7739a70da7897465badba62be7989
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu May 14 09:51:48 2015 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu May 14 10:07:37 2015 -0400

    Tests: Fix failures when running under the default install prefix (#15566)
    
    Fix test cases whose behavior differs when their source or build tree is
    under CMAKE_INSTALL_PREFIX by setting an install prefix under the build
    tree.  Otherwise they may fail when run under the default install prefix
    (e.g. /usr/local).

diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt
index 8fafa3b..fadd0fe 100644
--- a/Tests/FindPackageTest/CMakeLists.txt
+++ b/Tests/FindPackageTest/CMakeLists.txt
@@ -1,6 +1,9 @@
 cmake_minimum_required (VERSION 2.6)
 project(FindPackageTest)
 
+# Protect tests from running inside the default install prefix.
+set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/NotDefaultPrefix")
+
 list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
 
 # Look for a package which uses FindPackageHandleStandardArgs.cmake with the
diff --git a/Tests/RunCMake/CMP0041/RunCMakeTest.cmake b/Tests/RunCMake/CMP0041/RunCMakeTest.cmake
index a5e2114..e7f27a1 100644
--- a/Tests/RunCMake/CMP0041/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMP0041/RunCMakeTest.cmake
@@ -1,5 +1,8 @@
 include(RunCMake)
 
+# Protect tests from running inside the default install prefix.
+set(RunCMake_TEST_OPTIONS "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/NotDefaultPrefix")
+
 run_cmake(CMP0041-OLD)
 run_cmake(CMP0041-NEW)
 run_cmake(CMP0041-WARN)
diff --git a/Tests/RunCMake/IfacePaths/RunCMakeTest.cmake b/Tests/RunCMake/IfacePaths/RunCMakeTest.cmake
index 489e3df..066c83e 100644
--- a/Tests/RunCMake/IfacePaths/RunCMakeTest.cmake
+++ b/Tests/RunCMake/IfacePaths/RunCMakeTest.cmake
@@ -6,6 +6,9 @@ macro(run_cmake test)
   _run_cmake(${test})
 endmacro()
 
+# Protect tests from running inside the default install prefix.
+set(RunCMake_TEST_OPTIONS "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/NotDefaultPrefix")
+
 run_cmake(RelativePathInInterface)
 run_cmake(RelativePathInGenex)
 run_cmake(export-NOWARN)
diff --git a/Tests/RunCMake/include_directories/RunCMakeTest.cmake b/Tests/RunCMake/include_directories/RunCMakeTest.cmake
index 3f624f8..54d5e97 100644
--- a/Tests/RunCMake/include_directories/RunCMakeTest.cmake
+++ b/Tests/RunCMake/include_directories/RunCMakeTest.cmake
@@ -1,5 +1,8 @@
 include(RunCMake)
 
+# Protect tests from running inside the default install prefix.
+set(RunCMake_TEST_OPTIONS "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/NotDefaultPrefix")
+
 run_cmake(NotFoundContent)
 run_cmake(DebugIncludes)
 run_cmake(TID-bad-target)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=332ee3e305f017a2991b2ae348644141d1539f61
commit 332ee3e305f017a2991b2ae348644141d1539f61
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu May 14 09:50:34 2015 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu May 14 09:50:34 2015 -0400

    Tests: Fix CheckSourceTree test when build is under source (#15566)
    
    Since the build tree will populate content under the source tree
    the test cannot reliably check that the source tree is pristine.
    Simply skip most of the test in this case.

diff --git a/Tests/CMakeTests/CheckSourceTreeTest.cmake.in b/Tests/CMakeTests/CheckSourceTreeTest.cmake.in
index 33fe5f3..8145db7 100644
--- a/Tests/CMakeTests/CheckSourceTreeTest.cmake.in
+++ b/Tests/CMakeTests/CheckSourceTreeTest.cmake.in
@@ -16,8 +16,13 @@ string(REPLACE "\\" "\\\\" HOME "${HOME}")
 # (i.e. - is it an "in source" build?)
 #
 set(in_source_build 0)
+set(build_under_source 0)
 
-if(CMake_SOURCE_DIR STREQUAL "${CMake_BINARY_DIR}")
+string(FIND "${CMake_BINARY_DIR}" "${CMake_SOURCE_DIR}/" pos)
+if(pos EQUAL 0)
+  message("build dir is *inside* source dir")
+  set(build_under_source 1)
+elseif(CMake_SOURCE_DIR STREQUAL "${CMake_BINARY_DIR}")
   message("build dir *is* source dir")
   set(in_source_build 1)
 else()
@@ -39,8 +44,13 @@ message("bin_len='${bin_len}'")
 message("substr_len='${substr_len}'")
 message("bin_dir='${bin_dir}'")
 message("in_source_build='${in_source_build}'")
+message("build_under_source='${build_under_source}'")
 message("")
 
+if(build_under_source)
+  message(STATUS "Skipping rest of test because build tree is under source tree")
+  return()
+endif()
 
 # If this does not appear to be a git checkout, just pass the test here
 # and now. (Do not let the test fail if it is run in a tree *exported* from a

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

Summary of changes:
 Tests/CMakeTests/CheckSourceTreeTest.cmake.in         |   12 +++++++++++-
 Tests/FindPackageTest/CMakeLists.txt                  |    3 +++
 Tests/RunCMake/CMP0041/RunCMakeTest.cmake             |    3 +++
 Tests/RunCMake/IfacePaths/RunCMakeTest.cmake          |    3 +++
 Tests/RunCMake/include_directories/RunCMakeTest.cmake |    3 +++
 5 files changed, 23 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list