summaryrefslogtreecommitdiffstats
path: root/Tests/FindPackageTest/SortLib-3.1.1
diff options
context:
space:
mode:
authorPierluigi Taddei <pierluigi.taddei@gmail.com>2016-09-08 18:26:59 (GMT)
committerBrad King <brad.king@kitware.com>2016-09-15 17:35:25 (GMT)
commit31be918b0b2dd445bdf85d72a8eaa29841137bc8 (patch)
tree35af3199ab0fb54a1722d67ecf2a573e3efc153d /Tests/FindPackageTest/SortLib-3.1.1
parent010140311a0aa9336b7e2a2d22c177d445ee1c32 (diff)
downloadCMake-31be918b0b2dd445bdf85d72a8eaa29841137bc8.zip
CMake-31be918b0b2dd445bdf85d72a8eaa29841137bc8.tar.gz
CMake-31be918b0b2dd445bdf85d72a8eaa29841137bc8.tar.bz2
find_package: Optionally sort globbed directories in a meaningful order
Add `CMAKE_FIND_PACKAGE_SORT_{ORDER,DIRECTION}` variables to specify sort order and direction. When multiple package with the same name have been found in the same location sorting option can be used to force a specific version to be loaded (e.g. libA_1.12.0 instead of libA_1.1.0). Currently sorting by NAME and by NATURAL order have been implemented. Natural ordering makes use of the `strverscmp(3)` ordering.
Diffstat (limited to 'Tests/FindPackageTest/SortLib-3.1.1')
-rw-r--r--Tests/FindPackageTest/SortLib-3.1.1/SortLibConfig.cmake2
-rw-r--r--Tests/FindPackageTest/SortLib-3.1.1/SortLibConfigVersion.cmake9
2 files changed, 11 insertions, 0 deletions
diff --git a/Tests/FindPackageTest/SortLib-3.1.1/SortLibConfig.cmake b/Tests/FindPackageTest/SortLib-3.1.1/SortLibConfig.cmake
new file mode 100644
index 0000000..c1f2088
--- /dev/null
+++ b/Tests/FindPackageTest/SortLib-3.1.1/SortLibConfig.cmake
@@ -0,0 +1,2 @@
+set(SORT_LIB_VERSION 3.1.1)
+message("SortLib 3.1.1 config reached")
diff --git a/Tests/FindPackageTest/SortLib-3.1.1/SortLibConfigVersion.cmake b/Tests/FindPackageTest/SortLib-3.1.1/SortLibConfigVersion.cmake
new file mode 100644
index 0000000..fa927c7
--- /dev/null
+++ b/Tests/FindPackageTest/SortLib-3.1.1/SortLibConfigVersion.cmake
@@ -0,0 +1,9 @@
+set(PACKAGE_VERSION 3.1.1)
+if(PACKAGE_FIND_VERSION_MAJOR EQUAL 3)
+ if(PACKAGE_FIND_VERSION_MINOR EQUAL 1)
+ set(PACKAGE_VERSION_COMPATIBLE 1)
+ if(PACKAGE_FIND_VERSION_PATCH EQUAL 1)
+ set(PACKAGE_VERSION_EXACT 1)
+ endif()
+ endif()
+endif()