diff options
author | Kitware Robot <kwrobot@kitware.com> | 2012-08-13 17:47:32 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-08-13 18:19:16 (GMT) |
commit | 77543bde41b0e52c3959016698b529835945d62d (patch) | |
tree | ff63e5fbec326c4a5d821e7496c6d2cb52f75b92 /Tests/FindPackageTest | |
parent | 7bbaa4283de26864b2e55e819db0884771585467 (diff) | |
download | CMake-77543bde41b0e52c3959016698b529835945d62d.zip CMake-77543bde41b0e52c3959016698b529835945d62d.tar.gz CMake-77543bde41b0e52c3959016698b529835945d62d.tar.bz2 |
Convert CMake-language commands to lower case
Ancient CMake versions required upper-case commands. Later command
names became case-insensitive. Now the preferred style is lower-case.
Run the following shell code:
cmake --help-command-list |
grep -v "cmake version" |
while read c; do
echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed
Diffstat (limited to 'Tests/FindPackageTest')
22 files changed, 344 insertions, 344 deletions
diff --git a/Tests/FindPackageTest/Baz 1.1/BazConfigVersion.cmake b/Tests/FindPackageTest/Baz 1.1/BazConfigVersion.cmake index 321fa11..61db416 100644 --- a/Tests/FindPackageTest/Baz 1.1/BazConfigVersion.cmake +++ b/Tests/FindPackageTest/Baz 1.1/BazConfigVersion.cmake @@ -1,8 +1,8 @@ -SET(PACKAGE_VERSION 1.1) -IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) - SET(PACKAGE_VERSION_COMPATIBLE 1) - IF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) - SET(PACKAGE_VERSION_EXACT 1) - ENDIF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) -ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) +set(PACKAGE_VERSION 1.1) +if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) + set(PACKAGE_VERSION_COMPATIBLE 1) + if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) + set(PACKAGE_VERSION_EXACT 1) + endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) +endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) diff --git a/Tests/FindPackageTest/Baz 1.2/CMake/BazConfigVersion.cmake b/Tests/FindPackageTest/Baz 1.2/CMake/BazConfigVersion.cmake index 4576809..e0042d5 100644 --- a/Tests/FindPackageTest/Baz 1.2/CMake/BazConfigVersion.cmake +++ b/Tests/FindPackageTest/Baz 1.2/CMake/BazConfigVersion.cmake @@ -1,8 +1,8 @@ -SET(PACKAGE_VERSION 1.2) -IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) - SET(PACKAGE_VERSION_COMPATIBLE 1) - IF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2) - SET(PACKAGE_VERSION_EXACT 1) - ENDIF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2) -ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) +set(PACKAGE_VERSION 1.2) +if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) + set(PACKAGE_VERSION_COMPATIBLE 1) + if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2) + set(PACKAGE_VERSION_EXACT 1) + endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2) +endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt index e85fb4d..d344649 100644 --- a/Tests/FindPackageTest/CMakeLists.txt +++ b/Tests/FindPackageTest/CMakeLists.txt @@ -1,86 +1,86 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(FindPackageTest) +project(FindPackageTest) -LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) +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) +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) +find_package(OpenGL QUIET) # Look for a package that has no find module and will not be found. -FIND_PACKAGE(NotAPackage QUIET) +find_package(NotAPackage QUIET) # Look for a package that has an advanced find module. -FIND_PACKAGE(VTK QUIET) +find_package(VTK QUIET) -ADD_EXECUTABLE(FindPackageTest FindPackageTest.cxx) +add_executable(FindPackageTest FindPackageTest.cxx) # test behaviour of cmFindBase wrt. the CMAKE_PREFIX_PATH variable # foo.h should be found in ${CMAKE_CURRENT_SOURCE_DIR}/include: -SET(CMAKE_PREFIX_PATH /blub /blah "${CMAKE_CURRENT_SOURCE_DIR}") -FIND_PATH(FOO_DIR foo.h) +set(CMAKE_PREFIX_PATH /blub /blah "${CMAKE_CURRENT_SOURCE_DIR}") +find_path(FOO_DIR foo.h) -IF(NOT FOO_DIR) - MESSAGE(FATAL_ERROR "Did not find foo.h which is in ${CMAKE_CURRENT_SOURCE_DIR}/include +if(NOT FOO_DIR) + message(FATAL_ERROR "Did not find foo.h which is in ${CMAKE_CURRENT_SOURCE_DIR}/include CMAKE_PREFIX_PATH = ${CMAKE_PREFIX_PATH}") -ENDIF(NOT FOO_DIR) +endif(NOT FOO_DIR) -FIND_PACKAGE(VersionTestA 1) -FIND_PACKAGE(VersionTestB 1.2) -FIND_PACKAGE(VersionTestC 1.2.3) -FIND_PACKAGE(VersionTestD 1.2.3.4) +find_package(VersionTestA 1) +find_package(VersionTestB 1.2) +find_package(VersionTestC 1.2.3) +find_package(VersionTestD 1.2.3.4) -FIND_PACKAGE(LotsOfComponents COMPONENTS AComp OPTIONAL_COMPONENTS BComp CComp) -IF(NOT LOTSOFCOMPONENTS_FOUND) - MESSAGE(SEND_ERROR "LotsOfComponents not found !") -ENDIF() +find_package(LotsOfComponents COMPONENTS AComp OPTIONAL_COMPONENTS BComp CComp) +if(NOT LOTSOFCOMPONENTS_FOUND) + message(SEND_ERROR "LotsOfComponents not found !") +endif() #----------------------------------------------------------------------------- # Test system package registry if possible. -SET(CMakeTestSystemPackage "") -IF(WIN32 AND NOT CYGWIN) +set(CMakeTestSystemPackage "") +if(WIN32 AND NOT CYGWIN) # Try writing a value to the system package registry. - SET(_data "${FindPackageTest_SOURCE_DIR}/SystemPackage") - SET(_key "HKLM\\Software\\Kitware\\CMake\\Packages\\CMakeTestSystemPackage") - SET(_file "${FindPackageTest_BINARY_DIR}/CMakeTestSystemPackage.data") - FILE(WRITE ${_file} "${_data}\n") - EXECUTE_PROCESS( + set(_data "${FindPackageTest_SOURCE_DIR}/SystemPackage") + set(_key "HKLM\\Software\\Kitware\\CMake\\Packages\\CMakeTestSystemPackage") + set(_file "${FindPackageTest_BINARY_DIR}/CMakeTestSystemPackage.data") + file(WRITE ${_file} "${_data}\n") + execute_process( COMMAND ${CMAKE_COMMAND} -E md5sum ${_file} OUTPUT_VARIABLE _output ERROR_VARIABLE _error RESULT_VARIABLE _failed OUTPUT_STRIP_TRAILING_WHITESPACE ) - STRING(REGEX REPLACE " .*" "" _value "${_output}") - IF(NOT _failed AND _value) - EXECUTE_PROCESS( + string(REGEX REPLACE " .*" "" _value "${_output}") + if(NOT _failed AND _value) + execute_process( COMMAND reg add "${_key}" /v "${_value}" /t REG_SZ /d "${_data}" /f OUTPUT_VARIABLE _output ERROR_VARIABLE _output RESULT_VARIABLE _failed ) - ENDIF() + endif() # If the above worked, add the rest of the test and a rule to # cleanup the value. - IF(NOT _failed) - MESSAGE(STATUS "HKLM is writable: enabling CMakeTestSystemPackage") - SET(CMakeTestSystemPackage_CLEANUP reg delete "${_key}" /v "${_value}" /f) - SET(CMakeTestSystemPackage CMakeTestSystemPackage) - ELSE() - MESSAGE(STATUS "HKLM is readonly: disabling CMakeTestSystemPackage") - ENDIF() -ENDIF() + if(NOT _failed) + message(STATUS "HKLM is writable: enabling CMakeTestSystemPackage") + set(CMakeTestSystemPackage_CLEANUP reg delete "${_key}" /v "${_value}" /f) + set(CMakeTestSystemPackage CMakeTestSystemPackage) + else() + message(STATUS "HKLM is readonly: disabling CMakeTestSystemPackage") + endif() +endif() #----------------------------------------------------------------------------- -#SET(CMAKE_FIND_DEBUG_MODE 1) +#set(CMAKE_FIND_DEBUG_MODE 1) # For purposes of the test wipe out previous find results. -SET(PACKAGES +set(PACKAGES foo Foo Bar Blub TFramework Tframework TApp Tapp Special VersionedA VersionedB VersionedC VersionedD VersionedE WrongA WrongB WrongC WrongD @@ -91,14 +91,14 @@ SET(PACKAGES SetFoundTRUE SetFoundFALSE ${CMakeTestSystemPackage} ) -FOREACH(p ${PACKAGES}) - SET(${p}_DIR "" CACHE FILEPATH "Wipe out find results for testing." FORCE) -ENDFOREACH(p) +foreach(p ${PACKAGES}) + set(${p}_DIR "" CACHE FILEPATH "Wipe out find results for testing." FORCE) +endforeach(p) # Enable framework and bundle searching. Make sure bundles are found # before unix-syle packages. -SET(CMAKE_FIND_FRAMEWORK LAST) -SET(CMAKE_FIND_APPBUNDLE FIRST) +set(CMAKE_FIND_FRAMEWORK LAST) +set(CMAKE_FIND_APPBUNDLE FIRST) # Set the wrong answer for a find to make sure it re-finds. set(VersionedA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/cmake/zot-4.0) @@ -108,219 +108,219 @@ set(VersionedA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/cmake/zot-4.0) set(CMAKE_IGNORE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib/cmake/zot-3.1) # Look for packages with new-style signatures. -FIND_PACKAGE(foo NO_MODULE) -FIND_PACKAGE(Foo CONFIGS FooConfig.cmake) -FIND_PACKAGE(Bar) -SET(CMAKE_DISABLE_FIND_PACKAGE_Blub TRUE) -FIND_PACKAGE(Blub NO_MODULE) -FIND_PACKAGE(TFramework CONFIGS TFrameworkConfig.cmake) -FIND_PACKAGE(Tframework) -FIND_PACKAGE(TApp) -FIND_PACKAGE(Tapp CONFIGS tapp-config.cmake) -FIND_PACKAGE(Special NAMES Suffix SuffixTest PATH_SUFFIXES test) -FIND_PACKAGE(VersionedA 2 NAMES zot) -FIND_PACKAGE(VersionedB 3.1 EXACT NAMES zot) -FIND_PACKAGE(VersionedC 4.0 EXACT NAMES zot) -FIND_PACKAGE(VersionedD 1.1 EXACT NAMES Baz) -FIND_PACKAGE(VersionedE 1.2 EXACT NAMES Baz) +find_package(foo NO_MODULE) +find_package(Foo CONFIGS FooConfig.cmake) +find_package(Bar) +set(CMAKE_DISABLE_FIND_PACKAGE_Blub TRUE) +find_package(Blub NO_MODULE) +find_package(TFramework CONFIGS TFrameworkConfig.cmake) +find_package(Tframework) +find_package(TApp) +find_package(Tapp CONFIGS tapp-config.cmake) +find_package(Special NAMES Suffix SuffixTest PATH_SUFFIXES test) +find_package(VersionedA 2 NAMES zot) +find_package(VersionedB 3.1 EXACT NAMES zot) +find_package(VersionedC 4.0 EXACT NAMES zot) +find_package(VersionedD 1.1 EXACT NAMES Baz) +find_package(VersionedE 1.2 EXACT NAMES Baz) # Test Config files which set Xyz_FOUND themselves: -FIND_PACKAGE(SetFoundTRUE NO_MODULE) -FIND_PACKAGE(SetFoundFALSE NO_MODULE) +find_package(SetFoundTRUE NO_MODULE) +find_package(SetFoundFALSE NO_MODULE) # Test wrong initial path when result is present. -SET(WrongA_DIR "${VersionedD_DIR}") -FIND_PACKAGE(WrongA 1.2 EXACT NAMES Baz) +set(WrongA_DIR "${VersionedD_DIR}") +find_package(WrongA 1.2 EXACT NAMES Baz) # Test wrong initial cache entry of UNINITIALIZED type when result is present. -SET(WrongB_DIR "${VersionedD_DIR}" CACHE UNINITIALIZED "Wrong Value" FORCE) -GET_PROPERTY(type CACHE WrongB_DIR PROPERTY TYPE) -FIND_PACKAGE(WrongB 1.2 EXACT NAMES Baz) +set(WrongB_DIR "${VersionedD_DIR}" CACHE UNINITIALIZED "Wrong Value" FORCE) +get_property(type CACHE WrongB_DIR PROPERTY TYPE) +find_package(WrongB 1.2 EXACT NAMES Baz) # Test wrong initial path when result is missing. -SET(WrongC_DIR "${VersionedD_DIR}") -FIND_PACKAGE(WrongC 1.3 EXACT QUIET NAMES Baz) +set(WrongC_DIR "${VersionedD_DIR}") +find_package(WrongC 1.3 EXACT QUIET NAMES Baz) # Test wrong initial cache entry of UNINITIALIZED type when result is missing. -SET(WrongD_DIR "${VersionedD_DIR}" CACHE UNINITIALIZED "Wrong Value" FORCE) -GET_PROPERTY(type CACHE WrongD_DIR PROPERTY TYPE) -FIND_PACKAGE(WrongD 1.3 EXACT QUIET NAMES Baz) +set(WrongD_DIR "${VersionedD_DIR}" CACHE UNINITIALIZED "Wrong Value" FORCE) +get_property(type CACHE WrongD_DIR PROPERTY TYPE) +find_package(WrongD 1.3 EXACT QUIET NAMES Baz) # HINTS should override the system but PATHS should not -LIST(INSERT CMAKE_SYSTEM_PREFIX_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}/A") -FIND_PACKAGE(wibbleA NAMES wibble PATHS B) -FIND_PACKAGE(wibbleB NAMES wibble HINTS B) +list(INSERT CMAKE_SYSTEM_PREFIX_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}/A") +find_package(wibbleA NAMES wibble PATHS B) +find_package(wibbleB NAMES wibble HINTS B) # Look for package with recursive find-modules. -FIND_PACKAGE(RecursiveA COMPONENTS A) -FIND_PACKAGE(RecursiveB 2) -FIND_PACKAGE(RecursiveC 3.1 EXACT) +find_package(RecursiveA COMPONENTS A) +find_package(RecursiveB 2) +find_package(RecursiveC 3.1 EXACT) # Test architecture-specific search directories. -SET(CMAKE_LIBRARY_ARCHITECTURE arch) -FIND_PACKAGE(ArchA NAMES Bar) -FIND_PACKAGE(ArchB NAMES Foo CONFIGS FooConfig.cmake) -FIND_PACKAGE(ArchC 3.1 EXACT NAMES zot) -FIND_PACKAGE(ArchD 4.0 EXACT NAMES zot) -UNSET(CMAKE_LIBRARY_ARCHITECTURE) +set(CMAKE_LIBRARY_ARCHITECTURE arch) +find_package(ArchA NAMES Bar) +find_package(ArchB NAMES Foo CONFIGS FooConfig.cmake) +find_package(ArchC 3.1 EXACT NAMES zot) +find_package(ArchD 4.0 EXACT NAMES zot) +unset(CMAKE_LIBRARY_ARCHITECTURE) # Test <Package>_DIR environment variable. # We erase the main prefix path to ensure the env var is used. -SET(CMAKE_PREFIX_PATH) -SET(ENV{EnvA_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/lib/zot-3.1") -FIND_PACKAGE(EnvA 3.1 EXACT QUIET NAMES zot) # Should Work -FIND_PACKAGE(EnvB 3.1 EXACT QUIET NAMES zot) # Should Fail +set(CMAKE_PREFIX_PATH) +set(ENV{EnvA_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/lib/zot-3.1") +find_package(EnvA 3.1 EXACT QUIET NAMES zot) # Should Work +find_package(EnvB 3.1 EXACT QUIET NAMES zot) # Should Fail # Test system package registry if available. -IF(CMakeTestSystemPackage) - FIND_PACKAGE(CMakeTestSystemPackage) - EXECUTE_PROCESS(COMMAND ${CMakeTestSystemPackage_CLEANUP} +if(CMakeTestSystemPackage) + find_package(CMakeTestSystemPackage) + execute_process(COMMAND ${CMakeTestSystemPackage_CLEANUP} OUTPUT_VARIABLE _output ERROR_VARIABLE _error) -ENDIF() +endif() # Expected locations at which packages should be found. -SET(foo_EXPECTED "lib/foo-1.2/foo-config.cmake") -SET(Foo_EXPECTED "lib/foo-1.2/CMake/FooConfig.cmake") -SET(Bar_EXPECTED "lib/Bar/BarConfig.cmake") -SET(Blub_MISSING "") -SET(Special_EXPECTED "lib/suffix/test/SuffixTestConfig.cmake") -SET(TFramework_EXPECTED +set(foo_EXPECTED "lib/foo-1.2/foo-config.cmake") +set(Foo_EXPECTED "lib/foo-1.2/CMake/FooConfig.cmake") +set(Bar_EXPECTED "lib/Bar/BarConfig.cmake") +set(Blub_MISSING "") +set(Special_EXPECTED "lib/suffix/test/SuffixTestConfig.cmake") +set(TFramework_EXPECTED "TFramework.framework/Versions/A/Resources/CMake/TFrameworkConfig.cmake") -SET(Tframework_EXPECTED +set(Tframework_EXPECTED "TFramework.framework/Versions/A/Resources/tframework-config.cmake") -SET(TApp_EXPECTED +set(TApp_EXPECTED "TApp.app/Contents/Resources/TAppConfig.cmake") -SET(Tapp_EXPECTED +set(Tapp_EXPECTED "TApp.app/Contents/Resources/cmake/tapp-config.cmake") -SET(VersionedA_EXPECTED "lib/zot-2.0/zot-config.cmake") -SET(VersionedB_EXPECTED "lib/zot-3.1/zot-config.cmake") -SET(VersionedC_EXPECTED "lib/cmake/zot-4.0/zot-config.cmake") -SET(VersionedD_EXPECTED "Baz 1.1/BazConfig.cmake") -SET(VersionedE_EXPECTED "Baz 1.2/CMake/BazConfig.cmake") -SET(WrongA_EXPECTED "${VersionedE_EXPECTED}") -SET(WrongB_EXPECTED "${VersionedE_EXPECTED}") -SET(WrongC_MISSING "WrongC_DIR-NOTFOUND") -SET(WrongD_MISSING "WrongD_DIR-NOTFOUND") -SET(wibbleA_EXPECTED "A/wibble-config.cmake") -SET(wibbleB_EXPECTED "B/wibble-config.cmake") -SET(RecursiveA_EXPECTED "lib/RecursiveA/recursivea-config.cmake") -SET(RecursiveB_EXPECTED "lib/zot-2.0/zot-config.cmake") -SET(RecursiveC_EXPECTED "lib/zot-3.1/zot-config.cmake") -SET(ArchA_EXPECTED "lib/arch/Bar/BarConfig.cmake") -SET(ArchB_EXPECTED "lib/arch/foo-1.2/CMake/FooConfig.cmake") -SET(ArchC_EXPECTED "lib/arch/zot-3.1/zot-config.cmake") -SET(ArchD_EXPECTED "lib/arch/cmake/zot-4.0/zot-config.cmake") -SET(EnvA_EXPECTED "lib/zot-3.1/zot-config.cmake") -SET(EnvB_MISSING "EnvB_DIR-NOTFOUND") -SET(SetFoundTRUE_EXPECTED "cmake/SetFoundTRUEConfig.cmake") -SET(SetFoundFALSE_MISSING "${CMAKE_CURRENT_SOURCE_DIR}/cmake") -SET(CMakeTestSystemPackage_EXPECTED "SystemPackage/CMakeTestSystemPackageConfig.cmake") +set(VersionedA_EXPECTED "lib/zot-2.0/zot-config.cmake") +set(VersionedB_EXPECTED "lib/zot-3.1/zot-config.cmake") +set(VersionedC_EXPECTED "lib/cmake/zot-4.0/zot-config.cmake") +set(VersionedD_EXPECTED "Baz 1.1/BazConfig.cmake") +set(VersionedE_EXPECTED "Baz 1.2/CMake/BazConfig.cmake") +set(WrongA_EXPECTED "${VersionedE_EXPECTED}") +set(WrongB_EXPECTED "${VersionedE_EXPECTED}") +set(WrongC_MISSING "WrongC_DIR-NOTFOUND") +set(WrongD_MISSING "WrongD_DIR-NOTFOUND") +set(wibbleA_EXPECTED "A/wibble-config.cmake") +set(wibbleB_EXPECTED "B/wibble-config.cmake") +set(RecursiveA_EXPECTED "lib/RecursiveA/recursivea-config.cmake") +set(RecursiveB_EXPECTED "lib/zot-2.0/zot-config.cmake") +set(RecursiveC_EXPECTED "lib/zot-3.1/zot-config.cmake") +set(ArchA_EXPECTED "lib/arch/Bar/BarConfig.cmake") +set(ArchB_EXPECTED "lib/arch/foo-1.2/CMake/FooConfig.cmake") +set(ArchC_EXPECTED "lib/arch/zot-3.1/zot-config.cmake") +set(ArchD_EXPECTED "lib/arch/cmake/zot-4.0/zot-config.cmake") +set(EnvA_EXPECTED "lib/zot-3.1/zot-config.cmake") +set(EnvB_MISSING "EnvB_DIR-NOTFOUND") +set(SetFoundTRUE_EXPECTED "cmake/SetFoundTRUEConfig.cmake") +set(SetFoundFALSE_MISSING "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +set(CMakeTestSystemPackage_EXPECTED "SystemPackage/CMakeTestSystemPackageConfig.cmake") # Check the results. -FOREACH(p ${PACKAGES}) - IF(DEFINED ${p}_MISSING) +foreach(p ${PACKAGES}) + if(DEFINED ${p}_MISSING) # Check and report failure. - IF(NOT "${${p}_DIR}" STREQUAL "${${p}_MISSING}") - MESSAGE(SEND_ERROR + if(NOT "${${p}_DIR}" STREQUAL "${${p}_MISSING}") + message(SEND_ERROR "Package ${p} should have been [${${p}_MISSING}] but " "was [${${p}_DIR}]") - ENDIF() - IF(${p}_FOUND) - MESSAGE(SEND_ERROR + endif() + if(${p}_FOUND) + message(SEND_ERROR "Package ${p} should not have been found, but ${p}_FOUND is set to " "\"${${p}_FOUND}\"") - ENDIF() - ELSEIF(${p}_FOUND) + endif() + elseif(${p}_FOUND) # Convert to relative path for comparison to expected location. - FILE(RELATIVE_PATH REL_${p}_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}" + file(RELATIVE_PATH REL_${p}_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}" "${${p}_CONFIG}") # Debugging output. - IF(CMAKE_FIND_DEBUG_MODE) - MESSAGE("Package ${p} found [${REL_${p}_CONFIG}]") - ENDIF(CMAKE_FIND_DEBUG_MODE) + if(CMAKE_FIND_DEBUG_MODE) + message("Package ${p} found [${REL_${p}_CONFIG}]") + endif(CMAKE_FIND_DEBUG_MODE) # Check and report failure. - IF(NOT "${REL_${p}_CONFIG}" STREQUAL "${${p}_EXPECTED}") - MESSAGE(SEND_ERROR + if(NOT "${REL_${p}_CONFIG}" STREQUAL "${${p}_EXPECTED}") + message(SEND_ERROR "Package ${p} should have been [${${p}_EXPECTED}] but " "was [${REL_${p}_CONFIG}]") - ENDIF(NOT "${REL_${p}_CONFIG}" STREQUAL "${${p}_EXPECTED}") - ELSE() - MESSAGE(SEND_ERROR "Package ${p} not found!") - ENDIF() -ENDFOREACH(p) + endif(NOT "${REL_${p}_CONFIG}" STREQUAL "${${p}_EXPECTED}") + else() + message(SEND_ERROR "Package ${p} not found!") + endif() +endforeach(p) # Check that version information was extracted. -IF(NOT "${VersionedA_VERSION}" STREQUAL "2.0") - MESSAGE(SEND_ERROR +if(NOT "${VersionedA_VERSION}" STREQUAL "2.0") + message(SEND_ERROR "Package VersionedA is version [${VersionedA_VERSION}], not [2.0]") -ENDIF(NOT "${VersionedA_VERSION}" STREQUAL "2.0") -IF(NOT "${VersionedA_VERSION_MAJOR}" STREQUAL "2") - MESSAGE(SEND_ERROR +endif(NOT "${VersionedA_VERSION}" STREQUAL "2.0") +if(NOT "${VersionedA_VERSION_MAJOR}" STREQUAL "2") + message(SEND_ERROR "Package VersionedA is major version [${VersionedA_VERSION_MAJOR}], not [2]") -ENDIF(NOT "${VersionedA_VERSION_MAJOR}" STREQUAL "2") -IF(NOT "${VersionedA_VERSION_MINOR}" STREQUAL "0") - MESSAGE(SEND_ERROR +endif(NOT "${VersionedA_VERSION_MAJOR}" STREQUAL "2") +if(NOT "${VersionedA_VERSION_MINOR}" STREQUAL "0") + message(SEND_ERROR "Package VersionedA is minor version [${VersionedA_VERSION_MINOR}], not [0]") -ENDIF(NOT "${VersionedA_VERSION_MINOR}" STREQUAL "0") +endif(NOT "${VersionedA_VERSION_MINOR}" STREQUAL "0") -IF(NOT "${VersionedB_VERSION}" STREQUAL "3.1") - MESSAGE(SEND_ERROR +if(NOT "${VersionedB_VERSION}" STREQUAL "3.1") + message(SEND_ERROR "Package VersionedB is version [${VersionedB_VERSION}], not [3.1]") -ENDIF(NOT "${VersionedB_VERSION}" STREQUAL "3.1") -IF(NOT "${VersionedB_VERSION_MAJOR}" STREQUAL "3") - MESSAGE(SEND_ERROR +endif(NOT "${VersionedB_VERSION}" STREQUAL "3.1") +if(NOT "${VersionedB_VERSION_MAJOR}" STREQUAL "3") + message(SEND_ERROR "Package VersionedB is major version [${VersionedB_VERSION_MAJOR}], not [3]") -ENDIF(NOT "${VersionedB_VERSION_MAJOR}" STREQUAL "3") -IF(NOT "${VersionedB_VERSION_MINOR}" STREQUAL "1") - MESSAGE(SEND_ERROR +endif(NOT "${VersionedB_VERSION_MAJOR}" STREQUAL "3") +if(NOT "${VersionedB_VERSION_MINOR}" STREQUAL "1") + message(SEND_ERROR "Package VersionedB is minor version [${VersionedB_VERSION_MINOR}], not [1]") -ENDIF(NOT "${VersionedB_VERSION_MINOR}" STREQUAL "1") +endif(NOT "${VersionedB_VERSION_MINOR}" STREQUAL "1") -IF(NOT "${Special_VERSION}" STREQUAL "1.2") - MESSAGE(SEND_ERROR +if(NOT "${Special_VERSION}" STREQUAL "1.2") + message(SEND_ERROR "Package Special is version [${Special_VERSION}], not [1.2]") -ENDIF(NOT "${Special_VERSION}" STREQUAL "1.2") -IF(NOT "${Special_VERSION_MAJOR}" STREQUAL "1") - MESSAGE(SEND_ERROR +endif(NOT "${Special_VERSION}" STREQUAL "1.2") +if(NOT "${Special_VERSION_MAJOR}" STREQUAL "1") + message(SEND_ERROR "Package Special is major version [${Special_VERSION_MAJOR}], not [1]") -ENDIF(NOT "${Special_VERSION_MAJOR}" STREQUAL "1") -IF(NOT "${Special_VERSION_MINOR}" STREQUAL "2") - MESSAGE(SEND_ERROR +endif(NOT "${Special_VERSION_MAJOR}" STREQUAL "1") +if(NOT "${Special_VERSION_MINOR}" STREQUAL "2") + message(SEND_ERROR "Package Special is minor version [${Special_VERSION_MINOR}], not [2]") -ENDIF(NOT "${Special_VERSION_MINOR}" STREQUAL "2") +endif(NOT "${Special_VERSION_MINOR}" STREQUAL "2") # Test version number comparison. -IF(NOT "1.2.3.4" VERSION_LESS "1.2.3.5") - MESSAGE(SEND_ERROR "1.2.3.4 VERSION_LESS 1.2.3.5 is not true!") -ENDIF() -IF(NOT "1.2" VERSION_LESS "1.10") - MESSAGE(SEND_ERROR "1.2 VERSION_LESS 1.10 is not true!") -ENDIF() -IF(NOT "1.02" VERSION_GREATER "1.1") - MESSAGE(SEND_ERROR "1.02 VERSION_GREATER 1.1 is not true!") -ENDIF() -IF("1.2.3" VERSION_GREATER "1.2.3.4") - MESSAGE(SEND_ERROR "1.2.3 VERSION_GREATER 1.2.3.4 is not false!") -ENDIF() -IF(NOT "1.2" VERSION_EQUAL "1.2.0.0") - MESSAGE(SEND_ERROR "1.2 VERSION_EQUAL 1.2.0.0 is not true!") -ENDIF() +if(NOT "1.2.3.4" VERSION_LESS "1.2.3.5") + message(SEND_ERROR "1.2.3.4 VERSION_LESS 1.2.3.5 is not true!") +endif() +if(NOT "1.2" VERSION_LESS "1.10") + message(SEND_ERROR "1.2 VERSION_LESS 1.10 is not true!") +endif() +if(NOT "1.02" VERSION_GREATER "1.1") + message(SEND_ERROR "1.02 VERSION_GREATER 1.1 is not true!") +endif() +if("1.2.3" VERSION_GREATER "1.2.3.4") + message(SEND_ERROR "1.2.3 VERSION_GREATER 1.2.3.4 is not false!") +endif() +if(NOT "1.2" VERSION_EQUAL "1.2.0.0") + message(SEND_ERROR "1.2 VERSION_EQUAL 1.2.0.0 is not true!") +endif() #----------------------------------------------------------------------------- # Test export(PACKAGE) with find_package. -MESSAGE(STATUS "Preparing export(PACKAGE) test project") -TRY_COMPILE(EXPORTER_COMPILED +message(STATUS "Preparing export(PACKAGE) test project") +try_compile(EXPORTER_COMPILED ${FindPackageTest_BINARY_DIR}/Exporter ${FindPackageTest_SOURCE_DIR}/Exporter CMakeTestExportPackage dummy OUTPUT_VARIABLE output) -MESSAGE(STATUS "Searching for export(PACKAGE) test project") -SET(CMakeTestExportPackage_DIR "" CACHE FILEPATH +message(STATUS "Searching for export(PACKAGE) test project") +set(CMakeTestExportPackage_DIR "" CACHE FILEPATH "Wipe out find results for testing." FORCE) -STRING(REGEX REPLACE "-.*$" "" version ${CMAKE_VERSION}) -FIND_PACKAGE(CMakeTestExportPackage 1.${version} EXACT REQUIRED) +string(REGEX REPLACE "-.*$" "" version ${CMAKE_VERSION}) +find_package(CMakeTestExportPackage 1.${version} EXACT REQUIRED) #----------------------------------------------------------------------------- # Test configure_package_config_file(). diff --git a/Tests/FindPackageTest/Exporter/CMakeTestExportPackageConfigVersion.cmake.in b/Tests/FindPackageTest/Exporter/CMakeTestExportPackageConfigVersion.cmake.in index ff450a1..42bd84e 100644 --- a/Tests/FindPackageTest/Exporter/CMakeTestExportPackageConfigVersion.cmake.in +++ b/Tests/FindPackageTest/Exporter/CMakeTestExportPackageConfigVersion.cmake.in @@ -1,6 +1,6 @@ # Test config file. -SET(PACKAGE_VERSION "1.@CMAKE_VERSION@") -IF("${PACKAGE_FIND_VERSION}" VERSION_EQUAL "${PACKAGE_VERSION}") - SET(PACKAGE_VERSION_COMPATIBLE 1) - SET(PACKAGE_VERSION_EXACT 1) -ENDIF() +set(PACKAGE_VERSION "1.@CMAKE_VERSION@") +if("${PACKAGE_FIND_VERSION}" VERSION_EQUAL "${PACKAGE_VERSION}") + set(PACKAGE_VERSION_COMPATIBLE 1) + set(PACKAGE_VERSION_EXACT 1) +endif() diff --git a/Tests/FindPackageTest/FindRecursiveA.cmake b/Tests/FindPackageTest/FindRecursiveA.cmake index 3af7e99..a6d25dc 100644 --- a/Tests/FindPackageTest/FindRecursiveA.cmake +++ b/Tests/FindPackageTest/FindRecursiveA.cmake @@ -1 +1 @@ -FIND_PACKAGE(RecursiveA NO_MODULE) +find_package(RecursiveA NO_MODULE) diff --git a/Tests/FindPackageTest/FindRecursiveB.cmake b/Tests/FindPackageTest/FindRecursiveB.cmake index c609ab1..9e28f2c 100644 --- a/Tests/FindPackageTest/FindRecursiveB.cmake +++ b/Tests/FindPackageTest/FindRecursiveB.cmake @@ -1 +1 @@ -FIND_PACKAGE(RecursiveB NAMES zot) +find_package(RecursiveB NAMES zot) diff --git a/Tests/FindPackageTest/FindRecursiveC.cmake b/Tests/FindPackageTest/FindRecursiveC.cmake index 018cc73..cd4400c 100644 --- a/Tests/FindPackageTest/FindRecursiveC.cmake +++ b/Tests/FindPackageTest/FindRecursiveC.cmake @@ -1 +1 @@ -FIND_PACKAGE(RecursiveC NAMES zot) +find_package(RecursiveC NAMES zot) diff --git a/Tests/FindPackageTest/FindVersionTestA.cmake b/Tests/FindPackageTest/FindVersionTestA.cmake index 55c67e2..c6031d9 100644 --- a/Tests/FindPackageTest/FindVersionTestA.cmake +++ b/Tests/FindPackageTest/FindVersionTestA.cmake @@ -1,18 +1,18 @@ -IF(NOT "${VersionTestA_FIND_VERSION}" STREQUAL "1") - MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION=${VersionTestA_FIND_VERSION} is not 1") -ENDIF(NOT "${VersionTestA_FIND_VERSION}" STREQUAL "1") -IF(NOT "${VersionTestA_FIND_VERSION_MAJOR}" STREQUAL "1") - MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION_MAJOR=${VersionTestA_FIND_VERSION_MAJOR} is not 1") -ENDIF(NOT "${VersionTestA_FIND_VERSION_MAJOR}" STREQUAL "1") -IF(NOT "${VersionTestA_FIND_VERSION_MINOR}" STREQUAL "0") - MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION_MINOR=${VersionTestA_FIND_VERSION_MINOR} is not 0") -ENDIF(NOT "${VersionTestA_FIND_VERSION_MINOR}" STREQUAL "0") -IF(NOT "${VersionTestA_FIND_VERSION_PATCH}" STREQUAL "0") - MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION_PATCH=${VersionTestA_FIND_VERSION_PATCH} is not 0") -ENDIF(NOT "${VersionTestA_FIND_VERSION_PATCH}" STREQUAL "0") -IF(NOT "${VersionTestA_FIND_VERSION_TWEAK}" STREQUAL "0") - MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION_TWEAK=${VersionTestA_FIND_VERSION_TWEAK} is not 0") -ENDIF(NOT "${VersionTestA_FIND_VERSION_TWEAK}" STREQUAL "0") -IF(NOT "${VersionTestA_FIND_VERSION_COUNT}" STREQUAL "1") - MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION_COUNT=${VersionTestA_FIND_VERSION_COUNT} is not 1") -ENDIF(NOT "${VersionTestA_FIND_VERSION_COUNT}" STREQUAL "1") +if(NOT "${VersionTestA_FIND_VERSION}" STREQUAL "1") + message(SEND_ERROR "VersionTestA_FIND_VERSION=${VersionTestA_FIND_VERSION} is not 1") +endif(NOT "${VersionTestA_FIND_VERSION}" STREQUAL "1") +if(NOT "${VersionTestA_FIND_VERSION_MAJOR}" STREQUAL "1") + message(SEND_ERROR "VersionTestA_FIND_VERSION_MAJOR=${VersionTestA_FIND_VERSION_MAJOR} is not 1") +endif(NOT "${VersionTestA_FIND_VERSION_MAJOR}" STREQUAL "1") +if(NOT "${VersionTestA_FIND_VERSION_MINOR}" STREQUAL "0") + message(SEND_ERROR "VersionTestA_FIND_VERSION_MINOR=${VersionTestA_FIND_VERSION_MINOR} is not 0") +endif(NOT "${VersionTestA_FIND_VERSION_MINOR}" STREQUAL "0") +if(NOT "${VersionTestA_FIND_VERSION_PATCH}" STREQUAL "0") + message(SEND_ERROR "VersionTestA_FIND_VERSION_PATCH=${VersionTestA_FIND_VERSION_PATCH} is not 0") +endif(NOT "${VersionTestA_FIND_VERSION_PATCH}" STREQUAL "0") +if(NOT "${VersionTestA_FIND_VERSION_TWEAK}" STREQUAL "0") + message(SEND_ERROR "VersionTestA_FIND_VERSION_TWEAK=${VersionTestA_FIND_VERSION_TWEAK} is not 0") +endif(NOT "${VersionTestA_FIND_VERSION_TWEAK}" STREQUAL "0") +if(NOT "${VersionTestA_FIND_VERSION_COUNT}" STREQUAL "1") + message(SEND_ERROR "VersionTestA_FIND_VERSION_COUNT=${VersionTestA_FIND_VERSION_COUNT} is not 1") +endif(NOT "${VersionTestA_FIND_VERSION_COUNT}" STREQUAL "1") diff --git a/Tests/FindPackageTest/FindVersionTestB.cmake b/Tests/FindPackageTest/FindVersionTestB.cmake index 03173c6..914d5a7 100644 --- a/Tests/FindPackageTest/FindVersionTestB.cmake +++ b/Tests/FindPackageTest/FindVersionTestB.cmake @@ -1,18 +1,18 @@ -IF(NOT "${VersionTestB_FIND_VERSION}" STREQUAL "1.2") - MESSAGE(SEND_ERROR "VersionTestB_FIND_VERSION=${VersionTestB_FIND_VERSION} is not 1.2") -ENDIF(NOT "${VersionTestB_FIND_VERSION}" STREQUAL "1.2") -IF(NOT "${VersionTestB_FIND_VERSION_MAJOR}" STREQUAL "1") - MESSAGE(SEND_ERROR "VersionTestB_FIND_VERSION_MAJOR=${VersionTestB_FIND_VERSION_MAJOR} is not 1") -ENDIF(NOT "${VersionTestB_FIND_VERSION_MAJOR}" STREQUAL "1") -IF(NOT "${VersionTestB_FIND_VERSION_MINOR}" STREQUAL "2") - MESSAGE(SEND_ERROR "VersionTestB_FIND_VERSION_MINOR=${VersionTestB_FIND_VERSION_MINOR} is not 2") -ENDIF(NOT "${VersionTestB_FIND_VERSION_MINOR}" STREQUAL "2") -IF(NOT "${VersionTestB_FIND_VERSION_PATCH}" STREQUAL "0") - MESSAGE(SEND_ERROR "VersionTestB_FIND_VERSION_PATCH=${VersionTestB_FIND_VERSION_PATCH} is not 0") -ENDIF(NOT "${VersionTestB_FIND_VERSION_PATCH}" STREQUAL "0") -IF(NOT "${VersionTestB_FIND_VERSION_TWEAK}" STREQUAL "0") - MESSAGE(SEND_ERROR "VersionTestB_FIND_VERSION_TWEAK=${VersionTestB_FIND_VERSION_TWEAK} is not 0") -ENDIF(NOT "${VersionTestB_FIND_VERSION_TWEAK}" STREQUAL "0") -IF(NOT "${VersionTestB_FIND_VERSION_COUNT}" STREQUAL "2") - MESSAGE(SEND_ERROR "VersionTestB_FIND_VERSION_COUNT=${VersionTestB_FIND_VERSION_COUNT} is not 2") -ENDIF(NOT "${VersionTestB_FIND_VERSION_COUNT}" STREQUAL "2") +if(NOT "${VersionTestB_FIND_VERSION}" STREQUAL "1.2") + message(SEND_ERROR "VersionTestB_FIND_VERSION=${VersionTestB_FIND_VERSION} is not 1.2") +endif(NOT "${VersionTestB_FIND_VERSION}" STREQUAL "1.2") +if(NOT "${VersionTestB_FIND_VERSION_MAJOR}" STREQUAL "1") + message(SEND_ERROR "VersionTestB_FIND_VERSION_MAJOR=${VersionTestB_FIND_VERSION_MAJOR} is not 1") +endif(NOT "${VersionTestB_FIND_VERSION_MAJOR}" STREQUAL "1") +if(NOT "${VersionTestB_FIND_VERSION_MINOR}" STREQUAL "2") + message(SEND_ERROR "VersionTestB_FIND_VERSION_MINOR=${VersionTestB_FIND_VERSION_MINOR} is not 2") +endif(NOT "${VersionTestB_FIND_VERSION_MINOR}" STREQUAL "2") +if(NOT "${VersionTestB_FIND_VERSION_PATCH}" STREQUAL "0") + message(SEND_ERROR "VersionTestB_FIND_VERSION_PATCH=${VersionTestB_FIND_VERSION_PATCH} is not 0") +endif(NOT "${VersionTestB_FIND_VERSION_PATCH}" STREQUAL "0") +if(NOT "${VersionTestB_FIND_VERSION_TWEAK}" STREQUAL "0") + message(SEND_ERROR "VersionTestB_FIND_VERSION_TWEAK=${VersionTestB_FIND_VERSION_TWEAK} is not 0") +endif(NOT "${VersionTestB_FIND_VERSION_TWEAK}" STREQUAL "0") +if(NOT "${VersionTestB_FIND_VERSION_COUNT}" STREQUAL "2") + message(SEND_ERROR "VersionTestB_FIND_VERSION_COUNT=${VersionTestB_FIND_VERSION_COUNT} is not 2") +endif(NOT "${VersionTestB_FIND_VERSION_COUNT}" STREQUAL "2") diff --git a/Tests/FindPackageTest/FindVersionTestC.cmake b/Tests/FindPackageTest/FindVersionTestC.cmake index 1344cbc..66e07ea 100644 --- a/Tests/FindPackageTest/FindVersionTestC.cmake +++ b/Tests/FindPackageTest/FindVersionTestC.cmake @@ -1,18 +1,18 @@ -IF(NOT "${VersionTestC_FIND_VERSION}" STREQUAL "1.2.3") - MESSAGE(SEND_ERROR "VersionTestC_FIND_VERSION=${VersionTestC_FIND_VERSION} is not 1.2.3") -ENDIF(NOT "${VersionTestC_FIND_VERSION}" STREQUAL "1.2.3") -IF(NOT "${VersionTestC_FIND_VERSION_MAJOR}" STREQUAL "1") - MESSAGE(SEND_ERROR "VersionTestC_FIND_VERSION_MAJOR=${VersionTestC_FIND_VERSION_MAJOR} is not 1") -ENDIF(NOT "${VersionTestC_FIND_VERSION_MAJOR}" STREQUAL "1") -IF(NOT "${VersionTestC_FIND_VERSION_MINOR}" STREQUAL "2") - MESSAGE(SEND_ERROR "VersionTestC_FIND_VERSION_MINOR=${VersionTestC_FIND_VERSION_MINOR} is not 2") -ENDIF(NOT "${VersionTestC_FIND_VERSION_MINOR}" STREQUAL "2") -IF(NOT "${VersionTestC_FIND_VERSION_PATCH}" STREQUAL "3") - MESSAGE(SEND_ERROR "VersionTestC_FIND_VERSION_PATCH=${VersionTestC_FIND_VERSION_PATCH} is not 3") -ENDIF(NOT "${VersionTestC_FIND_VERSION_PATCH}" STREQUAL "3") -IF(NOT "${VersionTestC_FIND_VERSION_TWEAK}" STREQUAL "0") - MESSAGE(SEND_ERROR "VersionTestC_FIND_VERSION_TWEAK=${VersionTestC_FIND_VERSION_TWEAK} is not 0") -ENDIF(NOT "${VersionTestC_FIND_VERSION_TWEAK}" STREQUAL "0") -IF(NOT "${VersionTestC_FIND_VERSION_COUNT}" STREQUAL "3") - MESSAGE(SEND_ERROR "VersionTestC_FIND_VERSION_COUNT=${VersionTestC_FIND_VERSION_COUNT} is not 3") -ENDIF(NOT "${VersionTestC_FIND_VERSION_COUNT}" STREQUAL "3") +if(NOT "${VersionTestC_FIND_VERSION}" STREQUAL "1.2.3") + message(SEND_ERROR "VersionTestC_FIND_VERSION=${VersionTestC_FIND_VERSION} is not 1.2.3") +endif(NOT "${VersionTestC_FIND_VERSION}" STREQUAL "1.2.3") +if(NOT "${VersionTestC_FIND_VERSION_MAJOR}" STREQUAL "1") + message(SEND_ERROR "VersionTestC_FIND_VERSION_MAJOR=${VersionTestC_FIND_VERSION_MAJOR} is not 1") +endif(NOT "${VersionTestC_FIND_VERSION_MAJOR}" STREQUAL "1") +if(NOT "${VersionTestC_FIND_VERSION_MINOR}" STREQUAL "2") + message(SEND_ERROR "VersionTestC_FIND_VERSION_MINOR=${VersionTestC_FIND_VERSION_MINOR} is not 2") +endif(NOT "${VersionTestC_FIND_VERSION_MINOR}" STREQUAL "2") +if(NOT "${VersionTestC_FIND_VERSION_PATCH}" STREQUAL "3") + message(SEND_ERROR "VersionTestC_FIND_VERSION_PATCH=${VersionTestC_FIND_VERSION_PATCH} is not 3") +endif(NOT "${VersionTestC_FIND_VERSION_PATCH}" STREQUAL "3") +if(NOT "${VersionTestC_FIND_VERSION_TWEAK}" STREQUAL "0") + message(SEND_ERROR "VersionTestC_FIND_VERSION_TWEAK=${VersionTestC_FIND_VERSION_TWEAK} is not 0") +endif(NOT "${VersionTestC_FIND_VERSION_TWEAK}" STREQUAL "0") +if(NOT "${VersionTestC_FIND_VERSION_COUNT}" STREQUAL "3") + message(SEND_ERROR "VersionTestC_FIND_VERSION_COUNT=${VersionTestC_FIND_VERSION_COUNT} is not 3") +endif(NOT "${VersionTestC_FIND_VERSION_COUNT}" STREQUAL "3") diff --git a/Tests/FindPackageTest/FindVersionTestD.cmake b/Tests/FindPackageTest/FindVersionTestD.cmake index d3e3f50..88d9299 100644 --- a/Tests/FindPackageTest/FindVersionTestD.cmake +++ b/Tests/FindPackageTest/FindVersionTestD.cmake @@ -1,18 +1,18 @@ -IF(NOT "${VersionTestD_FIND_VERSION}" STREQUAL "1.2.3.4") - MESSAGE(SEND_ERROR "VersionTestD_FIND_VERSION=${VersionTestD_FIND_VERSION} is not 1.2.3.4") -ENDIF(NOT "${VersionTestD_FIND_VERSION}" STREQUAL "1.2.3.4") -IF(NOT "${VersionTestD_FIND_VERSION_MAJOR}" STREQUAL "1") - MESSAGE(SEND_ERROR "VersionTestD_FIND_VERSION_MAJOR=${VersionTestD_FIND_VERSION_MAJOR} is not 1") -ENDIF(NOT "${VersionTestD_FIND_VERSION_MAJOR}" STREQUAL "1") -IF(NOT "${VersionTestD_FIND_VERSION_MINOR}" STREQUAL "2") - MESSAGE(SEND_ERROR "VersionTestD_FIND_VERSION_MINOR=${VersionTestD_FIND_VERSION_MINOR} is not 2") -ENDIF(NOT "${VersionTestD_FIND_VERSION_MINOR}" STREQUAL "2") -IF(NOT "${VersionTestD_FIND_VERSION_PATCH}" STREQUAL "3") - MESSAGE(SEND_ERROR "VersionTestD_FIND_VERSION_PATCH=${VersionTestD_FIND_VERSION_PATCH} is not 3") -ENDIF(NOT "${VersionTestD_FIND_VERSION_PATCH}" STREQUAL "3") -IF(NOT "${VersionTestD_FIND_VERSION_TWEAK}" STREQUAL "4") - MESSAGE(SEND_ERROR "VersionTestD_FIND_VERSION_TWEAK=${VersionTestD_FIND_VERSION_TWEAK} is not 4") -ENDIF(NOT "${VersionTestD_FIND_VERSION_TWEAK}" STREQUAL "4") -IF(NOT "${VersionTestD_FIND_VERSION_COUNT}" STREQUAL "4") - MESSAGE(SEND_ERROR "VersionTestD_FIND_VERSION_COUNT=${VersionTestD_FIND_VERSION_COUNT} is not 4") -ENDIF(NOT "${VersionTestD_FIND_VERSION_COUNT}" STREQUAL "4") +if(NOT "${VersionTestD_FIND_VERSION}" STREQUAL "1.2.3.4") + message(SEND_ERROR "VersionTestD_FIND_VERSION=${VersionTestD_FIND_VERSION} is not 1.2.3.4") +endif(NOT "${VersionTestD_FIND_VERSION}" STREQUAL "1.2.3.4") +if(NOT "${VersionTestD_FIND_VERSION_MAJOR}" STREQUAL "1") + message(SEND_ERROR "VersionTestD_FIND_VERSION_MAJOR=${VersionTestD_FIND_VERSION_MAJOR} is not 1") +endif(NOT "${VersionTestD_FIND_VERSION_MAJOR}" STREQUAL "1") +if(NOT "${VersionTestD_FIND_VERSION_MINOR}" STREQUAL "2") + message(SEND_ERROR "VersionTestD_FIND_VERSION_MINOR=${VersionTestD_FIND_VERSION_MINOR} is not 2") +endif(NOT "${VersionTestD_FIND_VERSION_MINOR}" STREQUAL "2") +if(NOT "${VersionTestD_FIND_VERSION_PATCH}" STREQUAL "3") + message(SEND_ERROR "VersionTestD_FIND_VERSION_PATCH=${VersionTestD_FIND_VERSION_PATCH} is not 3") +endif(NOT "${VersionTestD_FIND_VERSION_PATCH}" STREQUAL "3") +if(NOT "${VersionTestD_FIND_VERSION_TWEAK}" STREQUAL "4") + message(SEND_ERROR "VersionTestD_FIND_VERSION_TWEAK=${VersionTestD_FIND_VERSION_TWEAK} is not 4") +endif(NOT "${VersionTestD_FIND_VERSION_TWEAK}" STREQUAL "4") +if(NOT "${VersionTestD_FIND_VERSION_COUNT}" STREQUAL "4") + message(SEND_ERROR "VersionTestD_FIND_VERSION_COUNT=${VersionTestD_FIND_VERSION_COUNT} is not 4") +endif(NOT "${VersionTestD_FIND_VERSION_COUNT}" STREQUAL "4") diff --git a/Tests/FindPackageTest/lib/TApp/TAppConfig.cmake b/Tests/FindPackageTest/lib/TApp/TAppConfig.cmake index cbf0603..5ba8d55 100644 --- a/Tests/FindPackageTest/lib/TApp/TAppConfig.cmake +++ b/Tests/FindPackageTest/lib/TApp/TAppConfig.cmake @@ -1,2 +1,2 @@ # Test config file that should not be found. -MESSAGE("Package TApp found non-bundle first!") +message("Package TApp found non-bundle first!") diff --git a/Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config-version.cmake b/Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config-version.cmake index 2f768e8..514e830 100644 --- a/Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config-version.cmake @@ -1,7 +1,7 @@ -SET(PACKAGE_VERSION 4.0) -IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4) - SET(PACKAGE_VERSION_COMPATIBLE 1) - IF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0) - SET(PACKAGE_VERSION_EXACT 1) - ENDIF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0) -ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4) +set(PACKAGE_VERSION 4.0) +if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4) + set(PACKAGE_VERSION_COMPATIBLE 1) + if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0) + set(PACKAGE_VERSION_EXACT 1) + endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0) +endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4) diff --git a/Tests/FindPackageTest/lib/arch/zot-3.1/zot-config-version.cmake b/Tests/FindPackageTest/lib/arch/zot-3.1/zot-config-version.cmake index 13763ad..59fe59d 100644 --- a/Tests/FindPackageTest/lib/arch/zot-3.1/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/arch/zot-3.1/zot-config-version.cmake @@ -1,7 +1,7 @@ -SET(PACKAGE_VERSION 3.1) -IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) - SET(PACKAGE_VERSION_COMPATIBLE 1) - IF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) - SET(PACKAGE_VERSION_EXACT 1) - ENDIF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) -ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) +set(PACKAGE_VERSION 3.1) +if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) + set(PACKAGE_VERSION_COMPATIBLE 1) + if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) + set(PACKAGE_VERSION_EXACT 1) + endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) +endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) diff --git a/Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config-version.cmake b/Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config-version.cmake index bee2f0e..e3e17de 100644 --- a/Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config-version.cmake @@ -1,4 +1,4 @@ # Claim to be any version to test that CMAKE_IGNORE_PATH hides us. -SET(PACKAGE_VERSION 3.1) -SET(PACKAGE_VERSION_COMPATIBLE 1) -SET(PACKAGE_VERSION_EXACT 1) +set(PACKAGE_VERSION 3.1) +set(PACKAGE_VERSION_COMPATIBLE 1) +set(PACKAGE_VERSION_EXACT 1) diff --git a/Tests/FindPackageTest/lib/cmake/zot-4.0/zot-config-version.cmake b/Tests/FindPackageTest/lib/cmake/zot-4.0/zot-config-version.cmake index 606945f..7afcc9b 100644 --- a/Tests/FindPackageTest/lib/cmake/zot-4.0/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/cmake/zot-4.0/zot-config-version.cmake @@ -1,8 +1,8 @@ -SET(PACKAGE_VERSION 4.0) -IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4) - SET(PACKAGE_VERSION_COMPATIBLE 1) - IF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0) - SET(PACKAGE_VERSION_EXACT 1) - ENDIF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0) -ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4) +set(PACKAGE_VERSION 4.0) +if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4) + set(PACKAGE_VERSION_COMPATIBLE 1) + if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0) + set(PACKAGE_VERSION_EXACT 1) + endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0) +endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4) diff --git a/Tests/FindPackageTest/lib/suffix/test/SuffixTestConfigVersion.cmake b/Tests/FindPackageTest/lib/suffix/test/SuffixTestConfigVersion.cmake index 5c3bdde..4e8ee82 100644 --- a/Tests/FindPackageTest/lib/suffix/test/SuffixTestConfigVersion.cmake +++ b/Tests/FindPackageTest/lib/suffix/test/SuffixTestConfigVersion.cmake @@ -1,7 +1,7 @@ -SET(PACKAGE_VERSION 1.2) -IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) - SET(PACKAGE_VERSION_COMPATIBLE 1) - IF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2) - SET(PACKAGE_VERSION_EXACT 1) - ENDIF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2) -ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) +set(PACKAGE_VERSION 1.2) +if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) + set(PACKAGE_VERSION_COMPATIBLE 1) + if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2) + set(PACKAGE_VERSION_EXACT 1) + endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2) +endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) diff --git a/Tests/FindPackageTest/lib/zot-2.0/zot-config-version.cmake b/Tests/FindPackageTest/lib/zot-2.0/zot-config-version.cmake index 10ac53d..78e41a5 100644 --- a/Tests/FindPackageTest/lib/zot-2.0/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/zot-2.0/zot-config-version.cmake @@ -1,5 +1,5 @@ -SET(PACKAGE_VERSION 2.0) -IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 2) - SET(PACKAGE_VERSION_COMPATIBLE 1) -ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 2) +set(PACKAGE_VERSION 2.0) +if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 2) + set(PACKAGE_VERSION_COMPATIBLE 1) +endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 2) diff --git a/Tests/FindPackageTest/lib/zot-3.0/zot-config-version.cmake b/Tests/FindPackageTest/lib/zot-3.0/zot-config-version.cmake index af57cfa..8e3daff 100644 --- a/Tests/FindPackageTest/lib/zot-3.0/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/zot-3.0/zot-config-version.cmake @@ -1,5 +1,5 @@ -SET(PACKAGE_VERSION 3.0) -IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) - SET(PACKAGE_VERSION_COMPATIBLE 1) -ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) +set(PACKAGE_VERSION 3.0) +if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) + set(PACKAGE_VERSION_COMPATIBLE 1) +endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) diff --git a/Tests/FindPackageTest/lib/zot-3.1/zot-config-version.cmake b/Tests/FindPackageTest/lib/zot-3.1/zot-config-version.cmake index b54d94c..b09c008 100644 --- a/Tests/FindPackageTest/lib/zot-3.1/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/zot-3.1/zot-config-version.cmake @@ -1,8 +1,8 @@ -SET(PACKAGE_VERSION 3.1) -IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) - SET(PACKAGE_VERSION_COMPATIBLE 1) - IF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) - SET(PACKAGE_VERSION_EXACT 1) - ENDIF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) -ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) +set(PACKAGE_VERSION 3.1) +if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) + set(PACKAGE_VERSION_COMPATIBLE 1) + if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) + set(PACKAGE_VERSION_EXACT 1) + endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) +endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) diff --git a/Tests/FindPackageTest/lib/zot/zot-config-version.cmake b/Tests/FindPackageTest/lib/zot/zot-config-version.cmake index 2a6be86..5674f70 100644 --- a/Tests/FindPackageTest/lib/zot/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/zot/zot-config-version.cmake @@ -1,10 +1,10 @@ # This version should never, ever be used. -SET(PACKAGE_VERSION_UNSUITABLE 1) -SET(PACKAGE_VERSION 3.1) -IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) - SET(PACKAGE_VERSION_COMPATIBLE 1) - IF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) - SET(PACKAGE_VERSION_EXACT 1) - ENDIF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) -ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) +set(PACKAGE_VERSION_UNSUITABLE 1) +set(PACKAGE_VERSION 3.1) +if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) + set(PACKAGE_VERSION_COMPATIBLE 1) + if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) + set(PACKAGE_VERSION_EXACT 1) + endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) +endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) diff --git a/Tests/FindPackageTest/lib/zot/zot-config.cmake b/Tests/FindPackageTest/lib/zot/zot-config.cmake index 442b8a4..9168183 100644 --- a/Tests/FindPackageTest/lib/zot/zot-config.cmake +++ b/Tests/FindPackageTest/lib/zot/zot-config.cmake @@ -1,2 +1,2 @@ # Test config file that is unsuitable. -MESSAGE(FATAL_ERROR "Unsuitable version of zot was found") +message(FATAL_ERROR "Unsuitable version of zot was found") |