Skip to content

Commit

Permalink
[cmake] Use CPP2PY_PYTHON_xxx variables instead of PYTHON_xxx
Browse files Browse the repository at this point in the history
  • Loading branch information
Thoemi09 committed Feb 27, 2024
1 parent 7e92179 commit 2481b15
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions python/h5/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ foreach(file ${python_sources})
endforeach()

# Install python files to proper location
set(PYTHON_LIB_DEST ${PYTHON_LIB_DEST_ROOT}/${PROJECT_NAME})
set(PYTHON_LIB_DEST ${CPP2PY_PYTHON_LIB_DEST_ROOT}/${PROJECT_NAME})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/version.py DESTINATION ${PYTHON_LIB_DEST})
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION ${PYTHON_LIB_DEST_ROOT} FILES_MATCHING PATTERN "*.py" PATTERN "*_desc.py" EXCLUDE)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION ${CPP2PY_PYTHON_LIB_DEST_ROOT} FILES_MATCHING PATTERN "*.py" PATTERN "*_desc.py" EXCLUDE)

# Build the h5py_io library
add_library(h5py_io STATIC h5py_io.cpp)
Expand Down
2 changes: 1 addition & 1 deletion test/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ target_include_directories(storable PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
foreach(test ${all_tests})
get_filename_component(test_name ${test} NAME_WE)
get_filename_component(test_dir ${test} DIRECTORY)
add_test(NAME Py_${test_name} COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${test_dir}/${test_name}.py WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${test_dir})
add_test(NAME Py_${test_name} COMMAND ${CPP2PY_PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${test_dir}/${test_name}.py WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${test_dir})
set_property(TEST Py_${test_name} APPEND PROPERTY ENVIRONMENT PYTHONPATH=${PROJECT_BINARY_DIR}/python:${h5_BINARY_DIR}/python:${CMAKE_CURRENT_BINARY_DIR}:$ENV{PYTHONPATH} ${SANITIZER_RT_PRELOAD})
endforeach()

0 comments on commit 2481b15

Please sign in to comment.