Commit a88d51d5 authored by Rashad Kanavath's avatar Rashad Kanavath

COMP: save pythonpath in OTBConfig.cmake and set to ENV in UseOTB.cmake

parent 6cd7acab
......@@ -28,6 +28,7 @@ set(OTB_BUILD_SHARED "@BUILD_SHARED_LIBS@")
# List of available OTB modules.
set(OTB_MODULES_ENABLED "@OTB_CONFIG_MODULES_ENABLED@")
# Import OTB targets.
set(OTB_CONFIG_TARGETS_FILE "@OTB_CONFIG_TARGETS_FILE@")
if(NOT OTB_TARGETS_IMPORTED@OTB_CONFIG_TARGETS_CONDITION@)
......@@ -38,6 +39,12 @@ endif()
# Load module interface macros.
include("@OTB_CONFIG_MODULE_API_FILE@")
if(OTB_WRAP_PYTHON)
set(OTB_PYTHONPATH "@OTB_PYTHONPATH@")
endif()
# Load application macros.
include(CMakeParseArguments)
include("@OTB_CONFIG_APPLI_MACROS_FILE@")
......
......@@ -27,3 +27,11 @@ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${ITK_REQUIRED_LINK_
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${ITK_REQUIRED_LINK_FLAGS}")
# OpenCV : no USE_FILE defined
#PYTHONPATH
if( OTB_PYTHONPATH )
if(DEFINED ENV{PYTHONPATH})
set(ENV{PYTHONPATH} "${OTB_PYTHONPATH};$ENV{PYTHONPATH}")
endif()
endif()
......@@ -305,6 +305,7 @@ set(OTB_CONFIG_CODE "
set(OTB_MODULES_DIR \"${OTB_MODULES_DIR}\")")
set(OTB_CONFIG_CMAKE_DIR "${OTB_SOURCE_DIR}/CMake")
set(OTB_USE_FILE "${OTB_CONFIG_CMAKE_DIR}/UseOTB.cmake")
set(OTB_PYTHONPATH "${OTB_BINARY_DIR}/${OTB_INSTALL_PYTHON_DIR}")
set(OTB_CONFIG_TARGETS_CONDITION " AND NOT OTB_BINARY_DIR")
set(OTB_CONFIG_TARGETS_FILE "${OTB_BINARY_DIR}/OTBTargets.cmake")
set(OTB_CONFIG_MODULE_API_FILE "${OTB_SOURCE_DIR}/CMake/OTBModuleAPI.cmake")
......@@ -326,6 +327,7 @@ set(OTB_CONFIG_CODE "${OTB_CONFIG_CODE}
set(OTB_MODULES_DIR \"\${OTB_INSTALL_PREFIX}/${OTB_INSTALL_PACKAGE_DIR}/Modules\")")
set(OTB_USE_FILE "\${OTB_INSTALL_PREFIX}/${OTB_INSTALL_PACKAGE_DIR}/UseOTB.cmake")
set(OTB_CONFIG_CMAKE_DIR "\${OTB_INSTALL_PREFIX}/${OTB_INSTALL_PACKAGE_DIR}")
set(OTB_PYTHONPATH "\${OTB_INSTALL_PREFIX}/${OTB_INSTALL_PYTHON_DIR}")
set(OTB_CONFIG_TARGETS_CONDITION "")
set(OTB_CONFIG_TARGETS_FILE "\${OTB_INSTALL_PREFIX}/${OTB_INSTALL_PACKAGE_DIR}/OTBTargets.cmake")
set(OTB_CONFIG_MODULE_API_FILE "\${OTB_INSTALL_PREFIX}/${OTB_INSTALL_PACKAGE_DIR}/OTBModuleAPI.cmake")
......
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