Commit dde5ad51 authored by Rashad Kanavath's avatar Rashad Kanavath

ENH: install share dir share/OTB-X.Y -> share/otb

qgis descriptors are copied to share/otb/description.
This ends up with share/otb/ and share/OTB-X.Y
It is better to have a single directory for and it should be
share/otb and not a versioned. Changes included in packaging
script show non-versioned 'otb' directory in share is easy to
manage than a verisoned one. In any case, users cannot keep
multiple versions of OTB under same prefix.
This was breifly discussed in issue :
#1557
parent 766b5b4a
......@@ -68,7 +68,7 @@ else()
set(OTB_INSTALL_INCLUDE_DIR include/OTB-${OTB_VERSION_MAJOR}.${OTB_VERSION_MINOR})
endif()
if(NOT OTB_INSTALL_DATA_DIR)
set(OTB_INSTALL_DATA_DIR share/OTB-${OTB_VERSION_MAJOR}.${OTB_VERSION_MINOR})
set(OTB_INSTALL_DATA_DIR share/otb)
endif()
if(NOT OTB_INSTALL_DOC_DIR)
set(OTB_INSTALL_DOC_DIR share/doc/OTB-${OTB_VERSION_MAJOR}.${OTB_VERSION_MINOR})
......
......@@ -48,10 +48,10 @@ set(installed_dirs)
list(APPEND installed_dirs "@CMAKE_INSTALL_PREFIX@/include/${otb_dir_name}")
# lib/{otb,python} directory
list(APPEND installed_dirs "@CMAKE_INSTALL_PREFIX@/lib/otb")
# share/otb directory
list(APPEND installed_dirs "@CMAKE_INSTALL_PREFIX@/share/otb")
# lib/cmake/OTB-X.Y directory
list(APPEND installed_dirs "@CMAKE_INSTALL_PREFIX@/lib/cmake/${otb_dir_name}")
# share/OTB-X.Y directory
list(APPEND installed_dirs "@CMAKE_INSTALL_PREFIX@/share/${otb_dir_name}")
# share/doc/OTB-X.Y directory
list(APPEND installed_dirs "@CMAKE_INSTALL_PREFIX@/share/doc/${otb_dir_name}")
......
......@@ -165,7 +165,7 @@ if(NOT OTB_INSTALL_JAVA_DIR)
set(OTB_INSTALL_JAVA_DIR "lib/otb/java")
endif()
if(NOT OTB_INSTALL_DATA_DIR)
set(OTB_INSTALL_DATA_DIR share/OTB-${OTB_VERSION_MAJOR}.${OTB_VERSION_MINOR})
set(OTB_INSTALL_DATA_DIR share/otb)
endif()
if(NOT OTB_INSTALL_DOC_DIR)
set(OTB_INSTALL_DOC_DIR share/doc/OTB-${OTB_VERSION_MAJOR}.${OTB_VERSION_MINOR})
......
......@@ -29,8 +29,8 @@ for /f %%i in ('dir /b include\OTB*') do rd /S /Q include\%%i
echo - Clean lib\cmake\OTB*
for /f %%i in ('dir /b lib\cmake\OTB*') do rd /S /Q lib\cmake\%%i
echo - Clean share\OTB*
for /f %%i in ('dir /b share\OTB*') do rd /S /Q share\%%i
echo - Clean share\otb
rd /S /Q share\otb
echo - Clean lib\otb
rd /S /Q lib\otb
......
......@@ -23,7 +23,7 @@ rm -fr OUT_DIR/include/OTB-*
rm -f OUT_DIR/lib/{libotb*,libOTB*}
rm -fr OUT_DIR/lib/{otb,python/*otbApplication*,python3/*otbApplication*,java/org.otb.application.jar}
rm -fr OUT_DIR/lib/cmake/OTB-*
rm -fr OUT_DIR/share/OTB*
rm -fr OUT_DIR/share/otb/
rm -fv OUT_DIR/bin/{otb*,monteverdi,mapla}
rm -fv OUT_DIR/{mapla.sh,monteverdi.sh}
rm -fv OUT_DIR/otbenv.*
......
......@@ -27,34 +27,16 @@ function(install_share_dirs)
set(PKG_SHARE_SOURCE_DIR ${SUPERBUILD_INSTALL_DIR}/share)
####################### install mvd i18N ############################
# OTB i18n directory is different from qt's i18N directory
#which is <prefix>/share/qt4/translations by default on linux.
# To install otb i18n directory correctly, we need to find
#Monteverdi_INSTALL_DATA_DIR. Value of this is a defined in ConfigureMonteverdi.h
# and default value is "share/OTB-X.Y"
#...
# #define Monteverdi_INSTALL_DATA_DIR
#...
#Instead of parsing ConfigureMonteverdi.h,
#we simply use default and add a check for this directory!
#define Monteverdi_INSTALL_DATA_DIR "share/OTB-X.Y"
set(OTB_I18N_DIRNAME OTB-${PKG_OTB_VERSION_MAJOR}.${PKG_OTB_VERSION_MINOR}/i18n)
set(MVD_I18N_SOURCE_DIR ${PKG_SHARE_SOURCE_DIR}/${OTB_I18N_DIRNAME})
set(MVD_I18N_SOURCE_DIR ${PKG_SHARE_SOURCE_DIR}/otb/i18n)
if(NOT EXISTS "${MVD_I18N_SOURCE_DIR}")
message(FATAL_ERROR "Error ${MVD_I18N_SOURCE_DIR} not exists")
endif()
set(MVD_I18N_DEST_DIR ${PKG_SHARE_DEST_DIR}/${OTB_I18N_DIRNAME})
file(GLOB MVD_APP_TS_FILES ${PACKAGE_OTB_SRC_DIR}/i18n/*.ts) # qm files
foreach(APP_TS_FILE ${MVD_APP_TS_FILES})
get_filename_component(APP_TS_FILENAME ${APP_TS_FILE} NAME_WE)
install(FILES ${MVD_I18N_SOURCE_DIR}/${APP_TS_FILENAME}.qm
DESTINATION ${MVD_I18N_DEST_DIR}
)
DESTINATION ${PKG_SHARE_DEST_DIR}/otb/i18n)
endforeach()
####################### install GDAL data ############################
......
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