Skip to content

Commit

Permalink
CMake Windows: fix issue building with tests and also unrar or mspack…
Browse files Browse the repository at this point in the history
… disabled
  • Loading branch information
micahsnyder committed Sep 7, 2022
1 parent cba4246 commit 742ee42
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions unit_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -469,12 +469,16 @@ if(WIN32)

# Collect our libs
file(COPY $<TARGET_FILE:ClamAV::libclamav> DESTINATION $<TARGET_FILE_DIR:check_clamav>)
if(NOT ENABLE_EXTERNAL_MSPACK)
file(COPY $<TARGET_FILE:ClamAV::libmspack> DESTINATION $<TARGET_FILE_DIR:check_clamav>)
endif()
file(COPY $<TARGET_FILE:ClamAV::libfreshclam> DESTINATION $<TARGET_FILE_DIR:check_clamav>)
file(COPY $<TARGET_FILE:ClamAV::libunrar> DESTINATION $<TARGET_FILE_DIR:check_clamav>)
file(COPY $<TARGET_FILE:ClamAV::libunrar_iface> DESTINATION $<TARGET_FILE_DIR:check_clamav>)
if ($<TARGET_EXISTS:ClamAV::libmspack>)
file(COPY $<TARGET_FILE:$<IF:$<TARGET_EXISTS:ClamAV::libmspack>,ClamAV::libmspack,check_clamav>> DESTINATION $<TARGET_FILE_DIR:check_clamav>)
endif()
if ($<TARGET_EXISTS:ClamAV::libunrar>)
file(COPY $<TARGET_FILE:$<IF:$<TARGET_EXISTS:ClamAV::libunrar>,ClamAV::libunrar,check_clamav>> DESTINATION $<TARGET_FILE_DIR:check_clamav>)
endif()
if ($<TARGET_EXISTS:ClamAV::libunrar_iface>)
file(COPY $<TARGET_FILE:$<IF:$<TARGET_EXISTS:ClamAV::libunrar_iface>,ClamAV::libunrar_iface,check_clamav>> DESTINATION $<TARGET_FILE_DIR:check_clamav>)
endif()

# Collect our apps
file(COPY $<TARGET_FILE:check_fpu_endian> DESTINATION $<TARGET_FILE_DIR:check_fpu_endian>)
Expand Down Expand Up @@ -520,11 +524,15 @@ if(WIN32)

# Collect our libs
file(COPY $<TARGET_FILE:ClamAV::libclamav> DESTINATION $<TARGET_FILE_DIR:check_clamav>)
if(NOT ENABLE_EXTERNAL_MSPACK)
file(COPY $<TARGET_FILE:ClamAV::libmspack> DESTINATION $<TARGET_FILE_DIR:check_clamav>)
if ($<TARGET_EXISTS:ClamAV::libmspack>)
file(COPY $<TARGET_FILE:$<IF:$<TARGET_EXISTS:ClamAV::libmspack>,ClamAV::libmspack,check_clamav>> DESTINATION $<TARGET_FILE_DIR:check_clamav>)
endif()
if ($<TARGET_EXISTS:ClamAV::libunrar>)
file(COPY $<TARGET_FILE:$<IF:$<TARGET_EXISTS:ClamAV::libunrar>,ClamAV::libunrar,check_clamav>> DESTINATION $<TARGET_FILE_DIR:check_clamav>)
endif()
if ($<TARGET_EXISTS:ClamAV::libunrar_iface>)
file(COPY $<TARGET_FILE:$<IF:$<TARGET_EXISTS:ClamAV::libunrar_iface>,ClamAV::libunrar_iface,check_clamav>> DESTINATION $<TARGET_FILE_DIR:check_clamav>)
endif()
file(COPY $<TARGET_FILE:ClamAV::libunrar> DESTINATION $<TARGET_FILE_DIR:check_clamav>)
file(COPY $<TARGET_FILE:ClamAV::libunrar_iface> DESTINATION $<TARGET_FILE_DIR:check_clamav>)
]])
endif()

Expand Down

0 comments on commit 742ee42

Please sign in to comment.