[clamav-users] "BZIP2_LIBRARIES" breaks cmake build

anctop at gmail.com anctop at gmail.com
Sun Jan 16 06:02:09 UTC 2022


Hi,

I am writing to report that the cmake build method will be broken if the 
"BZIP2_LIBRARIES" parameter is set.

The build is successful with this :
| cmake .. \
|  -D CMAKE_BUILD_TYPE=Release \
|  -D ENABLE_JSON_SHARED=OFF \
|  -D JSONC_INCLUDE_DIR=<path-to-json-c>/include/json-c \
|  -D JSONC_LIBRARY=<path-to-json-c>/lib/libjson-c.a

But it fails when "BZIP2_LIBRARIES" is used :
| cmake .. \
|  -D CMAKE_BUILD_TYPE=Release \
|  -D ENABLE_JSON_SHARED=OFF \
|  -D BZIP2_LIBRARIES=<path-to-bzip2>/lib/libbz2.a \
|  -D JSONC_INCLUDE_DIR=<path-to-json-c>/include/json-c \
|  -D JSONC_LIBRARY=<path-to-json-c>/lib/libjson-c.a

Between the lines "-- Configuring done" and "-- Generating done", the 
following block of text is repeated 17 times :
| CMake Warning (dev) in CMakeLists.txt:
|   Policy CMP0111 is not set: An imported target missing its location property
|   fails during generation.  Run "cmake --help-policy CMP0111" for policy
|   details.  Use the cmake_policy command to set the policy and suppress this
|   warning.
|
|   IMPORTED_LOCATION not set for imported target "BZip2::BZip2" configuration
|   "Release".
| This warning is for project developers.  Use -Wno-dev to suppress it.

If "make" is then invoked, it will stop at 52% of progress :
| [ 51%] Built target tgt_clam_IScab_ext.exe
| [ 51%] Built target tomsfastmath
| libclamav/CMakeFiles/clamav.dir/build.make:2445: *** target pattern contains no '%'.  Stop.
| make[1]: *** [CMakeFiles/Makefile2:1562: libclamav/CMakeFiles/clamav.dir/all] Error 2
| make[1]: *** Waiting for unfinished jobs....
| [ 52%] Linking CXX shared library libclamunrar.so
| [ 52%] Built target clamunrar
| make: *** [Makefile:166: all] Error 2

Parameters for other dependencies (e.g. "OPENSSL_CRYPTO_LIBRARY", 
"LIBXML2_LIBRARY", etc) have not caused any problem.


More information about the clamav-users mailing list