)
SALOME_INSTALL_SCRIPTS("${salomepython_PYTHON}" ${SALOME_INSTALL_PYTHON} DEF_PERMS)
-SALOME_INSTALL_SCRIPTS(__init__.py ${SALOME_INSTALL_PYTHON}/salome DEF_PERMS)
\ No newline at end of file
+SALOME_INSTALL_SCRIPTS(__init__.py ${SALOME_INSTALL_PYTHON}/salome DEF_PERMS)
+# /!\ Order of next 2 lines is important
+# because salome.pth file needs salome_pth.py
+SALOME_INSTALL_SCRIPTS(salome_pth.py ${_pydir} DEF_PERMS)
+install(FILES salome.pth DESTINATION ${_pydir})
--- /dev/null
+"""Append salome prefix to sys.path."""
+import sys
+from pathlib import Path
+
+SALOME_PREFIX = "salome"
+sys.path.append(f"{Path(__file__).parent / SALOME_PREFIX}")