Skip to content

Commit

Permalink
CMake: add static library installation of libclamav submodules
Browse files Browse the repository at this point in the history
For static builds, also install libclamav_rust, libclammspack, libclamunrar_iface,
and libclamunrar static libraries.
  • Loading branch information
driverxdw authored Nov 30, 2023
1 parent e3a0d9a commit 63fa9b4
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libclamav_rust/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,10 @@ if (WIN32)
target_link_libraries(clamav_rust PUBLIC INTERFACE Userenv)
endif()

if(WIN32)
install(FILES $<TARGET_FILE:clamav_rust> DESTINATION . COMPONENT libraries)
else()
install(FILES $<TARGET_FILE:clamav_rust> DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries)
endif()

add_library(ClamAV::libclamav_rust ALIAS clamav_rust)
6 changes: 6 additions & 0 deletions libclammspack/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ if(ENABLE_STATIC_LIB)
${CMAKE_CURRENT_BINARY_DIR}
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/mspack )

if(WIN32)
install(TARGETS clammspack_static DESTINATION . COMPONENT libraries)
else()
install(TARGETS clammspack_static DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries)
endif()

add_library( ClamAV::libmspack_static ALIAS clammspack_static )
if(NOT ENABLE_SHARED_LIB)
add_library( ClamAV::libmspack ALIAS clammspack_static )
Expand Down
6 changes: 6 additions & 0 deletions libclamunrar/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ if(ENABLE_STATIC_LIB)
COMPILE_FLAGS "-Wno-logical-op-parentheses -Wno-switch -Wno-dangling-else")
endif()

if(WIN32)
install(TARGETS clamunrar_static DESTINATION . COMPONENT libraries)
else()
install(TARGETS clamunrar_static DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries)
endif()

add_library( ClamAV::libunrar_static ALIAS clamunrar_static )
if(NOT ENABLE_SHARED_LIB)
add_library( ClamAV::libunrar ALIAS clamunrar_static )
Expand Down
6 changes: 6 additions & 0 deletions libclamunrar_iface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ if(ENABLE_UNRAR)
PRIVATE
ClamAV::libunrar_static )

if(WIN32)
install(TARGETS clamunrar_iface_static DESTINATION . COMPONENT libraries)
else()
install(TARGETS clamunrar_iface_static DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries)
endif()

add_library( ClamAV::libunrar_iface_static ALIAS clamunrar_iface_static )
if(NOT ENABLE_SHARED_LIB)
add_library( ClamAV::libunrar_iface ALIAS clamunrar_iface_static )
Expand Down

0 comments on commit 63fa9b4

Please sign in to comment.