diff options
author | Brad King <brad.king@kitware.com> | 2019-02-07 11:54:39 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-02-07 11:55:12 (GMT) |
commit | 982e6e777556de8db44b16b144ab62f4b7172319 (patch) | |
tree | 73c1c4137cdc714fa383b47fe8bff77bf5f1f763 /Tests | |
parent | 450a1904d5c7611806b8da55f2df72bcc0ddcacb (diff) | |
parent | dd45f23b0142fb92de17458dd69b2b6f967f94bd (diff) | |
download | CMake-982e6e777556de8db44b16b144ab62f4b7172319.zip CMake-982e6e777556de8db44b16b144ab62f4b7172319.tar.gz CMake-982e6e777556de8db44b16b144ab62f4b7172319.tar.bz2 |
Merge topic 'findcups'
dd45f23b01 FindCups: add imported target
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2917
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeLists.txt | 4 | ||||
-rw-r--r-- | Tests/FindCups/CMakeLists.txt | 10 | ||||
-rw-r--r-- | Tests/FindCups/Test/CMakeLists.txt | 16 | ||||
-rw-r--r-- | Tests/FindCups/Test/main.c | 12 |
4 files changed, 42 insertions, 0 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 86ad72c..8094c40 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1413,6 +1413,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release add_subdirectory(FindCURL) endif() + if(CMake_TEST_FindCups) + add_subdirectory(FindCups) + endif() + if(CMake_TEST_FindDoxygen) add_subdirectory(FindDoxygen) endif() diff --git a/Tests/FindCups/CMakeLists.txt b/Tests/FindCups/CMakeLists.txt new file mode 100644 index 0000000..5be1ac1 --- /dev/null +++ b/Tests/FindCups/CMakeLists.txt @@ -0,0 +1,10 @@ +add_test(NAME FindCups.Test COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindCups/Test" + "${CMake_BINARY_DIR}/Tests/FindCups/Test" + ${build_generator_args} + --build-project FindCups + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) diff --git a/Tests/FindCups/Test/CMakeLists.txt b/Tests/FindCups/Test/CMakeLists.txt new file mode 100644 index 0000000..9e90553 --- /dev/null +++ b/Tests/FindCups/Test/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.10) +project(TestFindCups C) +include(CTest) + +find_package(Cups REQUIRED) + +add_definitions(-DCMAKE_EXPECTED_CUPS_VERSION="${CUPS_VERSION_STRING}") + +add_executable(test_tgt main.c) +target_link_libraries(test_tgt Cups::Cups) +add_test(NAME test_tgt COMMAND test_tgt) + +add_executable(test_var main.c) +target_include_directories(test_var PRIVATE ${CUPS_INCLUDE_DIRS}) +target_link_libraries(test_var PRIVATE ${CUPS_LIBRARIES}) +add_test(NAME test_var COMMAND test_var) diff --git a/Tests/FindCups/Test/main.c b/Tests/FindCups/Test/main.c new file mode 100644 index 0000000..b69d621 --- /dev/null +++ b/Tests/FindCups/Test/main.c @@ -0,0 +1,12 @@ +#include <cups/cups.h> + +int main() +{ + int num_options = 0; + cups_option_t* options = NULL; + + num_options = cupsAddOption(CUPS_COPIES, "1", num_options, &options); + cupsFreeOptions(num_options, options); + + return 0; +} |