Skip to content

Commit

Permalink
cmake pythonpath fix (#1687)
Browse files Browse the repository at this point in the history
* Fixing CI issue for macos and windows.

* Update CMakeLists.txt

* Upd

* update

* Update

* Update ci_macos.yml
  • Loading branch information
olzhas authored Dec 18, 2022
1 parent e022002 commit 04f72d6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,10 @@ echo "====================================="
mkdir build && cd build
if [ "$OSTYPE" = "linux-gnu" ]; then
install_prefix_option="-DCMAKE_INSTALL_PREFIX=/usr/"
elif [ "$OSTYPE" = "darwin" ]; then
install_prefix_option="-DCMAKE_INSTALL_PREFIX=/usr/local/"
fi

cmake .. \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DDART_VERBOSE=ON \
Expand Down Expand Up @@ -195,6 +198,7 @@ fi

# dartpy: run a Python example using installed dartpy
if [ "$BUILD_DARTPY" = "ON" ]; then
echo $PYTHONPATH
cd $BUILD_DIR/python/examples/hello_world
python3 main.py
fi
2 changes: 2 additions & 0 deletions .github/workflows/ci_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup upterm session
uses: lhotari/action-upterm@v1
- name: Install Dependencies
env:
INSTALL_OSG_HEAD: OFF # To avoid building OSG, until 3.7 is released.
Expand Down
2 changes: 1 addition & 1 deletion python/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function(dartpy_add_example example_name) # ARGN for source file
endif()
add_custom_target(${example_name}
COMMAND ${CMAKE_COMMAND} -E echo "Running pytest by: PYTHONPATH=${DART_DARTPY_BUILD_DIR} ${PYTHON_EXECUTABLE} ${source}"
COMMAND PYTHONPATH=${DART_DARTPY_BUILD_DIR} ${PYTHON_EXECUTABLE} ${source}
COMMAND ${CMAKE_COMMAND} -E env "PYTHONPATH=${DART_DARTPY_BUILD_DIR} ${PYTHON_EXECUTABLE} ${source}"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
SOURCES ${source}
)
Expand Down

0 comments on commit 04f72d6

Please sign in to comment.