diff --git a/Documentation/Cookbook/CMake/RunApplicationsRstGenerator.sh.cmake.in b/Documentation/Cookbook/CMake/RunApplicationsRstGenerator.sh.cmake.in index 747e319c18053cf814f28aad8c5a45a080ef0529..b726f35e7af7da5771f3bfffcdcc19ba05b6bcfc 100644 --- a/Documentation/Cookbook/CMake/RunApplicationsRstGenerator.sh.cmake.in +++ b/Documentation/Cookbook/CMake/RunApplicationsRstGenerator.sh.cmake.in @@ -1,7 +1,8 @@ #!/bin/sh -export LD_LIBRARY_PATH=@CMAKE_BINARY_DIR@/lib:$LD_LIBRARY_PATH -export PYTHONPATH=@OTB_PYTHONPATH@:$PYTHONPATH -export OTB_APPLICATION_PATH=@OTB_APPLICATION_PATH@ +#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/otbGenerateWrappersRstDoc.py -o "$1" diff --git a/Documentation/Cookbook/CMakeLists.txt b/Documentation/Cookbook/CMakeLists.txt index d7fb74c0f1e289e3e412350eaf2c13de8072bf5e..80b571655ea876ed8352b17bce4440d6fa57a56c 100644 --- a/Documentation/Cookbook/CMakeLists.txt +++ b/Documentation/Cookbook/CMakeLists.txt @@ -22,22 +22,13 @@ # Build the cookbook # -message(STATUS "") -message(STATUS "Configuring Cookbook...") -message(STATUS "") - -find_package(OTB REQUIRED) - -if( OTB_FOUND ) - include(${OTB_USE_FILE}) - message(STATUS "Found OTB: ${OTB_DIR} (found version \"${OTB_VERSION}\")") -else() - message(FATAL_ERROR "OTB not found while configuring cookbook") +if (NOT UNIX) + message (STATUS "Not on Unix: skipping Cookbook build.") return() endif() -message(STATUS "OTB_PYTHONPATH = '${OTB_PYTHONPATH}'") -message(STATUS "OTB_APPLICATION_PATH = '${OTB_APPLICATION_PATH}'") +message(STATUS "") +message(STATUS "Configuring Cookbook...") # here we could add # find_package (Python3 COMPONENTS Interpreter) @@ -60,15 +51,13 @@ mark_as_advanced(PDFLATEX_COMMAND) # Check that we found everything we need foreach(cmd - OTB_PYTHONPATH - OTB_APPLICATION_PATH LATEX_COMMAND TAR_COMMAND PDFLATEX_COMMAND SPHINX_BUILD SH_INTERP) if(NOT ${cmd}) - message(FATAL_ERROR "${cmd} not set. Cannot continue") + message(FATAL_ERROR "Error while configuring Cookbook, ${cmd} not set. Cannot continue") endif() endforeach() @@ -77,6 +66,7 @@ set(RST_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/rst) set(LATEX_DIR ${CMAKE_CURRENT_BINARY_DIR}/latex) set(HTML_DIR ${CMAKE_CURRENT_BINARY_DIR}/html) +# Print summary of Cookbook configuration message(STATUS "RST_SOURCE_DIR = ${RST_SOURCE_DIR}") message(STATUS "RST_BINARY_DIR = ${RST_BINARY_DIR}") message(STATUS "LATEX_DIR = ${LATEX_DIR}")