zlib installed but not found while building
-
I get this error while running
cmake .. -DBUILD_WITH_QT6=ON
-- Configuring done CMake Error at src/CMakeLists.txt:1068 (add_library): Target "strawberry_lib" links to target "ZLIB::ZLIB" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing? CMake Error at src/CMakeLists.txt:1265 (add_executable): Target "strawberry" links to target "ZLIB::ZLIB" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing? CMake Error at ext/libstrawberry-tagreader/CMakeLists.txt:35 (add_library): Target "libstrawberry-tagreader" links to target "ZLIB::ZLIB" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing? CMake Error at ext/strawberry-tagreader/CMakeLists.txt:20 (add_executable): Target "strawberry-tagreader" links to target "ZLIB::ZLIB" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing? -- Generating done CMake Generate step failed. Build files cannot be regenerated correctly.
I have zlib and all the other requirements installed. Does anybody know how to solve this error? Thanks
-
@berry
This seem like a bug with your systems cmake files. Something is adding zlib::zlib, but the target isn't set. Protobuf is probably what's linking to zlib.
Try addingfind_package(ZLIB REQUIRED)
, or manually addingProtobuf_LIBRARIES
to the cmake command as a workaround. -
@jonas Thanks, that worked!
This seem like a bug with your systems cmake files.
I'm not sure how that happened. I'm using unmodified src code.