Skip to content

Commit d63c793

Browse files
committed
enable h5fortran_python option
1 parent 58a8072 commit d63c793

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ if(CMAKE_VERSION VERSION_LESS 3.25 AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
2323
endif()
2424

2525
# --- avoid Anaconda libraries
26-
find_package(Python COMPONENTS Interpreter)
26+
if(h5fortran_python)
27+
find_package(Python COMPONENTS Interpreter)
28+
endif()
2729

2830
if(DEFINED ENV{CONDA_PREFIX} AND h5fortran_IGNORE_CONDA_LIBRARIES)
2931
list(APPEND CMAKE_IGNORE_PREFIX_PATH $ENV{CONDA_PREFIX})

options.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ option(h5fortran_python "check HDF5 file writes with Python")
1313
option(h5fortran_IGNORE_CONDA_LIBRARIES "If ON, CMake will not search for the
1414
hdf5 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

1818
set_property(DIRECTORY PROPERTY EP_UPDATE_DISCONNECTED true)
1919

test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ set(shape_file ${CMAKE_CURRENT_BINARY_DIR}/test_shape.h5)
1616
set(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

0 commit comments

Comments
 (0)