Make configuration file compatible with Python3 and newer hdf5
This commit is contained in:
parent
c4f5029877
commit
8cbec6637c
@ -1,6 +1,5 @@
|
||||
cmake_minimum_required(VERSION 3.6)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
cmake_policy(SET CMP0012 OLD)
|
||||
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
project(CosmoToolbox)
|
||||
@ -54,7 +53,7 @@ IF(YORICK_SUPPORT)
|
||||
ENDIF((EXISTS ${NETCDFCPP_INCLUDE_PATH}/netcdf AND ${NETCDFCPP_LIBRARY} MATCHES "netcdf_c\\+\\+4") OR (INTERNAL_NETCDF))
|
||||
ENDIF(YORICK_SUPPORT)
|
||||
|
||||
find_program(CYTHON cython)
|
||||
find_program(CYTHON cython3 cython)
|
||||
find_library(ZLIB z)
|
||||
find_library(DL_LIBRARY dl)
|
||||
find_library(MATH_LIBRARY m)
|
||||
|
@ -1,10 +1,12 @@
|
||||
execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c"
|
||||
"import distutils.sysconfig as cs; import os; v=cs.get_config_vars(); print(os.path.join(v['LIBDIR'],v['LDLIBRARY']));"
|
||||
"import distutils.sysconfig as cs; import os; import sys; v=cs.get_config_vars(); print(os.path.join(v['LIBDIR'],v['LDLIBRARY'])); sys.exit(0)"
|
||||
RESULT_VARIABLE _PYLIB_SEARCH_SUCCESS
|
||||
OUTPUT_VARIABLE _PYLIB_VALUES_OUTPUT
|
||||
ERROR_VARIABLE _PYLIB_ERROR_VALUE
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
message(${_PYLIB_SEARCH_SUCCESS})
|
||||
|
||||
execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c"
|
||||
"import distutils.sysconfig as cs; import os; v=cs.get_config_vars(); print(v['INCLUDEPY']);"
|
||||
RESULT_VARIABLE _PYINC_SEARCH_SUCCESS
|
||||
|
7
external/external_build.cmake
vendored
7
external/external_build.cmake
vendored
@ -112,7 +112,12 @@ else (INTERNAL_HDF5)
|
||||
cmessage(STATUS "HDF5 lib: ${HDF5_LIBRARIES}")
|
||||
cmessage(STATUS "HDF5 includes: ${HDF5_INCLUDE_DIRS}")
|
||||
cmessage(STATUS "HDF5 C lib: ${HDF5_C_LIBRARY}")
|
||||
get_filename_component(HDF5_BIN_DIR ${HDF5_C_LIBRARY} DIRECTORY)
|
||||
cmessage(STATUS "HDF5 BIN: ${HDF5_BIN_DIR}")
|
||||
foreach(hdf5lib IN LISTS HDF5_LIBRARIES)
|
||||
if (${hdf5lib} MATCHES "(hdf5)|(HDF5)")
|
||||
get_filename_component(HDF5_BIN_DIR ${hdf5lib} DIRECTORY)
|
||||
endif()
|
||||
endforeach()
|
||||
cmessage(STATUS "HDF5 libpath: ${HDF5_BIN_DIR}")
|
||||
else()
|
||||
cmessage(STATUS "Found HDF5 cmake config.")
|
||||
|
Loading…
Reference in New Issue
Block a user