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.
10 lines
255 B
CMake
10 lines
255 B
CMake
set(PACKAGE_VERSION 3.10.1)
|
|
if(PACKAGE_FIND_VERSION_MAJOR EQUAL 3)
|
|
if(PACKAGE_FIND_VERSION_MINOR EQUAL 10)
|
|
set(PACKAGE_VERSION_COMPATIBLE 1)
|
|
if(PACKAGE_FIND_VERSION_PATCH EQUAL 1)
|
|
set(PACKAGE_VERSION_EXACT 1)
|
|
endif()
|
|
endif()
|
|
endif()
|