Commit 1509a2b4 authored by Rashad Kanavath's avatar Rashad Kanavath

BUG: fix make of cookbook from otb build or install directory

parent 3d256ab2
#!/bin/sh
export LD_LIBRARY_PATH=@OTB_INSTALL_PREFIX@/lib:$LD_LIBRARY_PATH
export PYTHONPATH=@OTB_INSTALL_PREFIX@/lib:@OTB_INSTALL_PREFIX@/lib/otb/python:$PYTHONPATH
export PYTHONPATH=@OTB_INSTALL_PREFIX@/lib:@OTB_PYTHONPATH@:$PYTHONPATH
export OTB_APPLICATION_PATH=@OTB_INSTALL_PREFIX@/lib/otb/applications
@PYTHON_EXECUTABLE@ @CMAKE_SOURCE_DIR@/Scripts/otbGenerateWrappersRstDoc.py
......@@ -10,6 +10,25 @@ endif()
#find OTB
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. Please set OTB_DIR")
return()
endif()
set(OTB_PYTHONPATH)
if( EXISTS "${OTB_DIR}/CMakeCache.txt" )
set(OTB_INSTALL_PREFIX ${OTB_DIR})
set(OTB_PYTHONPATH "${OTB_INSTALL_PREFIX}/Modules/Wrappers/SWIG/src")
elseif( EXISTS "${OTB_DIR}/UseOTB.cmake" )
get_filename_component(OTB_INSTALL_PREFIX ${OTB_DIR} PATH)
get_filename_component(OTB_INSTALL_PREFIX ${OTB_INSTALL_PREFIX} PATH)
get_filename_component(OTB_INSTALL_PREFIX ${OTB_INSTALL_PREFIX} PATH)
set(OTB_PYTHONPATH "${OTB_INSTALL_PREFIX}/lib/otb/python")
endif()
#find Python
find_package(PythonInterp REQUIRED)
......@@ -94,9 +113,16 @@ foreach(rst_file ${rst_sources3})
configure_file(${rst_file} ${RST_GENERATED_SOURCE_DIR}/Applications/${out_file} COPYONLY)
endforeach()
file(GLOB rst_sources4 ${RST_SOURCES}/*.txt)
foreach(rst_file ${rst_sources4})
get_filename_component(out_file ${rst_file} NAME)
configure_file(${rst_file} ${RST_GENERATED_SOURCE_DIR}/${out_file} COPYONLY)
endforeach()
configure_file(${RST_SOURCES}/conf.py.in ${RST_GENERATED_SOURCE_DIR}/conf.py @ONLY)
configure_file(${RST_SOURCES}/Makefile.in ${RST_GENERATED_SOURCE_DIR}/Makefile @ONLY)
add_custom_target(generate_otbapps_rst
ALL
COMMAND ${SH_INTERP} ${CMAKE_CURRENT_BINARY_DIR}/RunApplicationsRstGenerator.sh
......
Markdown is supported
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