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>
22 lines
622 B
CMake
22 lines
622 B
CMake
cmake_minimum_required(VERSION 3.14...4.0)
|
|
|
|
project(CLI11-package-config-test)
|
|
|
|
include(CTest)
|
|
|
|
find_package(PkgConfig)
|
|
|
|
if(CLI11_DIR)
|
|
set(CMAKE_PREFIX_PATH ${CLI11_DIR} ${CLI11_DIR}/lib)
|
|
endif()
|
|
|
|
message(STATUS "${CLI11_DIR}-- ${CMAKE_PREFIX_PATH}")
|
|
pkg_check_modules(CLI11 REQUIRED IMPORTED_TARGET CLI11)
|
|
|
|
# Test the target
|
|
add_executable(package-config-test ../../examples/positional_validation.cpp)
|
|
target_link_libraries(package-config-test PkgConfig::CLI11)
|
|
|
|
add_test(NAME package-config-test1 COMMAND package-config-test one)
|
|
set_property(TEST package-config-test1 PROPERTY PASS_REGULAR_EXPRESSION "File 1 = one")
|