install_share_dirs.cmake 2.54 KB
Newer Older
1
#
Julien Michel's avatar
Julien Michel committed
2
# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#
# 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.
#
Rashad Kanavath's avatar
Rashad Kanavath committed
20 21 22 23 24 25 26 27 28 29
function(install_share_dirs)

  #a convenient cmake var for storing <prefix>/bin
  set(PKG_STAGE_BIN_DIR "${PKG_STAGE_DIR}/bin")

  #<prefix>/share for gdal data files
  set(PKG_SHARE_DEST_DIR ${PKG_STAGE_DIR}/share)

  set(PKG_SHARE_SOURCE_DIR ${SUPERBUILD_INSTALL_DIR}/share)

30
  ####################### install mvd i18N ############################
31
  set(MVD_I18N_SOURCE_DIR ${PKG_SHARE_SOURCE_DIR}/otb/i18n)
32 33 34 35 36
  if(NOT EXISTS "${MVD_I18N_SOURCE_DIR}")
    message(FATAL_ERROR "Error ${MVD_I18N_SOURCE_DIR} not exists")
  endif()

  ####################### install GDAL data ############################
Rashad Kanavath's avatar
Rashad Kanavath committed
37 38 39 40 41 42 43 44 45
  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()
  if(NOT EXISTS "${GDAL_DATA_DIR}/epsg.wkt")
    message(FATAL_ERROR
      "Cannot generate package without GDAL_DATA : ${GDAL_DATA_DIR}")
  endif()
46
  install_without_message("${GDAL_DATA_DIR}" "share" )
47

Rashad Kanavath's avatar
Rashad Kanavath committed
48
  ####################### install GeoTIFF data ########################
49
  install_without_message("${PKG_SHARE_SOURCE_DIR}/epsg_csv" "share" )
Rashad Kanavath's avatar
Rashad Kanavath committed
50 51

  ####################### install OSSIM data ##########################
52
  install_without_message("${PKG_SHARE_SOURCE_DIR}/ossim" "share" )
Rashad Kanavath's avatar
Rashad Kanavath committed
53 54 55

  ####################### install proj share ##########################
  if(EXISTS ${PKG_SHARE_SOURCE_DIR}/proj)
56
    install_without_message("${PKG_SHARE_SOURCE_DIR}/proj" "share" )
Rashad Kanavath's avatar
Rashad Kanavath committed
57 58 59 60
  endif()
  
  ####################### Install copyrights ##########################
  #install license for packages
61
  install_without_message("${PKG_SHARE_SOURCE_DIR}/copyright" "share" )
62
  install(FILES ${OTBPackaging_SOURCE_DIR}/LICENSE
63
    DESTINATION ${PKG_STAGE_DIR})
Rashad Kanavath's avatar
Rashad Kanavath committed
64

65 66 67
  ####################### install share/otb ###########################
  install_without_message("${PKG_SHARE_SOURCE_DIR}/otb" "share" )

Rashad Kanavath's avatar
Rashad Kanavath committed
68 69
endfunction()