mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-28 09:59:20 -05:00
3e6466eb16
Teach find_package to check a CPS package's version (when provided) against a version request given to the find_package invocation.
14 lines
438 B
CMake
14 lines
438 B
CMake
cmake_minimum_required(VERSION 4.0)
|
|
|
|
include(Setup.cmake)
|
|
|
|
set(CMAKE_FIND_PACKAGE_SORT_ORDER NAME)
|
|
set(CMAKE_FIND_PACKAGE_SORT_DIRECTION ASC)
|
|
|
|
###############################################################################
|
|
# Test finding a package with a versioned dependency.
|
|
find_package(TransitiveVersion REQUIRED)
|
|
if(NOT Sample_VERSION STREQUAL "1.2.3+clarke")
|
|
message(SEND_ERROR "Sample wrong version ${Sample_VERSION} !")
|
|
endif()
|