Commit b3887086 authored by Rashad Kanavath's avatar Rashad Kanavath
Browse files

PKG: update packaging script works on Linux

parent 5936c5fa
......@@ -28,6 +28,7 @@ ExternalProject_Add(MVD
-DBUILD_SHARED_LIBS:BOOL=${SB_BUILD_SHARED_LIBS}
-DBUILD_TESTING:BOOL=OFF
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
-DMonteverdi_INSTALL_LIB_DIR:STRING=lib
-DCMAKE_PREFIX_PATH:STRING=${CMAKE_INSTALL_PREFIX};${CMAKE_PREFIX_PATH}
-DOTB_DATA_ROOT:STRING=${OTB_DATA_ROOT}
${MVD_SB_CONFIG}
......
......@@ -249,10 +249,6 @@ else()
include(External_otb)
endif()
option(GENERATE_PACKAGE "Generate OTB package" ON)
option(GENERATE_XDK "Generate XDK for OTB development" OFF)
if(GENERATE_PACKAGE OR GENERATE_XDK)
if(UNIX)
if(UNIX)
add_subdirectory(Packaging)
endif()
endif()
......@@ -10,6 +10,9 @@ if(NOT PROJECT_NAME)
project(OTBPackaging)
endif()
option(GENERATE_PACKAGE "Generate OTB package" ON)
option(GENERATE_XDK "Generate XDK for OTB development" OFF)
set(OUT_OF_SOURCE_BUILD FALSE)
if(PROJECT_NAME STREQUAL "OTBPackaging")
set(OUT_OF_SOURCE_BUILD TRUE)
......@@ -26,26 +29,59 @@ if(OUT_OF_SOURCE_BUILD)
if(BUILD_TESTING)
include(CTest)
endif()
set(SUPERBUILD_BINARY_DIR "" CACHE PATH "path to superbuild binary directory")
# From parent scope (SuperBuild) we have
# ENABLE_MONTEVERDI, DOWNLOAD_LOCATION, SB_INSTALL_PREFIX
option(ENABLE_MONTEVERDI "enable monteverdi" ON)
set(DOWNLOAD_LOCATION "" CACHE PATH "path to superbuild binary directory")
set(SB_INSTALL_PREFIX "" CACHE PATH "path to superbuild install directory")
if(WIN32 OR CMAKE_CROSSCOMPILING)
set(Monteverdi_SOURCE_DIR "" CACHE PATH "monteverdi source directory")
set(Monteverdi_BINARY_DIR "" CACHE PATH "monteverdi binary directory")
else()
set(SUPERBUILD_BINARY_DIR "" CACHE PATH "path to superbuild binary directory")
set(SUPERBUILD_INSTALL_DIR "" CACHE PATH "path to superbuild install directory")
option(ENABLE_MONTEVERDI "enable monteverdi" ON)
set(DOWNLOAD_LOCATION "" CACHE PATH "path to superbuild binary directory")
endif()
else()
# 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})
endif()
if(NOT WIN32)
#set CMAKE_INSTALL_PREFIX and PKG_INSTALL_PREFIX to SB_INSTALL_PREFIX for convenience.
set(CMAKE_INSTALL_PREFIX "${SB_INSTALL_PREFIX}")
get_filename_component(SUPERBUILD_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} PATH)
get_filename_component(OTB_SOURCE_DIR ${SUPERBUILD_SOURCE_DIR} PATH)
if(WIN32 OR CMAKE_CROSSCOMPILING)
set(MONTEVERDI_INSTALL_DIR "" CACHE PATH "monteverdi install directory")
foreach(req
Monteverdi_SOURCE_DIR
Monteverdi_BINARY_DIR
MONTEVERDI_INSTALL_DIR
)
if(NOT DEFINED ${req} OR "${${req}}" STREQUAL "")
message(FATAL_ERROR "you must set ${req} before calling this method")
endif()
set(vars "${vars} ${req}=[${${req}}]\n")
endforeach(req)
else() #Unix like
foreach(req
SUPERBUILD_BINARY_DIR
SUPERBUILD_INSTALL_DIR
SUPERBUILD_SOURCE_DIR
OTB_SOURCE_DIR
)
if(NOT DEFINED ${req} OR "${${req}}" STREQUAL "")
message(FATAL_ERROR "you must set ${req} before calling this method")
endif()
set(vars "${vars} ${req}=[${${req}}]\n")
endforeach(req)
endif()
#used in PackageHelper.cmake (don't change)
set(PKG_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
if(WIN32 OR CMAKE_CROSSCOMPILING)
set(CMAKE_INSTALL_PREFIX "${Monteverdi_INSTALL_DIR}")
else()
set(CMAKE_INSTALL_PREFIX "${SUPERBUILD_INSTALL_DIR}")
endif()
set(PACKAGE_NAME OTB)
set(PACKAGE_LONG_NAME OrfeoToolBox)
......@@ -72,24 +108,41 @@ else() #(WIN32 OR CMAKE_CROSSCOMPILING)
else()
set(PACKAGE_PLATFORM_NAME "Linux")
endif()
get_version("${OTB_SUPERBUILD_SOURCE_DIR}/CMake/External_itk.cmake" "ITK_SB_VERSION" ITK_SB_VERSION)
get_version("${SUPERBUILD_SOURCE_DIR}/CMake/External_itk.cmake" "ITK_SB_VERSION" ITK_SB_VERSION)
get_version("${OTB_SOURCE_DIR}/CMakeLists.txt" "OTB_VERSION_" OTB_VERSION_STRING)
set(PACKAGE_VERSION_STRING ${get_version_OTB_VERSION_STRING})
endif(UNIX)
endif() #(WIN32 OR CMAKE_CROSSCOMPILING)
get_filename_component(OTB_SUPERBUILD_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} PATH)
get_filename_component(OTB_SOURCE_DIR ${OTB_SUPERBUILD_SOURCE_DIR} PATH)
set(PACKAGE_LIST OTB)
if(GENERATE_XDK)
list(APPEND PACKAGE_LIST XDK)
endif()
include(${SUPERBUILD_SOURCE_DIR}/CMake/External_pkgtools.cmake)
set(OTB_SUPERBUILD_SOURCE_DIR ${OTB_SOURCE_DIR}/SuperBuild)
include(${OTB_SUPERBUILD_SOURCE_DIR}/CMake/External_pkgtools.cmake)
set(EXTRA_CACHE_CONFIG
"set(CMAKE_CROSSCOMPILING ON)
set(MXE_ARCH \"${MXE_ARCH}\")
set(MXE_MXEROOT \"${MXE_MXEROOT}\")")
set(PACKAGE_PROJECT_DIR ${CMAKE_BINARY_DIR}/${pkg}-PACKAGE)
#guess install directory from OTB_MODULES_DIR
#copy of cmake variables not needed.
if(WIN32 OR CMAKE_CROSSCOMPILING)
set(Monteverdi_SOURCE_DIR "${Monteverdi_SOURCE_DIR}")
set(Monteverdi_BINARY_DIR "${Monteverdi_BINARY_DIR}")
set(MONTEVERDI_INSTALL_DIR "${MONTEVERDI_INSTALL_DIR}")
set(OTB_INSTALL_DIR "${OTB_MODULES_DIR}/../../../..")
set(DEPENDENCIES_INSTALL_DIR "${MXE_MXEROOT}/usr/${MXE_ARCH}-w64-mingw32.shared")
set(QT_PLUGINS_DIR "${DEPENDENCIES_INSTALL_DIR}/qt/plugins")
set(QT_TRANSLATIONS_DIR "${DEPENDENCIES_INSTALL_DIR}/qt/translations")
set(ITK_VERSION_STRING)
else() #unixes
set(Monteverdi_SOURCE_DIR "${SUPERBUILD_BINARY_DIR}/MVD/src/MVD")
set(Monteverdi_BINARY_DIR "${SUPERBUILD_BINARY_DIR}/MVD/build")
set(MONTEVERDI_INSTALL_DIR "${SUPERBUILD_INSTALL_DIR}")
set(QT_PLUGINS_DIR "${SUPERBUILD_INSTALL_DIR}/plugins")
set(QT_TRANSLATIONS_DIR "${SUPERBUILD_INSTALL_DIR}/translations")
set(OTB_INSTALL_DIR "${SUPERBUILD_BINARY_DIR}/OTB/build")
set(DEPENDENCIES_INSTALL_DIR "${SUPERBUILD_INSTALL_DIR}")
set(ITK_VERSION_STRING "${get_version_ITK_SB_VERSION}")
set(EXTRA_CACHE_CONFIG)
endif()
macro_setup_cmake_sources(OTB)
if(GENERATE_XDK)
......
......@@ -2,6 +2,7 @@ macro(macro_setup_cmake_sources pkg)
message( "-- Configuring ${pkg} package")
set(PACKAGE_PROJECT_DIR ${CMAKE_BINARY_DIR}/PACKAGE-${pkg})
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory "${PACKAGE_PROJECT_DIR}/build")
#Easy way to have the write "PACKAGE_PROJECT_DIR/src/CMakeLists.txt"
......@@ -15,50 +16,24 @@ macro(macro_setup_cmake_sources pkg)
#set archive name inside loop
set(ARCHIVE_NAME ${PACKAGE_NAME}-${PACKAGE_VERSION_STRING}-${PACKAGE_PLATFORM_NAME}${PACKAGE_ARCH})
#copy of cmake variables not needed.
if(WIN32 OR CMAKE_CROSSCOMPILING)
set(cache_Monteverdi_SOURCE_DIR "${Monteverdi_SOURCE_DIR}")
set(cache_Monteverdi_BINARY_DIR "${Monteverdi_BINARY_DIR}")
set(cache_QT_PLUGINS_DIR "${QT_PLUGINS_DIR}")
set(cache_QT_TRANSLATIONS_DIR "${QT_TRANSLATIONS_DIR}")
set(cache_PKG_INSTALL_PREFIX "${PKG_INSTALL_PREFIX}")
set(cache_CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
#guess install directory from OTB_MODULES_DIR
set(cache_OTB_INSTALL_DIR "${OTB_MODULES_DIR}/../../../..")
set(cache_ITK_VERSION_STRING)
set(EXTRA_CACHE_CONFIG "
set(CMAKE_CROSSCOMPILING ON)
set(MXE_ARCH \"${MXE_ARCH}\")
set(MXE_MXEROOT \"${MXE_MXEROOT}\")")
else() #unixes
set(cache_Monteverdi_SOURCE_DIR "${SUPERBUILD_BINARY_DIR}/MVD/src/MVD")
set(cache_Monteverdi_BINARY_DIR "${SUPERBUILD_BINARY_DIR}/MVD/build")
set(cache_QT_PLUGINS_DIR "${PKG_INSTALL_PREFIX}/plugins")
set(cache_QT_TRANSLATIONS_DIR "${PKG_INSTALL_PREFIX}/translations")
set(cache_PKG_INSTALL_PREFIX "${PKG_INSTALL_PREFIX}")
set(cache_CMAKE_INSTALL_PREFIX "${PKG_INSTALL_PREFIX}")
set(cache_OTB_INSTALL_DIR "${SUPERBUILD_BINARY_DIR}/OTB/build")
set(cache_ITK_VERSION_STRING "${get_version_ITK_SB_VERSION}")
set(EXTRA_CACHE_CONFIG)
endif()
file(WRITE "${PACKAGE_PROJECT_DIR}/src/CMakeLists.txt"
"cmake_minimum_required(VERSION 2.6)
include(CMakeParseArguments)
include(CMakeDetermineSystem)
set(Monteverdi_SOURCE_DIR \"${cache_Monteverdi_SOURCE_DIR}\")
set(Monteverdi_BINARY_DIR \"${cache_Monteverdi_BINARY_DIR}\")
set(PACKAGE_SUPPORT_FILES_DIR \"${OTB_SOURCE_DIR}/SuperBuild/Packaging/Files\")
set(QT_PLUGINS_DIR \"${cache_QT_PLUGINS_DIR}\")
set(QT_TRANSLATIONS_DIR \"${cache_QT_TRANSLATIONS_DIR}\")
set(PKG_INSTALL_PREFIX \"${cache_PKG_INSTALL_PREFIX}\")
set(CMAKE_INSTALL_PREFIX \"${cache_CMAKE_INSTALL_PREFIX}\")
set(OTB_INSTALL_DIR ${cache_OTB_INSTALL_DIR})
set(ITK_VERSION_STRING \"${cache_ITK_VERSION_STRING}\")
set(Monteverdi_INSTALL_DATA_DIR \"share/otb\")
set(PKG_GENERATE_XDK ${PKG_GENERATE_XDK})
set(Monteverdi_SOURCE_DIR \"${Monteverdi_SOURCE_DIR}\")
set(Monteverdi_BINARY_DIR \"${Monteverdi_BINARY_DIR}\")
set(MONTEVERDI_INSTALL_DIR \"${MONTEVERDI_INSTALL_DIR}\")
set(Monteverdi_INSTALL_DATA_DIR \"share/otb\")
set(QT_PLUGINS_DIR \"${QT_PLUGINS_DIR}\")
set(QT_TRANSLATIONS_DIR \"${QT_TRANSLATIONS_DIR}\")
set(DEPENDENCIES_INSTALL_DIR \"${DEPENDENCIES_INSTALL_DIR}\")
set(OTB_INSTALL_DIR \"${OTB_INSTALL_DIR}\")
set(PACKAGE_SUPPORT_FILES_DIR \"${OTB_SOURCE_DIR}/SuperBuild/Packaging/Files\")
set(CMAKE_INSTALL_PREFIX \"${CMAKE_INSTALL_PREFIX}\")
set(ITK_VERSION_STRING \"${cache_ITK_VERSION_STRING}\")
set(PKG_GENERATE_XDK ${PKG_GENERATE_XDK})
${EXTRA_CACHE_CONFIG}
include(\"${OTB_SUPERBUILD_SOURCE_DIR}/CMake/PackageHelper.cmake\")
include(\"${SUPERBUILD_SOURCE_DIR}/Packaging/PackageHelper.cmake\")
super_package(STAGE_DIR \"${ARCHIVE_NAME}\")" )
endmacro()
......@@ -72,7 +47,6 @@ macro(macro_update_dependencies_list list_variable)
add_custom_target(PACKAGE-check
COMMAND ${CMAKE_COMMAND} --build "${SUPERBUILD_BINARY_DIR}/MVD/build"
WORKING_DIRECTORY "${SUPERBUILD_BINARY_DIR}/MVD/build"
DEPENDS PACKAGE-check-otb
)
else()
add_custom_target(PACKAGE-check
......@@ -109,7 +83,7 @@ macro(macro_create_targets_for_package pkg)
if(WIN32 OR CMAKE_CROSSCOMPILING)
add_custom_target(PACKAGE-${pkg}
COMMAND ${ZIP_EXECUTABLE}
"-r" "${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.zip" "${PKG_INSTALL_PREFIX}/${ARCHIVE_NAME}"
"-r" "${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.zip" "${CMAKE_INSTALL_PREFIX}/${ARCHIVE_NAME}"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
DEPENDS PACKAGE-${pkg}-build
)
......@@ -119,7 +93,7 @@ macro(macro_create_targets_for_package pkg)
COMMAND ${MAKESELF_SCRIPT}
"--target"
"${ARCHIVE_NAME}"
"${PKG_INSTALL_PREFIX}/${ARCHIVE_NAME}"
"${CMAKE_INSTALL_PREFIX}/${ARCHIVE_NAME}"
"${ARCHIVE_NAME}.run"
"${PACKAGE_LONG_NAME} ${PACKAGE_VERSION_STRING}"
"./pkgsetup"
......@@ -135,7 +109,8 @@ macro(macro_create_targets_for_package pkg)
#clean
add_custom_target(PACKAGE-${pkg}-clean
COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_BINARY_DIR}/${pkg}-PACKAGE"
COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_BINARY_DIR}/PACKAGE-${pkg}"
COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_BINARY_DIR}/PACKAGE-TOOLS"
COMMAND ${CMAKE_COMMAND} -E remove "${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}${PACKAGE_EXTENSION}"
COMMAND ${CMAKE_COMMAND} "${CMAKE_BINARY_DIR}" WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
)
......@@ -146,7 +121,7 @@ endmacro(macro_create_targets_for_package)
#macro: get_version
#args :
# input_file - Input cmake file where the version variable is set via cmake set() command.
# Example: ${OTB_SUPERBUILD_SOURCE_DIR}/CMake/External_itk.cmake
# Example: ${SUPERBUILD_SOURCE_DIR}/CMake/External_itk.cmake
#match_string - A match string to filter out required set() commands.
# Example: "ITK_SB_VERSION" will get all set(ITK_SB_VERSION_MAJOR)
# set(ITK_SB_VERSION_MINOR) set(ITK_SB_VERSION_PATCH)
......@@ -155,7 +130,7 @@ endmacro(macro_create_targets_for_package)
# Example: ITK_SB_VERSION. This is same as match_string but not always
# Sample usage:
# get_version(
# "${OTB_SUPERBUILD_SOURCE_DIR}/CMake/External_itk.cmake"
# "${SUPERBUILD_SOURCE_DIR}/CMake/External_itk.cmake"
# "ITK_SB_VERSION"
# ITK_SB_VERSION)
macro(get_version input_file match_string check_cmake_var)
......
......@@ -2,21 +2,22 @@ macro(super_package)
cmake_parse_arguments(PKG "" "STAGE_DIR" "SEARCHDIRS" ${ARGN} )
set(loader_program_PATHS)
if(WIN32 OR CMAKE_CROSSCOMPILING)
set(loader_program_names "${MXE_ARCH}-w64-mingw32.shared-objdump")
set(loader_program_PATHS "${MXE_MXEROOT}/usr/bin")
set(LOADER_PROGRAM_ARGS "-p")
set(DEPENDENCIES_INSTALL_DIR "${MXE_MXEROOT}/usr/${MXE_ARCH}-w64-mingw32.shared")
set(loader_program_names "${MXE_ARCH}-w64-mingw32.shared-objdump")
set(loader_program_PATHS "${MXE_MXEROOT}/usr/bin")
set(LOADER_PROGRAM_ARGS "-p")
else()
if(APPLE)
set(loader_program_names otool)
set(LOADER_PROGRAM_ARGS "-l")
set(loader_program_PATHS /opt/local/bin) # a path that is already listed i path on apple
set(loader_program_names otool)
set(LOADER_PROGRAM_ARGS "-l")
set(loader_program_PATHS /opt/local/bin) # a path that is already listed i path on apple
else()
set(loader_program_names objdump)
set(LOADER_PROGRAM_ARGS "-p")
set(loader_program_PATHS /usr/bin) # a path that is already listed in default path on Linux
set(loader_program_names objdump)
set(LOADER_PROGRAM_ARGS "-p")
set(loader_program_PATHS /usr/bin) # a path that is already listed in default path on Linux
endif()
if(NOT DEPENDENCIES_INSTALL_DIR)
message(FATAL_ERROR "DEPENDENCIES_INSTALL_DIR is not set of empty")
endif()
set(DEPENDENCIES_INSTALL_DIR ${PKG_INSTALL_PREFIX})
endif()
find_program(LOADER_PROGRAM "${loader_program_names}" PATHS ${loader_program_PATHS})
......@@ -29,23 +30,28 @@ macro(super_package)
set(PKG_SEARCHDIRS)
if(WIN32 OR CMAKE_CROSSCOMPILING)
set(MXE_BIN_DIR "${DEPENDENCIES_INSTALL_DIR}/bin")
list(APPEND PKG_SEARCHDIRS ${MXE_BIN_DIR})
file(GLOB MXE_GCC_LIB_DIR "${MXE_BIN_DIR}/gcc*")
file(GLOB MXE_GCC_LIB_DIR "${DEPENDENCIES_INSTALL_DIR}/bin/gcc*")
list(APPEND PKG_SEARCHDIRS ${MXE_GCC_LIB_DIR})
list(APPEND PKG_SEARCHDIRS "${MXE_BIN_DIR}/../qt/bin") #Qt
list(APPEND PKG_SEARCHDIRS "${MXE_BIN_DIR}/../qt/lib") #Qwt
list(APPEND PKG_SEARCHDIRS "${CMAKE_INSTALL_PREFIX}/bin") #mvd
list(APPEND PKG_SEARCHDIRS "${OTB_INSTALL_DIR}/bin") #otbApplicationLauncher*.exe
list(APPEND PKG_SEARCHDIRS "${DEPENDENCIES_INSTALL_DIR}/qt/bin") #Qt
list(APPEND PKG_SEARCHDIRS "${DEPENDENCIES_INSTALL_DIR}/qt/lib") #Qwt
list(APPEND PKG_SEARCHDIRS "${DEPENDENCIES_INSTALL_DIR}/bin") #mxe dlls
else() #unixes
list(APPEND PKG_SEARCHDIRS "${OTB_INSTALL_DIR}/bin") #exe
list(APPEND PKG_SEARCHDIRS "${OTB_INSTALL_DIR}/lib") #so
list(APPEND PKG_SEARCHDIRS "${OTB_INSTALL_DIR}/lib/otb") #mvd so
list(APPEND PKG_SEARCHDIRS "${DEPENDENCIES_INSTALL_DIR}/lib") #superbuild .so /.dylib
list(APPEND PKG_SEARCHDIRS "${MONTEVERDI_INSTALL_DIR}/lib/otb") #mvd so
endif()
#common for all platforms.
set(OTB_APPLICATIONS_DIR "${OTB_INSTALL_DIR}/lib/otb/applications")
list(APPEND PKG_SEARCHDIRS "${DEPENDENCIES_INSTALL_DIR}/bin") #superbuild, mxe binaries
list(APPEND PKG_SEARCHDIRS "${MONTEVERDI_INSTALL_DIR}/bin") #monteverdi, mapla
list(APPEND PKG_SEARCHDIRS "${OTB_INSTALL_DIR}/bin") #otbApplicationLauncherCommandLine..
list(APPEND PKG_SEARCHDIRS "${OTB_APPLICATIONS_DIR}") #otb apps
set(EXE_SEARCH_DIRS ${OTB_INSTALL_DIR}/bin)
list(APPEND EXE_SEARCH_DIRS ${MONTEVERDI_INSTALL_DIR}/bin)
list(APPEND EXE_SEARCH_DIRS ${DEPENDENCIES_INSTALL_DIR}/bin)
empty_package_staging_directory()
set(PKG_PEFILES)
......@@ -79,7 +85,7 @@ macro(super_package)
if(UNIX)
if(NOT APPLE)
####################### install patchelf #####################
install(FILES ${PKG_INSTALL_PREFIX}/tools/patchelf
install(FILES ${CMAKE_INSTALL_PREFIX}/tools/patchelf
DESTINATION ${PKG_STAGE_DIR}/tools
PERMISSIONS
OWNER_EXECUTE OWNER_WRITE OWNER_READ
......@@ -243,6 +249,7 @@ function(install_common include_mvd)
OTB_APPLICATIONS_DIR
PKG_STAGE_DIR
PACKAGE_SUPPORT_FILES_DIR
MONTEVERDI_INSTALL_DIR
OTB_INSTALL_DIR
)
if(NOT DEFINED ${req})
......@@ -266,7 +273,8 @@ function(install_common include_mvd)
install(FILES ${ENV_SOURCE_FILE} DESTINATION ${PKG_STAGE_DIR})
endif()
endforeach()
set(PKG_OTB_SHARE_SOURCE_DIR "${PKG_INSTALL_PREFIX}/share")
#MONTEVERDI_INSTALL_DIR/share has otb/i18N directory
set(PKG_OTB_SHARE_SOURCE_DIR "${MONTEVERDI_INSTALL_DIR}/share")
endif()
####################### install cli and gui scripts ###########################
file(GLOB PKG_APP_SCRIPTS
......@@ -401,8 +409,8 @@ function(install_monteverdi_files)
endfunction()
macro(empty_package_staging_directory)
message(STATUS "Empty package staging directory: ${PKG_INSTALL_PREFIX}/${PKG_STAGE_DIR}")
execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory "${PKG_INSTALL_PREFIX}/${PKG_STAGE_DIR}")
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}")
endmacro()
#NOTE:
......@@ -442,14 +450,17 @@ function(configure_package)
otbTestDriver
monteverdi
mapla)
if(EXISTS "${OTB_INSTALL_DIR}/bin/${EXE_FILE}${EXE_EXT}")
#see the first comment about VAR_IN_PKGSETUP_CONFIGURE
set(VAR_IN_PKGSETUP_CONFIGURE "${VAR_IN_PKGSETUP_CONFIGURE} bin/${EXE_FILE}${EXE_EXT}")
list(APPEND PKG_PEFILES
"${OTB_INSTALL_DIR}/bin/${EXE_FILE}${EXE_EXT}")
else()
message(WARNING "'${OTB_INSTALL_DIR}/bin/${EXE_FILE}${EXE_EXT}'(not found. skipping)")
endif()
foreach(EXE_SEARCH_DIR ${EXE_SEARCH_DIRS})
if(EXISTS "${EXE_SEARCH_DIR}/${EXE_FILE}${EXE_EXT}")
#see the first comment about VAR_IN_PKGSETUP_CONFIGURE
set(VAR_IN_PKGSETUP_CONFIGURE "${VAR_IN_PKGSETUP_CONFIGURE} bin/${EXE_FILE}${EXE_EXT}")
list(APPEND PKG_PEFILES
"${EXE_SEARCH_DIR}/${EXE_FILE}${EXE_EXT}")
else()
message(STATUS "'${OTB_INSTALL_DIR}/bin/${EXE_FILE}${EXE_EXT}'(not found. skipping)")
endif()
endforeach() #EXE_SEARCH_DIR
endforeach()
#For Unixes we write the startup script in the *pkgsetup.in
......
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