File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,9 @@ if(CMAKE_VERSION VERSION_LESS 3.25 AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
2323endif ()
2424
2525# --- avoid Anaconda libraries
26- find_package (Python COMPONENTS Interpreter)
26+ if (h5fortran_python)
27+ find_package (Python COMPONENTS Interpreter)
28+ endif ()
2729
2830if (DEFINED ENV{CONDA_PREFIX} AND h5fortran_IGNORE_CONDA_LIBRARIES)
2931 list (APPEND CMAKE_IGNORE_PREFIX_PATH $ENV{CONDA_PREFIX} )
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ option(h5fortran_python "check HDF5 file writes with Python")
1313option (h5fortran_IGNORE_CONDA_LIBRARIES "If ON, CMake will not search for the
1414hdf5 libraries in a Conda environment." ON )
1515
16- option (h5fortran_BUILD_TESTING "build tests" ${h5fortran_IS_TOP_LEVEL} )
16+ option (h5fortran_BUILD_TESTING "build tests" )
1717
1818set_property (DIRECTORY PROPERTY EP_UPDATE_DISCONNECTED true )
1919
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ set(shape_file ${CMAKE_CURRENT_BINARY_DIR}/test_shape.h5)
1616set (string_file ${CMAKE_CURRENT_BINARY_DIR} /test_string_py.h5)
1717
1818# --- Python h5py
19- if (NOT DEFINED h5py_ok AND Python_EXECUTABLE )
19+ if (NOT DEFINED h5py_ok AND Python_INTERPRETER_FOUND AND h5fortran_python )
2020 execute_process (COMMAND ${Python_EXECUTABLE} -c "import h5py"
2121 RESULT_VARIABLE ret
2222 ERROR_VARIABLE err
You can’t perform that action at this time.
0 commit comments