File tree Expand file tree Collapse file tree 3 files changed +11
-12
lines changed Expand file tree Collapse file tree 3 files changed +11
-12
lines changed Original file line number Diff line number Diff line change 1- cmake_minimum_required (VERSION 3.14...3.27 )
1+ cmake_minimum_required (VERSION 3.14...3.28 )
22
33if (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR )
44 message (FATAL_ERROR "Please do out of source build like
@@ -25,6 +25,10 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
2525# --- avoid Anaconda libraries
2626if (DEFINED ENV{CONDA_PREFIX})
2727 list (APPEND CMAKE_IGNORE_PREFIX_PATH $ENV{CONDA_PREFIX} )
28+ list (APPEND CMAKE_IGNORE_PATH $ENV{CONDA_PREFIX} /bin)
29+ # need CMAKE_IGNORE_PATH for CMake < 3.23
30+ # and to ensure system env var PATH doesn't interfere
31+ # despite CMAKE_IGNORE_PREFIX_PATH
2832endif ()
2933
3034include (options .cmake)
Original file line number Diff line number Diff line change @@ -63,9 +63,7 @@ include(CheckSymbolExists)
6363include (CheckCSourceCompiles)
6464include (CheckFortranSourceCompiles)
6565
66- # this is to help avoid unwanted Anaconda HDF5 or stray h5cc compiler script
67- set (_use_sys_env_path ${CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH} )
68- set (CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH false )
66+
6967function (get_flags exec outvar)
7068
7169execute_process (COMMAND ${exec} -show
@@ -875,8 +873,6 @@ check_hdf5_link()
875873set (CMAKE_REQUIRED_LIBRARIES)
876874set (CMAKE_REQUIRED_INCLUDES)
877875
878- set (CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH ${_use_sys_env_path} )
879-
880876include (FindPackageHandleStandardArgs)
881877find_package_handle_standard_args(HDF5
882878REQUIRED_VARS HDF5_C_LIBRARIES HDF5_links
Original file line number Diff line number Diff line change @@ -90,12 +90,11 @@ if(WIN32 AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.22)
9090endif ()
9191
9292# --- Python h5py
93- if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.12)
94- set (Python_FIND_VIRTUALENV STANDARD)
95- # use order in PATH to pick Python interpreter
96- # this avoids unexpected old system Python getting used IF conda environment has been activated
97- find_package (Python COMPONENTS Interpreter)
98- endif ()
93+ set (Python_FIND_VIRTUALENV STANDARD)
94+ # use order in PATH to pick Python interpreter
95+ # this avoids unexpected old system Python getting used IF conda environment has been activated
96+ find_package (Python COMPONENTS Interpreter)
97+
9998if (NOT DEFINED h5py_ok)
10099 execute_process (COMMAND ${Python_EXECUTABLE} -c "import h5py"
101100 RESULT_VARIABLE ret
You can’t perform that action at this time.
0 commit comments