Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Allow to override the python install path (and document it)
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Tue, 25 Jan 2022 08:13:54 +0000 (09:13 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Tue, 25 Jan 2022 08:13:54 +0000 (09:13 +0100)
CMakeLists.txt
docs/source/Installing_SimGrid.rst

index 10ccdbd..90cb6b6 100644 (file)
@@ -840,13 +840,15 @@ if(enable_python)
     set_property(TARGET python-bindings
                  APPEND PROPERTY INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}")
 
     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 
     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()
   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}")
 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()
 else()
   message("        Compile Python bindings .....: OFF (disabled, or pybind11 not found)")
 endif()
index 303787f..80cb783 100644 (file)
@@ -290,6 +290,14 @@ minimal-bindings (on/OFF)
   Take as few optional dependencies as possible, to get minimal
   library bindings in Java and Python.
 
   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".
 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".