Commit a9b6b6cb authored by Nicholas Breen's avatar Nicholas Breen

New upstream version 1.5

parent 5c1b316b
Pipeline #34791 failed with stages
in 4 minutes and 18 seconds
---
# BasedOnStyle: Google
AccessModifierOffset: -1
ConstructorInitializerIndentWidth: 4
AlignEscapedNewlinesLeft: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AlwaysBreakTemplateDeclarations: true
AlwaysBreakBeforeMultilineStrings: true
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
BreakBeforeBinaryOperators: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BinPackParameters: true
ColumnLimit: 80
ConstructorInitializerAllOnOneLineOrOnePerLine: true
DerivePointerBinding: true
ExperimentalAutoDetectBinPacking: false
IndentCaseLabels: true
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCSpaceBeforeProtocolList: false
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 60
PenaltyBreakString: 1000
PenaltyBreakFirstLessLess: 120
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerBindsToType: true
SpacesBeforeTrailingComments: 2
Cpp11BracedListStyle: true
Standard: Auto
IndentWidth: 2
TabWidth: 8
UseTab: Never
BreakBeforeBraces: Attach
IndentFunctionDeclarationAfterType: true
SpacesInParentheses: false
SpacesInAngles: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpaceAfterControlStatementKeyword: true
SpaceBeforeAssignmentOperators: true
ContinuationIndentWidth: 4
...
*~
Makefile
rules.ninja
build.ninja
.ninja_*
build
src/libtools/votca_config.h
src/libtools/gitversion.h
.project
.cproject
libvotca*.pc
libvotca*.so
libvotca*.so.*
libvotca*.a
scripts/VOTCARC.bash
scripts/VOTCARC.csh
share/doc/Doxyfile
share/doc/html/*
share/man/*.man
src/tools/votca_property
src/tools/*.man
netbeans/*/build
*/nbproject/private
CMakeFiles
install_manifest.txt
cmake_install.cmake
cmake_uninstall.cmake
CMakeCache.txt
intel/*
include/votca/tools/votca_config.h
netbeans/libtools/nbproject/Makefile-Debug.mk
netbeans/libtools/nbproject/Makefile-Release.mk
netbeans/libtools/nbproject/Makefile-profile_release.mk
netbeans/libtools/nbproject/Makefile-variables.mk
netbeans/libtools/nbproject/Package-Debug.bash
netbeans/libtools/nbproject/Package-Release.bash
netbeans/libtools/nbproject/Package-profile_release.bash
netbeans/libtools/nbproject/private/
stages:
- canary
- build
.build:
retry:
max: 2
variables:
CCACHE_DIR: "${CI_PROJECT_DIR}/ccache"
CXXFLAGS: "-Wall -Werror"
DISTRO: "latest"
image: votca/buildenv:${DISTRO}
stage: build
cache:
paths:
- ccache/
script:
- ccache -z
- j="$(grep -c processor /proc/cpuinfo 2>/dev/null)" || j=0; ((j++))
- git branch commit_of_build_${CI_BUILD_ID} ${CI_COMMIT_SHA}
- cd $HOME
- git clone --recursive https://github.com/votca/votca
- pushd votca
- if [[ ( ${CI_COMMIT_REF_NAME} =~ ^for/([^/]*)/.* || ${CI_COMMIT_REF_NAME} =~ ^(stable)$ ) && ${BASH_REMATCH[1]} != master ]]; then
git checkout -b ${BASH_REMATCH[1]} origin/${BASH_REMATCH[1]} && git submodule update --recursive --init;
fi
- git -C ${CI_PROJECT_NAME} fetch ${CI_PROJECT_DIR} commit_of_build_${CI_BUILD_ID}
- git -C ${CI_PROJECT_DIR} branch -d commit_of_build_${CI_BUILD_ID}
- git -C ${CI_PROJECT_NAME} checkout -f ${CI_COMMIT_SHA}
- mkdir -p build
- pushd build
- cmake .. -DENABLE_TESTING=ON -DBUILD_CSGAPPS=ON -DBUILD_XTP=ON -DBUILD_CTP=ON -DBUILD_CTP_MANUAL=ON -DBUILD_CSG_MANUAL=ON -DBUILD_XTP_MANUAL=ON -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DMODULE_BUILD=${MODULE_BUILD} ${MODULE_BUILD:+-DCMAKE_INSTALL_PREFIX=/home/votca/votca.install}
${MINIMAL:+-DCMAKE_DISABLE_FIND_PACKAGE_HDF5=ON -DWITH_FFTW=OFF -DWITH_GSL=OFF -DCMAKE_DISABLE_FIND_PACKAGE_GSL=ON
-DWITH_MKL=OFF -DCMAKE_DISABLE_FIND_PACKAGE_MKL=ON -DBUILD_MANPAGES=OFF -DWITH_GMX=OFF -DWITH_SQLITE3=OFF
-DCMAKE_DISABLE_FIND_PACKAGE_SQLITE3=ON -DBUILD_XTP=OFF -DBUILD_CTP=OFF}
- make -O -k -j${j} -l${j} VERBOSE=1
- make test CTEST_OUTPUT_ON_FAILURE=1
- test -z "${MODULE_BUILD}" && make install DESTDIR=${PWD}/install && rm -rf ${PWD}/install/usr && rmdir ${PWD}/install
- sudo make install
- ccache -s
Debug GCC:
stage: canary
variables:
CC: "gcc"
CXX: "g++"
CMAKE_BUILD_TYPE: "Debug"
extends: .build
None GCC:
variables:
CC: "gcc"
CXX: "g++"
CMAKE_BUILD_TYPE: ""
extends: .build
None Clang:
variables:
CC: "clang"
CXX: "clang++"
CMAKE_BUILD_TYPE: ""
extends: .build
Debug Clang:
variables:
CC: "clang"
CXX: "clang++"
CMAKE_BUILD_TYPE: "Debug"
extends: .build
Release GCC:
variables:
CC: "gcc"
CXX: "g++"
CMAKE_BUILD_TYPE: "Release"
extends: .build
Release Clang:
variables:
CC: "clang"
CXX: "clang++"
CMAKE_BUILD_TYPE: "Release"
extends: .build
Debug GCC Ubuntu:
variables:
CC: "gcc"
CXX: "g++"
CMAKE_BUILD_TYPE: "Debug"
DISTRO: "ubuntu"
extends: .build
Debug Clang Ubuntu:
variables:
CC: "clang"
CXX: "clang++"
CMAKE_BUILD_TYPE: "Debug"
DISTRO: "ubuntu"
extends: .build
Release GCC Ubuntu:
variables:
CC: "gcc"
CXX: "g++"
CMAKE_BUILD_TYPE: "Release"
DISTRO: "ubuntu"
extends: .build
Release Clang Ubuntu:
variables:
CC: "clang"
CXX: "clang++"
CMAKE_BUILD_TYPE: "Release"
DISTRO: "ubuntu"
extends: .build
Release GCC Minimal:
variables:
CC: "gcc"
CXX: "g++"
CMAKE_BUILD_TYPE: "Release"
MINIMAL: "yes"
DISTRO: "fedora_nogmx"
extends: .build
Release Clang Minimal:
variables:
CC: "clang"
CXX: "clang++"
CMAKE_BUILD_TYPE: "Release"
MINIMAL: "yes"
DISTRO: "fedora_nogmx"
extends: .build
Release GCC Module:
variables:
CC: "gcc"
CXX: "g++"
CMAKE_BUILD_TYPE: "Release"
MODULE_BUILD: "yes"
extends: .build
# the original source of this file can be found in votca/votca repository
# add changes there!
# To update:
# wget -O .travis.yml https://raw.githubusercontent.com/votca/votca/master/.travis.yml
language: cpp
sudo: required
services:
- docker
env:
matrix:
- ENV=1
- ENV=2
- ENV=3
- ENV=4
- ENV=5
- ENV=6
- ENV=7
- ENV=8
- ENV=9
- ENV=10
- ENV=11
- ENV=12
- ENV=13
- ENV=14
- ENV=15
- ENV=16
- ENV=17
- ENV=18
- ENV=19
- ENV=20
before_script:
- git checkout -b current_commit
- cd ../../
- if [[ ${TRAVIS_REPO_SLUG} = */votca ]]; then
if [[ ${TRAVIS_BRANCH} = next ]]; then
git -C ${TRAVIS_REPO_SLUG} submodule foreach git checkout master;
git -C ${TRAVIS_REPO_SLUG} submodule foreach git pull;
fi;
cp -vr ${TRAVIS_REPO_SLUG}/docker ${HOME};
mv -v ${TRAVIS_REPO_SLUG} $HOME/docker;
else
git clone --recursive https://github.com/votca/votca.git $HOME/docker/votca;
if [[ ${TRAVIS_BRANCH} != master ]]; then
git -C ${HOME}/docker/votca checkout -b ${TRAVIS_BRANCH} ${TRAVIS_TAG:-origin/${TRAVIS_BRANCH}} && git -C ${HOME}/docker/votca submodule update --recursive --init;
fi;
git -C ${HOME}/docker/votca/${TRAVIS_REPO_SLUG#*/} fetch ${PWD}/${TRAVIS_REPO_SLUG} current_commit;
git -C ${HOME}/docker/votca/${TRAVIS_REPO_SLUG#*/} checkout -f FETCH_HEAD;
cp -vr ${HOME}/docker/votca/docker/* ${HOME}/docker;
if [[ -d ${TRAVIS_REPO_SLUG}/docker ]]; then cp -vr ${TRAVIS_REPO_SLUG}/docker/* ${HOME}/docker; fi;
fi
- source ${HOME}/docker/set_env.sh
- cp -r $HOME/.ccache ${HOME}/docker/ccache
- sed -i "1s/latest/${DISTRO:-latest}/" ${HOME}/docker/Dockerfile
- if [[ ! ${SKIP} ]]; then
travis_retry timeout 540 docker pull $(sed -n '1s/FROM //p' ${HOME}/docker/Dockerfile);
fi
script:
- if [[ ! ${SKIP} ]]; then
travis_retry docker build "${docker_opts[@]}"
--build-arg CC=${CC} --build-arg CXX=${CXX} --build-arg CXXFLAGS="-Wall ${WERROR:+-Werror}"
--build-arg CI=${CI} --build-arg TRAVIS=${TRAVIS} --build-arg TRAVIS_OS_NAME=${DISTRO:-fedora}
--build-arg TRAVIS_BRANCH=${TRAVIS_BRANCH} --build-arg TRAVIS_JOB_NUMBER=${TRAVIS_JOB_NUMBER}
--build-arg TRAVIS_PULL_REQUEST=${TRAVIS_PULL_REQUEST} --build-arg TRAVIS_JOB_ID=${TRAVIS_JOB_ID}
--build-arg TRAVIS_TAG=${TRAVIS_TAG} --build-arg TRAVIS_REPO_SLUG=${TRAVIS_REPO_SLUG}
--build-arg TRAVIS_COMMIT=${TRAVIS_COMMIT}
${TRAVIS_TAG:+-t votca/votca:${TRAVIS_TAG}}
-t votca/votca:latest -t votca/votca:${TRAVIS_BRANCH} ${HOME}/docker/ &&
rm -rf $HOME/.ccache &&
CON=$(docker run -d votca/votca:${TRAVIS_BRANCH} /bin/bash) &&
docker cp ${CON}:/home/votca/.ccache ${HOME}/;
fi
after_success:
- shopt -s extglob && [[ ${TRAVIS_BRANCH} = @(master|stable|v1.*) && ${CC} = *gcc* && ${DOCKERHUB} = yes && ! ${SKIP} ]] && DEPLOY=yes
- if [[ ${TRAVIS_BRANCH} = master ]]; then DOCKER_TAG=latest; else DOCKER_TAG="${TRAVIS_BRANCH}"; fi
- if [[ ${DOCKER_USERNAME} && ${DOCKER_PASSWORD} && ${TRAVIS_PULL_REQUEST} == false && ${DEPLOY} ]]; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
docker push "${TRAVIS_REPO_SLUG}:${DOCKER_TAG}";
fi
- if [[ ${DOXYGEN} = yes && ! ${SKIP} ]]; then
git clone --depth=1 https://github.com/votca/doxygen.git "$HOME/devdoc";
cd $HOME/devdoc;
rm -f *;
git checkout -- CNAME;
docker cp ${CON}:/home/votca/votca/build/share/doc/html . ;
mv html/* .; rmdir html;
docker cp ${CON}:/home/votca/votca/build/csg-manual/manual.pdf . ;
docker cp ${CON}:/home/votca/votca/build/ctp/manual/ctp-manual.pdf . ;
docker cp ${CON}:/home/votca/votca/build/xtp/manual/xtp-manual.pdf . ;
git add --all .;
if [[ ${TRAVIS_BRANCH} = master && ${encrypted_7abbb71c3ba6_key} && ${encrypted_7abbb71c3ba6_iv} && ${TRAVIS_PULL_REQUEST} == false ]]; then
git config --global user.name "Automatic Deployment (Travis CI)";
git config --global user.email "votca-commits@googlegroups.com";
git commit -m "Documentation Update";
openssl aes-256-cbc -K $encrypted_7abbb71c3ba6_key -iv $encrypted_7abbb71c3ba6_iv -in keys/deploy3.enc -out ~/.ssh/id_rsa -d;
chmod 600 ~/.ssh/id_rsa;
git push git@github.com:votca/doxygen.git gh-pages;
else
git status;
git diff --cached --no-color | head -c 1k;
fi;
fi
branches:
only:
- master
- development
- stable
- next
- /^v\d+\.\d+(\.\d+|_rc\d+)?$/
cache:
- ccache
compiler:
- gcc
- clang
notifications:
email:
- votca-commits@googlegroups.com
For more detailed information about the changes see the history of the [repository](https://github.com/votca/tools/commits/stable).
## Version 1.5 _SuperVictor_ (released 31.01.19)
* enable gitlab CI
## Version 1.5_rc3 (released 19.01.19)
* travis: fixed bug in building tags
## Version 1.5_rc2 (released 16.01.19)
* histogramnew: refactor to fix memory lead
## Version 1.5_rc1 (released 28.12.18)
* added unit testing
* Eigen added as a dependency
* removed GSL dependency
## Version 1.2.2
* cmake: allow static fftw and gsl
* added dummy c function for cmake
* fixed conflicting type headers (real was defined)
## Version 1.2.1
* fixed soname of libs
* improved cmake checks and error messages
* fixed pkg-config file
## Version 1.2 (SuperDoris)
* changed buildsystem to cmake
* added database class through sqlite3
## Version 1.1.2
* fixed head of votca-tools manpage
## Version 1.1.1
* just a bugfix release
## Version 1.1 (SuperAnn)
* added thread class
* added spline class, with akima spline, linear spline
* added man7 page
* random.cc: avoid calling of exit()
* added lexical cast class
## Version 1.0.1
* fixed a bug in VOTCARC.csh for empty LD_LIBRARY_PATH
* completion file has moved back to csg
* added --disable-rc-files to configure
* updated bundled libtool to 2.2.10
## Version 1.0
* added libvotca_expat to allow compiling without expat
* allow comments in tables
* added application class to create standardized applications
* all boost dependecy are now in tools
* fixes in table format, flags is always last row now
* allow compling without fftw (needed for csg_boltzmann only)
* allow compling without gsl (needed for csg_resample and csg_fmatch)
## Version 1.0_rc5
* using libexpat instead of libxml2
* added libvotca_boost to allow compiling without boost
* using pkg-config to detect package flags
* compiles under AIX with xlC
* added VOTCARC to initialize all votca parts
* updated configure, see --help
## Version 1.0_rc4
* using libtool to build shared libs
## Version 1.0_rc3
* corrected bug in tokenizer
* fixed a bug in calculation of version string
* some fixes concerning autotools
## Version 1.0_rc2
* fixed typo in calculation of version string
* added NOTICE and LICENSE to the dist tarball
## Version 1.0_rc1
* initial version
cmake_minimum_required(VERSION 3.1)
project(votca-tools)
set(PROJECT_VERSION "1.5")
string(REGEX REPLACE "^[1-9]+\\.([1-9]+).*$" "\\1" SOVERSION "${PROJECT_VERSION}")
if (NOT ${SOVERSION} MATCHES "[1-9]+")
message(FATAL_ERROR "Could not determind SOVERSION from ${PROJECT_VERSION}")
endif (NOT ${SOVERSION} MATCHES "[1-9]+")
# Cmake modules/macros are in a subdirectory to keep this file cleaner
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CXX_FLAGS)
#release comes with -O3 by default
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CXX_FLAGS)
enable_language(CXX)
######################################################################
# compiler tests
# these need ot be done early (before further tests).
#####################################################################
include(CheckCXXCompilerFlag)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF) #...without compiler extensions like gnu++11
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel" AND CMAKE_VERSION VERSION_LESS "3.6.0")
message(FATAL_ERROR "Using the intel compiler requires cmake 3.6 or higher")
endif()
########################################################################
# User input options #
########################################################################
option(BUILD_SHARED_LIBS "Build shared libs" ON)
include(GNUInstallDirs)
option(ENABLE_TESTING "Build and enable testing stuff" OFF)
if(ENABLE_TESTING)
enable_testing()
endif(ENABLE_TESTING)
#this has to be the first include directive
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
#for votca_config.h
include_directories(${CMAKE_CURRENT_BINARY_DIR}/include)
########################################################################
#Find external packages
########################################################################
if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/.git)
find_package(Git)
endif(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/.git)
find_package(Threads REQUIRED)
set(THREAD_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
find_package(Boost 1.57.0 REQUIRED COMPONENTS program_options filesystem system )
include_directories(${Boost_INCLUDE_DIRS})
set (BOOST_CFLAGS_PKG "-I${Boost_INCLUDE_DIRS}")
set(BOOST_LIBS_PKG "-L${Boost_LIBRARY_DIRS}")
foreach(_blib ${Boost_LIBRARIES})
string(REGEX REPLACE ".*/lib([^/]*)\\.[^.]*$" "-l\\1" _blib ${_blib})
set(BOOST_LIBS_PKG "${BOOST_LIBS_PKG} ${_blib}")
endforeach(_blib)
option(BUILD_MANPAGES "Build manpages (might lead to problem on system without rpath" ON)
#define this target here, so that individual man pages can append to it.
add_custom_target(manpages ALL)
########################################################################
# Checks what linear algebra packages are installed #
########################################################################
find_package(MKL)
if (MKL_FOUND)
include_directories(${MKL_INCLUDE_DIRS})
set (MKL TRUE )
else()
set(MKL_LIBRARIES)
endif()
find_package(Eigen3 3.3.0 REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIR})
set(EIGEN3_PKG eigen3)
option(WITH_FFTW "Use FFTW3, disabling leads to reduced functionality!" ON)
if (WITH_FFTW)
find_package(FFTW3)
if(NOT FFTW3_FOUND)
message(FATAL_ERROR "FFTW3 not found, make sure you have also installed the fftw3 and it's dev package (it can be disable with -DWITH_FFTW=OFF)")
endif(NOT FFTW3_FOUND)
include_directories(${FFTW3_INCLUDE_DIRS})
set(FFTW3_PKG "fftw3")
else(WITH_FFTW)
#used in votca_config.h
set(NOFFTW TRUE)
set(FFTW3_PKG)
endif(WITH_FFTW)
########################################################################
# Basic system tests (standard libraries, headers, functions, types) #
########################################################################
include(CheckIncludeFile)
foreach(HEADER assert.h math.h stdio.h stdlib.h string.h)
check_include_file(${HEADER} FOUND_${HEADER})
if(NOT FOUND_${HEADER})
message(FATAL_ERROR "Could not find needed header - ${HEADER}")
endif(NOT FOUND_${HEADER})
endforeach(HEADER)
include(CheckIncludeFileCXX)
foreach(HEADER cmath fstream functional iostream limits list map ostream sstream stack stdexcept string vector)
check_include_file_cxx(${HEADER} FOUND_${HEADER})
if(NOT FOUND_${HEADER})
message(FATAL_ERROR "Could not find needed header - ${HEADER}")
endif(NOT FOUND_${HEADER})
endforeach(HEADER)
set(MATH_LIBRARIES "m" CACHE STRING "math library")
mark_as_advanced( MATH_LIBRARIES )
include(CheckLibraryExists)
foreach(FUNC sqrt)
check_library_exists(${MATH_LIBRARIES} ${FUNC} "" FOUND_${FUNC}_${MATH_LIBRARIES})
if(NOT FOUND_${FUNC}_${MATH_LIBRARIES})
message(FATAL_ERROR "Could not find needed math function - ${FUNC}")
endif(NOT FOUND_${FUNC}_${MATH_LIBRARIES})
endforeach(FUNC)
######################################
# Include the following subdirectory #
######################################
add_subdirectory(src)
add_subdirectory(include/votca/tools)
add_subdirectory(scripts)
add_subdirectory(share/man)
add_subdirectory(share/doc)
configure_file(${CMAKE_MODULE_PATH}/cmake_uninstall.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake IMMEDIATE @ONLY)
add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
include(FeatureSummary)
feature_summary(INCLUDE_QUIET_PACKAGES WHAT ALL)
endif (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
# - Try to find Eigen3 lib
#
# This module supports requiring a minimum version, e.g. you can do
# find_package(Eigen3 3.1.2)
# to require version 3.1.2 or newer of Eigen3.
#
# Once done this will define
#
# EIGEN3_FOUND - system has eigen lib with correct version
# EIGEN3_INCLUDE_DIR - the eigen include directory
# EIGEN3_VERSION - eigen version
#
# and the following imported target:
#
# Eigen3::Eigen - The header-only Eigen library
#
# This module reads hints about search locations from
# the following environment variables:
#
# EIGEN3_ROOT
# EIGEN3_ROOT_DIR
# Copyright (c) 2006, 2007 Montel Laurent, <montel@kde.org>
# Copyright (c) 2008, 2009 Gael Guennebaud, <g.gael@free.fr>
# Copyright (c) 2009 Benoit Jacob <jacob.benoit.1@gmail.com>
# Redistribution and use is allowed according to the terms of the 2-clause BSD license.
if(NOT Eigen3_FIND_VERSION)
if(NOT Eigen3_FIND_VERSION_MAJOR)
set(Eigen3_FIND_VERSION_MAJOR 2)
endif(NOT Eigen3_FIND_VERSION_MAJOR)
if(NOT Eigen3_FIND_VERSION_MINOR)
set(Eigen3_FIND_VERSION_MINOR 91)
endif(NOT Eigen3_FIND_VERSION_MINOR)
if(NOT Eigen3_FIND_VERSION_PATCH)
set(Eigen3_FIND_VERSION_PATCH 0)
endif(NOT Eigen3_FIND_VERSION_PATCH)
set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}")
endif(NOT Eigen3_FIND_VERSION)
macro(_eigen3_check_version)
file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header)
string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}")
set(EIGEN3_WORLD_VERSION "${CMAKE_MATCH_1}")
string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}")
set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}")
string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}")
set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}")
set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION})
if(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
set(EIGEN3_VERSION_OK FALSE)
else(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
set(EIGEN3_VERSION_OK TRUE)
endif(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
if(NOT EIGEN3_VERSION_OK)
message(STATUS "Eigen3 version ${EIGEN3_VERSION} found in ${EIGEN3_INCLUDE_DIR}, "
"but at least version ${Eigen3_FIND_VERSION} is required")
endif(NOT EIGEN3_VERSION_OK)
endmacro(_eigen3_check_version)
if (EIGEN3_INCLUDE_DIR)
# in cache already
_eigen3_check_version()
set(EIGEN3_FOUND ${EIGEN3_VERSION_OK})
set(Eigen3_FOUND ${EIGEN3_VERSION_OK})
else (EIGEN3_INCLUDE_DIR)
# search first if an Eigen3Config.cmake is available in the system,
# if successful this would set EIGEN3_INCLUDE_DIR and the rest of
# the script will work as usual
find_package(Eigen3 ${Eigen3_FIND_VERSION} NO_MODULE QUIET)
if(NOT EIGEN3_INCLUDE_DIR)
find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library
HINTS
ENV EIGEN3_ROOT
ENV EIGEN3_ROOT_DIR
PATHS
${CMAKE_INSTALL_PREFIX}/include
${KDE4_INCLUDE_DIR}
PATH_SUFFIXES eigen3 eigen
)
endif(NOT EIGEN3_INCLUDE_DIR)