[test-suite] r260738 - [test-suite] Use cmake `find_package` to search zLib for ClamAV test case

Simon Atanasyan via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 12 13:21:36 PST 2016


Author: atanasyan
Date: Fri Feb 12 15:21:36 2016
New Revision: 260738

URL: http://llvm.org/viewvc/llvm-project?rev=260738&view=rev
Log:
[test-suite] Use cmake `find_package` to search zLib for ClamAV test case

- in case of cross-compilation using `find_package` allows to provide
  path to target specific libraries using single CMAKE_PREFIX_PATH variable.

- zLib is manadatory for ClamAV test case so if it does not exist it is
  better to get know about that early

Differential Revision: http://reviews.llvm.org/D17196

Modified:
    test-suite/trunk/MultiSource/Applications/ClamAV/CMakeLists.txt

Modified: test-suite/trunk/MultiSource/Applications/ClamAV/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/CMakeLists.txt?rev=260738&r1=260737&r2=260738&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Applications/ClamAV/CMakeLists.txt (original)
+++ test-suite/trunk/MultiSource/Applications/ClamAV/CMakeLists.txt Fri Feb 12 15:21:36 2016
@@ -12,7 +12,12 @@ set(Source ${TMP1} ${TMP2} ${TMP3} ${TMP
 set(INPUT ${CMAKE_CURRENT_SOURCE_DIR}/inputs/clam.cab ${CMAKE_CURRENT_SOURCE_DIR}/inputs/clamdoc.tar.gz ${CMAKE_CURRENT_SOURCE_DIR}/inputs/clam.exe ${CMAKE_CURRENT_SOURCE_DIR}/inputs/clam.exe.bz2 ${CMAKE_CURRENT_SOURCE_DIR}/inputs/clam-v2.rar ${CMAKE_CURRENT_SOURCE_DIR}/inputs/clam-v3.rar ${CMAKE_CURRENT_SOURCE_DIR}/inputs/clam.zip ${CMAKE_CURRENT_SOURCE_DIR}/inputs/README ${CMAKE_CURRENT_SOURCE_DIR}/inputs/rtf-test/Doc11.rtf ${CMAKE_CURRENT_SOURCE_DIR}/inputs/rtf-test/Doc1.rtf ${CMAKE_CURRENT_SOURCE_DIR}/inputs/rtf-test/Doc22.rtf ${CMAKE_CURRENT_SOURCE_DIR}/inputs/rtf-test/Doc2.rtf ${CMAKE_CURRENT_SOURCE_DIR}/inputs/rtf-test/doc3.rtf ${CMAKE_CURRENT_SOURCE_DIR}/inputs/rtf-test/docCLAMexe.rtf ${CMAKE_CURRENT_SOURCE_DIR}/inputs/rtf-test/rtf1.rtf ${CMAKE_CURRENT_SOURCE_DIR}/inputs/rtf-test/rtf-novirus.rtf)
 set(PROG clamscan)
 list(APPEND CPPFLAGS -DHAVE_CONFIG_H -I. -DDONT_LOCK_DBDIRS)
-set(LDFLAGS -lz)
+
+# Find zLib library required for building ClamAV
+find_package(ZLIB REQUIRED)
+include_directories(${ZLIB_INCLUDE_DIRS})
+set(LDFLAGS ${ZLIB_LIBRARIES})
+
 set(RUN_OPTIONS --debug --exclude-dir .svn --verbose -d${CMAKE_CURRENT_SOURCE_DIR}/dbdir -r ${INPUT})
 if("${TARGET_OS}" STREQUAL "Darwin")
   list(APPEND CPPFLAGS -DC_DARWIN)




More information about the llvm-commits mailing list