Skip to content

Commit

Permalink
work on macos build in [travis]
Browse files Browse the repository at this point in the history
  • Loading branch information
oxy86 committed Nov 28, 2024
1 parent 0c5551e commit e5f90ae
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 9 deletions.
5 changes: 4 additions & 1 deletion scripts/travis_install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
32 changes: 24 additions & 8 deletions scripts/travis_make_build_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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 = "
Expand All @@ -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 "*****************************"
Expand All @@ -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 "*****************************"
Expand All @@ -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
Expand Down

0 comments on commit e5f90ae

Please sign in to comment.