Skip to content

Commit

Permalink
update the package_config_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
phlptp committed Aug 15, 2023
1 parent f9a2158 commit f88fa6e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 1 addition & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ if(CLI11_INSTALL_PACKAGE_TESTS)
package-config-tests
${CMAKE_CTEST_COMMAND}
-C
${CLI11_PACKAGE_TEST_BUILD_TYPE}
"-DCLI11_DIR=${CMAKE_INSTALL_PREFIX}"
--build-and-test
"${CMAKE_CURRENT_SOURCE_DIR}/package_config_tests"
"${CMAKE_CURRENT_BINARY_DIR}/package_config_tests"
Expand All @@ -348,7 +348,6 @@ if(CLI11_INSTALL_PACKAGE_TESTS)
--build-generator-platform
"${CMAKE_GENERATOR_PLATFORM}"
--build-options
"-DCLI11_VERSION=${CLI11_VERSION}"
"-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
"-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}"
${package_test_command})
Expand Down
9 changes: 5 additions & 4 deletions tests/package_config_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ project(CLI11-package-config-test)

include(CTest)

# Test the CLI11 CMake package config
find_package(CLI11 2.0 REQUIRED)

find_package(PkgConfig)

pkg_check_modules(CLI11 REQUIRED IMPORTED_TARGET cli11)
if(CLI11_DIR)
set(CMAKE_PREFIX_PATH ${CLI11_DIR})
endif()

pkg_check_modules(CLI11 REQUIRED IMPORTED_TARGET CLI11)

# Test the target
add_executable(package-config-test ../../examples/positional_validation.cpp)
Expand Down

0 comments on commit f88fa6e

Please sign in to comment.