From e5f90ae901cf42b0aa99ec3d2927b58c7f4530f2 Mon Sep 17 00:00:00 2001 From: Dimitris Kalamaras Date: Thu, 28 Nov 2024 22:42:02 +0200 Subject: [PATCH] work on macos build in [travis] --- scripts/travis_install_deps.sh | 5 ++++- scripts/travis_make_build_macos.sh | 32 ++++++++++++++++++++++-------- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/scripts/travis_install_deps.sh b/scripts/travis_install_deps.sh index 83b34ffd..41912902 100644 --- a/scripts/travis_install_deps.sh +++ b/scripts/travis_install_deps.sh @@ -58,7 +58,10 @@ elif [ "${TRAVIS_OS_NAME}" == "osx" ]; then # Add Qt binaries to path echo "Adding qt binaries installation path to system PATH..." # PATH=/usr/local/opt/qt/bin/:${PATH} - export PATH="$(brew --prefix qt)/bin:$PATH" + # Ensure Homebrew Qt is accessible in PATH + echo 'export PATH="$(brew --prefix qt)/bin:$PATH"' >> ~/.bash_profile; + source ~/.bash_profile; + else exit 1 fi diff --git a/scripts/travis_make_build_macos.sh b/scripts/travis_make_build_macos.sh index 42f3db5f..d8c2affb 100644 --- a/scripts/travis_make_build_macos.sh +++ b/scripts/travis_make_build_macos.sh @@ -4,6 +4,9 @@ echo "************************************************" echo "* STAGE 'script': Building SocNetV for macOS *" echo "************************************************" +# Set the project name as app name +APP_NAME="SocNetV" + # Check current directory project_dir=$(pwd) echo "Project dir is: ${project_dir}" @@ -34,6 +37,21 @@ else fi echo "VERSION = ${VERSION}"; + +# SYSTEM CHECK +# Ensure Qt is installed and in PATH +export PATH="$(brew --prefix qt)/bin:$PATH" + +# Debugging: Check if qmake is found +if ! command -v qmake &> /dev/null; then + echo "Error: qmake not found. Ensure Qt is installed and added to PATH." + exit 1 +fi + +echo "" +echo "qmake version = " +qmake -version + # Print macOS version echo "" echo "macOS version = " @@ -43,9 +61,9 @@ sw_vers echo "Xcode build version = " xcrun -sdk macosx --show-sdk-path -APP_NAME="SocNetV" -# Build your app + +# Build the app echo "*****************************" echo "Building ${APP_NAME} ${VERSION}..." echo "*****************************" @@ -57,15 +75,13 @@ echo "Running qmake to configure it as release..." qmake QMAKE_APPLE_DEVICE_ARCHS="x86_64 arm64" -config release echo "Running make to compile the source code..." -make -j4 - -echo "Finished building!" +make -j$(sysctl -n hw.ncpu) -echo "Current dir contents now:" +echo "Finished building! Current dir contents now:" find . -# Package your app +# Package the app echo "*****************************" echo "Packaging ${APP_NAME} ${VERSION}..." echo "*****************************" @@ -74,7 +90,7 @@ echo "Entering project dir ${project_dir} ..." cd ${project_dir}/ -# Remove build directories that you don't want to deploy +# Remove build directories that we don't want to deploy echo "Removing items we do not deploy from project dir ${project_dir}..." rm -rf moc rm -rf obj