Skip to content

Commit

Permalink
Merge branch 'sdf15' into scpeters/version_from_package_xml
Browse files Browse the repository at this point in the history
  • Loading branch information
scpeters authored Nov 18, 2024
2 parents a3a87ae + 4ebe022 commit 5473422
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set(CMAKE_REQUIRE_FIND_PACKAGE_pybind11 TRUE)
include(GNUInstallDirs)
include(CTest)

if(BUILD_TESTING)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../test/test_config.hh.in
${PROJECT_BINARY_DIR}/include/test_config.hh)
include_directories(${PROJECT_BINARY_DIR}/include)
endif()
endif()

set(PYBIND11_PYTHON_VERSION 3)
Expand Down Expand Up @@ -200,10 +206,10 @@ if (BUILD_TESTING AND NOT WIN32)
foreach (test ${python_tests})
if (pytest_FOUND)
add_test(NAME ${test}.py COMMAND
"${Python3_EXECUTABLE}" -m pytest "${CMAKE_SOURCE_DIR}/python/test/${test}.py" --junitxml "${CMAKE_BINARY_DIR}/test_results/${test}.xml")
"${Python3_EXECUTABLE}" -m pytest "${CMAKE_CURRENT_SOURCE_DIR}/test/${test}.py" --junitxml "${CMAKE_BINARY_DIR}/test_results/${test}.xml")
else()
add_test(NAME ${test}.py COMMAND
"${Python3_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/python/test/${test}.py")
"${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/test/${test}.py")
endif()
set(_env_vars)
list(APPEND _env_vars "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/python/:${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH}")
Expand Down

0 comments on commit 5473422

Please sign in to comment.