Commit d2ed4a1e authored by Rashad Kanavath's avatar Rashad Kanavath

ENH:jira #1293 mv SuperBuild/Packaging -> Packaging

parent 8c8a611a
......@@ -18,76 +18,44 @@
# limitations under the License.
#
##### check if standalone project ######
set(OUT_OF_SOURCE_BUILD FALSE)
if(NOT PROJECT_NAME)
cmake_minimum_required(VERSION 3.4)
include(CMakeParseArguments)
project(OTBPackaging)
option(GENERATE_PACKAGE "Generate OTB package" ON)
set(OUT_OF_SOURCE_BUILD TRUE)
if(BUILD_TESTING)
include(CTest)
endif()
if(NOT PACKAGE_OTB_SRC_DIR)
get_filename_component(PACKAGE_OTB_SRC_DIR ${OTBPackaging_SOURCE_DIR} PATH)
get_filename_component(PACKAGE_OTB_SRC_DIR ${PACKAGE_OTB_SRC_DIR} PATH)
endif()
option(OTB_WRAP_PYTHON "enable python wrapping" ON)
set(SUPERBUILD_BINARY_DIR "" CACHE PATH "path to superbuild binary directory")
set(SUPERBUILD_INSTALL_DIR "" CACHE PATH "path to superbuild install directory")
set(DOWNLOAD_LOCATION "" CACHE PATH "path to superbuild download archives")
else() #if(NOT PROJECT_NAME)
cmake_minimum_required(VERSION 3.4)
# SUPERBUILD_BINARY_DIR is only set in Packaging/CMakeLists.txt and not available
# in the parent scope like others. So we need to set it as CMAKE_BINARY_DIR
# if doing packages from source tree.
set( SUPERBUILD_BINARY_DIR ${CMAKE_BINARY_DIR} )
set( SUPERBUILD_INSTALL_DIR ${SB_INSTALL_PREFIX} )
if(NOT PACKAGE_OTB_SRC_DIR)
get_filename_component(PACKAGE_OTB_SRC_DIR ${OTB-SuperBuild_SOURCE_DIR} PATH)
endif()
endif()
cmake_minimum_required(VERSION 3.3.0)
if(NOT GENERATE_PACKAGE)
#well. we don't have any businees here. Let's move on..
return()
endif()
project(OTBPackaging)
include(CMakeParseArguments)
include(CMakeDetermineSystem)
include(GetPrerequisites)
include(CTest)
set(PKG_DEBUG OFF)
#setting this variable. prints a lot of debug information
#set( PKG_DEBUG 1)
set(CMAKE_BUILD_TYPE Release)
#user-defined variables and option
option(OTB_WRAP_PYTHON "include python bindings in package" ON)
set(SUPERBUILD_BINARY_DIR "" CACHE PATH "path to superbuild binary directory")
set(SUPERBUILD_INSTALL_DIR "" CACHE PATH "path to superbuild install directory")
set(DOWNLOAD_LOCATION "" CACHE PATH "path to superbuild download archives")
#set(OTB_INSTALL_DIR "${SUPERBUILD_INSTALL_DIR}")
#set(DEPENDENCIES_INSTALL_DIR "${SUPERBUILD_INSTALL_DIR}")
#variables based on above user-defined variables
set(OTB_BINARY_DIR "${SUPERBUILD_BINARY_DIR}/OTB/build")
set(QT_PLUGINS_DIR "${SUPERBUILD_INSTALL_DIR}/plugins")
set(QT_TRANSLATIONS_DIR "${SUPERBUILD_INSTALL_DIR}/translations")
get_filename_component(PACKAGE_OTB_SRC_DIR ${OTBPackaging_SOURCE_DIR} PATH)
set(SUPERBUILD_SOURCE_DIR "${PACKAGE_OTB_SRC_DIR}/SuperBuild")
if(OTB_WRAP_PYTHON AND NOT PYTHON_EXECUTABLE)
find_package ( PythonInterp REQUIRED )
mark_as_advanced(PYTHON_INCLUDE_DIR)
mark_as_advanced(PYTHON_LIBRARY)
find_package(PythonInterp REQUIRED)
endif()
find_program(FILE_COMMAND "file")
mark_as_advanced(FILE_COMMAND)
if(WIN32)
set(ZIP_EXE_NAMES 7z 7za)
find_program(ZIP_EXECUTABLE NAMES ${ZIP_EXE_NAMES})
if(NOT ZIP_EXECUTABLE)
message(FATAL_ERROR "Cannot find 7z executable. searched names ${ZIP_EXE_NAMES}. Please add it to your path")
message(FATAL_ERROR
"Cannot find 7z executable '${ZIP_EXE_NAMES}' in your PATH")
endif()
endif()
......@@ -96,47 +64,43 @@ if( "${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
set(LINUX TRUE)
endif()
include(${SUPERBUILD_SOURCE_DIR}/CMake/SuperBuild_Macro.cmake)
include(${PACKAGE_OTB_SRC_DIR}/CMake/OTBCheckTargetSystemArch.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/CreateCMakeProjects.cmake)
#install prefix is same as SUPERBUILD_INSTALL_DIR. could be changed later
set(CMAKE_INSTALL_PREFIX "${SUPERBUILD_INSTALL_DIR}")
#set CMAKE_MODULE_PATH to be the current source directory.
# This will allow to include all cmake files without full path and .cmake extension!
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
if(OTB_WRAP_PYTHON)
set(required_vars PYTHON_EXECUTABLE)
endif()
#include superbuild_macro for get_version()
include(${SUPERBUILD_SOURCE_DIR}/CMake/SuperBuild_Macro.cmake)
foreach(req
${required_vars}
SUPERBUILD_BINARY_DIR
SUPERBUILD_INSTALL_DIR
SUPERBUILD_SOURCE_DIR
PACKAGE_OTB_SRC_DIR
OTB_TARGET_SYSTEM_ARCH
OTB_TARGET_SYSTEM_ARCH_IS_X64
)
if(NOT DEFINED ${req} OR "${${req}}" STREQUAL "")
message(FATAL_ERROR "you must set ${req}")
endif()
set(vars "${vars} ${req}=[${${req}}]\n")
endforeach(req)
#include superbuild_macro for OTB_TARGET_SYSTEM_ARCH_IS_X64 value
include(${PACKAGE_OTB_SRC_DIR}/CMake/OTBCheckTargetSystemArch.cmake)
message("\n${vars}\n")
# get itk version from External_itk.cmake if not on mingw
# because mxe has different version
get_version(
INPUT_FILE "${SUPERBUILD_SOURCE_DIR}/CMake/External_itk.cmake"
MATCH_STRINGS "SB_ITK_VERSION_MAJOR" "SB_ITK_VERSION_MINOR"
PREFIX PKG
)
set(PKG_ITK_SB_VERSION "${PKG_SB_ITK_VERSION_MAJOR}.${PKG_SB_ITK_VERSION_MINOR}")
set(PKG_DEBUG OFF)
#get version of OTB from source_dir/CMakeLists.txt
get_version(
INPUT_FILE "${PACKAGE_OTB_SRC_DIR}/CMakeLists.txt"
MATCH_STRINGS "OTB_VERSION_MAJOR" "OTB_VERSION_MINOR" "OTB_VERSION_PATCH"
PREFIX PKG
)
set(CMAKE_INSTALL_PREFIX "${SUPERBUILD_INSTALL_DIR}")
set(PKG_OTB_VERSION_STRING ${PKG_OTB_VERSION_MAJOR}.${PKG_OTB_VERSION_MINOR}.${PKG_OTB_VERSION_PATCH})
set(PACKAGE_LONG_NAME OrfeoToolBox)
# Make up part of output package file
set(NAME_SUFFIX "" CACHE STRING "extra suffix for package name")
set(PACKAGE_NAME OTB)
if(NAME_SUFFIX)
set(PACKAGE_NAME OTB${NAME_SUFFIX})
endif()
if(APPLE)
set(PACKAGE_PLATFORM_NAME "Darwin")
elseif(WIN32)
......@@ -144,32 +108,113 @@ elseif(WIN32)
elseif(LINUX)
set(PACKAGE_PLATFORM_NAME "Linux")
endif()
set(PACKAGE_ARCH "32")
if(OTB_TARGET_SYSTEM_ARCH_IS_X64)
set(PACKAGE_ARCH "64")
endif()
# get itk version from External_itk.cmake if not on mingw
# because mxe has different version
get_version(
INPUT_FILE "${SUPERBUILD_SOURCE_DIR}/CMake/External_itk.cmake"
MATCH_STRINGS "SB_ITK_VERSION_MAJOR" "SB_ITK_VERSION_MINOR"
PREFIX PKG
# This directory is important.
# We stage/keep files that goes into final package in this directory
set(PKG_STAGE_DIR ${PACKAGE_NAME}-${PKG_OTB_VERSION_STRING}-${PACKAGE_PLATFORM_NAME}${PACKAGE_ARCH})
set(PATCHELF_PROGRAM "${CMAKE_BINARY_DIR}/PATCHELF/src/patchelf/src/patchelf")
include(External_patchelf)
include(PackageGlobals)
# Note that MANY or ALL of function use global variables set in this CMakeLists.txt
# The order in which the functions in these "included" files are called is only important.
# We tried not to share variables which are created inside functions or macro. In such cases,
# function return the value.
include(setif_value_in_list)
include(get_variables_ending_with)
include(clear_cmakecache_variables)
include(check_cmake_variables)
include(configure_loader)
include(search_library)
include(prepare_search_dirs)
include(prepare_file_list)
include(process_file_recurse)
include(install_without_message)
include(install_rule)
include(isfile_symlink)
include(update_symlinks_script)
# below functions include many install commands which are installing
# files under PKG_STAGE_DIR
include(install_python_bindings)
include(install_include_dirs)
include(install_share_dirs)
include(install_translation_files)
include(install_cmake_files)
include(install_mvd_files)
include(install_qtdev_files)
include(install_script_files)
include(install_vstudio_files)
include(installer_files)
include(create_package)
configure_loader(LOADER_PROGRAM LOADER_ARGS LOADER_REGEX)
check_cmake_variables()
message(STATUS "Empty package staging directory: ${CMAKE_INSTALL_PREFIX}/${PKG_STAGE_DIR}")
execute_process(COMMAND
${CMAKE_COMMAND} -E remove_directory
"${CMAKE_INSTALL_PREFIX}/${PKG_STAGE_DIR}"
)
set(PKG_ITK_SB_VERSION "${PKG_SB_ITK_VERSION_MAJOR}.${PKG_SB_ITK_VERSION_MINOR}")
#get version of OTB from source_dir/CMakeLists.txt
get_version(
INPUT_FILE "${PACKAGE_OTB_SRC_DIR}/CMakeLists.txt"
MATCH_STRINGS "OTB_VERSION_MAJOR" "OTB_VERSION_MINOR" "OTB_VERSION_PATCH"
PREFIX PKG
)
set(HAVE_QT4 FALSE CACHE INTERNAL "HAVE_QT4")
if(EXISTS "${SUPERBUILD_INSTALL_DIR}/bin/otbApplicationLauncherQt${EXE_EXT}")
set(HAVE_QT4 TRUE)
endif()
set(PKG_OTB_VERSION_STRING ${PKG_OTB_VERSION_MAJOR}.${PKG_OTB_VERSION_MINOR}.${PKG_OTB_VERSION_PATCH})
set(HAVE_MVD FALSE CACHE INTERNAL "HAVE_MVD")
if(EXISTS "${SUPERBUILD_INSTALL_DIR}/bin/monteverdi${EXE_EXT}")
set(HAVE_MVD TRUE)
endif()
set(HAVE_PYTHON FALSE CACHE INTERNAL "HAVE_PYTHON")
if(EXISTS "${SUPERBUILD_INSTALL_DIR}/lib/otb/python/_otbApplication${PYMODULE_EXT}")
set(HAVE_PYTHON TRUE)
endif()
#only for *nix
file(WRITE ${CMAKE_BINARY_DIR}/make_symlinks "#!/bin/sh\n")
#remove all *_USED|*_RESOLVED variables from CMakeCache.txt
clear_cmakecache_variables()
set(PKG_SEARCHDIRS)
prepare_search_dirs(PKG_SEARCHDIRS)
set(PKG_PEFILES)
prepare_file_list(PKG_PEFILES)
foreach(pfile ${PKG_PEFILES})
get_filename_component(pfile_name ${pfile} NAME)
process_file_recurse(${pfile_name})
endforeach()
install_python_bindings()
install_include_dirs()
install_share_dirs()
install_translation_files()
install_cmake_files()
install_mvd_files()
install_qtdev_files()
install_script_files()
install_vstudio_files()
installer_files()
#create cmake project and custom targets. c.f CreateCMakeProjects.cmake
CreateCMakeProjects()
create_package()
#
# 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.
#
set(PATCHELF_PREFIX_DIR "${CMAKE_BINARY_DIR}/PATCHELF")
set(PATCHELF_SOURCE_DIR "${PATCHELF_PREFIX_DIR}/src/patchelf")
# PATCHELF_BINARY_DIR is same as PATCHELF_SOURCE_DIR
set(PATCHELF_INSTALL_DIR "${PATCHELF_PREFIX_DIR}/install/patchelf")
set(PATCHELF_STAMP_DIR "${PATCHELF_PREFIX_DIR}/stamp/patchelf")
set(PATCHELF_TMP_DIR "${PATCHELF_PREFIX_DIR}/tmp/patchelf")
if( __EXTERNAL_PATCHELF__)
return()
else()
set(__EXTERNAL_PATCHELF__ 1)
endif()
if(WIN32 OR APPLE)
add_custom_target(PATCHELF)
return()
endif()
include(ExternalProject)
set(PATCHELF_ENV_COMMAND env CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} CXXFLAGS=-static)
ExternalProject_Add(PATCHELF
PREFIX "${PATCHELF_PREFIX_DIR}"
URL "http://nixos.org/releases/patchelf/patchelf-0.9/patchelf-0.9.tar.bz2"
URL_MD5 d02687629c7e1698a486a93a0d607947
DOWNLOAD_DIR "${DOWNLOAD_LOCATION}"
SOURCE_DIR "${PATCHELF_SOURCE_DIR}"
BINARY_DIR "${PATCHELF_SOURCE_DIR}"
INSTALL_DIR "${PATCHELF_INSTALL_DIR}"
STAMP_DIR "${PATCHELF_STAMP_DIR}"
TMP_DIR "${PATCHELF_TMP_DIR}"
CONFIGURE_COMMAND
${PATCHELF_ENV_COMMAND}
${PATCHELF_SOURCE_DIR}/configure
INSTALL_COMMAND ""
LOG_DOWNLOAD 1
LOG_CONFIGURE 1
LOG_BUILD 1
LOG_INSTALL 1
)
......@@ -18,6 +18,26 @@
# limitations under the License.
#
set(DEST_BIN_DIR bin)
set(DEST_APP_DIR lib/otb/applications)
set(LIB_PREFIX lib)
set(DEST_LIB_DIR lib)
set(EXE_EXT "")
set(SCRIPT_EXT ".sh")
set(LIB_EXT ".so")
set(PYMODULE_EXT ".so")
if(WIN32)
set(LIB_PREFIX)
set(DEST_LIB_DIR bin)
set(EXE_EXT ".exe")
set(LIB_EXT ".dll")
set(SCRIPT_EXT ".bat")
set(PYMODULE_EXT ".pyd")
elseif(APPLE)
set(LIB_EXT ".dylib")
endif()
set(WINDOWS_SYSTEM_DLLS
user32.dll
gdi32.dll
......@@ -45,17 +65,17 @@ set(WINDOWS_SYSTEM_DLLS
python...dll
)
if(PKG_GENERATE_XDK)
set(WINDOWS_SYSTEM_DLLS
${WINDOWS_SYSTEM_DLLS}
api-ms-win-*
concrt140.dll
ucrtbase.dll
msvcp140.dll
msvrt140.dll
vcomp140.dll
)
endif()
# if(PKG_GENERATE_XDK)
# set(WINDOWS_SYSTEM_DLLS
# ${WINDOWS_SYSTEM_DLLS}
# api-ms-win-*
# concrt140.dll
# ucrtbase.dll
# msvcp140.dll
# msvrt140.dll
# vcomp140.dll
# )
# endif()
set(LINUX_SYSTEM_DLLS
libm.so
......
......@@ -17,80 +17,29 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
function(func_install_xdk_files)
func_patch_cmake_files_for(NAME "ITK"
VERSION "${PKG_ITK_SB_VERSION}"
MATCH_STRING "${CMAKE_INSTALL_PREFIX}"
REPLACE_VAR "ITK_INSTALL_PREFIX"
)
func_patch_cmake_files_for(NAME "OTB"
VERSION "${PKG_OTB_VERSION_MAJOR}.${PKG_OTB_VERSION_MINOR}"
MATCH_STRING "${CMAKE_INSTALL_PREFIX}"
REPLACE_VAR "OTB_INSTALL_PREFIX"
)
set(QT_REQ_DIRS)
if(MSVC)
file(GLOB ALL_LIB_FILES "${SUPERBUILD_INSTALL_DIR}/lib/*.lib")
macro(check_cmake_variables)
if(OTB_WRAP_PYTHON)
set(required_vars PYTHON_EXECUTABLE)
endif()
foreach(LIB_FILE ${LIB_FILES})
install_rule(${LIB_FILE})
endforeach()
list(APPEND QT_REQ_DIRS imports)
list(APPEND QT_REQ_DIRS mkspecs)
list(APPEND QT_REQ_DIRS plugins)
list(APPEND QT_REQ_DIRS translations)
foreach(QT_REQ_DIR ${QT_REQ_DIRS} )
if(EXISTS "${SUPERBUILD_INSTALL_DIR}/${QT_REQ_DIR}")
func_install_without_message("${SUPERBUILD_INSTALL_DIR}/${QT_REQ_DIR}" "")
endif()
endforeach()
endfunction() #func_install_xdk_files
function(func_install_monteverdi_support_files)
# Just check if required variables are defined.
foreach(req
${required_vars}
PATCHELF_PROGRAM
PKG_STAGE_DIR
QT_TRANSLATIONS_DIR
SUPERBUILD_BINARY_DIR
SUPERBUILD_INSTALL_DIR
SUPERBUILD_SOURCE_DIR
PACKAGE_OTB_SRC_DIR
PACKAGE_SUPPORT_FILES_DIR
QT_PLUGINS_DIR
PKG_STAGE_BIN_DIR
PKG_QTPLUGINS_DIR
PKG_OTB_TRANSLATIONS_DIRNAME
OTB_TARGET_SYSTEM_ARCH
OTB_TARGET_SYSTEM_ARCH_IS_X64
LOADER_PROGRAM
LOADER_ARGS
LOADER_REGEX
)
if(NOT DEFINED ${req} OR "${${req}}" STREQUAL "")
message(FATAL_ERROR "you must set ${req} before calling this method")
message(FATAL_ERROR "you must set ${req}")
endif()
set(vars "${vars} ${req}=[${${req}}]\n")
message(STATUS "${req}=[${${req}}]")
endforeach(req)
#install icon file for .app file. Monteverdi and Mapla has same icon!
if(APPLE)
install(FILES ${PACKAGE_SUPPORT_FILES_DIR}/Monteverdi.icns
DESTINATION ${PKG_STAGE_DIR})
endif()
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()
endmacro()
macro(clear_cmakecache_variables)
unset(matched_vars CACHE)
get_variables_ending_with("_USED|_RESOLVED" matched_vars)
foreach (var_to_unset IN LISTS matched_vars)
if(PKG_DEBUG)
message("unset ${var_to_unset} from cache")
endif()
unset(${var_to_unset} CACHE)
endforeach()
endmacro() #clear_cmakecache_variables
function(configure_loader loader_pgm_result loader_args_result loader_regex_result)
set(loader_PATHS)
set(eol_char "E")
if(MSVC)
set(loader_PATHS)
set(loader_names "dumpbin")
set(loader_args "/DEPENDENTS")
set(loader_regex "^ ([^ ].*[Dd][Ll][Ll])${eol_char}$")
elseif(APPLE)
set(loader_PATHS)
set(loader_names otool)
set(loader_args "-l" )
set(loader_regex ".*name.*([ ].*dylib ).*${eol_char}$")
elseif("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
set(loader_PATHS)
set(loader_names objdump)
set(loader_args "-p" )
set(loader_regex "^..NEEDED.*([ ].*so.*)${eol_char}$")
else()
message(FATAL_ERROR "find_loader_and_args: Unknown platform")
endif()
find_program(loader_pgm "${loader_names}" PATHS ${loader_PATHS})
if(NOT loader_pgm)
message(FATAL_ERROR "${loader_names} not found in ${loader_PATHS}.")
endif()
#save result in PARENT_SCOPE
set(${loader_args_result} ${loader_args} PARENT_SCOPE)
set(${loader_pgm_result} ${loader_pgm} PARENT_SCOPE)
set(${loader_regex_result} ${loader_regex} PARENT_SCOPE)
endfunction()
macro(create_package)
# creation of package is different from windows and unix like
if(WIN32)
set(PACKAGE_OUTPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/${PKG_STAGE_DIR}.zip")
else()
set(PACKAGE_OUTPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/${PKG_STAGE_DIR}.run")
endif()
install(CODE "
message(STATUS \"Creating ${PACKAGE_OUTPUT_FILE}\")
if(WIN32)
execute_process(
COMMAND ${ZIP_EXECUTABLE} \"a\" \"-r\" \"-y\"
\"${PACKAGE_OUTPUT_FILE}\" \"${PKG_STAGE_DIR}/*\"
WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}\"
)
else()
execute_process(
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/makeself/makeself.sh
\"--quiet\"
\"--target\"
\"${PKG_STAGE_DIR}\"
\"${CMAKE_INSTALL_PREFIX}/${PKG_STAGE_DIR}\"
\"${PKG_STAGE_DIR}.run\"
\"${PACKAGE_LONG_NAME} ${PKG_OTB_VERSION_STRING}\"
\"./pkgsetup\"
WORKING_DIRECTORY \"${CMAKE_CURRENT_BINARY_DIR}\"
)
endif()
")
endmacro()
#
# 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 (get_variables_ending_with suffix result)
get_cmake_property(all_cmake_vars VARIABLES)
string (REGEX MATCHALL "(^|;)[A-Za-z0-9_\\.\\-]*(${suffix})" _matchedVars "${all_cmake_vars}")
set(${result} ${_matchedVars} PARENT_SCOPE)
endfunction()
include(patch_cmake_files.cmake)
function(install_cmake_files)
patch_cmake_files(NAME "ITK"
VERSION "${PKG_ITK_SB_VERSION}"
MATCH_STRING "${CMAKE_INSTALL_PREFIX}"
REPLACE_VAR "ITK_INSTALL_PREFIX"
)
patch_cmake_files(NAME "OTB"
VERSION "${PKG_OTB_VERSION_MAJOR}.${PKG_OTB_VERSION_MINOR}"
MATCH_STRING "${CMAKE_INSTALL_PREFIX}"
REPLACE_VAR "OTB_INSTALL_PREFIX"
)
endfunction()
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()
function(install_python_bindings)
if(HAVE_PYTHON)
install(DIRECTORY ${SUPERBUILD_INSTALL_DIR}/lib/otb/python
DESTINATION ${PKG_STAGE_DIR}/lib
)
endif()
endfunction()
function(install_qtdev_files)
if(NOT HAVE_QT4)
return()
endif()
set(QT_REQ_DIRS)
if(MSVC)
file(GLOB ALL_LIB_FILES "${SUPERBUILD_INSTALL_DIR}/lib/*.lib")
endif()
foreach(LIB_FILE ${LIB_FILES})
install_rule(${LIB_FILE})
endforeach()
list(APPEND QT_REQ_DIRS imports)