From: Martin Quinson Date: Tue, 25 Jan 2022 08:13:54 +0000 (+0100) Subject: Allow to override the python install path (and document it) X-Git-Tag: v3.30~28 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/f66071c52fab95f34add775d4cda3f8a33feac56 Allow to override the python install path (and document it) --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 10ccdbdfc2..90cb6b6f9f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -840,13 +840,15 @@ if(enable_python) set_property(TARGET python-bindings APPEND PROPERTY INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}") - if("${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr") - set(pybind_install_dir ${Python3_SITEARCH}) - else() - string(REGEX REPLACE "^/usr/" "${CMAKE_INSTALL_PREFIX}/" pybind_install_dir ${Python3_SITEARCH}) + if("${SIMGRID_PYTHON_LIBDIR}" STREQUAL "") # value not manually set + if("${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr") + set(SIMGRID_PYTHON_LIBDIR ${Python3_SITEARCH}) + else() + string(REGEX REPLACE "^/usr/" "${CMAKE_INSTALL_PREFIX}/" SIMGRID_PYTHON_LIBDIR ${Python3_SITEARCH}) + endif() endif() install(TARGETS python-bindings - LIBRARY DESTINATION "${pybind_install_dir}") + LIBRARY DESTINATION "${SIMGRID_PYTHON_LIBDIR}") else() message(FATAL_ERROR "Please install pybind11-dev to build the Python bindings (or disable that option).") endif() @@ -951,7 +953,7 @@ endif() if(pybind11_FOUND) message(" Compile Python bindings .....: ${enable_python}") message(" module ....................: ${PYTHON_MODULE_PREFIX}simgrid${PYTHON_MODULE_EXTENSION}") - message(" install path ..............: ${pybind_install_dir}") + message(" install path ..............: ${SIMGRID_PYTHON_LIBDIR} (force another value with -DSIMGRID_PYTHON_LIBDIR)") else() message(" Compile Python bindings .....: OFF (disabled, or pybind11 not found)") endif() diff --git a/docs/source/Installing_SimGrid.rst b/docs/source/Installing_SimGrid.rst index 303787fd1b..80cb783d47 100644 --- a/docs/source/Installing_SimGrid.rst +++ b/docs/source/Installing_SimGrid.rst @@ -290,6 +290,14 @@ minimal-bindings (on/OFF) Take as few optional dependencies as possible, to get minimal library bindings in Java and Python. +NS3_HINT (empty by default) + Alternative path into which ns-3 should be searched for. + +SIMGRID_PYTHON_LIBDIR (auto-detected) + Where to install the Python module library. By default, it is set to the cmake Python3_SITEARCH variable if installing to /usr, + and a modified version of that variable if installing to another path. Just force another value if the auto-detected default + does not fit your setup. + SMPI_C_FLAGS, SMPI_CXX_FLAGS, SMPI_Fortran_FLAGS (string) Default compiler options to use in smpicc, smpicxx, or smpiff. This can be useful to set options like "-m32" or "-m64".