Skip to content

Commit

Permalink
cmake: fix python test regression
Browse files Browse the repository at this point in the history
  • Loading branch information
axxel committed Dec 15, 2023
1 parent ac88bce commit a91d306
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wrappers/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ if (NOT hasParent)
endif()
endif()

find_package (Python COMPONENTS Interpreter Development) # see https://github.com/pybind/pybind11/issues/4785
find_package(Python3 COMPONENTS Interpreter Development REQUIRED) # see https://github.com/pybind/pybind11/issues/4785
zxing_add_package(pybind11 pybind11 ${pybind11_git_repo} ${pybind11_git_rev})

# build the python module
pybind11_add_module(zxingcpp zxing.cpp)
target_link_libraries(zxingcpp PRIVATE ZXing::ZXing)

if (BUILD_READERS AND BUILD_WRITERS)
add_test(NAME PythonTest COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test.py -v)
add_test(NAME PythonTest COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test.py -v)
set_property(TEST PythonTest PROPERTY ENVIRONMENT PYTHONPATH=$<TARGET_FILE_DIR:zxingcpp>)
endif()

Expand Down

0 comments on commit a91d306

Please sign in to comment.