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

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 orfeotoolbox/otb!157
No related merge requests found
Showing with 18 additions and 66 deletions
+18 -66
...@@ -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)
...@@ -429,11 +426,13 @@ install(FILES ${OTB_FIND_PACKAGE_SCRIPTS} DESTINATION ${OTB_INSTALL_PACKAGE_DIR} ...@@ -429,11 +426,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_BINARY_DIR}/${OTB_INSTALL_DATA_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)
...@@ -141,7 +141,6 @@ include(install_include_dirs) ...@@ -141,7 +141,6 @@ include(install_include_dirs)
include(install_importlibs) include(install_importlibs)
include(install_python_bindings) include(install_python_bindings)
include(install_java_bindings) include(install_java_bindings)
include(install_qgis_bindings)
include(install_share_dirs) include(install_share_dirs)
include(install_cmake_files) include(install_cmake_files)
include(install_qtdev_files) include(install_qtdev_files)
...@@ -193,12 +192,7 @@ if(EXISTS "${SUPERBUILD_INSTALL_DIR}/lib/otb/java/org.otb.application.jar") ...@@ -193,12 +192,7 @@ if(EXISTS "${SUPERBUILD_INSTALL_DIR}/lib/otb/java/org.otb.application.jar")
set(HAVE_JAVA TRUE) set(HAVE_JAVA TRUE)
endif() endif()
set(HAVE_QGIS FALSE CACHE INTERNAL "QGIS wrappings") #only for *nix
if(IS_DIRECTORY "${SUPERBUILD_INSTALL_DIR}/share/otb/description")
set(HAVE_QGIS TRUE)
endif()
#only for *nix
if(UNIX) if(UNIX)
file(WRITE ${CMAKE_BINARY_DIR}/make_symlinks "#!/bin/sh\n") file(WRITE ${CMAKE_BINARY_DIR}/make_symlinks "#!/bin/sh\n")
endif() endif()
...@@ -223,8 +217,6 @@ install_python_bindings() ...@@ -223,8 +217,6 @@ install_python_bindings()
install_java_bindings() install_java_bindings()
install_qgis_bindings()
install_share_dirs() install_share_dirs()
install_cmake_files() 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) ...@@ -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()
Supports Markdown
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