Commit 287c0daf authored by Antoine Regimbeau's avatar Antoine Regimbeau

Merge branch 'develop' into extractroi_modefit

parents 6115aedd f956fdf1
Pipeline #1515 passed with stages
in 55 minutes and 15 seconds
......@@ -44,6 +44,7 @@ fast-build:
- ctest -V -S CI/main_ci.cmake -DIMAGE_NAME:string=ubuntu-18.04-fast
- ccache -s
.common-build:
extends: .general
only: [merge_requests]
......@@ -56,6 +57,12 @@ fast-build:
- git checkout -f -q $CI_COMMIT_SHA
after_script:
- python3 CI/cdash_handler.py $CI_COMMIT_SHA $CI_PROJECT_ID $CI_PROJECT_DIR $K8S_SECRET_CDASH $CI_MERGE_REQUEST_REF_PATH
artifacts:
when: on_failure
expire_in: 24 hrs
paths:
- build/*/*.log #CMake log
- log/*.txt # Others
debian-build:
extends: .common-build
......@@ -87,34 +94,62 @@ ubuntu-llvm:
expire_in: 24 hrs
when: always
paths:
- sb_branch.txt
# This recovers logs from superbuild build
- build/*/*/*/*.log
- sb_branch.txt # Needed to checkout correct branch in build step
- build/*/*/*/*.log # Superbuild log
## Ubuntu superbuild
ubuntu-superbuild-prepare:
extends: .common-prepare
image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-superbuild-base:18.04
script:
- ctest -VV -S CI/prepare_superbuild.cmake -DIMAGE_NAME:string=otb-ubuntu-superbuild-base
centos-superbuild-prepare:
extends: .common-prepare
image: $BUILD_IMAGE_REGISTRY/otb-centos-superbuild-base:6.6
script:
- ctest -VV -S CI/prepare_superbuild.cmake -DIMAGE_NAME:string=otb-centos-superbuild-base
ubuntu-superbuild-build:
extends: .common-build
image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-superbuild-base:18.04
script:
- xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -V -S CI/main_superbuild.cmake -DIMAGE_NAME:string=otb-ubuntu-superbuild-base
- xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -VV -S CI/main_packages.cmake -DIMAGE_NAME:string=otb-ubuntu-superbuild-base
dependencies:
- ubuntu-superbuild-prepare
## CentOS superbuild
centos-superbuild-prepare:
extends: .common-prepare
image: $BUILD_IMAGE_REGISTRY/otb-centos-superbuild-base:6.6
script:
- ctest -VV -S CI/prepare_superbuild.cmake -DIMAGE_NAME:string=otb-centos-superbuild-base
centos-superbuild-build:
extends: .common-build
image: $BUILD_IMAGE_REGISTRY/otb-centos-superbuild-base:6.6
script:
- xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -V -S CI/main_superbuild.cmake -DIMAGE_NAME:string=otb-centos-superbuild-base
- xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -VV -S CI/main_packages.cmake -DIMAGE_NAME:string=otb-centos-superbuild-base
dependencies:
- centos-superbuild-prepare
## MacOS superbuild
macos-superbuild-prepare:
tags:
- macos
extends: .common-prepare
before_script:
# No need to install lfs as this machine is persistent
# No need to do git config
# Checkout the expected branch
- export GIT_LFS_SKIP_SMUDGE=1
- git checkout -f -q $CI_COMMIT_SHA
- export GIT_LFS_SKIP_SMUDGE=0
script:
- ctest -VV -S CI/prepare_superbuild.cmake -DIMAGE_NAME:string=otb-macos-superbuild
macos-superbuild-build:
tags:
- macos
extends: .common-build
script:
- ctest -V -S CI/main_superbuild.cmake -DIMAGE_NAME:string=otb-macos-superbuild
- ctest -VV -S CI/main_packages.cmake -DIMAGE_NAME:string=otb-macos-superbuild
dependencies:
- macos-superbuild-prepare
......@@ -38,7 +38,7 @@ OTB_USE_GLEW:BOOL=ON
OTB_USE_GLFW:BOOL=ON
OTB_USE_GLUT:BOOL=ON
OTB_USE_GSL:BOOL=ON
OTB_USE_LIBKML:BOOL=ON
OTB_USE_LIBKML:BOOL=OFF
OTB_USE_LIBSVM:BOOL=ON
OTB_USE_MPI:BOOL=OFF
OTB_USE_MUPARSER:BOOL=ON
......
#
# Copyright (C) 2005-2019 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.
#
# We are included from main_superbuild.cmake
# This script is a prototype for the future CI, it may evolve rapidly in a near future
include( "${CMAKE_CURRENT_LIST_DIR}/macros.cmake" )
set (ENV{LANG} "C") # Only ascii output
get_filename_component( OTB_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR} DIRECTORY )
set ( DEBUG "1" )
set ( CTEST_BUILD_CONFIGURATION "Release" )
set ( CTEST_CMAKE_GENERATOR "Unix Makefiles" )
set ( CTEST_BUILD_FLAGS "-j1" )
set ( CTEST_BUILD_NAME "Packages" )
set ( CTEST_SITE "${IMAGE_NAME}" )
# Find the build name and CI profile
set_dash_build_name()
# Directory variable
set ( CTEST_SOURCE_DIRECTORY "${OTB_SOURCE_DIR}/Packaging" )
set ( CTEST_BINARY_DIRECTORY "${OTB_SOURCE_DIR}/build_packages/" )
set ( CTEST_INSTALL_DIRECTORY "${OTB_SOURCE_DIR}/install_packages" )
set ( PROJECT_SOURCE_DIR "${CTEST_SOURCE_DIRECTORY}" )
# Copy back xdk for RUN_PATH reason
# We might want to change the name of artifact in main_superbuild
# file ( COPY "${OTB_SOURCE_DIR}/install/xdk" DESTINATION "${CI_ROOT_DIR}")
# Packages case:
# SUPERBUILD_BINARY_DIR this is needed for OTB_BINARY_DIR, not sure we need it
# SUPERBUILD_INSTALL_DIR do we need it? it seems so... We will set it to anything
# DOWNLOAD_LOCATION
# OTB_BINARY_DIR
# CMAKE_INSTALL_PREFIX
set ( CONFIGURE_OPTIONS
"-DCMAKE_INSTALL_PREFIX=${CTEST_INSTALL_DIRECTORY};\
-DOTB_BINARY_DIR=${OTB_SOURCE_DIR}/build;\
-DSUPERBUILD_INSTALL_DIR=${OTB_SOURCE_DIR}/xdk;\
-DSUPERBUILD_BINARY_DIR=${OTB_SOURCE_DIR}/build;" )
# Look for a GIT command-line client.
find_program(CTEST_GIT_COMMAND NAMES git git.cmd)
# Sources are already checked out : do nothing for update
set(CTEST_GIT_UPDATE_CUSTOM echo No update)
ctest_start( Experimental TRACK CI_Package )
ctest_update( SOURCE "${OTB_SOURCE_DIR}" )
ctest_configure(
BUILD "${CTEST_BINARY_DIRECTORY}"
SOURCE "${CTEST_SOURCE_DIRECTORY}"
OPTIONS "${CONFIGURE_OPTIONS}"
RETURN_VALUE _configure_rv
CAPTURE_CMAKE_ERROR _configure_error
)
if( NOT _configure_rv EQUAL 0 )
ctest_submit()
message( SEND_ERROR "An error occurs during ctest_configure.")
return()
endif()
ctest_build(
BUILD "${CTEST_BINARY_DIRECTORY}"
TARGET PACKAGE-OTB
RETURN_VALUE _build_rv
CAPTURE_CMAKE_ERROR _build_error
)
if( NOT _build_rv EQUAL 0 )
message( SEND_ERROR "An error occurs during ctest_build.")
endif()
ctest_test(
PARALLEL_LEVEL 1
RETURN_VALUE _test_rv
CAPTURE_CMAKE_ERROR _test_error
)
if( NOT _test_rv EQUAL 0 )
message( SEND_ERROR "An error occurs during ctest_test.")
endif()
ctest_submit()
......@@ -24,6 +24,7 @@ include( "${CMAKE_CURRENT_LIST_DIR}/macros.cmake" )
set (ENV{LANG} "C") # Only ascii output
get_filename_component(OTB_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR} DIRECTORY)
set ( DEBUG "1" )
###########################################################################
###########################################################################
# Download xkd
......@@ -69,6 +70,12 @@ endif()
if (clone_res)
message( SEND_ERROR "Problem in retreiving the archive")
message( "Command : COMMAND ${GIT} clone ${REMOTE} --branch ${BRANCH_NAME} \
--depth 1 superbuild-artifact")
message( "Result :")
message( "clone_res = ${clone_res}" )
message( "clone_out = ${clone_out}" )
message( "clone_err = ${clone_err}" )
return()
endif()
......@@ -76,9 +83,19 @@ set (CMAKE_COMMAND "cmake")
execute_process(
COMMAND ${CMAKE_COMMAND} "-E" "tar" "xf"
"${OTB_SOURCE_DIR}/superbuild-artifact/SuperBuild_Install.tar"
RESULT_VARIABLE tar_res
OUTPUT_VARIABLE tar_out
ERROR_VARIABLE tar_err
WORKING_DIRECTORY ${OTB_SOURCE_DIR}
)
if ( DEBUG )
message( "${CMAKE_COMMAND} -E tar xf ${OTB_SOURCE_DIR}/superbuild-artifact/SuperBuild_Install.tar")
message( "tar_res: '${clone_res}'" )
message( "tar_out: '${tar_out}'" )
message( "tar_err: '${tar_err}'" )
endif()
set( XDK_PATH "${OTB_SOURCE_DIR}/xdk")
if ( DEBUG )
......@@ -107,19 +124,24 @@ set_dash_build_name()
# Directory variable
set ( CTEST_SOURCE_DIRECTORY "${OTB_SOURCE_DIR}" )
set ( CTEST_BINARY_DIRECTORY "${OTB_SOURCE_DIR}/build/" )
set ( CTEST_INSTALL_DIRECTORY "${OTB_SOURCE_DIR}/install/" )
# install in same directory as xdk to be able to produce
# package afterwards
set ( CTEST_INSTALL_DIRECTORY "${XDK_PATH}" )
set ( PROJECT_SOURCE_DIR "${OTB_SOURCE_DIR}" )
set (CONFIGURE_OPTIONS "")
include ( "${CMAKE_CURRENT_LIST_DIR}/configure_options.cmake" )
# For superbuild we need remote module
foreach(remote_module DiapOTBModule OTBTemporalGapFilling)#otbGRM #Mosaic # #SertitObject
set ( CONFIGURE_OPTIONS
"${CONFIGURE_OPTIONS}-DModule_${remote_module}:BOOL=ON;")
endforeach()
# SuperBuild case : one more configure option
set ( CONFIGURE_OPTIONS
"${CONFIGURE_OPTIONS}-DCMAKE_PREFIX_PATH=${XDK_PATH};")
# Hack because there is no more superbuild available (LIBKML)
set ( CONFIGURE_OPTIONS
"${CONFIGURE_OPTIONS}-DOTB_USE_LIBKML:BOOL=OFF;" )
# FIX ME this part might platform dependent
set( GDAL_DATA "${XDK_PATH}/share/gdal" )
set( GEOTIFF_CSV "${XDK_PATH}/share/epsg_csv" )
......@@ -145,6 +167,11 @@ ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}"
RETURN_VALUE _configure_rv
CAPTURE_CMAKE_ERROR _configure_error
)
# Configure log
file ( WRITE
"${OTB_SOURCE_DIR}/log/configure_return_value_log.txt" "${_configure_rv}")
file ( WRITE
"${OTB_SOURCE_DIR}/log/configure_cmake_error_log.txt" "${_configure_error}")
if ( NOT _configure_rv EQUAL 0 )
ctest_submit()
......@@ -156,6 +183,14 @@ ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}"
CAPTURE_CMAKE_ERROR _build_error
)
# Build log
file ( WRITE
"${OTB_SOURCE_DIR}/log/build_return_value_log.txt" "${_build_rv}")
file ( WRITE
"${OTB_SOURCE_DIR}/log/build_cmake_error_log.txt" "${_build_error}")
# SEND_ERROR if build error
# FATAL_ERROR if build error?
if ( NOT _build_rv EQUAL 0 )
message( SEND_ERROR "An error occurs during ctest_build.")
endif()
......@@ -166,8 +201,41 @@ ctest_test(PARALLEL_LEVEL 8
CAPTURE_CMAKE_ERROR _test_error
)
# Test log
file ( WRITE
"${OTB_SOURCE_DIR}/log/test_return_value_log.txt" "${_test_rv}")
file ( WRITE
"${OTB_SOURCE_DIR}/log/test_cmake_error_log.txt" "${_test_error}")
if ( NOT _test_rv EQUAL 0 )
message( WARNING "Some tests have failed.")
endif()
ctest_submit()
# We need to install OTB for package purposes
set ( MAKE_COMMAND "make")
execute_process(
COMMAND ${MAKE_COMMAND} "install"
WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY}
RESULT_VARIABLE install_rv
OUTPUT_VARIABLE install_out
ERROR_VARIABLE install_err
)
if ( DEBUG )
message( "Install output")
message( "install_res = ${install_res}" )
message( "install_out = ${install_out}" )
message( "install_err = ${install_err}" )
endif()
# Install log
file ( WRITE
"${OTB_SOURCE_DIR}/log/install_out_log.txt" "${install_out}")
file ( WRITE
"${OTB_SOURCE_DIR}/log/install_error_log.txt" "${install_err}")
if ( NOT install_rv EQUAL 0 )
message( SEND_ERROR "Install have failed.")
endif()
#
# Copyright (C) 2005-2019 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.
#
# Configuration options for macOS
set(site_option
"OTB_USE_GLUT=OFF
OTB_USE_GLFW=OFF")
\ No newline at end of file
......@@ -152,7 +152,6 @@ if ( DEBUG )
endif()
if ( ( NOT ${_build_nb_err} EQUAL 0 ) OR ( ${_build_error} EQUAL -1 ))
ctest_submit()
message( FATAL_ERROR "An error occurs during ctest_build.")
endif()
......@@ -287,4 +286,4 @@ if ( DEBUG )
message( "push_res = ${push_res}" )
message( "push_out = ${push_out}" )
message( "push_err = ${push_err}" )
endif()
endif()
\ No newline at end of file
PROJCS["RGF93_Lambert_93",GEOGCS["GCS_RGF93",DATUM["D_RGF_1993",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["standard_parallel_1",49],PARAMETER["standard_parallel_2",44],PARAMETER["latitude_of_origin",46.5],PARAMETER["central_meridian",3],PARAMETER["false_easting",700000],PARAMETER["false_northing",6600000],UNIT["Meter",1]]
\ No newline at end of file
PROJCS["RGF93 / Lambert-93",GEOGCS["RGF93",DATUM["Reseau_Geodesique_Francais_1993",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6171"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4171"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",49],PARAMETER["standard_parallel_2",44],PARAMETER["latitude_of_origin",46.5],PARAMETER["central_meridian",3],PARAMETER["false_easting",700000],PARAMETER["false_northing",6600000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],AUTHORITY["EPSG","2154"]]
PROJCS["RGF93_Lambert_93",GEOGCS["GCS_RGF93",DATUM["D_RGF_1993",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["standard_parallel_1",49],PARAMETER["standard_parallel_2",44],PARAMETER["latitude_of_origin",46.5],PARAMETER["central_meridian",3],PARAMETER["false_easting",700000],PARAMETER["false_northing",6600000],UNIT["Meter",1]]
\ No newline at end of file
PROJCS["RGF93 / Lambert-93",GEOGCS["RGF93",DATUM["Reseau_Geodesique_Francais_1993",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6171"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4171"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",49],PARAMETER["standard_parallel_2",44],PARAMETER["latitude_of_origin",46.5],PARAMETER["central_meridian",3],PARAMETER["false_easting",700000],PARAMETER["false_northing",6600000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],AUTHORITY["EPSG","2154"]]
......@@ -39,8 +39,11 @@ 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")
#variables based on above user-defined variables
set(OTB_BINARY_DIR "${SUPERBUILD_BINARY_DIR}/OTB/build")
#variables based on above user-defined variables
message( "OTB_BINARY_DIR=${OTB_BINARY_DIR}" )
if ( NOT OTB_BINARY_DIR )
set(OTB_BINARY_DIR "${SUPERBUILD_BINARY_DIR}/OTB/build")
endif()
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")
......@@ -55,8 +58,9 @@ find_program(FILE_COMMAND NAMES "file")
find_program(READLINK NAMES "readlink")
find_program(ZIP_EXECUTABLE NAMES 7z 7za)
#install prefix is same as SUPERBUILD_INSTALL_DIR. could be changed later
set(CMAKE_INSTALL_PREFIX "${SUPERBUILD_INSTALL_DIR}")
if ( NOT CMAKE_INSTALL_PREFIX )
set(CMAKE_INSTALL_PREFIX "${SUPERBUILD_INSTALL_DIR}")
endif()
#set CMAKE_MODULE_PATH to be the current source directory.
# This will allow including all cmake files without full path and .cmake extension!
......@@ -200,8 +204,6 @@ install_importlibs()
install_python_bindings()
install_java_bindings()
install_share_dirs()
install_cmake_files()
......
......@@ -40,6 +40,8 @@ if(WIN32)
set(cmake_gen "-GNinja")
endif()
message( "CMAKE_PREFIX_PATH: '${CMAKE_PREFIX_PATH}'" )
execute_process(
COMMAND ${CMAKE_COMMAND}
-DCMAKE_INSTALL_PREFIX=${PKG_DIR}
......@@ -93,5 +95,5 @@ if( build_Pipeline_rv )
message(FATAL_ERROR "Build FAILED. build_Pipeline_ov=${build_Pipeline_ov}")
return()
else()
message("Build PASSED. build_Pipeline_ov=${build_Pipeline_ov}")
message("Build PASSED. build_Pipeline_ov=${build_Pipeline_ov}")
endif()
......@@ -37,7 +37,6 @@ rd /S /Q lib\otb
del /S /Q lib\otb*
del /S /Q lib\python\*otbApplication.* || exit 1
del /S /Q lib\java\org.otb.application.jar || exit 1
del /S /Q bin\otb* || exit 1
del /S /Q bin\monteverdi.exe || exit 1
del /S /Q bin\mapla.exe || exit 1
......
......@@ -21,7 +21,7 @@
set -e
rm -fr OUT_DIR/include/OTB-*
rm -f OUT_DIR/lib/{libotb*,libOTB*}
rm -fr OUT_DIR/lib/{otb,python/*otbApplication*,java/org.otb.application.jar}
rm -fr OUT_DIR/lib/{otb,python/*otbApplication*}
rm -fr OUT_DIR/lib/cmake/OTB-*
rm -fr OUT_DIR/share/otb/
rm -fv OUT_DIR/bin/{otb*,monteverdi,mapla}
......
......@@ -18,7 +18,7 @@
# limitations under the License.
#
function(detect_using_file_command input_file result_type result_dir)
execute_process(COMMAND "${FILE_COMMAND}" "${input_file}"
RESULT_VARIABLE file_rv
OUTPUT_VARIABLE file_ov
......@@ -29,10 +29,17 @@ function(detect_using_file_command input_file result_type result_dir)
message(FATAL_ERROR "${FILE_COMMAND} failed: ${file_rv}\n${file_ev}\n${file_ov}")
endif()
# message( "file_ov: '${file_ov}'" )
get_filename_component(input_file_NAME ${input_file} NAME)
string(REPLACE "${input_file}" " _file_full_ " file_ov "${file_ov}")
string(TOLOWER "${file_ov}" file_ov_lower)
# message( "input_file: '${input_file}'" )
# message( "input_file_NAME: '${input_file_NAME}'" )
# message( "file_ov: '${file_ov}'" )
# message( "file_ov_lower: '${file_ov_lower}'" )
set(detected_type)
set(detected_dir)
# below executable check works for both mac osx and linux
......@@ -85,9 +92,9 @@ function(detect_using_file_command input_file result_type result_dir)
set(is_this_a_symbolic_link FALSE)
set(target_file)
isfile_symlink("${input_file}" is_this_a_symbolic_link target_file)
isfile_symlink("${input_file}" is_this_a_symbolic_link target_file)
if(is_this_a_symbolic_link)
if(target_file)
set(libdir "lib")
setif_value_in_list(is_gtk_lib "${input_file_NAME}" GTK_LIB_LIST_1)
......@@ -105,6 +112,18 @@ function(detect_using_file_command input_file result_type result_dir)
message(FATAL_ERROR "unknown/untracked file type found: ${input_file}")
endif() #if("${file_ov_lower}" MATCHES ...)
# Patch file command returning shared-oject for executable on Linux when -PIE is used.
if( LINUX )
get_filename_component( input_file_DIR ${input_file} DIRECTORY )
get_filename_component( input_file_dIR ${input_file_DIR} NAME )
string( TOLOWER "${input_file_DIR}" input_file_DIR )
if( ${input_file_DIR} MATCHES "bin" )
message( WARNING "${input_file} detected as shared-object." )
set(detected_type PROGRAMS)
set(detected_dir bin)
endif()
endif()
#message("detected_type=${detected_type}")
set(${result_type} "${detected_type}" PARENT_SCOPE)
set(${result_dir} "${detected_dir}" PARENT_SCOPE)
......
......@@ -22,13 +22,13 @@ include(patch_cmake_files.cmake)
function(install_cmake_files)
patch_cmake_files(NAME "ITK"
VERSION "${PKG_ITK_SB_VERSION}"
MATCH_STRING "${CMAKE_INSTALL_PREFIX}"
MATCH_STRING "${SUPERBUILD_INSTALL_DIR}"
REPLACE_VAR "ITK_INSTALL_PREFIX"
)
patch_cmake_files(NAME "OTB"
VERSION "${PKG_OTB_VERSION_MAJOR}.${PKG_OTB_VERSION_MINOR}"
MATCH_STRING "${CMAKE_INSTALL_PREFIX}"
MATCH_STRING "${SUPERBUILD_INSTALL_DIR}"
REPLACE_VAR "OTB_INSTALL_PREFIX"
)
......
......@@ -52,6 +52,7 @@ if(UNIX)
#we don't do any framework build on osx. So let's be sure on case of gdal
if(APPLE)
list(APPEND GDAL_SB_CONFIG "--with-macosx-framework=no")
list(APPEND GDAL_SB_CONFIG "LDFLAGS=-headerpad_max_install_names")
endif()
# PATCH_COMMAND ${CMAKE_COMMAND} -E touch ${GDAL_SB_SRC}/config.rpath
......
......@@ -36,7 +36,7 @@ endif()
ExternalProject_Add(NETCDF
PREFIX NETCDF
URL "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.4.1.1.tar.gz"
URL "https://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-4.4.1.1.tar.gz"
URL_MD5 503a2d6b6035d116ed53b1d80c811bda
SOURCE_DIR ${NETCDF_SB_SRC}
BINARY_DIR ${NETCDF_SB_BUILD_DIR}
......
......@@ -164,6 +164,18 @@ add_custom_command(OUTPUT otb_depends_done.txt
DEPENDS ${OTB_DEPENDENCIES}
)
add_custom_target( EMBED_COPYRIGHT
COMMAND ${CMAKE_COMMAND} -E copy
${OTB_SB_SRC}/LICENSE ${CMAKE_INSTALL_PREFIX}/share/copyright/LICENSE
COMMAND ${CMAKE_COMMAND} -E copy
${OTB_SB_SRC}/NOTICE ${CMAKE_INSTALL_PREFIX}/share/copyright/NOTICE
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/Copyright ${CMAKE_INSTALL_PREFIX}/share/copyright
)
add_custom_target(OTB_DEPENDS
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/otb_depends_done.txt
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
......@@ -171,6 +183,9 @@ add_custom_target(OTB_DEPENDS
VERBATIM
)
add_dependencies( OTB_DEPENDS
EMBED_COPYRIGHT
)
ExternalProject_Add(OTB
DEPENDS ${OTB_DEPENDENCIES}
......@@ -219,14 +234,10 @@ ExternalProject_Add(OTB
ExternalProject_Add_Step(
OTB install_copyright
COMMAND ${CMAKE_COMMAND} -E copy
${OTB_SB_SRC}/LICENSE ${CMAKE_INSTALL_PREFIX}/share/copyright/LICENSE
COMMAND ${CMAKE_COMMAND} -E copy
${OTB_SB_SRC}/NOTICE ${CMAKE_INSTALL_PREFIX}/share/copyright/NOTICE
COMMAND ${CMAKE_COMMAND}
-E copy_directory
${CMAKE_SOURCE_DIR}/Copyright ${CMAKE_INSTALL_PREFIX}/share/copyright
DEPENDEES install
)
ExternalProject_Add_StepDependencies(
OTB install_copyright
EMBED_COPYRIGHT
)
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