Skip to content
Snippets Groups Projects
Commit 3911e557 authored by Rashad Kanavath's avatar Rashad Kanavath
Browse files

XDK: provide a readme && xdkenv.profile

parent 4af760f9
No related branches found
No related tags found
No related merge requests found
Prerequisites
-------------
- cmake (>= 3.2)
- gcc (>= 4.9)
- git
Extract XDK
-----------
::
cd /opt (You can use another a directory of your own choice)
chmod +x OTB-|release|-xdk-Linux64.run
./OTB-|release|-xdk-Linux64.run
**You now will have a directory named **OTB-|release|-xdk-Linux64** in **/opt**
Setup environment
-----------------
There is a helper script in package called **xdkenv.profile**. This script export
required environments to configure and build OTB.
::
cd /opt/OTB-|release|-xdk-Linux64
. ./xdkenv.profile
Test environment setup by checking value of CMAKE_PREFIX_PATH
::
echo $CMAKE_PREFIX_PATH
The above command will output:
/opt/OTB-|release|-xdk-Linux64
Download, Configure and build OTB
---------------------------------
::
mkdir -p /opt/OTB/build && cd /opt/OTB
git clone --depth=1 --branch=develop https://git@git.orfeo-toolbox.org/git/otb.git source
cd build && cmake ../source
make -j2
Notes
~~~~~
By default, all OTB\_USE\_\* variables in OTB are set to FALSE except for 6S and SiftFast. You can check/activate them in your cmake-gui/ccmake.
README.md
README.md
......@@ -58,12 +58,16 @@ macro(macro_setup_cmake_project pkg)
macro_super_package(STAGE_DIR \"${archive_name}\")"
)
set(README_FILE_SUFFIX)
if(PKG_GENERATE_XDK)
set(README_FILE_SUFFIX "_xdk")
endif()
if(APPLE)
set(README_FILE ${PACKAGE_OTB_SRC_DIR}/Documentation/Cookbook/rst/Installation_Macx.txt)
set(README_FILE ${PACKAGE_OTB_SRC_DIR}/Documentation/Cookbook/rst/Installation_Macx${README_FILE_SUFFIX}.txt)
elseif(LINUX) #not osx
set(README_FILE ${PACKAGE_OTB_SRC_DIR}/Documentation/Cookbook/rst/Installation_Linux.txt)
set(README_FILE ${PACKAGE_OTB_SRC_DIR}/Documentation/Cookbook/rst/Installation_Linux${README_FILE_SUFFIX}.txt)
elseif(WIN32) #windows
set(README_FILE ${PACKAGE_OTB_SRC_DIR}/Documentation/Cookbook/rst/Installation_Windows.txt)
set(README_FILE ${PACKAGE_OTB_SRC_DIR}/Documentation/Cookbook/rst/Installation_Windows${README_FILE_SUFFIX}.txt)
endif()
configure_file(
......
......@@ -121,6 +121,43 @@ EOF
chmod +x "$OUT_DIR/otbenv.profile"
else
cat > "$OUT_DIR/xdkenv.profile" << EOF
#!/bin/sh
# The below environment variables only affect current shell
# So if you run again from a terminal. you need to run the script again
# unset any existing LD_LIBRARY_PATH
unset LD_LIBRARY_PATH
# Add bin direcotory to system PATH
PATH=$OUT_DIR/bin:\$PATH
# set numeric locale to C
LC_NUMERIC=C
# set GDAL_DATA variable used by otb application
GDAL_DATA=$OUT_DIR/share/gdal
# set GEOTIFF_CSV variable used by otb application
GEOTIFF_CSV=$OUT_DIR/share/epsg_csv
CMAKE_PREFIX_PATH=$OUT_DIR
# export variables
export LC_NUMERIC
export GDAL_DATA
export GEOTIFF_CSV
export CMAKE_PREFIX_PATH
export PATH
EOF
chmod +x "$OUT_DIR/xdkenv.profile"
fi
#echo "Creating symbolic links..."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment