当使用 cmake 配置以编译 azerothcore 时,我收到一个无法找到 ZLIB 的 CMake 错误。
这就是我得到的:
Lees-MBP-2:build leeelliott$ export OPENSSL_ROOT_DIR=$(brew --prefix [email protected])
Lees-MBP-2:build leeelliott$ cmake ../ \
> -DCMAKE_INSTALL_PREFIX=/leeelliott/azerothcore/server/ \
> -DTOOLS_BUILD=all \
> -DSCRIPTS=static \
> -DMYSQL_ADD_INCLUDE_PATH=/opt/homebrew/include/mysql \
> -DMYSQL_LIBRARY=/opt/homebrew/lib/libmysqlclient.dylib \
> -DREADLINE_INCLUDE_DIR=/opt/homebrew/opt/readline/include \
> -DREADLINE_LIBRARY=/opt/homebrew/opt/readline/lib/libreadline.dylib \
> -DOPENSSL_INCLUDE_DIR="$OPENSSL_ROOT_DIR/include" \
> -DOPENSSL_SSL_LIBRARIES="$OPENSSL_ROOT_DIR/lib/libssl.dylib" \
> -DOPENSSL_CRYPTO_LIBRARIES="$OPENSSL_ROOT_DIR/lib/libcrypto.dylib"
-- CMake version: 3.27.1
-- Running cmake hook: AFTER_LOAD_CONF
-- No hooks registered for AFTER_LOAD_CONF
-- Enabled С++20 standard
-- Detected 64-bit platform
-- UNIX: Using default configuration directory
-- UNIX: Using default library directory
-- UNIX: Configuring uninstall target
-- UNIX: Created uninstall target
-- UNIX: Detected compiler: /usr/bin/cc
-- Clang: Minimum version required is 10.0.0, found 14.0.0.14000029 - ok!
-- Running cmake hook: AFTER_LOAD_CMAKE_MODULES
-- No hooks registered for AFTER_LOAD_CMAKE_MODULES
-- Using mysql-config: /usr/local/bin/mysql_config
-- Found MySQL library: /opt/homebrew/lib/libmysqlclient.dylib
-- Found MySQL headers: /usr/local/include/mysql
-- Found MySQL executable: /usr/local/bin/mysql
-- Found git binary : /usr/local/bin/git
* AzerothCore revision : a5e84f610a0e 2023-07-26 11:53:12 +0000 (master branch)
* AzerothCore buildtype : RelWithDebInfo
* Install core to : /leeelliott/azerothcore/server
* Install libraries to : /leeelliott/azerothcore/server/lib
* Install configs to : /leeelliott/azerothcore/server/etc
* Build applications : Yes (all)
* Build tools : Yes (all)
* Build with scripts : Yes (static)
* Build with modules : Yes (static)
* Build unit tests : No (default)
* Build core w/PCH : Yes (default)
* Build scripts w/PCH : Yes (default)
* Show compile-warnings : No (default)
* Use coreside debug : No (default)
* Use unix gperftools : No (default)
* Use GIT revision hash : Yes (default)
* Enable vmap DisableMgr checks : Yes (default)
* Show source tree : No (For UNIX default)
-- Found OpenSSL library: /usr/local/opt/[email protected]/lib/libssl.dylib;/usr/local/opt/[email protected]/lib/libcrypto.dylib
-- Found OpenSSL headers: /usr/local/opt/[email protected]/include
CMake Error at /usr/local/Cellar/cmake/3.27.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find ZLIB (missing: ZLIB_LIBRARY)
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.27.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
/usr/local/Cellar/cmake/3.27.1/share/cmake/Modules/FindZLIB.cmake:200 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
deps/zlib/CMakeLists.txt:15 (find_package)
-- Configuring incomplete, errors occurred!
我已经使用
brew install zlib
安装了 zlib
Zlib 文件夹似乎位于 /usr/local/cellar/zlib/
如何让 cmake 识别/找到 zlib?