diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2016-01-19 17:43:05 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-01-21 18:58:15 (GMT) |
commit | 9b08c6233052fa1c3d393ee474c874f997491f7b (patch) | |
tree | bccb66d49c87c0f6533a2286ce235be0dcbcb5d2 /Tests/FindPNG/Test/CMakeLists.txt | |
parent | c13ed964012bcdf3765ada195db66930d6a0fcf9 (diff) | |
download | CMake-9b08c6233052fa1c3d393ee474c874f997491f7b.zip CMake-9b08c6233052fa1c3d393ee474c874f997491f7b.tar.gz CMake-9b08c6233052fa1c3d393ee474c874f997491f7b.tar.bz2 |
FindPNG: Create an imported PNG::PNG target (#15911)
Imported targets are now the recommended way of dealing with external
library dependencies. Add one for FindPNG and update documentation
accordingly. Also add a test case activated by CMake_TEST_FindPNG.
Diffstat (limited to 'Tests/FindPNG/Test/CMakeLists.txt')
-rw-r--r-- | Tests/FindPNG/Test/CMakeLists.txt | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Tests/FindPNG/Test/CMakeLists.txt b/Tests/FindPNG/Test/CMakeLists.txt new file mode 100644 index 0000000..ad50011 --- /dev/null +++ b/Tests/FindPNG/Test/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.4) +project(TestFindPNG C) +include(CTest) + +find_package(PNG REQUIRED) + +add_definitions(-DCMAKE_EXPECTED_PNG_VERSION="${PNG_VERSION_STRING}") + +add_executable(test_tgt main.c) +target_link_libraries(test_tgt PNG::PNG) +add_test(NAME test_tgt COMMAND test_tgt) + +add_executable(test_var main.c) +target_include_directories(test_var PRIVATE ${PNG_INCLUDE_DIRS}) +target_link_libraries(test_var PRIVATE ${PNG_LIBRARIES}) +add_test(NAME test_var COMMAND test_var) |