Skip to content
Snippets Groups Projects
Commit 065d0b68 authored by Lars Bilke's avatar Lars Bilke Committed by Dmitri Naumov
Browse files

[cmake] Add python path to tfel libs into .envrc file.

parent 55b15d18
No related branches found
No related tags found
No related merge requests found
...@@ -232,13 +232,18 @@ if(OGS_WRITE_BENCHMARK_COMMANDS) ...@@ -232,13 +232,18 @@ if(OGS_WRITE_BENCHMARK_COMMANDS)
endif() endif()
# cmake-lint: disable=E1126 # cmake-lint: disable=E1126
file( set(_envrc_content
CONFIGURE "[ -d \"${PROJECT_BINARY_DIR}/.venv\" ] && source ${PROJECT_BINARY_DIR}/.venv/bin/activate"
OUTPUT "export PATH=$PATH:${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}"
.envrc
CONTENT
"PATH_add ${CMAKE_INSTALL_BINDIR}\n[ -d \".venv\" ] && source .venv/bin/activate"
) )
if(_TFEL_SITE-PACKAGES_DIR)
set(_envrc_content
"${_envrc_content}"
"export PYTHONPATH=${_TFEL_SITE-PACKAGES_DIR}:$PYTHONPATH"
)
endif()
string(REPLACE ";" "\n" _envrc_content "${_envrc_content}")
file(CONFIGURE OUTPUT .envrc CONTENT "${_envrc_content}")
check_header_compilation() check_header_compilation()
......
...@@ -65,12 +65,6 @@ if(OGS_USE_MFRONT) ...@@ -65,12 +65,6 @@ if(OGS_USE_MFRONT)
"-DPython_ADDITIONAL_VERSIONS=${_py_version_major_minor}" "-DPython_ADDITIONAL_VERSIONS=${_py_version_major_minor}"
"-Denable-python-bindings=ON" "-Denable-python-bindings=ON"
) )
message(
STATUS
"TFEL build with Python bindings. To use them:\n "
" export PYTHONPATH=${PROJECT_BINARY_DIR}/_ext/TFEL/lib/python"
"${_py_version_major_minor}/site-packages:$PYTHONPATH"
)
else() else()
# Cleanup variables from previous find_package()-call # Cleanup variables from previous find_package()-call
unset(Boost_INCLUDE_DIR) unset(Boost_INCLUDE_DIR)
...@@ -111,8 +105,20 @@ if(OGS_USE_MFRONT) ...@@ -111,8 +105,20 @@ if(OGS_USE_MFRONT)
STATUS STATUS
"ExternalProject_Add(): added package TFEL@rliv-${ogs.minimum_version.tfel-rliv}" "ExternalProject_Add(): added package TFEL@rliv-${ogs.minimum_version.tfel-rliv}"
) )
if(Boost_${_py_boost_comp}_FOUND)
set(_TFEL_SITE-PACKAGES_DIR
"${build_dir_TFEL}/lib/python${_py_version_major_minor}/site-packages"
CACHE INTERNAL ""
)
endif()
set(TFELHOME ${build_dir_TFEL} CACHE PATH "" FORCE) set(TFELHOME ${build_dir_TFEL} CACHE PATH "" FORCE)
endif() endif()
if(_TFEL_SITE-PACKAGES_DIR)
message(
STATUS "TFEL build with Python bindings. To use them:\n "
" export PYTHONPATH=${_TFEL_SITE-PACKAGES_DIR}:$PYTHONPATH"
)
endif()
endif() endif()
if(OGS_USE_PETSC) if(OGS_USE_PETSC)
...@@ -350,6 +356,7 @@ endif() ...@@ -350,6 +356,7 @@ endif()
# Building from source requires newer hdf version # Building from source requires newer hdf version
string(REPLACE "." "_" HDF5_TAG ${ogs.tested_version.hdf5}) string(REPLACE "." "_" HDF5_TAG ${ogs.tested_version.hdf5})
# cmake-lint: disable=C0103
if(COMPILER_IS_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.2) if(COMPILER_IS_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.2)
set(ogs.minimum_version.vtk "9.3.0") set(ogs.minimum_version.vtk "9.3.0")
endif() endif()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment