Skip to content
Commits on Source (6)
#
# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
# Copyright (C) 2005-2020 Centre National d'Etudes Spatiales (CNES)
#
# This file is part of Orfeo Toolbox
#
......@@ -106,7 +106,9 @@ stages:
#-------------------------- precheck job ---------------------------------------
fast-build:
extends: .common
only: [merge_requests, branches]
only:
- merge_requests
- branches
stage: precheck
image: $BUILD_IMAGE_REGISTRY/otb-ubuntu-native-develop:latest
before_script:
......@@ -136,10 +138,15 @@ legal-check:
#------------------------- prepare & build jobs --------------------------------
debian-build:
extends: .common-build
image: $BUILD_IMAGE_REGISTRY/otb-debian-native:unstable
image: $BUILD_IMAGE_REGISTRY/otb-debian-native:testing
allow_failure: true
script:
- xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -V -S CI/main_ci.cmake -DIMAGE_NAME:string=debian-unstable-gcc
dependencies: []
- xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -V -S CI/main_ci.cmake -DIMAGE_NAME:string=debian-testing-gcc
after_script:
- export CI_ALLOW_FAILURE=ON
- python3 -u CI/cdash_handler.py
needs:
- job: fast-build
## Ubuntu superbuild
ubuntu-xdk-prepare:
......@@ -158,8 +165,9 @@ ubuntu-xdk-build-doc:
- mv build/Documentation/Doxygen/OTB-Doxygen-*.tar.bz2 . || true
- xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -V -S CI/main_packages.cmake -DIMAGE_NAME:string=ubuntu-18.04-llvm-xdk -DNAME_SUFFIX:string=-glibc-2.27
- mv build_packages/OTB-*.run . || true
dependencies:
- ubuntu-xdk-prepare
needs:
- job: ubuntu-xdk-prepare
artifacts: true
## CentOS superbuild
centos-xdk-prepare:
......@@ -175,8 +183,9 @@ centos-xdk-build:
- xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -V -S CI/main_superbuild.cmake -DIMAGE_NAME:string=centos-6.6-gcc
- xvfb-run -a -n 1 -s "-screen 0 1024x768x24 -dpi 96" ctest -V -S CI/main_packages.cmake -DIMAGE_NAME:string=centos-6.6-gcc
- mv build_packages/OTB-*.run . || true
dependencies:
- centos-xdk-prepare
needs:
- job: centos-xdk-prepare
artifacts: true
## MacOS superbuild
macos-xdk-prepare:
......@@ -194,8 +203,9 @@ macos-xdk-build:
- ctest -V -S CI/main_superbuild.cmake -DIMAGE_NAME:string=macos-10.11.6-clang
- ctest -V -S CI/main_packages.cmake -DIMAGE_NAME:string=macos-10.11.6-clang
- mv build_packages/OTB-*.run . || true
dependencies:
- macos-xdk-prepare
needs:
- job: macos-xdk-prepare
artifacts: true
## Windows
.windows-prepare:
......@@ -234,8 +244,9 @@ windows-10-build:
- clcache.exe -s
- ctest -V -S CI/main_packages.cmake
- move "build_packages\OTB-*.zip" . || dir build_packages
dependencies:
- windows-10-prepare
needs:
- job: windows-10-prepare
artifacts: true
# - Win8.1
windows-8-prepare:
......@@ -259,8 +270,9 @@ windows-8-build:
- clcache.exe -s
- ctest -V -S CI/main_packages.cmake
- move "build_packages\OTB-*.zip" . || dir build_packages
dependencies:
- windows-8-prepare
needs:
- job: windows-8-prepare
artifacts: true
#------------------------- QA related jobs -------------------------------------
ubuntu-xdk-qa-code-coverage:
......@@ -282,8 +294,9 @@ ubuntu-xdk-qa-code-coverage:
- saxon-xslt -o build/ctest_report.xml
build/Testing/`head -n 1 build/Testing/TAG`/Test.xml
CI/ctest2junit.xsl
dependencies:
- ubuntu-xdk-prepare
needs:
- job: ubuntu-xdk-prepare
artifacts: true
ubuntu-xdk-qa-static-analysis:
extends: .common-build
......@@ -305,8 +318,9 @@ ubuntu-xdk-qa-static-analysis:
-i Modules/ThirdParty Modules
2> build/cppcheck_report.xml
after_script: []
dependencies:
- ubuntu-xdk-prepare
needs:
- job: ubuntu-xdk-prepare
artifacts: true
ubuntu-xdk-report:
extends: .common
......@@ -325,13 +339,54 @@ ubuntu-xdk-report:
- sonar-scanner -Dproject.settings=sonar-project.properties
-Dsonar.host.url=https://sonar.orfeo-toolbox.org
-Dsonar.login=$SONAR_OTB_TOKEN
-Dsonar.projectKey=$CI_PROJECT_NAMESPACE-$CI_PROJECT_NAME
`test -z "$CI_COMMIT_TAG" || echo "-Dsonar.projectVersion=$CI_COMMIT_TAG"`
-Dsonar.branch.name=$CI_COMMIT_REF_NAME
after_script: []
dependencies:
- ubuntu-xdk-qa-code-coverage
- ubuntu-xdk-qa-static-analysis
needs:
- job: ubuntu-xdk-qa-code-coverage
artifacts: true
- job: ubuntu-xdk-qa-static-analysis
artifacts: true
#------------------------- Conda packages jobs ---------------------------------
conda-linux-build:
extends: .common
stage: build
only:
- nightly
- /^release-[0-9]+\.[0-9]+$/@orfeotoolbox/otb
image: $BUILD_IMAGE_REGISTRY/otb-conda-build:latest
allow_failure: true
script:
- export otb_tag=${CI_COMMIT_TAG:-$CI_COMMIT_SHORT_SHA}
- ./CI/conda_build.sh
after_script: []
needs:
- job: fast-build
artifacts: false
artifacts:
when: always
expire_in: 24 hrs
paths:
- conda-bld/*
conda-linux-deploy:
extends: .general
stage: deploy
only:
- /^release-[0-9]+\.[0-9]+$/@orfeotoolbox/otb
image: $BUILD_IMAGE_REGISTRY/otb-conda-build:latest
before_script:
# Provision efficiently the local LFS cache before checkout
- git lfs fetch origin $CI_COMMIT_SHA
- git checkout -f -q $CI_COMMIT_SHA
script:
- ./CI/conda_deploy.sh
needs:
- job: conda-linux-build
artifacts: yes
#---------------------------- Deploy job ---------------------------------------
deploy:
......@@ -349,12 +404,17 @@ deploy:
- git checkout -f -q $CI_COMMIT_SHA
script:
- ./CI/deploy.sh $CI_COMMIT_REF_NAME $RC_NUMBER
dependencies:
- ubuntu-xdk-build-doc
- centos-xdk-build
- macos-xdk-build
- windows-8-build
- windows-10-build
needs:
- job: ubuntu-xdk-build-doc
artifacts: true
- job: centos-xdk-build
artifacts: true
- job: macos-xdk-build
artifacts: true
- job: windows-8-build
artifacts: true
- job: windows-10-build
artifacts: true
release-container:
image: $BUILD_IMAGE_REGISTRY/otb-alpine:3.7
......
......@@ -5,21 +5,25 @@ Antoine Regimbeau <antoine.regimbeau@c-s.fr>
Antoine Regimbeau <antoine.regimbeau@c-s.fr> aregimbe <antoine.regimbeau@c-s.fr>
Antoine Regimbeau <antoine.regimbeau@c-s.fr> aregimbeau <antoine.regimbeau@c-s.fr>
Arnaud Jaen <arnaud.jaen@c-s.fr>
Aurélie Emilien <aurelie.emilien@c-s.fr> Aurelie Emilien <aurelie.emilien@c-s.fr>
Aurélie Emilien <aurelie.emilien@c-s.fr>
Arthur Vincent <arthur.vincent@c-s.fr>
Arthur Vincent <arthur.vincent@c-s.fr> Arthur Vincent <vincenta@cesbio.cnes.fr>
Aurelien Bricier <aurelien.bricier@c-s.fr>
Aurélie Emilien <aurelie.emilien@c-s.fr>
Aurélie Emilien <aurelie.emilien@c-s.fr> Aurelie Emilien <aurelie.emilien@c-s.fr>
Bas Couwenberg <sebastic@debian.org>
Bas Couwenberg <sebastic@debian.org> Bas Couwenberg <sebastic@xs4all.nl>
Carole Amiot <carole.amiot@cnes.fr>
Carole Amiot <carole.amiot@cnes.fr> Carole Amiot <carole.amiot@thales-services.fr>
Caroline Ruffel <caroline.ruffel@c-s.fr>
Cédric Traizet <cedric.traizet@c-s.fr> Cedric <cedric.traizet@c-s.fr>
Cédric Traizet <cedric.traizet@c-s.fr> Cédric Traizet <traizetc@cesbio.cnes.fr>
Cédric Traizet <cedric.traizet@c-s.fr> ctraizet <cedric.traizet@c-s.fr>
Cédric Traizet <cedric.traizet@c-s.fr> Traizet Cedric <cedric.traizet@cesbio.cnes.fr>
Charles Peyrega <charles.peyrega@c-s.fr>
Chia Aik Song <crscas@nus.edu.sg>
Christophe Palmann <christophe.palmann@c-s.fr>
Conrad Bielski <conrad.bielski@yahoo.com>
Cyrille Valladeau <cyrille.valladeau@c-s.fr>
Cédric Traizet <cedric.traizet@c-s.fr> Cedric <cedric.traizet@c-s.fr>
Cédric Traizet <cedric.traizet@c-s.fr> Cédric Traizet <traizetc@cesbio.cnes.fr>
Cédric Traizet <cedric.traizet@c-s.fr> Traizet Cedric <cedric.traizet@cesbio.cnes.fr>
Cédric Traizet <cedric.traizet@c-s.fr> ctraizet <cedric.traizet@c-s.fr>
Daniel McInerney <daniel.o.mcinerney@gmail.com>
Daniel McInerney <daniel.o.mcinerney@gmail.com> dmci <daniel.o.mcinerney@gmail.com>
Daphne Deleflie <daphne.deleflie@thalesgroup.com>
......@@ -36,6 +40,8 @@ Grégoire Mercier <gregoire.mercier@telecom-bretagne.eu> Gregoire Mercier <gre
Guilhem Bonnefille <guilhem.bonnefille@c-s.fr>
Guillaume Borrut <guillaume.borrut@c-s.fr>
Guillaume Pasero <guillaume.pasero@c-s.fr>
Guillaume Pernot <guillaume.pernot@c-s.fr>
Guillaume Pernot <guillaume.pernot@c-s.fr> gpernot <guillaume.pernot@c-s.fr>
janestar <janestar92@163.com>
Jee Roen <jeroen.staab@posteo.de>
Jonathan Guinet <jonathan.guinet@c-s.fr>
......@@ -50,7 +56,7 @@ Julien Michel <julien.michel@cnes.fr> Julien Michel <julien.
Julien Michel <julien.michel@cnes.fr> Julien Michel <julien.michel@orfeo-toolbox.org>
Laurențiu Nicola <lnicola@dend.ro> Laurentiu Nicola <lnicola@dend.ro>
Laurențiu Nicola <lnicola@dend.ro> Laurențiu Nicola <grayshade@gmail.com>
Luc Hermitte <luc.hermitte@c-s.fr>
Luc Hermitte <luc.hermitte@c-s.fr> Luc Hermitte <luc.hermitte@cnes.fr>
Ludovic Hussonnois <ludovic.hussonnois@c-s.fr>
Manuel Grizonnet <manuel.grizonnet@cnes.fr>
Manuel Grizonnet <manuel.grizonnet@cnes.fr> Grizonnet Manuel <manuel.grizonnet@cnes.fr>
......@@ -70,26 +76,26 @@ Rashad Kanavath <rashad.kanavath@c-s.fr> Rashad Kanavath <moham
Rashad Kanavath <rashad.kanavath@c-s.fr> Rashad Kanavath <rashad.kanavath.email.com>
Rashad Kanavath <rashad.kanavath@c-s.fr> Rashad Kanavath <rashad.kanvath@c-s.fr>
Rashad Kanavath <rashad.kanavath@c-s.fr> Rashad M <rashad.kanavath@c-s.fr>
Rémi Cresson <remi.cresson@irstea.fr> remicres <remi.cresson@teledetection.fr>
Rémi Cresson <remi.cresson@irstea.fr> Remi Cresson <remi.cresson@irstea.fr>
Rémi Cresson <remi.cresson@irstea.fr> remi cresson <remi.cresson@teledetection.fr>
Rémi Cresson <remi.cresson@irstea.fr> remi <remi.cresson@irstea.fr>
Rémi Cresson <remi.cresson@irstea.fr> Rémi <remi.cresson@teledetection.fr>
Romain Garrigues <romain.garrigues@c-s.fr>
Rosa Ruiloba <rosario.ruiloba@c-s.fr>
Sébastien Dinot <sebastien.dinot@c-s.fr>
Sébastien Dinot <sebastien.dinot@c-s.fr> Sebastien Dinot <sebastien.dinot@c-s.fr>
Sébastien Dinot <sebastien.dinot@c-s.fr> Achille Talon <atalon@dinot.net>
Rémi Cresson <remi.cresson@irstea.fr> Remi Cresson <remi.cresson@irstea.fr>
Rémi Cresson <remi.cresson@irstea.fr> Rémi <remi.cresson@teledetection.fr>
Rémi Cresson <remi.cresson@irstea.fr> remi <remi.cresson@irstea.fr>
Rémi Cresson <remi.cresson@irstea.fr> remi cresson <remi.cresson@teledetection.fr>
Rémi Cresson <remi.cresson@irstea.fr> remicres <remi.cresson@teledetection.fr>
Sebastien Harasse <sebastien.harasse@c-s.fr>
Stephane Albert <stephane.albert@c-s.fr>
Stephane Albert <stephane.albert@c-s.fr> Stephane Albert <salbert@dora.si.c-s.fr>
Stephane Albert <stephane.albert@c-s.fr> Stephane ALBERT <stephane.albert@c-s.fr>
Stephane Albert <stephane.albert@c-s.fr> Stephane Albert <salbert@dora.si.c-s.fr>
Sylvain Poulain <kikislater@users.noreply.github.com> Sylvain POULAIN <kikislater@users.noreply.github.com>
Sébastien Dinot <sebastien.dinot@c-s.fr>
Sébastien Dinot <sebastien.dinot@c-s.fr> Achille Talon <atalon@dinot.net>
Sébastien Dinot <sebastien.dinot@c-s.fr> Sebastien Dinot <sebastien.dinot@c-s.fr>
Thomas Feuvrier <thomas.feuvrier@c-s.fr>
Tishampati Dhar <devnull@localhost>
Victor Poughon <victor.poughon@cnes.fr>
Vincent Poulain <vincent.poulain@thalesgroup.com>
Yannick Tanguy <yannick.tanguy@cnes.fr> Yannick TANGUY <yannick.tanguy@cnes.fr>
Yannick Tanguy <yannick.tanguy@cnes.fr> Yannick TANGUY <tanguyy@visu01.sis.cnes.fr>
Yannick Tanguy <yannick.tanguy@cnes.fr> Yannick TANGUY <yannick.tanguy@cnes.fr>
Yannick Tanguy <yannick.tanguy@cnes.fr> ytanguy <yannick.tanguy@cnes.fr>
Yin Tiangang <crsyt@nus.edu.sg>
......@@ -44,6 +44,9 @@ def CheckEnvParameters(params, verbose=True):
return False
return True
class CDashException(Exception):
pass
"""
Handler class to retrieve build informations
"""
......@@ -78,8 +81,7 @@ class Handler:
print ( configure_xml )
self.configure_path = configure_xml
return self.configure_path
print("Could not find the Configure.xml produced by ctest")
sys.exit(1)
raise CDashException("Could not find the Configure.xml produced by ctest")
def ParseConfigureFile(self):
"""
......@@ -98,14 +100,11 @@ class Handler:
if trace:
print( root.attrib )
if not 'Name' in root.keys():
print("Can't find site name in Configure.XML")
sys.exit(1)
raise CDashException("Can't find site name in Configure.XML")
if not 'BuildName' in root.keys():
print("Can't find build name in Configure.XML")
sys.exit(1)
raise CDashException("Can't find build name in Configure.XML")
if not 'BuildStamp' in root.keys():
print("Can't find build stamp in Configure.XML")
sys.exit(1)
raise CDashException("Can't find build stamp in Configure.XML")
self.site = root.get('Name')
self.name = root.get('BuildName')
self.stamp = root.get('BuildStamp')
......@@ -129,8 +128,7 @@ class Handler:
if key == "project":
project = value
if ( site == "" or stamp == "" or name == "" or project == ""):
print( "Missing argument for buildid request site:"+site+", stamp:"+stamp+", name:"+name+", project:"+project+".")
sys.exit(1)
raise CDashException("Missing argument for buildid request site:"+site+", stamp:"+stamp+", name:"+name+", project:"+project+".")
elif trace:
print( "Argument for buildid request site:"+site+", stamp:"+stamp+", name:"+name+", project:"+project+".")
buildid_api = "/api/v1/getbuildid.php?"
......@@ -157,8 +155,7 @@ class Handler:
print ( "build id is ", self.buildid)
return buildid.group(1)
else:
print("Error in recovering buildid")
sys.exit(1)
raise CDashException("Error in recovering buildid")
def GetBuildUrl (self , buildid = "" ):
"""
......@@ -246,6 +243,12 @@ if __name__ == "__main__":
if ( len(sys.argv) < 6 and len(sys.argv) > 1 ):
print("Usage : "+sys.argv[0]+" commit_sha1 project_id project_directory token ref_name")
sys.exit(1)
if os.environ.get('CI_SKIP_CDASH', False):
sys.exit(0)
allow_failure = os.environ.get('CI_ALLOW_FAILURE', False)
if ( len(sys.argv) >= 6):
sha1 = sys.argv[1]
proj = sys.argv[2]
......@@ -272,6 +275,8 @@ if __name__ == "__main__":
if trace:
print("build_dir is: " + build_dir)
handler.build_dir = build_dir
try:
handler.GetConfigureFile()
handler.ParseConfigureFile()
if handler.GetBuildId() is None:
......@@ -286,6 +291,13 @@ if __name__ == "__main__":
sys.exit(0)
gitlab_url = "https://gitlab.orfeo-toolbox.org/api/v4/projects/"
gitlab_url += proj + "/statuses/" + sha1
except CDashException as e:
if allow_failure:
state = 'success'
else:
print(e)
sys.exit(1)
params = urllib.parse.urlencode({'name':'cdash:' + handler.site , 'state': state ,\
'target_url' : cdash_url , 'description' : error , 'ref' : refn })
gitlab_request = urllib.request.Request(gitlab_url)
......
#!/usr/bin/env bash
#
# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
# Copyright (C) 2005-2020 Centre National d'Etudes Spatiales (CNES)
#
# This file is part of Orfeo Toolbox
#
......@@ -17,22 +18,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This script aims to identify the unreferenced authors to invite the team to
# check if they have already signed the contributor license agreement (CLA).
# When this is done, the author must be added to the reference list.
# Deploy a qt.conf file in the specified
# target build directory, as a pre-build step
macro( deploy_qt_conf TARGET_NAME )
source /build/anaconda3/bin/activate
add_custom_command(
TARGET ${TARGET_NAME}
PRE_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -D QT_TRANSLATIONS_DIR:PATH=${QT_TRANSLATIONS_DIR}
-D QT_PLUGINS_DIR:PATH=${QT_PLUGINS_DIR}
-D Monteverdi_SOURCE_DIR:PATH=${Monteverdi_SOURCE_DIR}
-D TARGET_DIR:PATH=$<TARGET_FILE_DIR:${TARGET_NAME}>
-P ${Monteverdi_SOURCE_DIR}/CMake/DeployQtConfScript.cmake
COMMENT "Deploying qt.conf in ${TARGET_NAME} build dir"
VERBATIM
)
cd /build/staged-recipes/recipes/
endmacro()
conda build ${CONDA_BUILD_OPTIONS} muparserx
conda build ${CONDA_BUILD_OPTIONS} openthreads
conda build ${CONDA_BUILD_OPTIONS} ossim
conda build ${CONDA_BUILD_OPTIONS} shark
conda build ${CONDA_BUILD_OPTIONS} tinyxml
conda build ${CONDA_BUILD_OPTIONS} libitk
conda build ${CONDA_BUILD_OPTIONS} otb
mkdir ${CI_PROJECT_DIR}/conda-bld
mv /build/anaconda3/conda-bld/linux-64/*.tar.bz2 ${CI_PROJECT_DIR}/conda-bld
#!/usr/bin/env bash
#
# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
# Copyright (C) 2005-2020 Centre National d'Etudes Spatiales (CNES)
#
# This file is part of Orfeo Toolbox
#
......@@ -17,7 +18,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This script aims to identify the unreferenced authors to invite the team to
# check if they have already signed the contributor license agreement (CLA).
# When this is done, the author must be added to the reference list.
configure_file(${Monteverdi_SOURCE_DIR}/CMake/qt.conf.in
${TARGET_DIR}/qt.conf
@ONLY)
\ No newline at end of file
source /build/anaconda3/bin/activate
ANACONDA_ORGANIZATION="orfeotoolbox"
anaconda login --username ${ANACONDA_LOGIN} --password ${ANACONDA_PASSWORD} --hostname ${CI_JOB_ID}
anaconda upload --force --user ${ANACONDA_ORGANIZATION} conda-bld/*.tar.bz2 || /bin/true
#!/bin/bash
#
# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
# Copyright (C) 2005-2020 Centre National d'Etudes Spatiales (CNES)
#
# This file is part of Orfeo Toolbox
#
......
......@@ -21,7 +21,7 @@
# Configuration options for debian-unstable-gcc
set(site_option
"opencv_INCLUDE_DIR:PATH=/usr/include
"OpenCV_DIR:PATH=/usr
OTB_USE_MPI:BOOL=OFF
OTB_USE_SHARK:BOOL=OFF
")
#!/bin/bash
#
# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
#
......@@ -18,31 +19,28 @@
# limitations under the License.
#
# Find the AntiGrain Geometry graphical toolkit header files
#
# AGG_FOUND - True if AGG found.
# AGG_INCLUDE_DIRS - where to find agg_pixfmt_rgba.h, etc.
#
if( AGG_INCLUDE_DIR )
# Already in cache, be silent
set( AGG_FIND_QUIETLY TRUE )
endif()
find_path( AGG_INCLUDE_DIR agg_pixfmt_rgba.h
PATH_SUFFIXES agg2
)
# This script aims at moving and renaming source, packages and documentation from
# staging area to production area
# handle the QUIETLY and REQUIRED arguments and set AGG_FOUND to TRUE if
# all listed variables are TRUE
include( FindPackageHandleStandardArgs )
find_package_handle_standard_args( Agg DEFAULT_MSG AGG_INCLUDE_DIR )
staging_area=/home/otbpush/test/staging
#check if we are dealing with the right packages
mark_as_advanced( AGG_INCLUDE_DIR )
pack_suffix=-$(echo "$CI_COMMIT_TAG" | grep -o "rc[0-9]*") # this retrieve the rc number
echo "pack_suffix=${pack_suffix}"
if(AGG_FOUND)
set(AGG_INCLUDE_DIRS ${AGG_INCLUDE_DIR})
else()
set(AGG_INCLUDE_DIRS)
endif()
echo "Renaming binary packages"
# find build_packages/. -name "*.run" \
# -exec sh -c 'mv "$1" "${1%.run}${pack_suffix}.run"' _ {} \;
packages_list=$(ls ${staging_area} | grep -E "OTB-[0-9]*.[0-9]*.[0-9]*-.*\.(run|zip)")
ls -all build_packages/
for name in $packages_list
do
len=${#name}
#add pack_suffix to the name
mv "$name" "${name:0:$len-4}${pack_suffix}${name:$len-4}"
done
# TO REMOVE
###########
ls -all build_packages/
###########
......@@ -19,30 +19,21 @@
# limitations under the License.
#
# Configure git for tar.xz
git config tar.tar.xz.command "xz -c"
pack_suffix=""
if [ $1 = "develop" ] # check if the branch name is develop or not
if [ "$CI_COMMIT_REF_NAME" = "develop" ] # check if the branch name is develop or not
then # we are on develop
jobs_directory=/home/otbpush/test/$(date +%F)
else # we are on a release branch
jobs_directory=/home/otbpush/test/staging
if [ "$#" -eq 2 ]
then # there is a rc tag, we need a suffix for packages
pack_suffix=-$(echo "$2" | grep -o "rc[0-9]*") # this retrieve the rc number
fi
fi
echo "jobs_directory=${jobs_directory}"
echo "pack_suffix=${pack_suffix}"
# Create today's directory on serveur otb5-vm2
echo "Creating today's directory"
ssh otbpush@otb5-vm2.orfeo-toolbox.org mkdir -p ${jobs_directory}
# Delete latest
echo "Deleting latest directory"
if [ $1 = "develop" ]
if [ "$CI_COMMIT_REF_NAME" = "develop" ]
then # On develop
ssh otbpush@otb5-vm2.orfeo-toolbox.org rm -rf /home/otbpush/test/latest
# Create symilink
......@@ -50,19 +41,13 @@ then # On develop
# Cleaning old directory
matching_dirs=$(ls -1 | grep -oE '^20[0-9]{2}-[0-9]{2}-[0-9]{2}$' | sort)
history_length=11
rm -rf $(echo $matching_dirs | tr ' ' '\n' | head -n -${history_length})
rm -rf "$(echo "$matching_dirs" | tr ' ' '\n' | head -n -${history_length})"
else # On release
# Remove what is inside staging area
ssh otbpush@otb5-vm2.orfeo-toolbox.org rm -rf ${jobs_directory}/*
fi
# Push package
echo "Renaming binary packages"
for name in $(find . -regex "./OTB-.*\(run\|zip\)"); do
len=(${#name})
mv "$name" "${name:0:$len-4}${pack_suffix}${name:$len-4}"
done
echo "Pushing binary packages"
scp OTB-*.{run,zip} otbpush@otb5-vm2.orfeo-toolbox.org:${jobs_directory}/.
# Push doc
......@@ -71,9 +56,9 @@ scp {CookBook-*-html.tar.gz,OTB-Doxygen-*.tar.bz2} otbpush@otb5-vm2.orfeo-toolbo
# Create zip, tar.gz and tar.xy source
echo "Creating source tarball and zip"
git archive --format=zip -o OTB-sources-$CI_COMMIT_SHORT_SHA.zip HEAD
git archive --format=tgz -o OTB-sources-$CI_COMMIT_SHORT_SHA.tar.gz HEAD
git archive --format=tar.xz -o OTB-sources-$CI_COMMIT_SHORT_SHA.tar.xz HEAD
git archive --format=zip -o OTB-sources-"$CI_COMMIT_SHORT_SHA".zip HEAD
git archive --format=tgz -o OTB-sources-"$CI_COMMIT_SHORT_SHA".tar.gz HEAD
git archive --format=tar.xz -o OTB-sources-"$CI_COMMIT_SHORT_SHA".tar.xz HEAD
# Remove old source file
echo "Removing old sources"
ssh otbpush@otb5-vm2.orfeo-toolbox.org \
......@@ -82,7 +67,20 @@ ${jobs_directory}/OTB-sources-*.tar.*
# Push new source file
echo "Pushing new sources"
scp OTB-sources-$CI_COMMIT_SHORT_SHA.* \
scp OTB-sources-"$CI_COMMIT_SHORT_SHA".* \
otbpush@otb5-vm2.orfeo-toolbox.org:${jobs_directory}/
echo "${CI_COMMIT_SHA}" > ref.sha
echo "Pushing ref.sha"
scp ref.sha otbpush@otb5-vm2.orfeo-toolbox.org:${jobs_directory}/
#Untar doc
if [ "$CI_COMMIT_REF_NAME" = "develop" ]
then
ssh otbpush@otb5-vm2.orfeo-toolbox.org \
tar -xf ${jobs_directory}/CookBook-*-html.tar.gz -C ${jobs_directory}/
ssh otbpush@otb5-vm2.orfeo-toolbox.org \
rm -rf /home/otbpush/test/CookBook/*
ssh otbpush@otb5-vm2.orfeo-toolbox.org \
mv ${jobs_directory}/CookBook-*/* /home/otbpush/test/CookBook/.
fi
......@@ -25,5 +25,6 @@ set(site_option
OTB_USE_GLFW=OFF
CMAKE_C_COMPILER_LAUNCHER:STRING=ccache
CMAKE_CXX_COMPILER_LAUNCHER:STRING=ccache
OPENGL_INCLUDE_DIR:STRING=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/OpenGL.framework/Headers
OTB_DATA_USE_LARGEINPUT:BOOL=ON")
# Large input path are in an environment variable on macOS
......@@ -39,20 +39,17 @@ if(WIN32)
set(ENV{PATH} "${XDK_PATH_NATIVE}\\bin;$ENV{PATH}" )
set(ENV{PATH} "$ENV{PATH};${XDK_PATH_NATIVE}\\lib" )
set(ENV{GDAL_DATA} "${XDK_PATH_NATIVE}\\data" )
set(ENV{GEOTIFF_CSV} "${XDK_PATH_NATIVE}\\share\\epsg_csv" )
set(ENV{PROJ_LIB} "${XDK_PATH_NATIVE}\\share" )
set(ENV{PROJ_LIB} "${XDK_PATH_NATIVE}\\share\\proj" )
# needed to load Qt plugins for testing, not for binary packages where we use a qt.conf file
set(ENV{QT_PLUGIN_PATH} "${XDK_PATH_NATIVE}\\plugins")
set( CTEST_ENVIRONMENT
"PATH=$ENV{PATH}
GDAL_DATA=$ENV{GDAL_DATA}
GEOTIFF_CSV=$ENV{GEOTIFF_CSV}
PROJ_LIB=$ENV{PROJ_LIB}
")
else()
set(ENV{PATH} "${XDK_PATH}/lib:${XDK_PATH}/bin:$ENV{PATH}" )
set( GDAL_DATA "${XDK_PATH}/share/gdal" )
set( GEOTIFF_CSV "${XDK_PATH}/share/epsg_csv" )
set( PROJ_LIB "${XDK_PATH}/share" )
set( CTEST_ENVIRONMENT
"PATH=$ENV{PATH}
......
# File from https://github.com/progschj/OpenGL-Examples/
#
# ----------------------------------------------------------------------------
# Copyright (c) 2012-2013 Jakob Progsch
# Released under ZLib license:
#
# This software is provided 'as-is', without any express or implied warranty.
# In no event will the authors be held liable for any damages arising from the
# use of this software.
#
# Permission is granted to anyone to use this software for any purpose,
# including commercial applications, and to alter it and redistribute it
# freely, subject to the following restrictions:
#
# 1. The origin of this software must not be misrepresented; you must not
# claim that you wrote the original software. If you use this software in
# a product, an acknowledgment in the product documentation would be
# appreciated but is not required.
#
# 2. Altered source versions must be plainly marked as such, and must not be
# misrepresented as being the original software.
#
# 3. This notice may not be removed or altered from any source distribution.
# ----------------------------------------------------------------------------
#
# NOTE: This file was removed from OpenGL-Examples project on 2013-11-01:
# https://github.com/progschj/OpenGL-Examples/commit/a100ce1ec6f5f6acf6ba3a3279cd3b3b91775b20
#
# Try to find GLEW library and include path.
# Once done this will define
#rewritten for OTB by Rashad Kanavath
#
# GLEW_FOUND
# GLEW_INCLUDE_PATH
# GLEW_LIBRARY
#
# This whole file could be deleted. Find Packages GLEW can be used now
find_path(
GLEW_INCLUDE_DIR GL/glew.h
DOC "The directory where GL/glew.h resides"
)
if(WIN32)
set(GLEW_LIB_NAMES glew GLEW glew32 glew32s)
else()
set(GLEW_LIB_NAMES libGLEW GLEW)
endif()
FIND_LIBRARY( GLEW_LIBRARY
NAMES ${GLEW_LIB_NAMES}
DOC "The GLEW library")
set(GLEW_FOUND FALSE)
if (GLEW_INCLUDE_DIR AND GLEW_LIBRARY)
set(GLEW_LIBRARIES ${GLEW_LIBRARY})
set(GLEW_FOUND TRUE)
endif()
INCLUDE(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(GLEW
REQUIRED_VARS GLEW_LIBRARY GLEW_INCLUDE_DIR
VERSION_VAR GLEW_VERSION_STRING)
#
# 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.
#
# - Find ICUUC
# Find the native ICUUC includes and library
#
# ICUUC_FOUND - True if ICUUC found.
# ICUUC_INCLUDE_DIRS - where to find unicode/unistr.h, etc.
# ICUUC_LIBRARIES - List of libraries when using ICUUC.
#
if( ICUUC_INCLUDE_DIR )
# Already in cache, be silent
set( ICUUC_FIND_QUIETLY TRUE )
endif()
find_path( ICUUC_INCLUDE_DIR unicode/unistr.h )
find_library( ICUUC_LIBRARY
NAMES icuuc )
# handle the QUIETLY and REQUIRED arguments and set ICUUC_FOUND to TRUE if
# all listed variables are TRUE
include( FindPackageHandleStandardArgs )
find_package_handle_standard_args( ICUUC DEFAULT_MSG ICUUC_LIBRARY ICUUC_INCLUDE_DIR )
mark_as_advanced( ICUUC_INCLUDE_DIR ICUUC_LIBRARY )
if(ICUUC_FOUND)
set(ICUUC_INCLUDE_DIRS ${ICUUC_INCLUDE_DIR})
set(ICUUC_LIBRARIES ${ICUUC_LIBRARY})
else()
set(ICUUC_INCLUDE_DIRS)
set(ICUUC_LIBRARIES)
endif()
# - Finds the KWStyle utility
# This module looks for KWStyle. If KWStyle is found,
# the following variables are defined:
# KWSTYLE_FOUND - Set if KWStyle is found
# KWSTYLE_EXECUTABLE - Path to the KWStyle executable
# KWSTYLE_VERSION_STRING - A human-readable string containing the version of KWStyle
#=============================================================================
# Copyright 2008-2013 Kitware, Inc.
# Copyright 2013 Brian Helba
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
find_program(
KWSTYLE_EXECUTABLE
NAMES KWStyle
DOC "Path to the KWStyle executable"
)
mark_as_advanced(KWSTYLE_EXECUTABLE)
if(KWSTYLE_EXECUTABLE)
execute_process(
COMMAND ${KWSTYLE_EXECUTABLE} -version
OUTPUT_VARIABLE KWSTYLE_VERSION_STRING
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(KWSTYLE_VERSION_STRING)
# string(REPLACE ..) fails if the input is an empty string
string(REPLACE
"Version: "
""
KWSTYLE_VERSION_STRING
${KWSTYLE_VERSION_STRING}
)
else(KWSTYLE_VERSION_STRING)
# CMake's find_package_handle_standard_args has a bug where the
# version empty string ("") is always acceptable
set(KWSTYLE_VERSION_STRING "?")
endif(KWSTYLE_VERSION_STRING)
endif(KWSTYLE_EXECUTABLE)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
KWStyle
REQUIRED_VARS KWSTYLE_EXECUTABLE
VERSION_VAR KWSTYLE_VERSION_STRING
)
#
# 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.
#
# - Find LTDL
# Find the native LTDL includes and library
#
# LTDL_FOUND - True if LTDL found.
# LTDL_INCLUDE_DIRS - where to find ltdl.h, etc.
# LTDL_LIBRARIES - List of libraries when using LTDL.
#
if( LTDL_INCLUDE_DIR )
# Already in cache, be silent
set( LTDL_FIND_QUIETLY TRUE )
endif()
find_path( LTDL_INCLUDE_DIR ltdl.h )
find_library( LTDL_LIBRARY
NAMES ltdl )
# handle the QUIETLY and REQUIRED arguments and set LTDL_FOUND to TRUE if
# all listed variables are TRUE
include( FindPackageHandleStandardArgs )
find_package_handle_standard_args( LTDL DEFAULT_MSG LTDL_LIBRARY LTDL_INCLUDE_DIR )
mark_as_advanced( LTDL_INCLUDE_DIR LTDL_LIBRARY )
if(LTDL_FOUND)
set(LTDL_INCLUDE_DIRS ${LTDL_INCLUDE_DIR})
set(LTDL_LIBRARIES ${LTDL_LIBRARY})
else()
set(LTDL_INCLUDE_DIRS)
set(LTDL_LIBRARIES)
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.
#
# - Extract information from a mercurial working copy
# Example usage:
# find_package(Mercurial)
# if(Mercurial_FOUND)
# Mercurial_WC_IDENTIFY(${PROJECT_SOURCE_DIR} Project)
# message("Current revision is ${Project_WC_REVISION}")
# message("Mercurial version is ${Mercurial_VERSION_HG}")
# endif()
# This file can be deleted as we no longer use mercurial
set(Mercurial_FOUND FALSE)
set(Mercurial_HG_FOUND FALSE)
find_program(Mercurial_HG_EXECUTABLE hg
DOC "mercurial command line client")
mark_as_advanced(Mercurial_HG_EXECUTABLE)
if(Mercurial_HG_EXECUTABLE)
set(Mercurial_HG_FOUND TRUE)
set(Mercurial_FOUND TRUE)
macro(Mercurial_WC_IDENTIFY dir prefix)
# the subversion commands should be executed with the C locale, otherwise
# the message (which are parsed) may be translated, Alex
set(_Mercurial_SAVED_LC_ALL "$ENV{LC_ALL}")
set(ENV{LC_ALL} C)
execute_process(COMMAND ${Mercurial_HG_EXECUTABLE} version
WORKING_DIRECTORY ${dir}
OUTPUT_VARIABLE Mercurial_VERSION_HG
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
execute_process(COMMAND ${Mercurial_HG_EXECUTABLE} identify ${dir}
OUTPUT_VARIABLE ${prefix}_WC_IDENTIFY
# ERROR_VARIABLE Mercurial_hg_identify_error
# RESULT_VARIABLE Mercurial_hg_identify_result
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
execute_process(COMMAND ${Mercurial_HG_EXECUTABLE} status -m ${dir}
OUTPUT_VARIABLE ${prefix}_WC_STATUS
# ERROR_VARIABLE Mercurial_hg_status_error
# RESULT_VARIABLE Mercurial_hg_status_result
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
if(NOT ${Mercurial_hg_identify_result} EQUAL 0)
message(SEND_ERROR "Command \"${Mercurial_HG_EXECUTABLE} identify ${dir}\" failed with output:\n${Mercurial_hg_identify_error}")
else()
string(REGEX REPLACE "^(.*\n)?Mercurial Distributed SCM [(]version ([.0-9]+).*"
"\\2" Mercurial_VERSION_HG "${Mercurial_VERSION_HG}")
string(REGEX REPLACE "^(.*\n)?([0-9a-f]+).*"
"\\2" ${prefix}_WC_REVISION "${${prefix}_WC_IDENTIFY}")
endif()
# restore the previous LC_ALL
set(ENV{LC_ALL} ${_Mercurial_SAVED_LC_ALL})
endmacro()
endif()
if(NOT Mercurial_FOUND)
if(NOT Mercurial_FIND_QUIETLY)
message(STATUS "Mercurial was not found.")
else()
if(Mercurial_FIND_REQUIRED)
message(FATAL_ERROR "Mercurial was not found.")
endif()
endif()
endif()
......@@ -21,9 +21,9 @@
set(OPENCV_SEARCH_PATH)
if(OpenCV_DIR)
get_filename_component(OPENCV_SEARCH_PATH "${OpenCV_DIR}" PATH)
get_filename_component(OPENCV_SEARCH_PATH "${OpenCV_DIR}" REALPATH)
if(OPENCV_SEARCH_PATH)
get_filename_component(OPENCV_SEARCH_PATH "${OPENCV_SEARCH_PATH}" PATH)
get_filename_component(OPENCV_SEARCH_PATH "${OPENCV_SEARCH_PATH}" REALPATH)
endif()
if(OPENCV_SEARCH_PATH)
find_path(
......
# OpenThreads is a C++ based threading library. Its largest userbase
# seems to OpenSceneGraph so you might notice I accept OSGDIR as an
# environment path.
# I consider this part of the Findosg* suite used to find OpenSceneGraph
# components.
# Each component is separate and you must opt in to each module.
#
# Locate OpenThreads
# This module defines
# OPENTHREADS_LIBRARIES
# OPENTHREADS_FOUND, if false, do not try to link to OpenThreads
# OPENTHREADS_INCLUDE_DIRS, where to find the headers
# OPENTHREADS_VERSION - version string
# OPENTHREADS_VERSION_MAJOR - version major number
# OPENTHREADS_VERSION_MINOR - version minor number
# OPENTHREADS_VERSION_PATCH - version patch number
# OPENTHREADS_VERSION_NUMBER - version number ((major*100)+minor)*100+patch
#
# $OPENTHREADS_DIR is an environment variable that would
# correspond to the ./configure --prefix=$OPENTHREADS_DIR
# used in building osg.
#
# Created by Eric Wing.
# Modified by Guillaume Pasero.
#=============================================================================
# Copyright 2007-2009 Kitware, Inc.
# Copyright 2009-2017 Centre National d'Etudes Spatiales (CNES)
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Header files are presumed to be included like
# #include <OpenThreads/Thread>
# To make it easier for one-step automated configuration/builds,
# we leverage environmental paths. This is preferable
# to the -DVAR=value switches because it insulates the
# users from changes we may make in this script.
# It also offers a little more flexibility than setting
# the CMAKE_*_PATH since we can target specific components.
# However, the default CMake behavior will search system paths
# before anything else. This is problematic in the cases
# where you have an older (stable) version installed, but
# are trying to build a newer version.
# CMake doesn't offer a nice way to globally control this behavior
# so we have to do a nasty "double FIND_" in this module.
# The first FIND disables the CMAKE_ search paths and only checks
# the environmental paths.
# If nothing is found, then the second find will search the
# standard install paths.
# Explicit -DVAR=value arguments should still be able to override everything.
# This whole file could be deleted. Find Packages OpenThreads can be used now
find_path(
OPENTHREADS_INCLUDE_DIR OpenThreads/Thread
PATH_SUFFIXES include
)
mark_as_advanced(OPENTHREADS_INCLUDE_DIR)
if(EXISTS "${OPENTHREADS_INCLUDE_DIR}/OpenThreads/Version")
file(READ "${OPENTHREADS_INCLUDE_DIR}/OpenThreads/Version" _openthreads_version_CONTENTS)
string(REGEX REPLACE ".*# *define +OPENTHREADS_MAJOR_VERSION +([0-9]+).*" "\\1" OPENTHREADS_VERSION_MAJOR "${_openthreads_version_CONTENTS}")
string(REGEX REPLACE ".*# *define +OPENTHREADS_MINOR_VERSION +([0-9]+).*" "\\1" OPENTHREADS_VERSION_MINOR "${_openthreads_version_CONTENTS}")
string(REGEX REPLACE ".*# *define +OPENTHREADS_PATCH_VERSION +([0-9]+).*" "\\1" OPENTHREADS_VERSION_PATCH "${_openthreads_version_CONTENTS}")
set(OPENTHREADS_VERSION "${OPENTHREADS_VERSION_MAJOR}.${OPENTHREADS_VERSION_MINOR}.${OPENTHREADS_VERSION_PATCH}")
math(EXPR OPENTHREADS_VERSION_NUMBER
"((${OPENTHREADS_VERSION_MAJOR})*100+${OPENTHREADS_VERSION_MINOR})*100+${OPENTHREADS_VERSION_PATCH}")
else()
if(NOT OPENTHREADS_FIND_QUIETLY)
message(WARNING "OpenThreads/Version not found !")
endif()
endif()
find_library(OPENTHREADS_LIBRARY
NAMES OpenThreads OpenThreadsWin32
PATH_SUFFIXES lib64 lib
)
mark_as_advanced(OPENTHREADS_LIBRARY)
find_library(OPENTHREADS_LIBRARY_DEBUG
NAMES OpenThreadsd OpenThreadsWin32d
PATH_SUFFIXES lib64 lib
)
mark_as_advanced(OPENTHREADS_LIBRARY_DEBUG)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenThreads DEFAULT_MSG
OPENTHREADS_LIBRARY OPENTHREADS_INCLUDE_DIR)
if(OPENTHREADS_LIBRARY_DEBUG)
set(OPENTHREADS_LIBRARIES
optimized ${OPENTHREADS_LIBRARY}
debug ${OPENTHREADS_LIBRARY_DEBUG})
else()
set(OPENTHREADS_LIBRARIES ${OPENTHREADS_LIBRARY})
endif()
set(OPENTHREADS_INCLUDE_DIRS ${OPENTHREADS_INCLUDE_DIR})
#
# 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.
#
macro(package_mingw)
cmake_parse_arguments(PACKAGE "" "PREFIX_DIR;ARCH;MXEROOT;WITH_OTBGUI" "SEARCHDIRS;PEFILES" ${ARGN} )
list(APPEND PACKAGE_PEFILES ${CMAKE_INSTALL_PREFIX}/bin/otbApplicationLauncherCommandLine.exe)
list(APPEND PACKAGE_PEFILES ${CMAKE_INSTALL_PREFIX}/bin/otbTestDriver.exe)
if(PACKAGE_WITH_OTBGUI)
list(APPEND PACKAGE_PEFILES ${CMAKE_INSTALL_PREFIX}/bin/otbApplicationLauncherQt.exe)
endif()
if("${PACKAGE_ARCH}" STREQUAL "x86")
set(MXE_BIN_DIR "${PACKAGE_MXEROOT}/usr/i686-w64-mingw32.shared/bin")
set(MXE_OBJDUMP "${PACKAGE_MXEROOT}/usr/bin/i686-w64-mingw32.shared-objdump")
elseif("${PACKAGE_ARCH}" STREQUAL "x64")
set(MXE_BIN_DIR "${PACKAGE_MXEROOT}/usr/x86_64-w64-mingw32.shared/bin")
set(MXE_OBJDUMP "${PACKAGE_MXEROOT}/usr/bin/x86_64-w64-mingw32.shared-objdump")
endif()
file(GLOB MXE_GCC_LIB_DIR "${MXE_BIN_DIR}/gcc*")
list(APPEND PACKAGE_SEARCHDIRS ${MXE_GCC_LIB_DIR})
list(APPEND PACKAGE_SEARCHDIRS ${MXE_BIN_DIR})
list(APPEND PACKAGE_SEARCHDIRS "${MXE_BIN_DIR}/../qt/bin") #Qt
list(APPEND PACKAGE_SEARCHDIRS "${MXE_BIN_DIR}/../qt/lib") #Qwt
list(APPEND PACKAGE_SEARCHDIRS "${CMAKE_INSTALL_PREFIX}/bin") #mvd
list(APPEND PACKAGE_SEARCHDIRS "${CMAKE_INSTALL_PREFIX}/lib/otb/applications") #otb apps
install_common(${PACKAGE_WITH_OTBGUI})
file(GLOB otbapps_list ${CMAKE_INSTALL_PREFIX}/lib/otb/applications/otbapp_*dll) # /lib/otb
list(APPEND PACKAGE_PEFILES ${otbapps_list})
set(alldlls)
set(notfound_dlls)
foreach(infile ${PACKAGE_PEFILES})
get_filename_component(bn ${infile} NAME)
process_deps(${bn})
endforeach()
list(LENGTH notfound_dlls nos)
if(${nos} GREATER 0)
STRING(REPLACE ".dll" ".dll," notfound ${notfound_dlls})
message(FATAL_ERROR "Following dlls were not found: ${notfound}
Please consider adding their paths to SEARCHDIRS when calling package_mingw macro.")
endif()
endmacro(package_mingw)
set(SYSTEM_DLLS
msvc.*dll
user32.dll
gdi32.dll
shell32.dll
kernel32.dll
advapi32.dll
crypt32.dll
ws2_32.dll
wldap32.dll
ole32.dll
opengl32.dll
glu32.dll
comdlg32.dll
imm32.dll
oleaut32.dll
comctl32.dll
winmm.dll
shfolder.dll
secur32.dll
wsock32.dll
winspool.drv)
macro(is_system_dll matched value)
set(${matched})
string(TOLOWER ${value} value_)
foreach (pattern ${SYSTEM_DLLS})
string(TOLOWER ${pattern} pattern_)
if(${value_} MATCHES ${pattern_})
set(${matched} TRUE)
endif()
endforeach()
endmacro()
macro(list_contains var value)
set(${var})
foreach(value2 ${ARGN})
if(${value} STREQUAL ${value2})
set(${var} TRUE)
endif()
endforeach(value2)
endmacro()
function(process_deps infile)
get_filename_component(bn ${infile} NAME)
list_contains(contains "${bn}" "${alldlls}")
if(NOT contains)
set(DLL_FOUND FALSE)
foreach(SEARCHDIR ${PACKAGE_SEARCHDIRS})
if(NOT DLL_FOUND)
if(EXISTS ${SEARCHDIR}/${infile})
set(DLL_FOUND TRUE)
else()
string(TOLOWER ${infile} infile_lower)
if(EXISTS ${SEARCHDIR}/${infile_lower})
set(DLL_FOUND TRUE)
set(infile ${infile_lower})
endif()
endif()
if(DLL_FOUND)
message(STATUS "Processing ${SEARCHDIR}/${infile}")
if(NOT "${infile}" MATCHES "otbapp")
install(FILES "${SEARCHDIR}/${infile}"
DESTINATION ${PACKAGE_PREFIX_DIR}/bin)
else()
##message(STATUS "skipping..${infile}")
endif()
if(NOT EXISTS ${MXE_OBJDUMP})
message(FATAL_ERROR "objdump executable not found. please check MXE_OBJDUMP is set to correct cross compiled executable")
endif()
execute_process(COMMAND ${MXE_OBJDUMP} "-p" "${SEARCHDIR}/${infile}" OUTPUT_VARIABLE dlldeps)
string(REGEX MATCHALL "DLL.Name..[A-Za-z(0-9\\.0-9)+_\\-]*" OUT "${dlldeps}")
string(REGEX REPLACE "DLL.Name.." "" OUT "${OUT}")
foreach(o ${OUT})
process_deps(${o})
endforeach()
endif()
endif(NOT DLL_FOUND)
endforeach()
if(NOT DLL_FOUND)
is_system_dll(iss "${infile}")
if(NOT iss)
set(notfound_dlls "${notfound_dlls};${infile}")
endif()
else(NOT DLL_FOUND)
set( alldlls "${alldlls};${bn}" PARENT_SCOPE )
endif(NOT DLL_FOUND)
set(notfound_dlls "${notfound_dlls}" PARENT_SCOPE )
endif()
endfunction()
function(install_common with_otbgui)
set(APP_PREFIX_DIR "${PACKAGE_PREFIX_DIR}")
set(APP_BIN_DIR "${APP_PREFIX_DIR}/bin")
set(APP_OTBLIBS_DIR "${APP_PREFIX_DIR}/lib/otb")
set(APP_DATA_DIR "${APP_PREFIX_DIR}/share")
####################### install GDAL data #######################
set(GDAL_DATA ${MXE_BIN_DIR}/../share/gdal)
if(NOT EXISTS "${GDAL_DATA}/epsg.wkt")
message(FATAL_ERROR "Cannot generate package without GDAL_DATA : ${GDAL_DATA}")
endif()
install(
DIRECTORY ${GDAL_DATA}
DESTINATION ${APP_DATA_DIR})
####################### Check otb applications #######################
file(GLOB OTB_APPS_LIST ${CMAKE_INSTALL_PREFIX}/lib/otb/applications/otbapp_*dll) # /lib/otb
if(NOT OTB_APPS_LIST)
message(FATAL_ERROR "No OTB-applications detected")
endif()
## otb apps dir /lib/otb/applications
install(
DIRECTORY "${CMAKE_INSTALL_PREFIX}/lib/otb/applications"
DESTINATION ${APP_OTBLIBS_DIR})
file(GLOB CLI_SCRIPTS ${CMAKE_INSTALL_PREFIX}/bin/otbcli*)
foreach(CLI_SCRIPT ${CLI_SCRIPTS})
install(
FILES "${CLI_SCRIPT}"
DESTINATION ${APP_BIN_DIR})
endforeach()
if(with_otbgui)
file(GLOB GUI_SCRIPTS ${CMAKE_INSTALL_PREFIX}/bin/otbgui*)
foreach(GUI_SCRIPT ${GUI_SCRIPTS})
install(
FILES "${GUI_SCRIPT}"
DESTINATION ${APP_BIN_DIR})
endforeach()
endif()
endfunction()
......@@ -247,100 +247,6 @@ foreach(otb-module ${OTB_MODULES_ALL})
endif()
endforeach()
#-----------------------------------------------------------------------------
# Construct an in-build-order list of "CDash subproject" modules from the
# list of enabled modules:
set(OTB_CDASH_SUBPROJECT_MODULES)
if(OTB_GENERATE_PROJECT_XML OR OTB_GENERATE_SUBPROJECTS_CMAKE)
# Since a "CDash subproject" for OTB logically contains both a non-test
# module and its corresponding test module, the subproject order must take
# both modules into account. The subprojects in this list are named after
# the non-test modules in the enabled modules list. But the ordering of
# these subprojects use the dependencies of the modules *and* their test
# modules
foreach(module ${OTB_MODULES_ENABLED})
if(${module}_TESTED_BY)
# module that HAS a test module: skip for now... will be added as a
# subproject later, in the slot when its corresponding "-test" module
# is encountered
elseif(${module}_TESTS_FOR)
# this is a test module... *now* list the module which it tests as
# the subproject name:
list(APPEND OTB_CDASH_SUBPROJECT_MODULES ${${module}_TESTS_FOR})
else()
# a module that is not a test module, and has no tested by...
# is just a module-only subproject with no test module:
list(APPEND OTB_CDASH_SUBPROJECT_MODULES ${module})
endif()
endforeach()
endif()
#-----------------------------------------------------------------------------
# Write a Project.xml file to send the description of the submodules and
# their dependencies up to CDash:
if(OTB_GENERATE_PROJECT_XML)
set(filename "${OTB_BINARY_DIR}/${main_project_name}.Project.xml")
set(xml "<?xml version='1.0' encoding='UTF-8'?>\n")
set(xml "${xml}<Project name='${main_project_name}'>\n")
foreach(module ${OTB_CDASH_SUBPROJECT_MODULES})
if(${module}_IS_TEST)
message(FATAL_ERROR "unexpected: subproject names should not be test modules module='${module}' tests_for='${${module}_TESTS_FOR}'")
endif()
set(xml "${xml} <SubProject name='${module}'>\n")
set(deps "")
set(dep_list ${OTB_MODULE_${module}_DEPENDS})
if(${module}_TESTED_BY)
list(APPEND dep_list ${OTB_MODULE_${${module}_TESTED_BY}_DEPENDS})
if(dep_list)
list(SORT dep_list)
endif()
endif()
foreach(dep ${dep_list})
if(NOT ${dep}_IS_TEST AND NOT "${module}" STREQUAL "${dep}")
set(xml "${xml} <Dependency name='${dep}'/>\n")
endif()
endforeach()
set(xml "${xml} </SubProject>\n")
endforeach()
set(xml "${xml}</Project>\n")
# Always write out "${filename}.in":
file(WRITE ${filename}.in "${xml}")
# Use configure_file so "${filename}" only changes when its content changes:
configure_file(${filename}.in ${filename} COPYONLY)
endif()
#-----------------------------------------------------------------------------
# Write the list of enabled modules out for ctest scripts to use as an
# in-order subproject list:
if(OTB_GENERATE_SUBPROJECTS_CMAKE)
set(filename "${OTB_BINARY_DIR}/${main_project_name}.SubProjects.cmake")
set(s "# Generated by CMake, do not edit!\n")
set(s "${s}set(otb_subprojects\n")
foreach(otb-module ${OTB_CDASH_SUBPROJECT_MODULES})
if(${otb-module}_IS_TEST)
message(FATAL_ERROR "unexpected: subproject names should not be test modules otb-module='${otb-module}' tests_for='${${otb-module}_TESTS_FOR}'")
endif()
set(s "${s} \"${otb-module}\"\n")
endforeach()
set(s "${s})\n")
# Always write out "${filename}.in":
file(WRITE ${filename}.in "${s}")
# Use configure_file so "${filename}" only changes when its content changes:
configure_file(${filename}.in ${filename} COPYONLY)
endif()
#-----------------------------------------------------------------------------
if(NOT OTB_MODULES_ENABLED)
message(WARNING "No modules enabled!")
file(REMOVE "${OTB_BINARY_DIR}/OTBTargets.cmake")
......