[Cmake-commits] CMake branch, next, updated. v2.8.12-4695-gd679c25

Brad King brad.king at kitware.com
Thu Oct 31 10:04:19 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  d679c25782d3173e9660d0c46fb603db4ed8d9b6 (commit)
       via  d184a9f3ca50dc54e26a781701a8721b5d7251b9 (commit)
      from  c86980ff60530f9ab399a77ff10a8f7f2d7c6bef (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=d679c25782d3173e9660d0c46fb603db4ed8d9b6
commit d679c25782d3173e9660d0c46fb603db4ed8d9b6
Merge: c86980f d184a9f
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Oct 31 10:04:17 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Oct 31 10:04:17 2013 -0400

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


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d184a9f3ca50dc54e26a781701a8721b5d7251b9
commit d184a9f3ca50dc54e26a781701a8721b5d7251b9
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Oct 29 10:40:09 2013 +0100
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Oct 31 10:03:32 2013 -0400

    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.
    Add a CMAKE_FIND_NO_INSTALL_PREFIX variable that can be set to
    searching the install prefix.

diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index 22a1c4d..157c38d 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -88,6 +88,7 @@ Variables that Change Behavior
    /variable/CMAKE_FIND_LIBRARY_PREFIXES
    /variable/CMAKE_FIND_LIBRARY_SUFFIXES
    /variable/CMAKE_FIND_PACKAGE_WARN_NO_MODULE
+   /variable/CMAKE_FIND_NO_INSTALL_PREFIX
    /variable/CMAKE_IGNORE_PATH
    /variable/CMAKE_INCLUDE_PATH
    /variable/CMAKE_INSTALL_DEFAULT_COMPONENT_NAME
diff --git a/Help/variable/CMAKE_FIND_NO_INSTALL_PREFIX.rst b/Help/variable/CMAKE_FIND_NO_INSTALL_PREFIX.rst
new file mode 100644
index 0000000..91231b0
--- /dev/null
+++ b/Help/variable/CMAKE_FIND_NO_INSTALL_PREFIX.rst
@@ -0,0 +1,13 @@
+CMAKE_FIND_NO_INSTALL_PREFIX
+----------------------------
+
+Ignore the :variable:`CMAKE_INSTALL_PREFIX` when searching for assets.
+
+CMake adds the :variable:`CMAKE_INSTALL_PREFIX` to the
+:variable:`CMAKE_SYSTEM_PREFIX_PATH` by default. This variable may be set
+on the command line to control that behavior.
+
+Set :variable:`CMAKE_FIND_NO_INSTALL_PREFIX` to TRUE to tell find_package not
+to search in the :variable:`CMAKE_INSTALL_PREFIX` by default.  Note that the
+prefix may still be searched for other reasons, such as being the same prefix
+as the CMake installation, or for being a built-in system prefix.
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..c231495 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)
@@ -88,8 +90,12 @@ list(APPEND CMAKE_SYSTEM_INCLUDE_PATH
   )
 
 # mingw can also link against dlls which can also be in /bin, so list this too
+if (NOT CMAKE_FIND_NO_INSTALL_PREFIX)
+  list(APPEND CMAKE_SYSTEM_LIBRARY_PATH
+    "${CMAKE_INSTALL_PREFIX}/bin"
+  )
+endif()
 list(APPEND CMAKE_SYSTEM_LIBRARY_PATH
-  "${CMAKE_INSTALL_PREFIX}/bin"
   "${_CMAKE_INSTALL_DIR}/bin"
   /bin
   )
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..2923449
--- /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:PATH=${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:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list