From 1c9a8a18e4611b2678b643fa4966225a5e388f70 Mon Sep 17 00:00:00 2001 From: Luis Diaz Mas Date: Sun, 20 Aug 2017 16:13:33 +0200 Subject: [PATCH] Add travis support for Linux: - Installing requirements with install script - Add missing include(checkIncludeFile) cmake command - Configuration matrix to compile the project with different options --- .travis.yml | 42 +++++++++------------------------ .travis/install.sh | 8 +++++++ .travis/run.sh | 8 +++++++ config/generateConfigFile.cmake | 2 ++ 4 files changed, 29 insertions(+), 31 deletions(-) create mode 100755 .travis/install.sh create mode 100755 .travis/run.sh diff --git a/.travis.yml b/.travis.yml index 8af0ea6d..5d75791a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,40 +1,20 @@ language: cpp -sudo: false +sudo: required +dist: trusty -addons: - apt: - packages: - - cmake - - zlib1g-dev - - libssh-dev - - libssh - - libcurl4-openssl-dev - - gettext - sources: - - kalakris-cmake - compiler: - gcc - clang -before_install: - - echo $LANG - - echo $LC_ALL - - if [ $TRAVIS_OS_NAME == osx ]; then brew update && brew install libssh curl; fi - - rvm use $RVM --install --binary --fuzzy - - gem update --system -# - gem --version - -script: - - cmake -DCMAKE_INSTALL_PREFIX=..\dist -EXIV2_ENABLE_NLS=ON -DEXIV2_ENABLE_CURL=OFF -DEXIV2_ENABLE_SSH=OFF . - - cmake --build . && cmake --build . --target install - - cmake -DCMAKE_INSTALL_PREFIX=..\dist2 -EXIV2_ENABLE_NLS=ON -DEXIV2_ENABLE_CURL=ON -DEXIV2_ENABLE_SSH=ON -DEXIV2_ENABLE_WEBREADY=ON . - - cmake --build . && cmake --build . --target install - -notifications: - email: false - +env: + - CMAKE_OPTIONS="" # Default + - CMAKE_OPTIONS="-DEXIV2_ENABLE_VIDEO=ON -DEXIV2_ENABLE_WEBREADY=ON" # All enabled + - CMAKE_OPTIONS="-DEXIV2_ENABLE_XMP=OFF -DEXIV2_ENABLE_NLS=OFF -DEXIV2_ENABLE_LENSDATA=OFF" # All disabled + - CMAKE_OPTIONS="-DEXIV2_ENABLE_WEBREADY=ON -DEXIV2_ENABLE_CURL=OFF -DEXIV2_ENABLE_SSH=OFF" # WebReady without SSH nor CURL + os: - linux - - osx \ No newline at end of file + +install: ./.travis/install.sh +script: ./.travis/run.sh diff --git a/.travis/install.sh b/.travis/install.sh new file mode 100755 index 00000000..5ae17c15 --- /dev/null +++ b/.travis/install.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -e +set -x + +if [[ "$(uname -s)" == 'Linux' ]]; then + sudo apt-get install cmake zlib1g-dev libssh-dev libcurl4-openssl-dev gettext libexpat1-dev +fi + diff --git a/.travis/run.sh b/.travis/run.sh new file mode 100755 index 00000000..6547727a --- /dev/null +++ b/.travis/run.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -e +set -x + +mkdir build && cd build +cmake ${CMAKE_OPTIONS} .. +make -j diff --git a/config/generateConfigFile.cmake b/config/generateConfigFile.cmake index c4eb787f..7d925a30 100644 --- a/config/generateConfigFile.cmake +++ b/config/generateConfigFile.cmake @@ -1,3 +1,5 @@ +include(CheckIncludeFile) + # Note that the scope of the EXV_ variables in local if (${EXIV2_ENABLE_WEBREADY}) set(EXV_USE_SSH ${EXIV2_ENABLE_SSH})