summaryrefslogtreecommitdiffstats
path: root/Tests/FindPackageTest
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-06-08 14:28:20 (GMT)
committerBrad King <brad.king@kitware.com>2011-06-08 14:28:20 (GMT)
commit52a6ed2aed6ad2ed6880e76535359a6b45fda253 (patch)
treead57839d084eeeea9ca6c8cd55e1acb4c25b9442 /Tests/FindPackageTest
parentb41ad3b399c591f8f35eaacf056ffd9016b9e0bc (diff)
downloadCMake-52a6ed2aed6ad2ed6880e76535359a6b45fda253.zip
CMake-52a6ed2aed6ad2ed6880e76535359a6b45fda253.tar.gz
CMake-52a6ed2aed6ad2ed6880e76535359a6b45fda253.tar.bz2
Test find_package multiarch support (#12037)
Diffstat (limited to 'Tests/FindPackageTest')
-rw-r--r--Tests/FindPackageTest/CMakeLists.txt13
-rw-r--r--Tests/FindPackageTest/lib/arch/Bar/BarConfig.cmake1
-rw-r--r--Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config-version.cmake7
-rw-r--r--Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config.cmake1
-rw-r--r--Tests/FindPackageTest/lib/arch/foo-1.2/CMake/FooConfig.cmake1
-rw-r--r--Tests/FindPackageTest/lib/arch/zot-3.1/zot-config-version.cmake7
-rw-r--r--Tests/FindPackageTest/lib/arch/zot-3.1/zot-config.cmake1
7 files changed, 31 insertions, 0 deletions
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 <Package>_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.