Commit 7cd48124 authored by Antoine Regimbeau's avatar Antoine Regimbeau

Merge branch 'packaging_ci' into superbuild_ci-macos

parents 91d88f88 92a7731d
Pipeline #1451 passed with stages
in 87 minutes and 15 seconds
......@@ -18,18 +18,6 @@ variables:
# The fetch strategy fails with LFS and GitLab
GIT_STRATEGY: "clone"
before_script:
# make sure LFS hooks are installed
- git lfs install
# Provision efficiently the local LFS cache before checkout
- git lfs fetch origin $CI_COMMIT_SHA
# Checkout the expected branch
- 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_API_TOKEN
stages:
- precheck
- prepare
......@@ -42,24 +30,33 @@ stages:
- runner_system_failure
- stuck_or_timeout_failure
#fast-build:
# extends: .general
# only: [merge_requests, branches]
# stage: precheck
fast-build:
extends: .general
only: [merge_requests, branches]
stage: precheck
image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-native-develop:latest
# before_script:
# - export GIT_LFS_SKIP_SMUDGE=1
# - git checkout $CI_COMMIT_REF_NAME
# - python3 CI/check_twin_pipelines.py
# script:
# - ctest -V -S CI/main_ci.cmake -DIMAGE_NAME:string=ubuntu-18.04-fast
# - ccache -s
before_script:
- git checkout -f -q $CI_COMMIT_SHA
- python3 CI/check_twin_pipelines.py
after_script:
- python3 CI/cdash_handler.py $CI_COMMIT_SHA $CI_PROJECT_ID $CI_PROJECT_DIR $K8S_SECRET_CDASH $CI_MERGE_REQUEST_REF_PATH
script:
- ctest -V -S CI/main_ci.cmake -DIMAGE_NAME:string=ubuntu-18.04-fast
- ccache -s
.common-build:
extends: .general
only: [merge_requests]
stage: build
dependencies: []
before_script:
- git lfs install --skip-repo
# Provision efficiently the local LFS cache before checkout
- git lfs fetch origin $CI_COMMIT_SHA
# Checkout the expected branch
- 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
debian-build:
extends: .common-build
......@@ -83,52 +80,45 @@ ubuntu-llvm:
only: [merge_requests]
stage: prepare
before_script:
# This override the previous before_script
- git checkout $CI_COMMIT_REF_NAME
# We are now doing the git-lfs install
# This is done after the checkout so we avoid downloading Data
# But we need it to upload the archive
- git-lfs install
- git config --global user.email "otbbot@orfeo-toolbox.org"
- git config --global user.name "otbbot"
- eval $(ssh-agent -s)
- ssh-add <(echo "$K8S_SECRET_SSH")
# This is for debug, we are checking the owner of the ssh key
- ssh -o StrictHostKeyChecking=no -T git@gitlab.orfeo-toolbox.org
after_script:
- echo "Nothing to do for after_script"
- git checkout -f -q $CI_COMMIT_SHA
- git lfs install --skip-repo
artifacts:
expire_in: 24 hrs
when: always
paths:
- sb_branch.txt
# This recovers logs from superbuild build
- build/*/*/*/*.log
- sb_branch.txt
## Ubuntu superbuild
ubuntu-superbuild-prepare:
extends: .common-prepare
image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-superbuild-base:18.04
script:
- ctest -V -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 -V -S CI/prepare_superbuild.cmake -DIMAGE_NAME:string=otb-centos-superbuild-base
- ctest -VV -S CI/prepare_superbuild.cmake -DIMAGE_NAME:string=otb-ubuntu-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
......
......@@ -245,14 +245,14 @@ TODO :
"""
if __name__ == "__main__":
if ( len(sys.argv) < 5 ):
print("Usage : "+sys.argv[0]+" commit_sha1 project_id build_directory token")
if ( len(sys.argv) < 6 ):
print("Usage : "+sys.argv[0]+" commit_sha1 project_id build_directory token ref_name")
sys.exit()
if trace:
print (sys.argv)
handler = Handler()
build_dir = os.path.join( sys.argv[3] , "build/")
# build_dir = sys.argv[3]
ref_name = sys.argv[5]
if trace:
print("build_dir is: " + build_dir)
handler.build_dir = build_dir
......@@ -271,7 +271,7 @@ if __name__ == "__main__":
gitlab_url = "https://gitlab.orfeo-toolbox.org/api/v4/projects/"
gitlab_url += sys.argv[2] + "/statuses/" + sys.argv[1]
params = urllib.parse.urlencode({'name':'cdash:' + handler.site , 'state': state ,\
'target_url' : cdash_url , 'description' : error })
'target_url' : cdash_url , 'description' : error , 'ref' : ref_name })
gitlab_request = urllib.request.Request(gitlab_url)
gitlab_request.add_header('PRIVATE-TOKEN' , sys.argv[4] )
res = urllib.request.urlopen(gitlab_request, data=params.encode('ascii'))
......
......@@ -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
......@@ -50,7 +51,7 @@ find_program(CTEST_GIT_COMMAND NAMES git git.cmd)
# FIXME: Replace ${GIT} variable with $[CTEST_GIT_COMMAND}"
set( GIT "${CTEST_GIT_COMMAND}" )
set( DEBUG 1 )
execute_process(
COMMAND ${GIT} "clone" "${REMOTE}" "--branch" "${BRANCH_NAME}"
"--depth" "1" "superbuild-artifact"
......@@ -82,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 )
......@@ -112,19 +123,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 SertitObject Mosaic otbGRM DiapOTBModule OTBTemporalGapFilling)
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" )
......@@ -176,3 +192,25 @@ if ( NOT _test_rv EQUAL 0 )
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_res
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()
# Artifacts can only be in project dir...
# file ( COPY "${XDK_PATH}" DESTINATION "${OTB_SOURCE_DIR}/install")
# include ( "${CMAKE_CURRENT_LIST_DIR}/main_packages.cmake" )
......@@ -24,8 +24,6 @@ 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 ( SUPERBUILD_SOURCE_DIR "${OTB_SOURCE_DIR}/SuperBuild" )
set ( CTEST_BUILD_CONFIGURATION "Release" )
......@@ -154,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()
......@@ -185,55 +182,6 @@ execute_process(
)
set ( SB_ARTIFACT_GIT "${OTB_SOURCE_DIR}/superbuild-artifact" )
# setting up the repo
# StrictHostKeyChecking so we don't have to add the host as a known key
# -F /dev/null so the agent is not taking a default file ~/.ssh/..
execute_process(
COMMAND ${GIT} "config" "core.sshCommand"
"ssh -o StrictHostKeyChecking=no"
WORKING_DIRECTORY ${SB_ARTIFACT_GIT}
RESULT_VARIABLE ssh_res
OUTPUT_VARIABLE ssh_out
ERROR_VARIABLE ssh_err
)
if ( DEBUG )
message( "Step 1: ssh")
message( "ssh_res = ${ssh_res}" )
message( "ssh_out = ${ssh_out}" )
message( "ssh_err = ${ssh_err}" )
endif()
execute_process(
COMMAND ${GIT} "config" "user.mail" "otbbot@orfeo-toolbox.org"
WORKING_DIRECTORY ${SB_ARTIFACT_GIT}
RESULT_VARIABLE mail_res
OUTPUT_VARIABLE mail_out
ERROR_VARIABLE mail_err
)
if ( DEBUG )
message( "Step 2: mail")
message( "mail_res = ${mail_res}" )
message( "mail_out = ${mail_out}" )
message( "mail_err = ${mail_err}" )
endif()
execute_process(
COMMAND ${GIT} "config" "user.name" "otbbot"
WORKING_DIRECTORY ${SB_ARTIFACT_GIT}
RESULT_VARIABLE name_res
OUTPUT_VARIABLE name_out
ERROR_VARIABLE name_err
)
if ( DEBUG )
message( "Step 3: name")
message( "name_res = ${name_res}" )
message( "name_out = ${name_out}" )
message( "name_err = ${name_err}" )
endif()
# create a branche
execute_process(
COMMAND ${GIT} "checkout" "-b" "${BRANCH_NAME}"
......@@ -261,9 +209,6 @@ execute_process(
WORKING_DIRECTORY ${OTB_SOURCE_DIR}
)
# In a near futur it might be nice to clean up the mess we made...
if ( DEBUG )
if (EXISTS "${SB_ARTIFACT_GIT}/${SB_TAR_NAME}")
message("Tar file exists in superbuild_artefact at: ${SB_ARTIFACT_GIT}/${SB_TAR_NAME}")
......
......@@ -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!
......
......@@ -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()
......@@ -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"
)
......
......@@ -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