mirror of
https://github.com/madler/zlib.git
synced 2026-01-18 17:11:27 +01:00
CMake: Add install-target for contrib/testzlib.
This commit is contained in:
@@ -9,14 +9,36 @@ project(
|
||||
|
||||
option(ZLIB_TESTZLIB_BUILD_SHARED "Enable building testzlib" ON)
|
||||
option(ZLIB_TESTZLIB_BUILD_STATIC "Enable building static linked testzlib" ON)
|
||||
option(ZLIB_TESTZLIB_BUILD_TESTING "Enable building tests for testzlib" ON)
|
||||
option(ZLIB_TESTZLIB_INSTALL "Enable installation of testzlib" ON)
|
||||
|
||||
if(ZLIB_TESTZLIB_BUILD_SHARED)
|
||||
add_executable(testzlib testzlib.c)
|
||||
target_link_libraries(testzlib PRIVATE ZLIB::ZLIB)
|
||||
add_executable(zlib_testzlib testzlib.c)
|
||||
target_link_libraries(zlib_testzlib PRIVATE ZLIB::ZLIB)
|
||||
|
||||
set_target_properties(zlib_testzlib
|
||||
PROPERTIES
|
||||
OUTPUT_NAME testzlib)
|
||||
|
||||
if(ZLIB_TESTZLIB_INSTALL)
|
||||
install(
|
||||
TARGETS zlib_testzlib
|
||||
COMPONENT Runtime
|
||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||
endif(ZLIB_TESTZLIB_INSTALL)
|
||||
endif(ZLIB_TESTZLIB_BUILD_SHARED)
|
||||
|
||||
if(ZLIB_TESTZLIB_BUILD_STATIC)
|
||||
add_executable(testzlibStatic testzlib.c)
|
||||
target_link_libraries(testzlibStatic PRIVATE ZLIB::ZLIBSTATIC)
|
||||
add_executable(zlib_testzlibStatic testzlib.c)
|
||||
target_link_libraries(zlib_testzlibStatic PRIVATE ZLIB::ZLIBSTATIC)
|
||||
|
||||
set_target_properties(zlib_testzlibStatic
|
||||
PROPERTIES
|
||||
OUTPUT_NAME testzlibStatic)
|
||||
|
||||
if(ZLIB_TESTZLIB_INSTALL)
|
||||
install(
|
||||
TARGETS zlib_testzlibStatic
|
||||
COMPONENT Runtime
|
||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||
endif(ZLIB_TESTZLIB_INSTALL)
|
||||
endif(ZLIB_TESTZLIB_BUILD_STATIC)
|
||||
|
||||
Reference in New Issue
Block a user