diff --git a/CMake/OTBApplicationMacros.cmake b/CMake/OTBApplicationMacros.cmake index 99809f780db7c60a5aa7cd55a6899eca04866ec9..0443afe3b3167d7a4efb20986bcf3811b3e1f890 100644 --- a/CMake/OTBApplicationMacros.cmake +++ b/CMake/OTBApplicationMacros.cmake @@ -191,9 +191,9 @@ else { $OTB_LAUNCHER = \"${_launcher_type}.ps1\" } -# As we are using another powershell script, execute it with the '. <path>' syntax -# Start application -. \"$OTB_LAUNCHER\" \"${APPLAUNCHER_NAME}\" $args +# As we are using another powershell we need to use InvokeExpression Syntax +# The '&' is to run the script in its own shell without polluting this one +Invoke-Expression \"&'$OTB_LAUNCHER' ${APPLAUNCHER_NAME} $args\" ") else() # Launcher script in Shell format diff --git a/Documentation/Cookbook/rst/templates/PythonAPI.rst b/Documentation/Cookbook/rst/templates/PythonAPI.rst index fb6d7a0a89c23bf8f74a86490e79a9056e224c9c..e9150848021ea8b8f95fb655f615e71ea5cac0d8 100644 --- a/Documentation/Cookbook/rst/templates/PythonAPI.rst +++ b/Documentation/Cookbook/rst/templates/PythonAPI.rst @@ -20,6 +20,7 @@ that are not installed on your default PYTHONPATH. import os os.add_dll_directory("/Path/To/OTB_INSTALL/lib/otb/python") os.add_dll_directory("/Path/To/OTB_INSTALL/lib/") + os.add_dll_directory("/Path/To/OTB_INSTALL/bin") import otbApplication as otb Once your environment is set, you can use OTB applications from Python, just