Commit 46c6be0f authored by Rashad Kanavath's avatar Rashad Kanavath

PKG: fix mvd & qt4 translations file install

parent 7927a230
......@@ -144,9 +144,7 @@ include(install_include_dirs)
include(install_importlibs)
include(install_python_bindings)
include(install_share_dirs)
include(install_translation_files)
include(install_cmake_files)
include(install_mvd_files)
include(install_qtdev_files)
include(install_vstudio_files)
include(installer_files)
......@@ -212,11 +210,7 @@ install_python_bindings()
install_share_dirs()
install_translation_files()
install_cmake_files()
install_mvd_files()
install_cmake_files()
install_qtdev_files()
......
......@@ -35,7 +35,6 @@ macro(check_cmake_variables)
foreach(req
${required_vars}
PKG_STAGE_DIR
QT_TRANSLATIONS_DIR
SUPERBUILD_BINARY_DIR
SUPERBUILD_INSTALL_DIR
SUPERBUILD_SOURCE_DIR
......
function(install_mvd_files)
if(NOT HAVE_MVD)
return()
endif()
#install icon file for .app file. Monteverdi and Mapla has same icon!
if(APPLE)
install(FILES Files/Monteverdi.icns
DESTINATION ${PKG_STAGE_DIR})
endif()
#TODO:? revisit this
if(UNIX)
file(GLOB DOT_A_FILES ${SUPERBUILD_INSTALL_DIR}/lib/lib*.a )
foreach(DOT_A_FILE ${DOT_A_FILES})
install(FILES "${DOT_A_FILE}" DESTINATION ${PKG_STAGE_DIR}/lib)
endforeach()
endif()
endfunction()
......@@ -9,20 +9,47 @@ 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})
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 ${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}
)
endforeach()
####################### install GDAL data ############################
set(GDAL_DATA_DIR ${PKG_SHARE_SOURCE_DIR}/gdal)
#MSVC install gdal-data in in a different directory. So we don't spoil it
if(MSVC)
set(GDAL_DATA_DIR ${SUPERBUILD_INSTALL_DIR}/data)
endif()
####################### install GDAL data ############################
if(NOT EXISTS "${GDAL_DATA_DIR}/epsg.wkt")
message(FATAL_ERROR
"Cannot generate package without GDAL_DATA : ${GDAL_DATA_DIR}")
endif()
install_without_message("${GDAL_DATA_DIR}" "share" )
####################### install GeoTIFF data ########################
install_without_message("${PKG_SHARE_SOURCE_DIR}/epsg_csv" "share" )
......@@ -37,12 +64,10 @@ function(install_share_dirs)
####################### Install copyrights ##########################
#install license for packages
install_without_message("${PKG_SHARE_SOURCE_DIR}/copyright" "share" )
install(FILES ${PKG_SHARE_SOURCE_DIR}/copyright/LICENSE DESTINATION ${PKG_STAGE_DIR})
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} )
......
function(install_translation_files)
# get all translations already distributed with qt4/
#
# These files are the "qt_<localename>.qm" files
# Qt distributes translation of common message strings used in Qt.
#We just copy these files into package.
file(GLOB QT_TRANSLATIONS_FILES ${QT_TRANSLATIONS_DIR}/qt_*)
foreach(translation_item ${QT_TRANSLATIONS_FILES})
# We need to remove the "qt_help_<localename>.qm" files from this list
if(NOT ${translation_item} MATCHES "qt_help")
install(FILES ${translation_item}
DESTINATION "${PKG_STAGE_DIR}/lib/qt4/translations")
endif()
endforeach()
# 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-6.1"
#...
# #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-6.1"
set(Monteverdi_I18N_SOURCE_DIR ${SUPERBUILD_INSTALL_DIR}/share/OTB-${PKG_OTB_VERSION_MAJOR}.${PKG_OTB_VERSION_MINOR}/i18n)
set(Monteverdi_I18N_INSTALL_DIR ${PKG_STAGE_DIR}/share/OTB-${PKG_OTB_VERSION_MAJOR}.${PKG_OTB_VERSION_MINOR}/i18n)
#translation of monteverdi specific strings
if(NOT EXISTS "${Monteverdi_I18N_SOURCE_DIR}")
message(FATAL_ERROR "Error ${Monteverdi_I18N_SOURCE_DIR} not exists")
endif()
file(GLOB APP_TS_FILES ${PACKAGE_OTB_SRC_DIR}/i18n/*.ts) # qm files
foreach(APP_TS_FILE ${APP_TS_FILES})
get_filename_component(APP_TS_FILENAME ${APP_TS_FILE} NAME_WE)
install(FILES ${Monteverdi_I18N_SOURCE_DIR}/${APP_TS_FILENAME}.qm
DESTINATION ${Monteverdi_I18N_INSTALL_DIR}
)
endforeach()
endfunction()
......@@ -13,6 +13,7 @@ macro(installer_files)
configure_file("${README_FILE}" ${CMAKE_BINARY_DIR}/README )
install(FILES ${CMAKE_BINARY_DIR}/README DESTINATION ${PKG_STAGE_DIR} )
#configure pkgsetup for mac and linux
if(LINUX)
configure_file(
......@@ -27,6 +28,10 @@ macro(installer_files)
${CMAKE_CURRENT_SOURCE_DIR}/Files/macx_pkgsetup.in
${CMAKE_CURRENT_BINARY_DIR}/pkgsetup @ONLY
)
#install icon file for .app file. Monteverdi and Mapla has same icon!
install(FILES
Files/Monteverdi.icns DESTINATION ${PKG_STAGE_DIR})
endif()
#start installing script and other stuff related to package
......
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