[Cmake-commits] CMake branch, next, updated. v2.8.12-4614-gc09cd03

Stephen Kelly steveire at gmail.com
Tue Oct 29 06:06:24 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  c09cd0394e5c009f5ac9b6849747dabde8e7a1ee (commit)
       via  c64945d6606a94b61480a0190ca2a363ecc2fbc7 (commit)
      from  5d9b1c73fdb9da9be8dc67db9432c59b623396d9 (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=c09cd0394e5c009f5ac9b6849747dabde8e7a1ee
commit c09cd0394e5c009f5ac9b6849747dabde8e7a1ee
Merge: 5d9b1c7 c64945d
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Oct 29 06:06:21 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Oct 29 06:06:21 2013 -0400

    Merge topic 'add-CMAKE_FIND_NO_INSTALL_PREFIX' into next
    
    c64945d Allow disabling adding the install prefix to the prefix search path.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c64945d6606a94b61480a0190ca2a363ecc2fbc7
commit c64945d6606a94b61480a0190ca2a363ecc2fbc7
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Oct 29 10:40:09 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Oct 29 11:04:35 2013 +0100

    Allow disabling adding the install prefix to the prefix search path.
    
    In certain scenarios, it is preferable to keep a 'dirty' install prefix
    than to clear it, and to expect that content will not be found there.

diff --git a/Modules/Platform/UnixPaths.cmake b/Modules/Platform/UnixPaths.cmake
index ccb2663..7a424c4 100644
--- a/Modules/Platform/UnixPaths.cmake
+++ b/Modules/Platform/UnixPaths.cmake
@@ -37,10 +37,13 @@ list(APPEND CMAKE_SYSTEM_PREFIX_PATH
 
   # CMake install location
   "${_CMAKE_INSTALL_DIR}"
-
-  # Project install destination.
-  "${CMAKE_INSTALL_PREFIX}"
   )
+if (NOT CMAKE_FIND_NO_INSTALL_PREFIX)
+  list(APPEND CMAKE_SYSTEM_PREFIX_PATH
+    # Project install destination.
+    "${CMAKE_INSTALL_PREFIX}"
+  )
+endif()
 
 # List common include file locations not under the common prefixes.
 list(APPEND CMAKE_SYSTEM_INCLUDE_PATH
diff --git a/Modules/Platform/WindowsPaths.cmake b/Modules/Platform/WindowsPaths.cmake
index fc921d7..e08bb37 100644
--- a/Modules/Platform/WindowsPaths.cmake
+++ b/Modules/Platform/WindowsPaths.cmake
@@ -73,11 +73,13 @@ get_filename_component(_CMAKE_INSTALL_DIR "${CMAKE_ROOT}" PATH)
 get_filename_component(_CMAKE_INSTALL_DIR "${_CMAKE_INSTALL_DIR}" PATH)
 list(APPEND CMAKE_SYSTEM_PREFIX_PATH "${_CMAKE_INSTALL_DIR}")
 
-# Add other locations.
-list(APPEND CMAKE_SYSTEM_PREFIX_PATH
-  # Project install destination.
-  "${CMAKE_INSTALL_PREFIX}"
-  )
+if (NOT CMAKE_FIND_NO_INSTALL_PREFIX)
+  # Add other locations.
+  list(APPEND CMAKE_SYSTEM_PREFIX_PATH
+    # Project install destination.
+    "${CMAKE_INSTALL_PREFIX}"
+    )
+endif()
 
 if(CMAKE_CROSSCOMPILING AND NOT CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")
   # MinGW (useful when cross compiling from linux with CMAKE_FIND_ROOT_PATH set)
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 97bf14d..99a0fb3 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -109,6 +109,7 @@ add_RunCMake_test(CMP0004)
 add_RunCMake_test(TargetPolicies)
 add_RunCMake_test(alias_targets)
 add_RunCMake_test(interface_library)
+add_RunCMake_test(no_install_prefix)
 
 find_package(Qt4 QUIET)
 find_package(Qt5Core QUIET)
diff --git a/Tests/RunCMake/no_install_prefix/CMakeLists.txt b/Tests/RunCMake/no_install_prefix/CMakeLists.txt
new file mode 100644
index 0000000..12cd3c7
--- /dev/null
+++ b/Tests/RunCMake/no_install_prefix/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.4)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/no_install_prefix/RunCMakeTest.cmake b/Tests/RunCMake/no_install_prefix/RunCMakeTest.cmake
new file mode 100644
index 0000000..e7b7e16
--- /dev/null
+++ b/Tests/RunCMake/no_install_prefix/RunCMakeTest.cmake
@@ -0,0 +1,15 @@
+include(RunCMake)
+
+set(RunCMake_TEST_OPTIONS "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/prefix")
+
+file(REMOVE_RECURSE "${RunCMake_BINARY_DIR}/prefix")
+file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/prefix/NoPrefix")
+file(WRITE "${RunCMake_BINARY_DIR}/prefix/NoPrefix/NoPrefixConfig.cmake" "")
+set(RunCMake_TEST_OPTIONS "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/prefix")
+run_cmake(with_install_prefix)
+
+file(REMOVE_RECURSE "${RunCMake_BINARY_DIR}/prefix")
+file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/prefix/NoPrefix")
+file(WRITE "${RunCMake_BINARY_DIR}/prefix/NoPrefix/NoPrefixConfig.cmake" "")
+list(APPEND RunCMake_TEST_OPTIONS "-DCMAKE_FIND_NO_INSTALL_PREFIX=1")
+run_cmake(no_install_prefix)
diff --git a/Tests/RunCMake/no_install_prefix/do_test.cmake b/Tests/RunCMake/no_install_prefix/do_test.cmake
new file mode 100644
index 0000000..340c7dc
--- /dev/null
+++ b/Tests/RunCMake/no_install_prefix/do_test.cmake
@@ -0,0 +1,2 @@
+
+find_package(NoPrefix REQUIRED)
diff --git a/Tests/RunCMake/no_install_prefix/no_install_prefix-result.txt b/Tests/RunCMake/no_install_prefix/no_install_prefix-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/no_install_prefix/no_install_prefix-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/no_install_prefix/no_install_prefix-stderr.txt b/Tests/RunCMake/no_install_prefix/no_install_prefix-stderr.txt
new file mode 100644
index 0000000..66c6241
--- /dev/null
+++ b/Tests/RunCMake/no_install_prefix/no_install_prefix-stderr.txt
@@ -0,0 +1,18 @@
+CMake Error at do_test.cmake:2 \(find_package\):
+  By not providing "FindNoPrefix.cmake" in CMAKE_MODULE_PATH this project has
+  asked CMake to find a package configuration file provided by "NoPrefix",
+  but CMake did not find one.
+
+  Could not find a package configuration file provided by "NoPrefix" with any
+  of the following names:
+
+    NoPrefixConfig.cmake
+    noprefix-config.cmake
+
+  Add the installation prefix of "NoPrefix" to CMAKE_PREFIX_PATH or set
+  "NoPrefix_DIR" to a directory containing one of the above files.  If
+  "NoPrefix" provides a separate development package or SDK, be sure it has
+  been installed.
+Call Stack \(most recent call first\):
+  no_install_prefix.cmake:2 \(include\)
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/no_install_prefix/no_install_prefix.cmake b/Tests/RunCMake/no_install_prefix/no_install_prefix.cmake
new file mode 100644
index 0000000..c7d28da
--- /dev/null
+++ b/Tests/RunCMake/no_install_prefix/no_install_prefix.cmake
@@ -0,0 +1,2 @@
+
+include(do_test.cmake)
diff --git a/Tests/RunCMake/no_install_prefix/with_install_prefix-result.txt b/Tests/RunCMake/no_install_prefix/with_install_prefix-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/no_install_prefix/with_install_prefix-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/no_install_prefix/with_install_prefix-stderr.txt b/Tests/RunCMake/no_install_prefix/with_install_prefix-stderr.txt
new file mode 100644
index 0000000..10f3293
--- /dev/null
+++ b/Tests/RunCMake/no_install_prefix/with_install_prefix-stderr.txt
@@ -0,0 +1 @@
+^$
diff --git a/Tests/RunCMake/no_install_prefix/with_install_prefix.cmake b/Tests/RunCMake/no_install_prefix/with_install_prefix.cmake
new file mode 100644
index 0000000..c7d28da
--- /dev/null
+++ b/Tests/RunCMake/no_install_prefix/with_install_prefix.cmake
@@ -0,0 +1,2 @@
+
+include(do_test.cmake)

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

Summary of changes:
 Modules/Platform/UnixPaths.cmake                   |    9 ++++++---
 Modules/Platform/WindowsPaths.cmake                |   12 +++++++-----
 Tests/RunCMake/CMakeLists.txt                      |    1 +
 .../{CMP0004 => no_install_prefix}/CMakeLists.txt  |    0
 .../RunCMake/no_install_prefix/RunCMakeTest.cmake  |   15 +++++++++++++++
 Tests/RunCMake/no_install_prefix/do_test.cmake     |    2 ++
 .../no_install_prefix-result.txt}                  |    0
 .../no_install_prefix/no_install_prefix-stderr.txt |   18 ++++++++++++++++++
 .../no_install_prefix/no_install_prefix.cmake      |    2 ++
 .../with_install_prefix-result.txt}                |    0
 .../with_install_prefix-stderr.txt}                |    0
 .../no_install_prefix/with_install_prefix.cmake    |    2 ++
 12 files changed, 53 insertions(+), 8 deletions(-)
 copy Tests/RunCMake/{CMP0004 => no_install_prefix}/CMakeLists.txt (100%)
 create mode 100644 Tests/RunCMake/no_install_prefix/RunCMakeTest.cmake
 create mode 100644 Tests/RunCMake/no_install_prefix/do_test.cmake
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => no_install_prefix/no_install_prefix-result.txt} (100%)
 create mode 100644 Tests/RunCMake/no_install_prefix/no_install_prefix-stderr.txt
 create mode 100644 Tests/RunCMake/no_install_prefix/no_install_prefix.cmake
 copy Tests/RunCMake/{CMP0022/CMP0022-WARN-empty-old-result.txt => no_install_prefix/with_install_prefix-result.txt} (100%)
 copy Tests/RunCMake/{CMP0022/CMP0022-NOWARN-static-link_libraries-stderr.txt => no_install_prefix/with_install_prefix-stderr.txt} (100%)
 create mode 100644 Tests/RunCMake/no_install_prefix/with_install_prefix.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list