diff --git a/.travis.yml b/.travis.yml index baa1142..a68db74 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,36 @@ +# Define Distribution +dist: bionic + # Use C++ build environment. language: cpp sudo: required -# We use docker-based builds to enable current Ubuntu LTS BuildEnv -services: - - docker +# Protobuf requires g++ (see https://github.com/google/protobuf/blob/master/src/README.md) +compiler: + - gcc +# Handle dependencies in separate directory. before_install: - - docker build -t osi-standard/osi-visualizer . + - DEPS_DIR="${HOME}/deps" + - mkdir -p "${DEPS_DIR}" + - cd "${DEPS_DIR}" + +# Install necessary packages. +install: + # Install a recent version of CMake + - | + CMAKE_URL="https://cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.tar.gz" + if [ ! -f ${DEPS_DIR}/cmake/bin/cmake ] ; then mkdir -p cmake ; travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake ; fi + export PATH=${DEPS_DIR}/cmake/bin:${PATH} + +# Change directory back to default build directory. +before_script: + - cd "${TRAVIS_BUILD_DIR}" + - sudo apt-get update && sudo apt-get upgrade && sudo apt-get autoremove + - sudo bash install-deps.sh + - sudo bash build-install-build-deps.sh -# Run the build script. +# Run the build script script: - - docker run -it -v $(pwd):/project osi-standard/osi-visualizer /bin/sh -c "mkdir -p build && cd build && cmake .. && cmake --build ." + - bash build.sh diff --git a/build-install-build-deps.sh b/build-install-build-deps.sh index 08b8f34..4cdf81a 100644 --- a/build-install-build-deps.sh +++ b/build-install-build-deps.sh @@ -24,45 +24,37 @@ echo " mkdir -p fmi_library cd fmi_library -FMI_lib_version=2.0.2 - fmi_library_include_install_dir=/usr/local/include/fmi-library fmi_library_lib_install_dir=/usr/local/lib/fmi-library -if ! [ -e ${fmi_library_include_install_dir} -a -e ${fmi_library_lib_install_dir} ] +if ! [ -e ${fmi_library_include_install_dir} -a -e ${fmi_library_lib_install_dir} ] then -echo " -Downloading FMI library... -" + echo "Downloading FMI library..." -if [ ! -d $FMI_lib_version ] -then - wget --no-parent -nH --cut-dirs=2 -r https://svn.jmodelica.org/FMILibrary/tags/$FMI_lib_version/ -fi + if [ ! -d FMILibrary-2.0.2 ] + then + wget --no-parent -nH --cut-dirs=2 -r https://jmodelica.org/FMILibrary/FMILibrary-2.0.2-src.zip + fi -echo " -Building FMI library... -" - cd ${FMI_lib_version} + echo "Building FMI library..." + unzip FMILibrary-2.0.2-src.zip + cd FMILibrary-2.0.2 mkdir -p build cd build - cmake ../. -DCMAKE_BUILD_TYPE=RELEASE + cmake .. + make -j8 make -j8 install - cd .. - if [[ -d "install" ]] + cd ../install + + if [ ! -d ${fmi_library_include_install_dir} ] + then + sudo mkdir -p ${fmi_library_include_install_dir} + sudo cp -uvrf ./include/* ${fmi_library_include_install_dir}/ + fi + + if [ ! -d ${fmi_library_lib_install_dir} ] then - cd install - mkdir -p ${fmi_library_include_install_dir} - if [[ -d ${fmi_library_include_install_dir} ]] - then - cp -uvrf ./include/* ${fmi_library_include_install_dir}/ - fi - mkdir -p ${fmi_library_lib_install_dir} - if [[ -d ${fmi_library_lib_install_dir} ]] - then - cp -uvrf ./lib/* ${fmi_library_lib_install_dir}/ - fi - else - echo "Could not install the fmi-library into usr/local" + sudo mkdir -p ${fmi_library_lib_install_dir} + sudo cp -uvrf ./lib/* ${fmi_library_lib_install_dir}/ fi fi \ No newline at end of file diff --git a/install-deps.sh b/install-deps.sh index b68f0ce..c67b4d9 100644 --- a/install-deps.sh +++ b/install-deps.sh @@ -42,4 +42,4 @@ echo " # Installing OpenGL ################################# " -apt-get install libgl1-mesa-dev libgl1-mesa-dri libgl1-mesa-glx -y +apt-get install libgl1-mesa-dev libgl1-mesa-dri libgl1-mesa-glx libqt5opengl5-dev -y