mirror of
https://github.com/CLIUtils/CLI11.git
synced 2026-01-19 04:52:08 +00:00
3.15 is a good minimum these days, and what pybind11, etc. now use. (Edit: we are using some really old docker containers, so let's do 3.14+ for now). --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
20 lines
500 B
CMake
20 lines
500 B
CMake
cmake_minimum_required(VERSION 3.14...4.0)
|
|
|
|
project(CLI11-find-package-test)
|
|
|
|
include(CTest)
|
|
|
|
if(CLI11_DIR)
|
|
set(CMAKE_PREFIX_PATH ${CLI11_DIR})
|
|
endif()
|
|
|
|
# Test the CLI11 CMake package config
|
|
find_package(CLI11 2.0 REQUIRED)
|
|
|
|
# Test the target
|
|
add_executable(package-test ../../examples/positional_validation.cpp)
|
|
target_link_libraries(package-test CLI11::CLI11)
|
|
|
|
add_test(NAME package-test1 COMMAND package-test one)
|
|
set_property(TEST package-test1 PROPERTY PASS_REGULAR_EXPRESSION "File 1 = one")
|