Commit 40038c7d authored by Rashad Kanavath's avatar Rashad Kanavath

Merge branch '1658-install-qgis-descriptors-to-share' into 'develop'

Resolve "install qgis descriptors into <PREFIX>/share/ on all platforms"

Closes #1658

See merge request !157
parents 7f9b6c88 5f8d7b1b
......@@ -71,7 +71,7 @@ else()
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})
set(OTB_INSTALL_DOC_DIR share/doc/otb)
endif()
if(NOT OTB_INSTALL_PACKAGE_DIR)
set(OTB_INSTALL_PACKAGE_DIR "lib/cmake/OTB-${OTB_VERSION_MAJOR}.${OTB_VERSION_MINOR}")
......
......@@ -165,19 +165,16 @@ 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)
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})
set(OTB_INSTALL_DOC_DIR "share/doc/otb")
endif()
if(NOT OTB_INSTALL_PACKAGE_DIR)
set(OTB_INSTALL_PACKAGE_DIR "${OTB_INSTALL_LIBRARY_DIR}/cmake/OTB-${OTB_VERSION_MAJOR}.${OTB_VERSION_MINOR}")
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
file(TO_NATIVE_PATH "${OTB_INSTALL_APP_DIR}" OTB_INSTALL_APP_DIR_NATIVE)
......@@ -429,11 +426,13 @@ install(FILES ${OTB_FIND_PACKAGE_SCRIPTS} DESTINATION ${OTB_INSTALL_PACKAGE_DIR}
# TODO : install release notes, copyright notice, ...
# 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_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_BINARY_DIR}/${OTB_INSTALL_DATA_DIR} )
install(DIRECTORY ${OTB_BINARY_DIR}/${OTB_INSTALL_DATA_DIR} DESTINATION share)
if(BUILD_TESTING)
add_subdirectory(Utilities/InstallTest)
......
......@@ -22,9 +22,9 @@ target_link_libraries(otbQgisDescriptor ${OTBQgis_LIBRARIES})
otb_module_target(otbQgisDescriptor)
add_custom_command(TARGET otbQgisDescriptor PRE_BUILD
COMMAND "${CMAKE_COMMAND}" "-E" "echo" "Cleaning ${OTB_BINARY_DIR}/${OTB_INSTALL_DESCR_DIR}/"
COMMAND "${CMAKE_COMMAND}" "-E" "remove_directory" "${OTB_BINARY_DIR}/${OTB_INSTALL_DESCR_DIR}/"
COMMAND "${CMAKE_COMMAND}" "-E" "make_directory" "${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_DATA_DIR}/description/"
COMMAND "${CMAKE_COMMAND}" "-E" "make_directory" "${OTB_BINARY_DIR}/${OTB_INSTALL_DATA_DIR}/description/"
)
set(app_names ${OTB_APPLICATIONS_NAME_LIST})
......@@ -41,12 +41,12 @@ if(CMAKE_SKIP_RPATH AND "${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
endif()
foreach(app_name ${app_names})
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}"
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}
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)
list(APPEND dfiles "${dfile}")
endforeach()
......@@ -54,6 +54,3 @@ endforeach()
add_custom_target(generate_descriptors DEPENDS ${dfiles} )
add_dependencies(${otb-module}-all generate_descriptors)
install(DIRECTORY ${OTB_BINARY_DIR}/${OTB_INSTALL_DESCR_DIR}
DESTINATION share/otb)
......@@ -141,7 +141,6 @@ include(install_include_dirs)
include(install_importlibs)
include(install_python_bindings)
include(install_java_bindings)
include(install_qgis_bindings)
include(install_share_dirs)
include(install_cmake_files)
include(install_qtdev_files)
......@@ -193,12 +192,7 @@ if(EXISTS "${SUPERBUILD_INSTALL_DIR}/lib/otb/java/org.otb.application.jar")
set(HAVE_JAVA TRUE)
endif()
set(HAVE_QGIS FALSE CACHE INTERNAL "QGIS wrappings")
if(IS_DIRECTORY "${SUPERBUILD_INSTALL_DIR}/share/otb/description")
set(HAVE_QGIS TRUE)
endif()
#only for *nix
#only for *nix
if(UNIX)
file(WRITE ${CMAKE_BINARY_DIR}/make_symlinks "#!/bin/sh\n")
endif()
......@@ -223,8 +217,6 @@ install_python_bindings()
install_java_bindings()
install_qgis_bindings()
install_share_dirs()
install_cmake_files()
......
#
# Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
#
# This file is part of Orfeo Toolbox
#
# https://www.orfeo-toolbox.org/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
function(install_qgis_bindings)
if(HAVE_QGIS)
install(DIRECTORY ${SUPERBUILD_INSTALL_DIR}/share/otb/description
DESTINATION ${PKG_STAGE_DIR})
endif()
endfunction()
......@@ -32,12 +32,6 @@ function(install_share_dirs)
if(NOT EXISTS "${MVD_I18N_SOURCE_DIR}")
message(FATAL_ERROR "Error ${MVD_I18N_SOURCE_DIR} not exists")
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 ############################
set(GDAL_DATA_DIR ${PKG_SHARE_SOURCE_DIR}/gdal)
......@@ -68,12 +62,8 @@ function(install_share_dirs)
install(FILES ${PKG_SHARE_SOURCE_DIR}/copyright/LICENSE
DESTINATION ${PKG_STAGE_DIR})
####################### Install VERSION ##########################
set(PKG_VERSION_FILE
"${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()
####################### install share/otb ###########################
install_without_message("${PKG_SHARE_SOURCE_DIR}/otb" "share" )
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