From 52a6ed2aed6ad2ed6880e76535359a6b45fda253 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 8 Jun 2011 10:28:20 -0400 Subject: Test find_package multiarch support (#12037) --- Tests/FindPackageTest/CMakeLists.txt | 13 +++++++++++++ Tests/FindPackageTest/lib/arch/Bar/BarConfig.cmake | 1 + .../lib/arch/cmake/zot-4.0/zot-config-version.cmake | 7 +++++++ .../FindPackageTest/lib/arch/cmake/zot-4.0/zot-config.cmake | 1 + .../FindPackageTest/lib/arch/foo-1.2/CMake/FooConfig.cmake | 1 + .../lib/arch/zot-3.1/zot-config-version.cmake | 7 +++++++ Tests/FindPackageTest/lib/arch/zot-3.1/zot-config.cmake | 1 + 7 files changed, 31 insertions(+) create mode 100644 Tests/FindPackageTest/lib/arch/Bar/BarConfig.cmake create mode 100644 Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config-version.cmake create mode 100644 Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config.cmake create mode 100644 Tests/FindPackageTest/lib/arch/foo-1.2/CMake/FooConfig.cmake create mode 100644 Tests/FindPackageTest/lib/arch/zot-3.1/zot-config-version.cmake create mode 100644 Tests/FindPackageTest/lib/arch/zot-3.1/zot-config.cmake diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt index 89383a0..87fe84e 100644 --- a/Tests/FindPackageTest/CMakeLists.txt +++ b/Tests/FindPackageTest/CMakeLists.txt @@ -80,6 +80,7 @@ SET(PACKAGES WrongA WrongB WrongC WrongD wibbleA wibbleB RecursiveA RecursiveB RecursiveC + ArchA ArchB ArchC ArchD EnvA EnvB ${CMakeTestSystemPackage} ) @@ -142,6 +143,14 @@ 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) + # Test _DIR environment variable. # We erase the main prefix path to ensure the env var is used. SET(CMAKE_PREFIX_PATH) @@ -183,6 +192,10 @@ 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(CMakeTestSystemPackage_EXPECTED "SystemPackage/CMakeTestSystemPackageConfig.cmake") diff --git a/Tests/FindPackageTest/lib/arch/Bar/BarConfig.cmake b/Tests/FindPackageTest/lib/arch/Bar/BarConfig.cmake new file mode 100644 index 0000000..deffa57 --- /dev/null +++ b/Tests/FindPackageTest/lib/arch/Bar/BarConfig.cmake @@ -0,0 +1 @@ +# Test config file. 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 new file mode 100644 index 0000000..2f768e8 --- /dev/null +++ b/Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config-version.cmake @@ -0,0 +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) diff --git a/Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config.cmake b/Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config.cmake new file mode 100644 index 0000000..deffa57 --- /dev/null +++ b/Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config.cmake @@ -0,0 +1 @@ +# Test config file. diff --git a/Tests/FindPackageTest/lib/arch/foo-1.2/CMake/FooConfig.cmake b/Tests/FindPackageTest/lib/arch/foo-1.2/CMake/FooConfig.cmake new file mode 100644 index 0000000..deffa57 --- /dev/null +++ b/Tests/FindPackageTest/lib/arch/foo-1.2/CMake/FooConfig.cmake @@ -0,0 +1 @@ +# Test config file. 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 new file mode 100644 index 0000000..13763ad --- /dev/null +++ b/Tests/FindPackageTest/lib/arch/zot-3.1/zot-config-version.cmake @@ -0,0 +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) diff --git a/Tests/FindPackageTest/lib/arch/zot-3.1/zot-config.cmake b/Tests/FindPackageTest/lib/arch/zot-3.1/zot-config.cmake new file mode 100644 index 0000000..deffa57 --- /dev/null +++ b/Tests/FindPackageTest/lib/arch/zot-3.1/zot-config.cmake @@ -0,0 +1 @@ +# Test config file. -- cgit v0.12