prepare_file_list.cmake 3.14 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#
# 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.
#
20
function(prepare_file_list file_list_result)
21

22
  set(file_list)
23
  set(otbapp_launcher "otbApplicationLauncherCommandLine${EXE_EXT}")
24
  #This must exist in any OTB Installation. minimal or full
25
  if(NOT EXISTS "${SUPERBUILD_INSTALL_DIR}/bin/${otbapp_launcher}")
26 27
    message(
      FATAL_ERROR
28
      "${SUPERBUILD_INSTALL_DIR}/bin/${otbapp_launcher} not found.")
29 30 31
    return()
  endif()

32
  set(file_list "${otbapp_launcher}")
33

34
  if(HAVE_QT4)
35
    list(APPEND file_list "otbApplicationLauncherQt${EXE_EXT}")
36 37
  endif()

38
  if(HAVE_MVD)
39 40
    list(APPEND file_list "monteverdi${EXE_EXT}")
    list(APPEND file_list "mapla${EXE_EXT}")
41 42
  endif()
  
43
  if(HAVE_PYTHON)
44
    list(APPEND file_list "_otbApplication${PYMODULE_EXT}")
45
  endif()
Rashad Kanavath's avatar
Rashad Kanavath committed
46
  
47
  foreach(exe_file "iceViewer" "otbTestDriver" "SharkVersion")
Rashad Kanavath's avatar
Rashad Kanavath committed
48
    if(EXISTS "${SUPERBUILD_INSTALL_DIR}/bin/${exe_file}${EXE_EXT}")
Rashad Kanavath's avatar
Rashad Kanavath committed
49
      list(APPEND file_list "${exe_file}${EXE_EXT}")
50
    else()
Rashad Kanavath's avatar
Rashad Kanavath committed
51
      message(STATUS "${exe_file}${EXE_EXT} not found in ${SUPERBUILD_INSTALL_DIR}/bin. (skipping)")
52 53 54 55 56
    endif()
  endforeach()

  #Qt stuff
  if(HAVE_QT4)
57 58 59 60 61 62 63
    list(APPEND file_list "lrelease${EXE_EXT}")
    list(APPEND file_list "moc${EXE_EXT}")
    list(APPEND file_list "qmake${EXE_EXT}")
    list(APPEND file_list "rcc${EXE_EXT}")
    list(APPEND file_list "uic${EXE_EXT}")
    list(APPEND file_list "proj${EXE_EXT}")
    list(APPEND file_list "cs2cs${EXE_EXT}")
64 65
  endif()
  
Rashad Kanavath's avatar
Rashad Kanavath committed
66 67 68 69
  file(GLOB otb_test_exe_list 
    "${SUPERBUILD_INSTALL_DIR}/bin/gdal*${EXE_EXT}"
    "${OTB_BINARY_DIR}/bin/*[T|t]est*${EXE_EXT}"
    )
70

Rashad Kanavath's avatar
Rashad Kanavath committed
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
  #special items to be removed!. hackety-hack
  list(REMOVE_ITEM otb_test_exe_list
    "${SUPERBUILD_INSTALL_DIR}/bin/gdal-config"
    )
  list(REMOVE_ITEM otb_test_exe_list
    "${OTB_BINARY_DIR}/bin/otbcli_TestApplication")
  
  list(REMOVE_ITEM otb_test_exe_list
    "${OTB_BINARY_DIR}/bin/otbgui_TestApplication")
  
  foreach(otb_test_exe   ${otb_test_exe_list})
    get_filename_component(otb_test_exe_name ${otb_test_exe} NAME)
    list(APPEND file_list ${otb_test_exe_name})
  endforeach()
  
  # special case for msvc: ucrtbase.dll must be explicitly vetted.
  # for proj.dll, see Mantis-1424
  if(MSVC)
    list(APPEND file_list "ucrtbase.dll")
    list(APPEND file_list "proj.dll")
  endif()  
92

93 94
  set(otb_applications_dir "${SUPERBUILD_INSTALL_DIR}/lib/otb/applications")
  file(GLOB OTB_APPS_LIST "${otb_applications_dir}/otbapp_*${LIB_EXT}") # /lib/otb
95
  list(APPEND  file_list ${OTB_APPS_LIST})
96 97


Rashad Kanavath's avatar
Rashad Kanavath committed
98
  set(${file_list_result} ${file_list} PARENT_SCOPE)
Rashad Kanavath's avatar
Rashad Kanavath committed
99
endfunction()