Skip to content

Commit

Permalink
Revert "Stop using python_cmake_module. (#90)" (#93)
Browse files Browse the repository at this point in the history
This reverts commit 5f4f2c0.

Signed-off-by: Michael Carroll <[email protected]>
  • Loading branch information
mjcarroll authored Apr 12, 2024
1 parent 5f4f2c0 commit b0c989d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions resource_retriever/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,25 @@ if(BUILD_TESTING)
ament_add_gtest(${PROJECT_NAME}_test test/test.cpp)
target_link_libraries(${PROJECT_NAME}_test ${PROJECT_NAME})

# Python test
# Provides PYTHON_EXECUTABLE_DEBUG
find_package(python_cmake_module REQUIRED)
find_package(PythonExtra REQUIRED)

set(_PYTHON_EXECUTABLE "${PYTHON_EXECUTABLE}")
if(WIN32 AND CMAKE_BUILD_TYPE STREQUAL "Debug")
set(PYTHON_EXECUTABLE "${PYTHON_EXECUTABLE_DEBUG}")
endif()

find_package(ament_cmake_pytest REQUIRED)
ament_add_pytest_test(resource_retriever_python_test test/test.py
PYTHON_EXECUTABLE "${PYTHON_EXECUTABLE}"
APPEND_ENV PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}
TIMEOUT 60
)

set(PYTHON_EXECUTABLE "${_PYTHON_EXECUTABLE}")

install(
FILES test/test.txt
DESTINATION share/${PROJECT_NAME}/test
Expand Down
1 change: 1 addition & 0 deletions resource_retriever/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
<test_depend>python3-pytest</test_depend>
<test_depend>python_cmake_module</test_depend>

<export>
<build_type>ament_cmake</build_type>
Expand Down

0 comments on commit b0c989d

Please sign in to comment.