1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-05-03 05:53:52 +00:00
CLI11/tests/find_package_tests/CMakeLists.txt
Philip Top c071cb6297
fix: CMake package and pkgconfig rework (#916)
add tests that exercise the CMake module and pkg-config files

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-09-15 16:21:15 -04:00

20 lines
501 B
CMake

cmake_minimum_required(VERSION 3.10...3.26)
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")