Fossil SCM
| 6ea30fb… | florian | 1 | cmake_minimum_required(VERSION 3.12...3.31) |
| 6ea30fb… | florian | 2 | |
| 6ea30fb… | florian | 3 | project( |
| 6ea30fb… | florian | 4 | zlib_find_package_test |
| 6ea30fb… | florian | 5 | LANGUAGES C |
| 6ea30fb… | florian | 6 | VERSION @zlib_VERSION@) |
| 6ea30fb… | florian | 7 | |
| 6ea30fb… | florian | 8 | enable_testing() |
| 6ea30fb… | florian | 9 | option(ZLIB_BUILD_SHARED "" @ZLIB_BUILD_SHARED@) |
| 6ea30fb… | florian | 10 | option(ZLIB_BUILD_STATIC "" @ZLIB_BUILD_STATIC@) |
| 6ea30fb… | florian | 11 | |
| 6ea30fb… | florian | 12 | if(ZLIB_BUILD_SHARED) |
| 6ea30fb… | florian | 13 | find_package(ZLIB @zlib_VERSION@ CONFIG COMPONENTS shared REQUIRED) |
| 6ea30fb… | florian | 14 | add_executable(test_example @zlib_SOURCE_DIR@/test/example.c) |
| 6ea30fb… | florian | 15 | target_link_libraries(test_example ZLIB::ZLIB) |
| 6ea30fb… | florian | 16 | |
| 6ea30fb… | florian | 17 | if(NOT ${CMAKE_SHARED_LIBRARY_SUFFIX} STREQUAL ".dll") |
| 6ea30fb… | florian | 18 | add_test(NAME zlib_test_example_shared COMMAND test_example) |
| 6ea30fb… | florian | 19 | endif(NOT ${CMAKE_SHARED_LIBRARY_SUFFIX} STREQUAL ".dll") |
| 6ea30fb… | florian | 20 | endif(ZLIB_BUILD_SHARED) |
| 6ea30fb… | florian | 21 | |
| 6ea30fb… | florian | 22 | if(ZLIB_BUILD_STATIC) |
| 6ea30fb… | florian | 23 | find_package(ZLIB @zlib_VERSION@ CONFIG COMPONENTS static REQUIRED) |
| 6ea30fb… | florian | 24 | add_executable(test_example_static @zlib_SOURCE_DIR@/test/example.c) |
| 6ea30fb… | florian | 25 | target_link_libraries(test_example_static ZLIB::ZLIBSTATIC) |
| 6ea30fb… | florian | 26 | add_test(NAME zlib_test_example_static COMMAND test_example_static) |
| 6ea30fb… | florian | 27 | endif(ZLIB_BUILD_STATIC) |