Fossil SCM
| 6ea30fb… | florian | 1 | cmake_minimum_required(VERSION 3.12...3.31) |
| 6ea30fb… | florian | 2 | |
| 6ea30fb… | florian | 3 | project( |
| 6ea30fb… | florian | 4 | testzlib |
| 6ea30fb… | florian | 5 | VERSION 1.0.0 |
| 6ea30fb… | florian | 6 | LANGUAGES C |
| 6ea30fb… | florian | 7 | DESCRIPTION "A little program to test zlib" |
| 6ea30fb… | florian | 8 | HOMEPAGE_URL "https://www.zlib.net") |
| 6ea30fb… | florian | 9 | |
| 6ea30fb… | florian | 10 | option(ZLIB_TESTZLIB_BUILD_SHARED "Enable building testzlib" ON) |
| 6ea30fb… | florian | 11 | option(ZLIB_TESTZLIB_BUILD_STATIC "Enable building static linked testzlib" ON) |
| 6ea30fb… | florian | 12 | option(ZLIB_TESTZLIB_INSTALL "Enable installation of testzlib" ON) |
| 6ea30fb… | florian | 13 | |
| 6ea30fb… | florian | 14 | if(ZLIB_TESTZLIB_BUILD_SHARED) |
| 6ea30fb… | florian | 15 | add_executable(zlib_testzlib testzlib.c) |
| 6ea30fb… | florian | 16 | target_link_libraries(zlib_testzlib PRIVATE ZLIB::ZLIB) |
| 6ea30fb… | florian | 17 | |
| 6ea30fb… | florian | 18 | set_target_properties(zlib_testzlib |
| 6ea30fb… | florian | 19 | PROPERTIES |
| 6ea30fb… | florian | 20 | OUTPUT_NAME testzlib) |
| 6ea30fb… | florian | 21 | |
| 6ea30fb… | florian | 22 | if(ZLIB_TESTZLIB_INSTALL) |
| 6ea30fb… | florian | 23 | install( |
| 6ea30fb… | florian | 24 | TARGETS zlib_testzlib |
| 6ea30fb… | florian | 25 | COMPONENT Runtime |
| 6ea30fb… | florian | 26 | RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") |
| 6ea30fb… | florian | 27 | endif(ZLIB_TESTZLIB_INSTALL) |
| 6ea30fb… | florian | 28 | endif(ZLIB_TESTZLIB_BUILD_SHARED) |
| 6ea30fb… | florian | 29 | |
| 6ea30fb… | florian | 30 | if(ZLIB_TESTZLIB_BUILD_STATIC) |
| 6ea30fb… | florian | 31 | add_executable(zlib_testzlibStatic testzlib.c) |
| 6ea30fb… | florian | 32 | target_link_libraries(zlib_testzlibStatic PRIVATE ZLIB::ZLIBSTATIC) |
| 6ea30fb… | florian | 33 | |
| 6ea30fb… | florian | 34 | set_target_properties(zlib_testzlibStatic |
| 6ea30fb… | florian | 35 | PROPERTIES |
| 6ea30fb… | florian | 36 | OUTPUT_NAME testzlibStatic) |
| 6ea30fb… | florian | 37 | |
| 6ea30fb… | florian | 38 | if(ZLIB_TESTZLIB_INSTALL) |
| 6ea30fb… | florian | 39 | install( |
| 6ea30fb… | florian | 40 | TARGETS zlib_testzlibStatic |
| 6ea30fb… | florian | 41 | COMPONENT Runtime |
| 6ea30fb… | florian | 42 | RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") |
| 6ea30fb… | florian | 43 | endif(ZLIB_TESTZLIB_INSTALL) |
| 6ea30fb… | florian | 44 | endif(ZLIB_TESTZLIB_BUILD_STATIC) |