diff options
author | Patrick Gansterer <paroga@paroga.com> | 2019-02-05 05:51:20 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-02-06 16:20:57 (GMT) |
commit | dd45f23b0142fb92de17458dd69b2b6f967f94bd (patch) | |
tree | 7154ac3c3a25cc991489ba32ac9299f99cc3deee /Tests/FindCups/Test | |
parent | 062cfd991faac000d484c74e5af7d65726c655dc (diff) | |
download | CMake-dd45f23b0142fb92de17458dd69b2b6f967f94bd.zip CMake-dd45f23b0142fb92de17458dd69b2b6f967f94bd.tar.gz CMake-dd45f23b0142fb92de17458dd69b2b6f967f94bd.tar.bz2 |
FindCups: add imported target
Diffstat (limited to 'Tests/FindCups/Test')
-rw-r--r-- | Tests/FindCups/Test/CMakeLists.txt | 16 | ||||
-rw-r--r-- | Tests/FindCups/Test/main.c | 12 |
2 files changed, 28 insertions, 0 deletions
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; +} |