CMakeLists.txt 484 B

12345678910111213141516
  1. cmake_minimum_required(VERSION 3.4)
  2. project(TestFindPNG C)
  3. include(CTest)
  4. find_package(PNG REQUIRED)
  5. add_definitions(-DCMAKE_EXPECTED_PNG_VERSION="${PNG_VERSION_STRING}")
  6. add_executable(test_tgt main.c)
  7. target_link_libraries(test_tgt PNG::PNG)
  8. add_test(NAME test_tgt COMMAND test_tgt)
  9. add_executable(test_var main.c)
  10. target_include_directories(test_var PRIVATE ${PNG_INCLUDE_DIRS})
  11. target_link_libraries(test_var PRIVATE ${PNG_LIBRARIES})
  12. add_test(NAME test_var COMMAND test_var)