dkcornz
dkcornz

Reputation: 11

Problem with CMake and SQL Build on Mac in Azerothcore

CMake Error at src/cmake/macros/FindMySQL.cmake:302 (message):
  Could not find MySQL headers! Please install the development libraries and
  headers
Call Stack (most recent call first):
  CMakeLists.txt:102 (find_package)

The problem I'm facing is in the configuration step. Unsure of what exactly I have to change, is it just the path to the server? I.e.:/opt/homebrew/var/mysql/

I've tried that, and it's throwing the above error.

https://www.azerothcore.org/wiki/macos-core-installation#:~:text=Configuring%20for%20compiling,lib/libcrypto.dylib%22

I've tried identifying the path of the sql server, installed with Brew. Including that in the script.

Upvotes: 1

Views: 491

Answers (1)

Michal
Michal

Reputation: 2532

The AzerothCore wiki, as of the writing of this answer, contains a CMake command for MacOS that assumes an Apple Silicon CPU. Homebrew installs packages in /opt/homebrew for such Macs, and in /usr/local for Intel CPUs.

You would have to change up the paths for a few of the brew install'ed libraries:

export OPENSSL_ROOT_DIR=$(brew --prefix openssl@3)
cmake ../ \
-DCMAKE_INSTALL_PREFIX=$HOME/azeroth-server/  \
-DTOOLS_BUILD=all \
-DSCRIPTS=static \
-DMYSQL_ADD_INCLUDE_PATH=/usr/local/include/mysql \
-DMYSQL_LIBRARY=/usr/local/opt/mysql/lib/libmysqlclient.dylib \
-DREADLINE_INCLUDE_DIR=/usr/local/opt/readline/include \
-DREADLINE_LIBRARY=/usr/local/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"

I encountered this issue myself, and put in a pull request to the AC wiki to include this separate CMake command for Intel CPU Macs. Soon, perhaps, this will be remedied in the docs themselves.

The wiki is now up to date with the information in this answer.

Upvotes: 0

Related Questions