Skip to content

Commit

Permalink
Homebrew CI: set Python3_EXECUTABLE in cmake (#1110)
Browse files Browse the repository at this point in the history
If the formula of the package being tested defines a
python_cmake_arg method, then set Python3_EXECUTABLE
when invoking cmake. Also append to CMAKE_ARGS variable.

Signed-off-by: Steve Peters <[email protected]>
  • Loading branch information
scpeters authored Jan 30, 2024
1 parent 1dfd981 commit 9c2ad95
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ if brew ruby -e "exit ! '${PROJECT_FORMULA}'.f.recursive_dependencies.map(&:name
fi
# set cmake args if we are using qwt-qt5
if brew ruby -e "exit ! '${PROJECT_FORMULA}'.f.recursive_dependencies.map(&:name).keep_if { |d| d == 'qwt-qt5' }.empty?"; then
CMAKE_ARGS='-DQWT_WIN_INCLUDE_DIR=/usr/local/opt/qwt-qt5/lib/qwt.framework/Headers -DQWT_WIN_LIBRARY_DIR=/usr/local/opt/qwt-qt5/lib'
CMAKE_ARGS="${CMAKE_ARGS} -DQWT_WIN_INCLUDE_DIR=/usr/local/opt/qwt-qt5/lib/qwt.framework/Headers -DQWT_WIN_LIBRARY_DIR=/usr/local/opt/qwt-qt5/lib"
fi
# Workaround for [email protected]: set PATH
if brew ruby -e "exit ! '${PROJECT_FORMULA}'.f.recursive_dependencies.map(&:name).keep_if { |d| d == 'osrf/simulation/[email protected]' }.empty?"; then
Expand All @@ -147,6 +147,10 @@ fi
if brew ruby -e "exit ! '${PROJECT_FORMULA}'.f.recursive_dependencies.map(&:name).keep_if { |d| d == 'icu4c' }.empty?"; then
export LIBRARY_PATH=${LIBRARY_PATH}:/usr/local/opt/icu4c/lib
fi
# set Python3_EXECUTABLE if this homebrew formula defines the python_cmake_arg method
if brew ruby -e "exit '${PROJECT_FORMULA}'.f.respond_to?(:python_cmake_arg)"; then
CMAKE_ARGS="${CMAKE_ARGS} -DPython3_EXECUTABLE=$(which python3)"
fi

# if we are using [email protected] (custom OR port), need to add dartsim library path since it is keg-only
if brew ruby -e "exit ! '${PROJECT_FORMULA}'.f.recursive_dependencies.map(&:name).keep_if { |d| d == 'osrf/simulation/[email protected]' }.empty?"; then
Expand Down

0 comments on commit 9c2ad95

Please sign in to comment.