diff options
author | Brad King <brad.king@kitware.com> | 2011-01-11 15:52:13 -0500 |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2011-01-11 15:52:13 -0500 |
commit | 764015c2840b1059093e8af86dcbf96e048d2dfa (patch) | |
tree | 47e3cb60b5516bb320182fb3a5229985690c853e /Tests | |
parent | d4ed72e3bb4d3ca85750c21eae21a0273207e0dc (diff) | |
parent | ce28737c933a749cbc84c601f3ac9f56e4c832aa (diff) | |
download | cmake-764015c2840b1059093e8af86dcbf96e048d2dfa.tar.gz |
Merge topic 'policy-CMP0017'
ce28737 Remove usage of CMAKE_CURRENT_LIST_DIR now that we have CMP0017
7db8db5 Improve documentation and messages for the new CMP0017
db44848 Prefer files from CMAKE_ROOT when including from CMAKE_ROOT
1e69c6f Merge branch 'user-policy-defaults' into policy-CMP0017
65a0a2a Merge branch 'include-command-whitespace' into policy-CMP0017
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/FindPackageTest/CMakeLists.txt | 10 | ||||
-rw-r--r-- | Tests/FindPackageTest/FindPackageHandleStandardArgs.cmake | 1 |
2 files changed, 10 insertions, 1 deletions
diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt index a472beab66..f420f4bd52 100644 --- a/Tests/FindPackageTest/CMakeLists.txt +++ b/Tests/FindPackageTest/CMakeLists.txt @@ -1,6 +1,15 @@ cmake_minimum_required (VERSION 2.6) PROJECT(FindPackageTest) +LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) + +# Look for a package which uses FindPackageHandleStandardArgs.cmake with the +# new (as of cmake 2.8.3) syntax. This works only if CMP0017 is set to NEW, +# because otherwise FindPackageHandleStandardArgs.cmake from the current +# directory is included (via CMAKE_MODULE_PATH). +CMAKE_POLICY(SET CMP0017 NEW) +FIND_PACKAGE(ZLIB QUIET) + # Look for a package that has a find module and may be found. FIND_PACKAGE(OpenGL QUIET) @@ -23,7 +32,6 @@ IF(NOT FOO_DIR) CMAKE_PREFIX_PATH = ${CMAKE_PREFIX_PATH}") ENDIF(NOT FOO_DIR) -LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) FIND_PACKAGE(VersionTestA 1) FIND_PACKAGE(VersionTestB 1.2) FIND_PACKAGE(VersionTestC 1.2.3) diff --git a/Tests/FindPackageTest/FindPackageHandleStandardArgs.cmake b/Tests/FindPackageTest/FindPackageHandleStandardArgs.cmake new file mode 100644 index 0000000000..7e41c96c9f --- /dev/null +++ b/Tests/FindPackageTest/FindPackageHandleStandardArgs.cmake @@ -0,0 +1 @@ +message(FATAL_ERROR "This file (${CMAKE_CURRENT_LIST_FILE}) must not be included, but FindPackageHandleStandardArgs.cmake from Modules/ instead !") |