Commit a5bd3a21 authored by Rashad Kanavath's avatar Rashad Kanavath

ENH: install descriptors in share/otb/description

share/otb directory contains i18n and maybe other data files for OTB.

This allows to simply some code.
* avoid search and install of i18n files in package scripts
* use of OTB_INSTALL_DESCR cmake variable for storing qgis description
* install qgis description to share/otb/description in all cases:
 ** build directory, otb, superbuild, remote modules?
 ** generate of missing description file when loading qgis plugin. (This
 always goes to share/otb/description)
 ** packaging in debian, ubuntu and binary packages
* unversioned otb doc folder. share/doc/OTB-X.Y -> share/doc/otb. This is where all VERSION , LICENSE are kept.
parent b3e93bf9
...@@ -71,7 +71,7 @@ else() ...@@ -71,7 +71,7 @@ else()
set(OTB_INSTALL_DATA_DIR share/otb) set(OTB_INSTALL_DATA_DIR share/otb)
endif() endif()
if(NOT OTB_INSTALL_DOC_DIR) if(NOT OTB_INSTALL_DOC_DIR)
set(OTB_INSTALL_DOC_DIR share/doc/OTB-${OTB_VERSION_MAJOR}.${OTB_VERSION_MINOR}) set(OTB_INSTALL_DOC_DIR share/doc/otb)
endif() endif()
if(NOT OTB_INSTALL_PACKAGE_DIR) if(NOT OTB_INSTALL_PACKAGE_DIR)
set(OTB_INSTALL_PACKAGE_DIR "lib/cmake/OTB-${OTB_VERSION_MAJOR}.${OTB_VERSION_MINOR}") set(OTB_INSTALL_PACKAGE_DIR "lib/cmake/OTB-${OTB_VERSION_MAJOR}.${OTB_VERSION_MINOR}")
......
...@@ -165,19 +165,16 @@ if(NOT OTB_INSTALL_JAVA_DIR) ...@@ -165,19 +165,16 @@ if(NOT OTB_INSTALL_JAVA_DIR)
set(OTB_INSTALL_JAVA_DIR "lib/otb/java") set(OTB_INSTALL_JAVA_DIR "lib/otb/java")
endif() endif()
if(NOT OTB_INSTALL_DATA_DIR) if(NOT OTB_INSTALL_DATA_DIR)
set(OTB_INSTALL_DATA_DIR share/otb) set(OTB_INSTALL_DATA_DIR "share/otb")
endif() endif()
if(NOT OTB_INSTALL_DOC_DIR) if(NOT OTB_INSTALL_DOC_DIR)
set(OTB_INSTALL_DOC_DIR share/doc/OTB-${OTB_VERSION_MAJOR}.${OTB_VERSION_MINOR}) set(OTB_INSTALL_DOC_DIR "share/doc/otb")
endif() endif()
if(NOT OTB_INSTALL_PACKAGE_DIR) if(NOT OTB_INSTALL_PACKAGE_DIR)
set(OTB_INSTALL_PACKAGE_DIR "${OTB_INSTALL_LIBRARY_DIR}/cmake/OTB-${OTB_VERSION_MAJOR}.${OTB_VERSION_MINOR}") set(OTB_INSTALL_PACKAGE_DIR "${OTB_INSTALL_LIBRARY_DIR}/cmake/OTB-${OTB_VERSION_MAJOR}.${OTB_VERSION_MINOR}")
endif() endif()
if(NOT OTB_INSTALL_DESCR_DIR)
set (OTB_INSTALL_DESCR_DIR "share/otb/description")
endif()
#convert path to native for reconfiguring otbcli.bat.in #convert path to native for reconfiguring otbcli.bat.in
file(TO_NATIVE_PATH "${OTB_INSTALL_APP_DIR}" OTB_INSTALL_APP_DIR_NATIVE) file(TO_NATIVE_PATH "${OTB_INSTALL_APP_DIR}" OTB_INSTALL_APP_DIR_NATIVE)
...@@ -422,11 +419,13 @@ install(FILES ${OTB_FIND_PACKAGE_SCRIPTS} DESTINATION ${OTB_INSTALL_PACKAGE_DIR} ...@@ -422,11 +419,13 @@ install(FILES ${OTB_FIND_PACKAGE_SCRIPTS} DESTINATION ${OTB_INSTALL_PACKAGE_DIR}
# TODO : install release notes, copyright notice, ... # TODO : install release notes, copyright notice, ...
# install(FILES "LICENSE" "NOTICE" "README.txt" DESTINATION ${OTB_INSTALL_DOC_DIR} COMPONENT Runtime) # install(FILES "LICENSE" "NOTICE" "README.txt" DESTINATION ${OTB_INSTALL_DOC_DIR} COMPONENT Runtime)
install(FILES "LICENSE" DESTINATION ${OTB_INSTALL_DOC_DIR} COMPONENT Runtime) install(FILES "LICENSE" DESTINATION ${OTB_INSTALL_DOC_DIR})
# Configure and install VERSION file # Configure and install VERSION file
configure_file(VERSION VERSION @ONLY) configure_file(VERSION VERSION @ONLY)
install(FILES ${OTB_BINARY_DIR}/VERSION DESTINATION ${OTB_INSTALL_DOC_DIR} COMPONENT Runtime) install(FILES ${OTB_BINARY_DIR}/VERSION DESTINATION ${OTB_INSTALL_DOC_DIR} )
install(DIRECTORY ${OTB_BINARY_DIR}/${OTB_INSTALL_DATA_DIR} DESTINATION share)
if(BUILD_TESTING) if(BUILD_TESTING)
add_subdirectory(Utilities/InstallTest) add_subdirectory(Utilities/InstallTest)
......
...@@ -22,9 +22,9 @@ target_link_libraries(otbQgisDescriptor ${OTBQgis_LIBRARIES}) ...@@ -22,9 +22,9 @@ target_link_libraries(otbQgisDescriptor ${OTBQgis_LIBRARIES})
otb_module_target(otbQgisDescriptor) otb_module_target(otbQgisDescriptor)
add_custom_command(TARGET otbQgisDescriptor PRE_BUILD add_custom_command(TARGET otbQgisDescriptor PRE_BUILD
COMMAND "${CMAKE_COMMAND}" "-E" "echo" "Cleaning ${OTB_BINARY_DIR}/${OTB_INSTALL_DESCR_DIR}/" COMMAND "${CMAKE_COMMAND}" "-E" "echo" "Cleaning ${OTB_BINARY_DIR}/${OTB_INSTALL_DATA_DIR}/description/"
COMMAND "${CMAKE_COMMAND}" "-E" "remove_directory" "${OTB_BINARY_DIR}/${OTB_INSTALL_DESCR_DIR}/" COMMAND "${CMAKE_COMMAND}" "-E" "remove_directory" "${OTB_BINARY_DIR}/${OTB_INSTALL_DATA_DIR}/description/"
COMMAND "${CMAKE_COMMAND}" "-E" "make_directory" "${OTB_BINARY_DIR}/${OTB_INSTALL_DESCR_DIR}/" COMMAND "${CMAKE_COMMAND}" "-E" "make_directory" "${OTB_BINARY_DIR}/${OTB_INSTALL_DATA_DIR}/description/"
) )
set(app_names ${OTB_APPLICATIONS_NAME_LIST}) set(app_names ${OTB_APPLICATIONS_NAME_LIST})
...@@ -41,12 +41,12 @@ if(CMAKE_SKIP_RPATH AND "${CMAKE_SYSTEM_NAME}" MATCHES "Linux") ...@@ -41,12 +41,12 @@ if(CMAKE_SKIP_RPATH AND "${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
endif() endif()
foreach(app_name ${app_names}) foreach(app_name ${app_names})
add_dependencies(otbQgisDescriptor otbapp_${app_name}) add_dependencies(otbQgisDescriptor otbapp_${app_name})
set(dfile "${OTB_BINARY_DIR}/${OTB_INSTALL_DESCR_DIR}/${app_name}.txt") set(dfile "${OTB_BINARY_DIR}/${OTB_INSTALL_DATA_DIR}/description/${app_name}.txt")
add_custom_command(OUTPUT "${dfile}" add_custom_command(OUTPUT "${dfile}"
COMMAND ${generate_descriptor_cmd} COMMAND ${generate_descriptor_cmd}
"${app_name}" "${OTB_BINARY_DIR}/${OTB_INSTALL_APP_DIR}" "${OTB_BINARY_DIR}/${OTB_INSTALL_DESCR_DIR}/" "${app_name}" "${OTB_BINARY_DIR}/${OTB_INSTALL_APP_DIR}" "${OTB_BINARY_DIR}/${OTB_INSTALL_DATA_DIR}/description/"
WORKING_DIRECTORY ${OTB_BINARY_DIR} WORKING_DIRECTORY ${OTB_BINARY_DIR}
COMMENT "./bin/otbQgisDescriptor ${app_name} ./${OTB_INSTALL_APP_DIR} ./${OTB_INSTALL_DESCR_DIR}/" COMMENT "./bin/otbQgisDescriptor ${app_name} ./${OTB_INSTALL_APP_DIR} ./${OTB_INSTALL_DATA_DIR}/description/"
VERBATIM) VERBATIM)
list(APPEND dfiles "${dfile}") list(APPEND dfiles "${dfile}")
endforeach() endforeach()
...@@ -54,6 +54,3 @@ endforeach() ...@@ -54,6 +54,3 @@ endforeach()
add_custom_target(generate_descriptors DEPENDS ${dfiles} ) add_custom_target(generate_descriptors DEPENDS ${dfiles} )
add_dependencies(${otb-module}-all generate_descriptors) add_dependencies(${otb-module}-all generate_descriptors)
install(DIRECTORY ${OTB_BINARY_DIR}/${OTB_INSTALL_DESCR_DIR}
DESTINATION share/otb)
...@@ -32,12 +32,6 @@ function(install_share_dirs) ...@@ -32,12 +32,6 @@ function(install_share_dirs)
if(NOT EXISTS "${MVD_I18N_SOURCE_DIR}") if(NOT EXISTS "${MVD_I18N_SOURCE_DIR}")
message(FATAL_ERROR "Error ${MVD_I18N_SOURCE_DIR} not exists") message(FATAL_ERROR "Error ${MVD_I18N_SOURCE_DIR} not exists")
endif() endif()
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 ${PKG_SHARE_DEST_DIR}/otb/i18n)
endforeach()
####################### install GDAL data ############################ ####################### install GDAL data ############################
set(GDAL_DATA_DIR ${PKG_SHARE_SOURCE_DIR}/gdal) set(GDAL_DATA_DIR ${PKG_SHARE_SOURCE_DIR}/gdal)
...@@ -68,12 +62,8 @@ function(install_share_dirs) ...@@ -68,12 +62,8 @@ function(install_share_dirs)
install(FILES ${PKG_SHARE_SOURCE_DIR}/copyright/LICENSE install(FILES ${PKG_SHARE_SOURCE_DIR}/copyright/LICENSE
DESTINATION ${PKG_STAGE_DIR}) DESTINATION ${PKG_STAGE_DIR})
####################### Install VERSION ########################## ####################### install share/otb ###########################
set(PKG_VERSION_FILE install_without_message("${PKG_SHARE_SOURCE_DIR}/otb" "share" )
"${SUPERBUILD_INSTALL_DIR}/share/doc/${PKG_OTB_VERSION_MAJOR}.${PKG_OTB_VERSION_MINOR}/VERSION")
if(EXISTS ${PKG_VERSION_FILE} )
install(FILES ${PKG_VERSION_FILE} DESTINATION ${PKG_STAGE_DIR})
endif()
endfunction() endfunction()
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