Commit 4d5e8154 authored by Julien Osman's avatar Julien Osman
Browse files

FIX: Add a script to set PYTHONPATH for Pythin API doc generation

parent 67f75e77
Pipeline #9214 passed with stages
in 77 minutes and 27 seconds
#!/bin/sh
#
# Copyright (C) 2005-2020 Centre National d'Etudes Spatiales (CNES)
#
# This file is part of Orfeo Toolbox
#
# https://www.orfeo-toolbox.org/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#cmake builds with rpath in the binary dir, so we don't need to set LD_LIBRARY_PATH here
#export LD_LIBRARY_PATH=@CMAKE_BINARY_DIR@/lib:$LD_LIBRARY_PATH
export PYTHONPATH=@CMAKE_BINARY_DIR@/lib/otb/python:$PYTHONPATH
export OTB_APPLICATION_PATH=@CMAKE_BINARY_DIR@/lib/otb/applications
python3 @CMAKE_CURRENT_SOURCE_DIR@/Scripts/otbGeneratePythonApiRstDoc.py "$1"
......@@ -92,6 +92,12 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMake/RunApplicationsRstGenerator.sh.
${CMAKE_CURRENT_BINARY_DIR}/RunApplicationsRstGenerator.sh
@ONLY)
execute_process(COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_BINARY_DIR}/RunPythonApiRstGenerator.sh)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMake/RunPythonApiRstGenerator.sh.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/RunPythonApiRstGenerator.sh
@ONLY)
file(COPY ${RST_SOURCE_DIR} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/Art DESTINATION ${RST_BINARY_DIR})
......@@ -118,8 +124,8 @@ add_custom_target(generate_otbapps_rst
DEPENDS OTBSWIGWrapper-all
)
add_custom_target(generate_pythonapy_rst
COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/Scripts/otbGeneratePythonApiRstDoc.py
add_custom_target(generate_pythonapi_rst
COMMAND ${SH_INTERP} ${CMAKE_CURRENT_BINARY_DIR}/RunPythonApiRstGenerator.sh
${RST_BINARY_DIR}
WORKING_DIRECTORY ${RST_BINARY_DIR}
COMMENT "Auto-generating Python Api Documentation in RST"
......@@ -153,7 +159,7 @@ add_custom_target(CookBookHTML
-c ${SPHINX_CONF_DIR}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS generate_otbapps_rst
DEPENDS generate_pythonapy_rst
DEPENDS generate_pythonapi_rst
DEPENDS generate_examples_rst
COMMENT "Building RST documentation in html")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment