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_TESTING "" OFF) |
| 6ea30fb… | florian | 10 | option(ZLIB_BUILD_SHARED "" @ZLIB_BUILD_SHARED@) |
| 6ea30fb… | florian | 11 | option(ZLIB_BUILD_STATIC "" @ZLIB_BUILD_STATIC@) |
| 6ea30fb… | florian | 12 | |
| 6ea30fb… | florian | 13 | add_subdirectory(@zlib_SOURCE_DIR@ ${CMAKE_CURRENT_BINARY_DIR}/zlib) |
| 6ea30fb… | florian | 14 | |
| 6ea30fb… | florian | 15 | if(ZLIB_BUILD_SHARED) |
| 6ea30fb… | florian | 16 | add_executable(test_example @zlib_SOURCE_DIR@/test/example.c) |
| 6ea30fb… | florian | 17 | target_link_libraries(test_example ZLIB::ZLIB) |
| 6ea30fb… | florian | 18 | |
| 6ea30fb… | florian | 19 | if(NOT ${CMAKE_SHARED_LIBRARY_SUFFIX} STREQUAL ".dll") |
| 6ea30fb… | florian | 20 | add_test(NAME zlib_test_example_shared COMMAND test_example) |
| 6ea30fb… | florian | 21 | endif(NOT ${CMAKE_SHARED_LIBRARY_SUFFIX} STREQUAL ".dll") |
| 6ea30fb… | florian | 22 | endif(ZLIB_BUILD_SHARED) |
| 6ea30fb… | florian | 23 | |
| 6ea30fb… | florian | 24 | if(ZLIB_BUILD_STATIC) |
| 6ea30fb… | florian | 25 | add_executable(test_example_static @zlib_SOURCE_DIR@/test/example.c) |
| 6ea30fb… | florian | 26 | target_link_libraries(test_example_static ZLIB::ZLIBSTATIC) |
| 6ea30fb… | florian | 27 | add_test(NAME zlib_test_example_static COMMAND test_example_static) |
| 6ea30fb… | florian | 28 | endif(@ZLIB_BUILD_STATIC) |