diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/.gitmodules @@ -0,0 +1 @@ + diff --git a/.travis.yml b/.travis.yml index eda50ac0d..545ac3742 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,841 +1,1293 @@ # Copyright 2016, 2017 Peter Dimov +# Copyright 2019 Nil Foundation AG +# Copyright 2019 Mikhail Komarov # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt) +# +# This file should be used in couple of configurations: +# +# 1. Configuration for building at boostorg/multiprecision TravisCI. +# This means no actual build with CMake should be performed, only configuration. +# +# 2. Configuration for building with less CI-loaded projects. +# This means not only configuration with CMake should be performed, but also +# build and test should be executed. +# To make this script be fine for building and testing with CMake, uncommend +# copy and paste following lines before the last 'fi' at 'script' section: +# +#------------------------------------------------------------------------------# +#if [[ $TEST_SUITE == compile_fail ]]; then +# if [[ $TRAVIS_OS_NAME == linux ]]; then +# ctest --build-and-test .. . --build-generator "Unix Makefiles" --tests-regex "multiprecision_test_compile_fail_*" -j $(($(nproc) + 1)); +# elif [[ $TRAVIS_OS_NAME == osx ]]; then +# ctest --build-and-test .. . --build-generator "Unix Makefiles" --tests-regex "multiprecision_test_compile_fail_*" -j $(($(sysctl -n hw.ncpu) + 1)); +# fi +#else +# if [[ $TRAVIS_OS_NAME == linux ]]; then +# cmake --build . --target multiprecision_test_suite_$TEST_SUITE -- -j$(($(nproc) + 1)); +# elif [[ $TRAVIS_OS_NAME == osx ]]; then +# cmake --build . --target multiprecision_test_suite_$TEST_SUITE -- -j$(($(sysctl -n hw.ncpu) + 1)); +# fi +#fi +#------------------------------------------------------------------------------# language: cpp -sudo: false +sudo: true python: "2.7" -dist : xenial +dist: xenial os: - - linux - - osx + - linux + - osx branches: - only: - - master - - develop + only: + - master + - develop + - cmake-develop + - cmake-master env: - matrix: - - BOGUS_JOB=true + matrix: + - BOGUS_JOB=true matrix: - - exclude: - - env: BOGUS_JOB=true - - include: - - os: linux - env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=gnu++03 TEST_SUITE=arithmetic_tests - addons: - apt: - packages: - - g++-6 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=gnu++11 TEST_SUITE=arithmetic_tests - addons: - apt: - packages: - - g++-6 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=gnu++14 TEST_SUITE=arithmetic_tests - addons: - apt: - packages: - - g++-6 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=gnu++03 TEST_SUITE=cpp_int_tests - addons: - apt: - packages: - - g++-6 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=gnu++11 TEST_SUITE=cpp_int_tests - addons: - apt: - packages: - - g++-6 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=gnu++14 TEST_SUITE=cpp_int_tests - addons: - apt: - packages: - - g++-6 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=gnu++03 TEST_SUITE=functions_and_limits - addons: - apt: - packages: - - g++-6 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=gnu++11 TEST_SUITE=functions_and_limits - addons: - apt: - packages: - - g++-6 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=gnu++14 TEST_SUITE=functions_and_limits - addons: - apt: - packages: - - g++-6 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=gnu++03 TEST_SUITE="conversions performance" - addons: - apt: - packages: - - g++-6 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=gnu++11 TEST_SUITE="conversions performance" - addons: - apt: - packages: - - g++-6 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=gnu++14 TEST_SUITE="conversions performance" - addons: - apt: - packages: - - g++-6 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=gnu++03 TEST_SUITE=misc - addons: - apt: - packages: - - g++-6 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=gnu++11 TEST_SUITE=misc - addons: - apt: - packages: - - g++-6 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=gnu++14 TEST_SUITE=misc - addons: - apt: - packages: - - g++-6 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=gnu++03 TEST_SUITE="compile_fail examples" - addons: - apt: - packages: - - g++-6 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=gnu++11 TEST_SUITE="compile_fail examples" - addons: - apt: - packages: - - g++-6 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=gnu++14 TEST_SUITE="compile_fail examples" - addons: - apt: - packages: - - g++-6 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=gnu++03 TEST_SUITE=concepts - addons: - apt: - packages: - - g++-6 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=gnu++11 TEST_SUITE=concepts - addons: - apt: - packages: - - g++-6 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=gnu++14 TEST_SUITE=concepts - addons: - apt: - packages: - - g++-6 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++14 TEST_SUITE=arithmetic_tests - addons: - apt: - packages: - - g++-5 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++14 TEST_SUITE=cpp_int_tests - addons: - apt: - packages: - - g++-5 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++14 TEST_SUITE=functions_and_limits - addons: - apt: - packages: - - g++-5 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++14 TEST_SUITE="conversions performance" - addons: - apt: - packages: - - g++-5 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++14 TEST_SUITE=misc - addons: - apt: - packages: - - g++-5 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++14 TEST_SUITE="compile_fail examples" - addons: - apt: - packages: - - g++-5 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++14 TEST_SUITE=concepts - addons: - apt: - packages: - - g++-5 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=gnu++17 TEST_SUITE=arithmetic_tests - addons: - apt: - packages: - - g++-8 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=gnu++17 TEST_SUITE=cpp_int_tests - addons: - apt: - packages: - - g++-8 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=gnu++17 TEST_SUITE=functions_and_limits - addons: - apt: - packages: - - g++-8 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=gnu++17 TEST_SUITE="conversions performance" - addons: - apt: - packages: - - g++-8 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=gnu++17 TEST_SUITE=misc - addons: - apt: - packages: - - g++-8 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=gnu++17 TEST_SUITE="compile_fail examples" - addons: - apt: - packages: - - g++-8 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=gnu++17 TEST_SUITE=concepts - addons: - apt: - packages: - - g++-8 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-9 CXXSTD=gnu++17 TEST_SUITE=arithmetic_tests - addons: - apt: - packages: - - g++-9 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-9 CXXSTD=gnu++17 TEST_SUITE=cpp_int_tests - addons: - apt: - packages: - - g++-9 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-9 CXXSTD=gnu++17 TEST_SUITE=functions_and_limits - addons: - apt: - packages: - - g++-9 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-9 CXXSTD=gnu++17 TEST_SUITE="conversions performance" - addons: - apt: - packages: - - g++-9 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-9 CXXSTD=gnu++17 TEST_SUITE="misc include=/usr/include/eigen3" - addons: - apt: - packages: - - g++-9 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - - libeigen3-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-9 CXXSTD=gnu++17 TEST_SUITE="compile_fail examples" - addons: - apt: - packages: - - g++-9 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-9 CXXSTD=gnu++17 TEST_SUITE=concepts - addons: - apt: - packages: - - g++-9 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=clang COMPILER=clang++-9 CXXSTD=c++17 TEST_SUITE=arithmetic_tests - addons: - apt: - packages: - - clang-9 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main' - key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' - - - os: linux - env: TOOLSET=clang COMPILER=clang++-9 CXXSTD=c++17 TEST_SUITE=cpp_int_tests - addons: - apt: - packages: - - clang-9 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main' - key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' - - - os: linux - env: TOOLSET=clang COMPILER=clang++-9 CXXSTD=c++17 TEST_SUITE=functions_and_limits - addons: - apt: - packages: - - clang++-9 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main' - key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' - - - os: linux - env: TOOLSET=clang COMPILER=clang++-9 CXXSTD=c++17 TEST_SUITE="conversions performance" - addons: - apt: - packages: - - clang-9 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main' - key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' - - - os: linux - env: TOOLSET=clang COMPILER=clang++-9 CXXSTD=c++17 TEST_SUITE=misc - addons: - apt: - packages: - - clang-9 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main' - key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' - - - os: linux - env: TOOLSET=clang COMPILER=clang++-9 CXXSTD=c++17 TEST_SUITE="compile_fail examples" - addons: - apt: - packages: - - clang-9 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main' - key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' - - - os: linux - env: TOOLSET=clang COMPILER=clang++-9 CXXSTD=c++17 TEST_SUITE=concepts - addons: - apt: - packages: - - clang-9 - - libgmp-dev - - libmpfr-dev - - libmpc-dev - - libmpfi-dev - - libtommath-dev - sources: - - ubuntu-toolchain-r-test - - sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main' - key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE=arithmetic_tests - osx_image: xcode9.3 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE=cpp_int_tests - osx_image: xcode9.3 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE=functions_and_limits - osx_image: xcode9.3 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE="conversions performance" - osx_image: xcode9.3 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE=misc - osx_image: xcode9.3 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE="compile_fail examples" - osx_image: xcode9.3 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE=concepts - osx_image: xcode9.3 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE=arithmetic_tests - osx_image: xcode8.3 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE=cpp_int_tests - osx_image: xcode8.3 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE=functions_and_limits - osx_image: xcode8.3 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE="conversions performance" - osx_image: xcode8.3 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE=misc - osx_image: xcode8.3 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE="compile_fail examples" - osx_image: xcode8.3 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE=concepts - osx_image: xcode8.3 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE=arithmetic_tests - osx_image: xcode7.3 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE=cpp_int_tests - osx_image: xcode7.3 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE=functions_and_limits - osx_image: xcode7.3 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE="conversions performance" - osx_image: xcode7.3 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE=misc - osx_image: xcode7.3 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE="compile_fail examples" - osx_image: xcode7.3 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE=concepts - osx_image: xcode7.3 + exclude: + - env: BOGUS_JOB=true + + include: + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++03 TEST_SUITE=arithmetic_tests + addons: + apt: + packages: + - g++-6 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++11 TEST_SUITE=arithmetic_tests + addons: + apt: + packages: + - g++-6 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++14 TEST_SUITE=arithmetic_tests + addons: + apt: + packages: + - g++-6 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++1z TEST_SUITE=arithmetic_tests + addons: + apt: + packages: + - g++-6 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++03 TEST_SUITE=cpp_int_tests + addons: + apt: + packages: + - g++-6 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++11 TEST_SUITE=cpp_int_tests + addons: + apt: + packages: + - g++-6 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++14 TEST_SUITE=cpp_int_tests + addons: + apt: + packages: + - g++-6 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++1z TEST_SUITE=cpp_int_tests + addons: + apt: + packages: + - g++-6 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++03 TEST_SUITE=functions_and_limits + addons: + apt: + packages: + - g++-6 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++11 TEST_SUITE=functions_and_limits + addons: + apt: + packages: + - g++-6 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++14 TEST_SUITE=functions_and_limits + addons: + apt: + packages: + - g++-6 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=gnu++14 TEST_SUITE=functions_and_limits + addons: + apt: + packages: + - g++-6 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++1z TEST_SUITE=functions_and_limits + addons: + apt: + packages: + - g++-6 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++03 TEST_SUITE=conversions + addons: + apt: + packages: + - g++-6 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++11 TEST_SUITE=conversions + addons: + apt: + packages: + - g++-6 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++14 TEST_SUITE=conversions + addons: + apt: + packages: + - g++-6 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=gnu++14 TEST_SUITE=conversions + addons: + apt: + packages: + - g++-6 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++1z TEST_SUITE=conversions + addons: + apt: + packages: + - g++-6 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++03 TEST_SUITE=misc + addons: + apt: + packages: + - g++-6 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++11 TEST_SUITE=misc + addons: + apt: + packages: + - g++-6 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++14 TEST_SUITE=misc + addons: + apt: + packages: + - g++-6 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=gnu++14 TEST_SUITE=misc + addons: + apt: + packages: + - g++-6 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++1z TEST_SUITE=misc + addons: + apt: + packages: + - g++-6 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++03 TEST_SUITE="examples compile_fail" + addons: + apt: + packages: + - g++-6 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++11 TEST_SUITE="examples compile_fail" + addons: + apt: + packages: + - g++-6 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++14 TEST_SUITE="examples compile_fail" + addons: + apt: + packages: + - g++-6 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++1z TEST_SUITE="examples compile_fail" + addons: + apt: + packages: + - g++-6 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++03 TEST_SUITE=concepts + addons: + apt: + packages: + - g++-6 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++11 TEST_SUITE=concepts + addons: + apt: + packages: + - g++-6 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++14 TEST_SUITE=concepts + addons: + apt: + packages: + - g++-6 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++1z TEST_SUITE=concepts + addons: + apt: + packages: + - g++-6 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++14 TEST_SUITE=arithmetic_tests + addons: + apt: + packages: + - g++-5 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++14 TEST_SUITE=cpp_int_tests + addons: + apt: + packages: + - g++-5 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++14 TEST_SUITE=functions_and_limits + addons: + apt: + packages: + - g++-5 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++14 TEST_SUITE=conversions + addons: + apt: + packages: + - g++-5 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++14 TEST_SUITE=misc + addons: + apt: + packages: + - g++-5 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++14 TEST_SUITE="compile_fail examples" + addons: + apt: + packages: + - g++-5 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++14 TEST_SUITE=concepts + addons: + apt: + packages: + - g++-5 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=c++03 TEST_SUITE=arithmetic_tests + addons: + apt: + packages: + - g++-8 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=c++11 TEST_SUITE=arithmetic_tests + addons: + apt: + packages: + - g++-8 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=c++14 TEST_SUITE=arithmetic_tests + addons: + apt: + packages: + - g++-8 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=c++17 TEST_SUITE=arithmetic_tests + addons: + apt: + packages: + - g++-8 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=c++03 TEST_SUITE=cpp_int_tests + addons: + apt: + packages: + - g++-8 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=c++11 TEST_SUITE=cpp_int_tests + addons: + apt: + packages: + - g++-8 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=c++14 TEST_SUITE=cpp_int_tests + addons: + apt: + packages: + - g++-8 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=c++17 TEST_SUITE=cpp_int_tests + addons: + apt: + packages: + - g++-8 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=c++03 TEST_SUITE=functions_and_limits + addons: + apt: + packages: + - g++-8 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=c++11 TEST_SUITE=functions_and_limits + addons: + apt: + packages: + - g++-8 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=c++14 TEST_SUITE=functions_and_limits + addons: + apt: + packages: + - g++-8 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=gnu++14 TEST_SUITE=functions_and_limits + addons: + apt: + packages: + - g++-8 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=c++17 TEST_SUITE=functions_and_limits + addons: + apt: + packages: + - g++-8 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=c++03 TEST_SUITE=conversions + addons: + apt: + packages: + - g++-8 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=c++11 TEST_SUITE=conversions + addons: + apt: + packages: + - g++-8 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=c++14 TEST_SUITE=conversions + addons: + apt: + packages: + - g++-8 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=gnu++14 TEST_SUITE=conversions + addons: + apt: + packages: + - g++-8 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=c++17 TEST_SUITE=conversions + addons: + apt: + packages: + - g++-8 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=c++03 TEST_SUITE=misc + addons: + apt: + packages: + - g++-8 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=c++11 TEST_SUITE=misc + addons: + apt: + packages: + - g++-8 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=c++14 TEST_SUITE=misc + addons: + apt: + packages: + - g++-8 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=gnu++14 TEST_SUITE=misc + addons: + apt: + packages: + - g++-8 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=c++17 TEST_SUITE=misc + addons: + apt: + packages: + - g++-8 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=c++03 TEST_SUITE="compile_fail examples" + addons: + apt: + packages: + - g++-8 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=c++11 TEST_SUITE="compile_fail examples" + addons: + apt: + packages: + - g++-8 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=c++14 TEST_SUITE="compile_fail examples" + addons: + apt: + packages: + - g++-8 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=c++17 TEST_SUITE="compile_fail examples" + addons: + apt: + packages: + - g++-8 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=c++03 TEST_SUITE=concepts + addons: + apt: + packages: + - g++-8 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=c++11 TEST_SUITE=concepts + addons: + apt: + packages: + - g++-8 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=c++14 TEST_SUITE=concepts + addons: + apt: + packages: + - g++-8 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: linux + env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=c++17 TEST_SUITE=concepts + addons: + apt: + packages: + - g++-8 + - cmake + - libgmp-dev + - libmpfr-dev + - libmpc-dev + - libmpfi-dev + - libtommath-dev + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-8 + + - os: osx + env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE=arithmetic_tests + osx_image: xcode9.3 + + - os: osx + env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE=cpp_int_tests + osx_image: xcode9.3 + + - os: osx + env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE=functions_and_limits + osx_image: xcode9.3 + + - os: osx + env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE=conversions + osx_image: xcode9.3 + + - os: osx + env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE=misc + osx_image: xcode9.3 + + - os: osx + env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE="compile_fail examples" + osx_image: xcode9.3 + + - os: osx + env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE=concepts + osx_image: xcode9.3 + + - os: osx + env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE=arithmetic_tests + osx_image: xcode8.3 + + - os: osx + env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE=cpp_int_tests + osx_image: xcode8.3 + + - os: osx + env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE=functions_and_limits + osx_image: xcode8.3 + + - os: osx + env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE=conversions + osx_image: xcode8.3 + + - os: osx + env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE=misc + osx_image: xcode8.3 + + - os: osx + env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE="compile_fail examples" + osx_image: xcode8.3 + + - os: osx + env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE=concepts + osx_image: xcode8.3 + + - os: osx + env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE=arithmetic_tests + osx_image: xcode7.3 + + - os: osx + env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE=cpp_int_tests + osx_image: xcode7.3 + + - os: osx + env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE=functions_and_limits + osx_image: xcode7.3 + + - os: osx + env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE=conversions + osx_image: xcode7.3 + + - os: osx + env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE=misc + osx_image: xcode7.3 + + - os: osx + env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE="compile_fail examples" + osx_image: xcode7.3 + + - os: osx + env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 TEST_SUITE=concepts + osx_image: xcode7.3 install: - - cd .. - - git clone -b $TRAVIS_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root - - cd boost-root - - git submodule update --init tools/build - - git submodule update --init libs/config - - git submodule update --init libs/polygon - - git submodule update --init tools/boost_install - - git submodule update --init libs/headers - - git submodule update --init tools/boostdep - - cp -r $TRAVIS_BUILD_DIR/* libs/multiprecision - - python tools/boostdep/depinst/depinst.py multiprecision - - ./bootstrap.sh - - ./b2 headers + - cd .. + - if [[ $TRAVIS_BRANCH == master || $TRAVIS_BRANCH == cmake-master ]]; then + git clone -b master --depth 1 https://github.com/boostorg/boost.git boost-root; + elif [[ $TRAVIS_BRANCH == develop || $TRAVIS_BRANCH == cmake-develop ]]; then + git clone -b develop --depth 1 https://github.com/boostorg/boost.git boost-root; + else + git clone -b develop --depth 1 https://github.com/boostorg/boost.git boost-root; + fi + - cd boost-root + - git submodule update --init tools/build + - git submodule update --init libs/config + - git submodule update --init tools/boost_install + - git submodule update --init libs/headers + - git submodule update --init tools/boostdep + - cp -r $TRAVIS_BUILD_DIR/* libs/multiprecision + - python tools/boostdep/depinst/depinst.py multiprecision + - ./bootstrap.sh + - ./b2 headers script: - - |- - echo "using $TOOLSET : : $COMPILER : -std=$CXXSTD ;" > ~/user-config.jam - - (cd libs/config/test && ../../../b2 config_info_travis_install toolset=$TOOLSET && ./config_info_travis) - - (cd libs/multiprecision/test && ../../../b2 -j3 toolset=$TOOLSET $TEST_SUITE define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER) + - |- + echo "using $TOOLSET : : $COMPILER : -std=$CXXSTD ;" > ~/user-config.jam + - if [[ $TRAVIS_OS_NAME == linux ]]; then + proc=$(($(nproc) + 1)); + elif [[ $TRAVIS_OS_NAME == osx ]]; then + proc=$(($(sysctl -n hw.ncpu) + 1)); + fi; + - (cd libs/config/test && ../../../b2 config_info_travis_install toolset=$TOOLSET && ./config_info_travis); + - (cd libs/multiprecision/test && ../../../b2 -j$proc toolset=$TOOLSET $TEST_SUITE define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER); + - sudo ./b2 -j$proc install; + - cd $TRAVIS_BUILD_DIR && mkdir cmake-build && cd cmake-build; + - if [[ $(echo $CXXSTD | sed 's/[^0-9]*//g') == 03 ]]; then + CXXSTD=c++98; + fi; + - if [[ $CXXSTD == c++1z ]]; then + CXXSTD=c++17; + fi; + - cmake -DBUILD_TESTS=TRUE -DCMAKE_CXX_STANDARD=$(echo $CXXSTD | sed 's/[^0-9]*//g') -DBUILD_WITH_CI_KNOWN_ISSUES_SUPPRESS=TRUE ..; notifications: - email: - on_success: always + email: + on_success: always diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..59342f31d --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,92 @@ +#---------------------------------------------------------------------------# +# Copyright (c) 2018-2019 Nil Foundation AG +# Copyright (c) 2018-2019 Mikhail Komarov +# Copyright (c) 2018-2019 Alexey Moskvin +# +# Distributed under the Boost Software License, Version 1.0 +# See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt +#---------------------------------------------------------------------------# + +cmake_minimum_required(VERSION 3.5) + +set(BOOST_CMAKE FALSE) + +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake" + "${CMAKE_CURRENT_LIST_DIR}/cmake/packages" + "${CMAKE_CURRENT_LIST_DIR}/cmake/modules/share/modules/cmake") + +include(CMDeploy) +include(CMConfig) +include(CMSetupVersion) + +cm_setup_version(VERSION 1.73.0) + +option(BUILD_WITH_CI_KNOWN_ISSUES_SUPPRESS "Build for CI suppressing known issues" FALSE) +option(BUILD_TESTS "Build unit tests" FALSE) + +if(BUILD_WITH_CI_KNOWN_ISSUES_SUPPRESS) + add_definitions(-DCI_SUPPRESS_KNOWN_ISSUES) +endif() + +if("${CMAKE_WORKSPACE_NAME}" STREQUAL "boost") + set(BOOST_CMAKE TRUE) + + cm_project(multiprecision WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME}) + + find_package(${CMAKE_WORKSPACE_NAME}_core) + find_package(${CMAKE_WORKSPACE_NAME}_static_assert) + find_package(${CMAKE_WORKSPACE_NAME}_predef) + find_package(${CMAKE_WORKSPACE_NAME}_mpl) + find_package(${CMAKE_WORKSPACE_NAME}_random) + find_package(${CMAKE_WORKSPACE_NAME}_functional) + find_package(${CMAKE_WORKSPACE_NAME}_assert) + find_package(${CMAKE_WORKSPACE_NAME}_type_traits) + find_package(${CMAKE_WORKSPACE_NAME}_smart_ptr) + find_package(${CMAKE_WORKSPACE_NAME}_rational) + find_package(${CMAKE_WORKSPACE_NAME}_lexical_cast) + find_package(${CMAKE_WORKSPACE_NAME}_integer) + find_package(${CMAKE_WORKSPACE_NAME}_array) + find_package(${CMAKE_WORKSPACE_NAME}_config) + find_package(${CMAKE_WORKSPACE_NAME}_throw_exception) + find_package(${CMAKE_WORKSPACE_NAME}_math) + + add_library(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE) + set_property(TARGET ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} PROPERTY EXPORT_NAME ${CURRENT_PROJECT_NAME}) + + target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE ${CMAKE_WORKSPACE_NAME}::core) + target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE ${CMAKE_WORKSPACE_NAME}::static_assert) + target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE ${CMAKE_WORKSPACE_NAME}::predef) + target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE ${CMAKE_WORKSPACE_NAME}::mpl) + target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE ${CMAKE_WORKSPACE_NAME}::random) + target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE ${CMAKE_WORKSPACE_NAME}::functional) + target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE ${CMAKE_WORKSPACE_NAME}::assert) + target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE ${CMAKE_WORKSPACE_NAME}::type_traits) + target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE ${CMAKE_WORKSPACE_NAME}::smart_ptr) + target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE ${CMAKE_WORKSPACE_NAME}::rational) + target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE ${CMAKE_WORKSPACE_NAME}::lexical_cast) + target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE ${CMAKE_WORKSPACE_NAME}::integer) + target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE ${CMAKE_WORKSPACE_NAME}::array) + target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE ${CMAKE_WORKSPACE_NAME}::config) + target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE ${CMAKE_WORKSPACE_NAME}::throw_exception) + target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE ${CMAKE_WORKSPACE_NAME}::math) +else() + cm_workspace(boost SOURCES_DIR "${CMAKE_CURRENT_LIST_DIR}") + + cm_project(multiprecision WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME}) + + find_package(Boost COMPONENTS REQUIRED random) + + add_library(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE) + set_property(TARGET ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} PROPERTY EXPORT_NAME ${CURRENT_PROJECT_NAME}) + + target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE ${Boost_LIBRARIES}) +endif() + +cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} + INCLUDE ${CURRENT_SOURCES_DIR}/include + NAMESPACE ${CMAKE_WORKSPACE_NAME}::) + +if(BUILD_TESTS) + add_subdirectory(test) +endif() diff --git a/README.md b/README.md index 9d7d0b1b8..4068d115f 100644 --- a/README.md +++ b/README.md @@ -48,4 +48,3 @@ You can either run all the tests listed in `Jamfile.v2` or run a single test: ../../../b2 <- run all tests ../../../b2 test_complex <- single test - diff --git a/appveyor.yml b/appveyor.yml index a2ce9b2bf..8a17036c5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,7 @@ # Copyright 2016 Peter Dimov +# Copyright 2019 Aleksey Moskvin +# Copyright 2019 Mikhail Komarov +# Copyright 2019 Nil Foundation AG # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt) @@ -10,69 +13,112 @@ branches: only: - master - develop + - cmake-develop platform: - x64 +os: unstable + environment: matrix: - - ARGS: --toolset=msvc-9.0 address-model=32 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + ARGS: --toolset=msvc-14.2 address-model=64 cxxstd=17 TARGETS: arithmetic_tests cpp_int_tests functions_and_limits - - ARGS: --toolset=msvc-9.0 address-model=32 - TARGETS: conversions misc compile_fail examples concepts - - ARGS: --toolset=msvc-10.0 address-model=32 + TARGETS_CMAKE: multiprecision_test_suite_arithmetic_tests multiprecision_test_suite_cpp_int_tests multiprecision_test_suite_functions_and_limits + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + ARGS: --toolset=msvc-14.2 address-model=64 cxxstd=17 TARGETS: arithmetic_tests cpp_int_tests functions_and_limits - - ARGS: --toolset=msvc-10.0 address-model=32 - TARGETS: conversions misc compile_fail examples concepts - - ARGS: --toolset=msvc-11.0 address-model=32 + TARGETS_CMAKE: multiprecision_test_suite_conversions multiprecision_test_suite_misc multiprecision_test_suite_compile_fail multiprecision_test_suite_examples multiprecision_test_suite_concepts + + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARGS: --toolset=msvc-14.1 address-model=64 cxxstd=17 TARGETS: arithmetic_tests cpp_int_tests functions_and_limits - - ARGS: --toolset=msvc-11.0 address-model=32 - TARGETS: conversions misc compile_fail examples concepts - - ARGS: --toolset=msvc-12.0 address-model=32 + TARGETS_CMAKE: multiprecision_test_suite_arithmetic_tests multiprecision_test_suite_cpp_int_tests multiprecision_test_suite_functions_and_limits + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARGS: --toolset=msvc-14.1 address-model=64 cxxstd=17 + TARGETS: arithmetic_tests cpp_int_tests functions_and_limits + TARGETS_CMAKE: multiprecision_test_suite_conversions multiprecision_test_suite_misc multiprecision_test_suite_compile_fail multiprecision_test_suite_examples multiprecision_test_suite_concepts + + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARGS: --toolset=msvc-14.0 address-model=64 cxxstd=17 + TARGETS: arithmetic_tests cpp_int_tests functions_and_limits + TARGETS_CMAKE: multiprecision_test_suite_arithmetic_tests multiprecision_test_suite_cpp_int_tests multiprecision_test_suite_functions_and_limits + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + ARGS: --toolset=msvc-14.0 address-model=64 cxxstd=17 TARGETS: arithmetic_tests cpp_int_tests functions_and_limits - - ARGS: --toolset=msvc-12.0 address-model=32 + TARGETS_CMAKE: multiprecision_test_suite_conversions multiprecision_test_suite_misc multiprecision_test_suite_compile_fail multiprecision_test_suite_examples multiprecision_test_suite_concepts + + - ARGS: --toolset=msvc-10.0 address-model=32 + TARGETS: arithmetic_tests cpp_int_tests functions_and_limits + TARGETS_CMAKE: multiprecision_test_suite_arithmetic_tests multiprecision_test_suite_cpp_int_tests multiprecision_test_suite_functions_and_limits + - ARGS: --toolset=msvc-10.0 address-model=32 TARGETS: conversions misc compile_fail examples concepts - - ARGS: --toolset=msvc-14.0 address-model=32 + TARGETS_CMAKE: multiprecision_test_suite_conversions multiprecision_test_suite_misc multiprecision_test_suite_compile_fail multiprecision_test_suite_examples multiprecision_test_suite_concepts + + - ARGS: --toolset=msvc-11.0 address-model=32 TARGETS: arithmetic_tests cpp_int_tests functions_and_limits - - ARGS: --toolset=msvc-14.0 address-model=32 + TARGETS_CMAKE: multiprecision_test_suite_arithmetic_tests multiprecision_test_suite_cpp_int_tests multiprecision_test_suite_functions_and_limits + - ARGS: --toolset=msvc-11.0 address-model=32 TARGETS: conversions misc compile_fail examples concepts - - ARGS: --toolset=msvc-12.0 address-model=64 + TARGETS_CMAKE: multiprecision_test_suite_conversions multiprecision_test_suite_misc multiprecision_test_suite_compile_fail multiprecision_test_suite_examples multiprecision_test_suite_concepts + + - ARGS: --toolset=msvc-12.0 address-model=32 TARGETS: arithmetic_tests cpp_int_tests functions_and_limits - - ARGS: --toolset=msvc-12.0 address-model=64 + TARGETS_CMAKE: multiprecision_test_suite_arithmetic_tests multiprecision_test_suite_cpp_int_tests multiprecision_test_suite_functions_and_limits + - ARGS: --toolset=msvc-12.0 address-model=32 TARGETS: conversions misc compile_fail examples concepts - - ARGS: --toolset=msvc-14.0 address-model=64 + TARGETS_CMAKE: multiprecision_test_suite_conversions multiprecision_test_suite_misc multiprecision_test_suite_compile_fail multiprecision_test_suite_examples multiprecision_test_suite_concepts + + - ARGS: --toolset=msvc-14.0 address-model=32 TARGETS: arithmetic_tests cpp_int_tests functions_and_limits - - ARGS: --toolset=msvc-14.0 address-model=64 + TARGETS_CMAKE: multiprecision_test_suite_arithmetic_tests multiprecision_test_suite_cpp_int_tests multiprecision_test_suite_functions_and_limits + - ARGS: --toolset=msvc-14.0 address-model=32 TARGETS: conversions misc compile_fail examples concepts - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 - ARGS: --toolset=msvc-14.2 address-model=64 cxxstd=17 + TARGETS_CMAKE: multiprecision_test_suite_conversions multiprecision_test_suite_misc multiprecision_test_suite_compile_fail multiprecision_test_suite_examples multiprecision_test_suite_concepts + + - ARGS: --toolset=msvc-12.0 address-model=64 TARGETS: arithmetic_tests cpp_int_tests functions_and_limits - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 - ARGS: --toolset=msvc-14.2 address-model=64 cxxstd=17 + TARGETS_CMAKE: multiprecision_test_suite_arithmetic_tests multiprecision_test_suite_cpp_int_tests multiprecision_test_suite_functions_and_limits + - ARGS: --toolset=msvc-12.0 address-model=64 TARGETS: conversions misc compile_fail examples concepts - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 - ARGS: --toolset=msvc-14.2 address-model=32 cxxstd=17 + TARGETS_CMAKE: multiprecision_test_suite_conversions multiprecision_test_suite_misc multiprecision_test_suite_compile_fail multiprecision_test_suite_examples multiprecision_test_suite_concepts + + - ARGS: --toolset=msvc-14.0 address-model=64 TARGETS: arithmetic_tests cpp_int_tests functions_and_limits - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 - ARGS: --toolset=msvc-14.2 address-model=32 cxxstd=17 + TARGETS_CMAKE: multiprecision_test_suite_arithmetic_tests multiprecision_test_suite_cpp_int_tests multiprecision_test_suite_functions_and_limits + - ARGS: --toolset=msvc-14.0 address-model=64 TARGETS: conversions misc compile_fail examples concepts - - ARGS: --toolset=gcc address-model=64 + TARGETS_CMAKE: multiprecision_test_suite_conversions multiprecision_test_suite_misc multiprecision_test_suite_compile_fail multiprecision_test_suite_examples multiprecision_test_suite_concepts + + - ARGS: --toolset=gcc address-model=64 TARGETS: arithmetic_tests cpp_int_tests functions_and_limits PATH: C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;%PATH% - - ARGS: --toolset=gcc address-model=64 + TARGETS_CMAKE: multiprecision_test_suite_arithmetic_tests multiprecision_test_suite_cpp_int_tests multiprecision_test_suite_functions_and_limits + + - ARGS: --toolset=gcc address-model=64 TARGETS: conversions misc compile_fail examples concepts PATH: C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;%PATH% - - ARGS: --toolset=gcc address-model=64 cxxstd=2a cxxstd-dialect=gnu + TARGETS_CMAKE: multiprecision_test_suite_conversions multiprecision_test_suite_misc multiprecision_test_suite_compile_fail multiprecision_test_suite_examples multiprecision_test_suite_concepts + + - ARGS: --toolset=gcc address-model=64 cxxstd=2a cxxstd-dialect=gnu TARGETS: arithmetic_tests cpp_int_tests functions_and_limits PATH: C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;%PATH% - - ARGS: --toolset=gcc address-model=64 cxxstd=2a cxxstd-dialect=gnu + TARGETS_CMAKE: multiprecision_test_suite_arithmetic_tests multiprecision_test_suite_cpp_int_tests multiprecision_test_suite_functions_and_limits + + - ARGS: --toolset=gcc address-model=64 cxxstd=2a cxxstd-dialect=gnu TARGETS: conversions misc compile_fail examples concepts PATH: C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;%PATH% + TARGETS_CMAKE: multiprecision_test_suite_conversions multiprecision_test_suite_misc multiprecision_test_suite_compile_fail multiprecision_test_suite_examples multiprecision_test_suite_concepts install: - cd .. - - git clone -b %APPVEYOR_REPO_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root + - if not %APPVEYOR_REPO_BRANCH% == "master" if not %APPVEYOR_REPO_BRANCH% == "develop" ( + git clone -b develop --depth 1 https://github.com/boostorg/boost.git boost-root + ) Else ( + git clone -b %APPVEYOR_REPO_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root + ) - cd boost-root - git submodule update --init tools/build - git submodule update --init tools/boost_install @@ -82,8 +128,9 @@ install: - xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\multiprecision - git submodule update --init tools/boostdep - python tools/boostdep/depinst/depinst.py multiprecision - - bootstrap + - bootstrap.bat - b2 headers + - b2 install build: off @@ -93,3 +140,10 @@ test_script: - config_info_travis - cd ..\..\multiprecision\test - ..\..\..\b2 --hash -j3 %ARGS% %TARGETS% define=CI_SUPPRESS_KNOWN_ISSUES + + - cd .. + - for /f %%a in ('dir /b C:\Boost\lib\cmake\Boost-*') do (set boost_dir=C:\Boost\lib\cmake\%%a) + - mkdir cmake-build + - cd cmake-build + - cmake -DBoost_DIR=%boost_dir% -DBUILD_TESTS=TRUE -DCMAKE_CXX_STANDARD=14 -DBUILD_WITH_CI_KNOWN_ISSUES_SUPPRESS=TRUE -DBUILD_SHARED_LIBS=TRUE -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE --build .. +# - cmake --build C:/projects/boost-root/libs/multiprecision/cmake-build --target %TARGETS_CMAKE% \ No newline at end of file diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt new file mode 100644 index 000000000..f47038912 --- /dev/null +++ b/cmake/modules/CMakeLists.txt @@ -0,0 +1,16 @@ +#---------------------------------------------------------------------------# +# Copyright (c) 2018-2019 Nil Foundation AG +# Copyright (c) 2018-2019 Mikhail Komarov +# +# Distributed under the Boost Software License, Version 1.0 +# See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt +#---------------------------------------------------------------------------# + +cmake_minimum_required (VERSION 3.5) + +install(DIRECTORY share/modules/cmake DESTINATION cm) + +enable_testing() +add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C ${CMAKE_CFG_INTDIR}) +add_subdirectory(test) diff --git a/cmake/modules/share/modules/cmake/CMConfig.cmake b/cmake/modules/share/modules/cmake/CMConfig.cmake new file mode 100644 index 000000000..fc6659094 --- /dev/null +++ b/cmake/modules/share/modules/cmake/CMConfig.cmake @@ -0,0 +1,203 @@ +#---------------------------------------------------------------------------# +# Copyright (c) 2018-2019 Nil Foundation AG +# Copyright (c) 2018-2019 Mikhail Komarov +# +# Distributed under the Boost Software License, Version 1.0 +# See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt +#---------------------------------------------------------------------------# + +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) +include(CMFuture) +enable_testing() + +function(contains_path FILEPATH SUBPATH RESULT) + file(RELATIVE_PATH PATH "${SUBPATH}" "${FILEPATH}") + if(${PATH} MATCHES "\\.\\./") + set(${RESULT} FALSE PARENT_SCOPE) + else() + set(${RESULT} TRUE PARENT_SCOPE) + endif() +endfunction() + +function(add_subdirectories INPUT_DIRECTORY) + set(options) + set(oneValueArgs SUBMODULE_DEFINITION_HEADER) + set(multiValueArgs EXCLUDE_DIRS EXCLUDE_LIBS) + + set(INCLUDED_DIRS) + set(INCLUDED_LIBS) + + cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + file(GLOB_RECURSE LIBS ${INPUT_DIRECTORY}/*CMakeLists.txt) + + if(PARSE_EXCLUDE_DIRS) + set(EXCLUDED_DIRS) + + foreach(ITERATOR ${LIBS}) + foreach(DIR_ITERATOR IN LISTS PARSE_EXCLUDE_DIRS) + contains_path(${ITERATOR} ${DIR_ITERATOR} CONTAINS) + if(${CONTAINS}) + list(APPEND EXCLUDED_DIRS ${ITERATOR}) + endif() + endforeach() + endforeach() + + list(REMOVE_ITEM LIBS ${EXCLUDED_DIRS}) + endif() + + foreach(lib ${LIBS}) + file(READ ${lib} CONTENT) + if(PARSE_SUBMODULE_DEFINITION_HEADER) + if("${CONTENT}" MATCHES ${PARSE_SUBMODULE_DEFINITION_HEADER}) + get_filename_component(LIB_DIR ${lib} DIRECTORY) + get_filename_component(LIB_NAME ${LIB_DIR} NAME) + if(PARSE_EXCLUDE_LIBS OR PARSE_EXCLUDE_DIRS) + if(NOT "${LIB_NAME}" IN_LIST PARSE_EXCLUDE_LIBS AND NOT "${LIB_DIR}" IN_LIST PARSE_EXCLUDE_DIRS) + list(APPEND INCLUDED_LIBS ${LIB_NAME}) + list(APPEND INCLUDED_DIRS ${LIB_DIR}) + add_subdirectory(${LIB_DIR}) + endif() + else() + list(APPEND INCLUDED_LIBS ${LIB_NAME}) + list(APPEND INCLUDED_DIRS ${LIB_DIR}) + add_subdirectory(${LIB_DIR}) + endif() + endif() + else() + get_filename_component(LIB_DIR ${lib} DIRECTORY) + get_filename_component(LIB_NAME ${LIB_DIR} NAME) + if(PARSE_EXCLUDE_LIBS OR PARSE_EXCLUDE_DIRS) + if(NOT "${LIB_NAME}" IN_LIST PARSE_EXCLUDE_LIBS AND NOT "${LIB_DIR}" IN_LIST PARSE_EXCLUDE_DIRS) + list(APPEND INCLUDED_LIBS ${LIB_NAME} PARENT_SCOPE) + list(APPEND INCLUDED_DIRS ${LIB_DIR} PARENT_SCOPE) + add_subdirectory(${LIB_DIR}) + endif() + else() + + list(APPEND INCLUDED_LIBS ${LIB_NAME} PARENT_SCOPE) + list(APPEND INCLUDED_DIRS ${LIB_DIR} PARENT_SCOPE) + add_subdirectory(${LIB_DIR}) + endif() + endif() + endforeach() + + set(INCLUDED_DIRS ${INCLUDED_DIRS} PARENT_SCOPE) + set(INCLUDED_LIBS ${INCLUDED_LIBS} PARENT_SCOPE) +endfunction() + +function(cm_project INPUT_PROJECT_NAME) + set(options) + set(oneValueArgs DESCRIPTION VERSION WORKSPACE_NAME) + set(multiValueArgs LANGUAGES) + + cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + if(PARSE_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "Unknown keywords given to workspace(): \"${PARSE_UNPARSED_ARGUMENTS}\"") + endif() + + if(PARSE_WORKSPACE_NAME) + if(PARSE_VERSION AND PARSE_LANGUAGES AND PARSE_DESCRIPTION) + project(${INPUT_WORKSPACE_NAME}_${INPUT_PROJECT_NAME} + VERSION ${PARSE_VERSION} + DESCRIPTION ${PARSE_DESCRIPTION} + LANGUAGES ${PARSE_LANGUAGES}) + elseif(PARSE_LANGUAGES) + project(${INPUT_WORKSPACE_NAME}_${INPUT_PROJECT_NAME} ${PARSE_LANGUAGES}) + else() + project(${INPUT_WORKSPACE_NAME}_${INPUT_PROJECT_NAME}) + endif() + endif() + + set(CURRENT_PROJECT_NAME ${INPUT_PROJECT_NAME} PARENT_SCOPE) + set(CMAKE_PROJECT_NAME ${CMAKE_PROJECT_NAME} PARENT_SCOPE) + set(PROJECT_NAME ${INPUT_PROJECT_NAME} PARENT_SCOPE) + + string(TOUPPER ${INPUT_PROJECT_NAME} UPPER_PROJECT_NAME) + set(CURRENT_UPPER_PROJECT_NAME ${UPPER_PROJECT_NAME} PARENT_SCOPE) + + if(PARSE_WORKSPACE_NAME) + file(RELATIVE_PATH RELATIVE_DIR ${CMAKE_WORKSPACE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) + + set(CURRENT_SOURCES_DIR ${CMAKE_WORKSPACE_SOURCES_DIR}/${RELATIVE_DIR} PARENT_SCOPE) + set(CURRENT_TEST_SOURCES_DIR ${CMAKE_WORKSPACE_SOURCES_DIR}/${RELATIVE_DIR}/test PARENT_SCOPE) + endif() +endfunction() + +function(cm_workspace WORKSPACE_NAME) + set(options) + set(oneValueArgs DESCRIPTION VERSION SOURCES_DIR) + set(multiValueArgs LANGUAGES) + + cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + if(PARSE_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "Unknown keywords given to workspace(): \"${PARSE_UNPARSED_ARGUMENTS}\"") + endif() + + project(${WORKSPACE_NAME} ${PARSE_VERSION} ${PARSE_DESCRIPTION} ${PARSE_LANGUAGES}) + set(PROJECT_NAME ${WORKSPACE_NAME} PARENT_SCOPE) + set(CMAKE_PROJECT_NAME ${WORKSPACE_NAME} PARENT_SCOPE) + set(CMAKE_WORKSPACE_NAME ${WORKSPACE_NAME} PARENT_SCOPE) + set(CMAKE_WORKSPACE_LIST ${CMAKE_WORKSPACE_LIST} ${CMAKE_WORKSPACE_NAME} PARENT_SCOPE) + set(CMAKE_WORKSPACE_DIR ${CMAKE_CURRENT_SOURCE_DIR} PARENT_SCOPE) + string(TOUPPER ${WORKSPACE_NAME} UPPER_WORKSPACE_NAME) + set(CMAKE_UPPER_WORKSPACE_NAME ${UPPER_WORKSPACE_NAME} PARENT_SCOPE) + + if(PARSE_SOURCES_DIR) + set(CMAKE_WORKSPACE_SOURCES_DIR ${PARSE_SOURCES_DIR} PARENT_SCOPE) + endif() +endfunction() + +function(patch_file INPUT_SOURCE INPUT_PATCH OUTPUT_DIRECTORY) + set(options) + set(oneValueArgs PREFIX_PATCH_NAME POSTFIX_PATCH_NAME) + set(multiValueArgs) + + cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + find_package(Patch) + if(NOT Patch_FOUND) + message("Patch utulity is not found") + endif() + string(REPLACE ${CURRENT_TEST_SOURCES_DIR} ${CMAKE_CURRENT_BINARY_DIR} OUTPUT_FILE ${INPUT_SOURCE}) + file(COPY ${INPUT_SOURCE} DESTINATION ${OUTPUT_DIRECTORY}) + get_filename_component(SOURCE_FILE_NAME ${INPUT_SOURCE} NAME) + set(NEW_SOURCE_FILE_NAME ${PARSE_PREFIX_PATCH_NAME}${SOURCE_FILE_NAME}) + if(PARSE_POSTFIX_PATCH_NAME) + string(REPLACE . ${PARSE_POSTFIX_PATCH_NAME}. NEW_SOURCE_FILE_NAME ${NEW_SOURCE_FILE_NAME}) + endif() + file(RENAME ${OUTPUT_DIRECTORY}/${SOURCE_FILE_NAME} ${OUTPUT_DIRECTORY}/${NEW_SOURCE_FILE_NAME}) + execute_process(COMMAND patch ${OUTPUT_DIRECTORY}/${NEW_SOURCE_FILE_NAME} ${INPUT_PATCH} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +endfunction() + +function(patch_directory SOURCES_DIRECTORY PATCHES_DIRECTORY OUTPUT_DIRECTORY) + set(options) + set(oneValueArgs PREFIX_PATCH_NAME POSTFIX_PATCH_NAME) + set(multiValueArgs) + + cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + find_package(Patch) + if(NOT Patch_FOUND) + message("Patch utulity is not found") + endif() + file(GLOB_RECURSE PATCHES_FILES LIST_DIRECTORIES FALSE ${PATCHES_DIRECTORY}/*.patch) + file(GLOB_RECURSE SOURCES_FILES LIST_DIRECTORIES FALSE ${SOURCES_DIRECTORY}/*) + foreach(PATCH_FILE IN LISTS PATCHES_FILES) + string(REPLACE ".patch" "" SOURCE_FILE_NAME ${PATCH_FILE}) + string(REPLACE ${PATCHES_DIRECTORY} ${SOURCES_DIRECTORY} SOURCE_FILE_NAME ${SOURCE_FILE_NAME}) + list(FIND SOURCES_FILES ${SOURCE_FILE_NAME} SOURCES_FILE_FIND) + if(${SOURCES_FILE_FIND} EQUAL -1) + message(FATAL_ERROR "Source file for patch is not found: " ${PATCH_FILE}) + endif() + list(GET SOURCES_FILES ${SOURCES_FILE_FIND} SOURCE_FILE) + string(REPLACE ${SOURCES_DIRECTORY} ${OUTPUT_DIRECTORY} OUTPUT_FILE_DIRECTORY ${SOURCE_FILE}) + get_filename_component(OUTPUT_FILE_DIRECTORY ${OUTPUT_FILE_DIRECTORY} DIRECTORY) + patch_file(${SOURCE_FILE} ${PATCH_FILE} ${OUTPUT_FILE_DIRECTORY} + PREFIX_PATCH_NAME ${PARSE_PREFIX_PATCH_NAME} POSTFIX_PATCH_NAME ${PARSE_POSTFIX_PATCH_NAME}) + endforeach() +endfunction() diff --git a/cmake/modules/share/modules/cmake/CMDeploy.cmake b/cmake/modules/share/modules/cmake/CMDeploy.cmake new file mode 100644 index 000000000..7976b782d --- /dev/null +++ b/cmake/modules/share/modules/cmake/CMDeploy.cmake @@ -0,0 +1,50 @@ +#---------------------------------------------------------------------------# +# Copyright (c) 2018-2019 Nil Foundation AG +# Copyright (c) 2018-2019 Mikhail Komarov +# +# Distributed under the Boost Software License, Version 1.0 +# See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt +#---------------------------------------------------------------------------# + +include(CMPkgConfig) +include(CMInstallTargets) +include(CMExport) + +function(cm_deploy) + set(options SKIP_HEADER_INSTALL) + set(oneValueArgs NAMESPACE COMPATIBILITY) + set(multiValueArgs TARGETS INCLUDE) + + cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + if(PARSE_SKIP_HEADER_INSTALL) + cm_install_targets(TARGETS ${PARSE_TARGETS} INCLUDE ${PARSE_INCLUDE} SKIP_HEADER_INSTALL) + else() + cm_install_targets(TARGETS ${PARSE_TARGETS} INCLUDE ${PARSE_INCLUDE} ) + endif() + + cm_auto_pkgconfig(TARGET ${PARSE_TARGETS}) + cm_auto_export(TARGETS ${PARSE_TARGETS} NAMESPACE ${PARSE_NAMESPACE} COMPATIBILITY ${PARSE_COMPATIBILITY}) + + foreach(TARGET ${PARSE_TARGETS}) + get_target_property(TARGET_NAME ${TARGET} EXPORT_NAME) + if(NOT TARGET_NAME) + get_target_property(TARGET_NAME ${TARGET} NAME) + endif() + set(EXPORT_LIB_TARGET ${PARSE_NAMESPACE}${TARGET_NAME}) + if(NOT TARGET ${EXPORT_LIB_TARGET}) + add_library(${EXPORT_LIB_TARGET} ALIAS ${TARGET}) + endif() + set_target_properties(${TARGET} PROPERTIES INTERFACE_FIND_PACKAGE_NAME ${PROJECT_NAME}) + if(COMMAND cm_add_rpath) + get_target_property(TARGET_TYPE ${TARGET} TYPE) + if(NOT "${TARGET_TYPE}" STREQUAL "INTERFACE_LIBRARY") + cm_add_rpath("$") + endif() + endif() + cm_shadow_notify(${EXPORT_LIB_TARGET}) + cm_shadow_notify(${TARGET}) + endforeach() + +endfunction() diff --git a/cmake/modules/share/modules/cmake/CMExport.cmake b/cmake/modules/share/modules/cmake/CMExport.cmake new file mode 100644 index 000000000..11bf7c014 --- /dev/null +++ b/cmake/modules/share/modules/cmake/CMExport.cmake @@ -0,0 +1,155 @@ +#---------------------------------------------------------------------------# +# Copyright (c) 2018-2019 Nil Foundation AG +# Copyright (c) 2018-2019 Mikhail Komarov +# +# Distributed under the Boost Software License, Version 1.0 +# See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt +#---------------------------------------------------------------------------# + +include(GNUInstallDirs) +include(WriteBasicConfigVersionFile) + +function(cm_get_target_package_source OUT_VAR TARGET) + set(RESULT) + if(TARGET ${TARGET}) + get_property(TARGET_ALIAS TARGET ${TARGET} PROPERTY ALIASED_TARGET) + if(TARGET_ALIAS) + set(TARGET ${TARGET_ALIAS}) + endif() + get_property(TARGET_IMPORTED TARGET ${TARGET} PROPERTY IMPORTED) + if(TARGET_IMPORTED OR TARGET_ALIAS) + get_property(TARGET_FIND_PACKAGE_NAME TARGET ${TARGET} PROPERTY INTERFACE_FIND_PACKAGE_NAME) + if(NOT TARGET_FIND_PACKAGE_NAME) + message(SEND_ERROR "The target ${TARGET_FIND_PACKAGE_NAME} does not have information about find_package() call.") + endif() + set(PKG_NAME ${TARGET_FIND_PACKAGE_NAME}) + get_property(TARGET_FIND_PACKAGE_VERSION TARGET ${TARGET} PROPERTY INTERFACE_FIND_PACKAGE_VERSION) + if(TARGET_FIND_PACKAGE_VERSION) + set(PKG_NAME "${PKG_NAME} ${TARGET_FIND_PACKAGE_VERSION}") + endif() + get_property(TARGET_FIND_PACKAGE_EXACT TARGET ${TARGET} PROPERTY INTERFACE_FIND_PACKAGE_EXACT) + if(TARGET_FIND_PACKAGE_EXACT) + set(PKG_NAME "${PKG_NAME} ${TARGET_FIND_PACKAGE_EXACT}") + endif() + set(RESULT "${PKG_NAME}") + # get_property(TARGET_FIND_PACKAGE_REQUIRED TARGET ${TARGET} PROPERTY INTERFACE_FIND_PACKAGE_REQUIRED) + # get_property(TARGET_FIND_PACKAGE_QUIETLY TARGET ${TARGET} PROPERTY INTERFACE_FIND_PACKAGE_QUIETLY) + endif() + else() + if("${TARGET}" MATCHES "::") + set(TARGET_NAME "$") + else() + set(TARGET_NAME "${TARGET}") + endif() + cm_shadow_exists(HAS_TARGET ${TARGET}) + set(RESULT "$<${HAS_TARGET}:$>") + endif() + set(${OUT_VAR} "${RESULT}" PARENT_SCOPE) +endfunction() + +function(cm_auto_export) + set(options) + set(oneValueArgs NAMESPACE EXPORT NAME COMPATIBILITY) + set(multiValueArgs TARGETS) + + cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER) + set(PACKAGE_NAME ${PROJECT_NAME}) + if(PARSE_NAME) + set(PACKAGE_NAME ${PARSE_NAME}) + endif() + + string(TOUPPER ${PACKAGE_NAME} PACKAGE_NAME_UPPER) + string(TOLOWER ${PACKAGE_NAME} PACKAGE_NAME_LOWER) + + set(TARGET_FILE ${PROJECT_NAME_LOWER}-targets) + if(PARSE_EXPORT) + set(TARGET_FILE ${PARSE_EXPORT}) + endif() + set(CONFIG_NAME ${PACKAGE_NAME_LOWER}-config) + set(TARGET_VERSION ${PROJECT_VERSION}) + + set(BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR}) + set(LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}) + set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}) + set(CONFIG_PACKAGE_INSTALL_DIR ${LIB_INSTALL_DIR}/cmake/${PACKAGE_NAME_LOWER}) + + set(CONFIG_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}.cmake") + + set(CONFIG_FILE_CONTENT " +include(CMakeFindDependencyMacro) +") + + if(PARSE_TARGETS) + # Add dependencies + foreach(TARGET ${PARSE_TARGETS}) + get_property(TARGET_LIBS TARGET ${TARGET} PROPERTY INTERFACE_LINK_LIBRARIES) + foreach(LIB ${TARGET_LIBS}) + cm_get_target_package_source(PKG_SRC ${LIB}) + set(HAS_PKG_SRC "$") + string(APPEND CONFIG_FILE_CONTENT "# $<$:Skip >Library: ${LIB}\n") + string(APPEND CONFIG_FILE_CONTENT "$<${HAS_PKG_SRC}:find_dependency(${PKG_SRC})>\n") + endforeach() + endforeach() + # Compute targets imported name + set(EXPORT_LIB_TARGETS) + foreach(TARGET ${PARSE_TARGETS}) + get_target_property(TARGET_NAME ${TARGET} EXPORT_NAME) + if(NOT TARGET_NAME) + get_target_property(TARGET_NAME ${TARGET} NAME) + endif() + set(EXPORT_LIB_TARGET_${TARGET} ${PARSE_NAMESPACE}${TARGET_NAME}) + list(APPEND EXPORT_LIB_TARGETS ${EXPORT_LIB_TARGET_${TARGET}}) + endforeach() + # Export custom properties + set(EXPORT_PROPERTIES) + foreach(TARGET ${PARSE_TARGETS}) + # TODO: Make this a property: the custom properties to be exported + foreach(PROPERTY INTERFACE_PKG_CONFIG_NAME) + set(PROP "$") + set(EXPORT_PROPERTIES "${EXPORT_PROPERTIES} +$<$:set_target_properties(${EXPORT_LIB_TARGET_${TARGET}} PROPERTIES ${PROPERTY} ${PROP})> +") + endforeach() + endforeach() + string(APPEND CONFIG_FILE_CONTENT " +include(\"\${CMAKE_CURRENT_LIST_DIR}/${TARGET_FILE}.cmake\") +include(\"\${CMAKE_CURRENT_LIST_DIR}/properties-${TARGET_FILE}.cmake\") +") + endif() + + file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/properties-${TARGET_FILE}.cmake CONTENT "${EXPORT_PROPERTIES}") + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/properties-${TARGET_FILE}.cmake DESTINATION ${CONFIG_PACKAGE_INSTALL_DIR}) + + file(GENERATE OUTPUT "${CONFIG_FILE}" CONTENT "${CONFIG_FILE_CONTENT}") + + set(COMPATIBILITY_ARG SameMajorVersion) + if(PARSE_COMPATIBILITY) + set(COMPATIBILITY_ARG ${PARSE_COMPATIBILITY}) + endif() + write_basic_config_version_file( + ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}-version.cmake + VERSION ${TARGET_VERSION} + COMPATIBILITY ${COMPATIBILITY_ARG} + ) + + set(NAMESPACE_ARG) + if(PARSE_NAMESPACE) + set(NAMESPACE_ARG "NAMESPACE;${PARSE_NAMESPACE}") + endif() + install(EXPORT ${TARGET_FILE} + DESTINATION + ${CONFIG_PACKAGE_INSTALL_DIR} + ${NAMESPACE_ARG} + ) + + install(FILES + ${CONFIG_FILE} + ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}-version.cmake + DESTINATION + ${CONFIG_PACKAGE_INSTALL_DIR}) + +endfunction() + diff --git a/cmake/modules/share/modules/cmake/CMFuture.cmake b/cmake/modules/share/modules/cmake/CMFuture.cmake new file mode 100644 index 000000000..6566a8442 --- /dev/null +++ b/cmake/modules/share/modules/cmake/CMFuture.cmake @@ -0,0 +1,96 @@ +#---------------------------------------------------------------------------# +# Copyright (c) 2018-2019 Nil Foundation AG +# Copyright (c) 2018-2019 Mikhail Komarov +# +# Distributed under the Boost Software License, Version 1.0 +# See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt +#---------------------------------------------------------------------------# + +define_property(TARGET PROPERTY "INTERFACE_FIND_PACKAGE_NAME" + BRIEF_DOCS "The package name that was searched for to create this target" + FULL_DOCS "The package name that was searched for to create this target" +) + +define_property(TARGET PROPERTY "INTERFACE_FIND_PACKAGE_REQUIRED" + BRIEF_DOCS "true if REQUIRED option was given" + FULL_DOCS "true if REQUIRED option was given" +) + +define_property(TARGET PROPERTY "INTERFACE_FIND_PACKAGE_QUIETLY" + BRIEF_DOCS "true if QUIET option was given" + FULL_DOCS "true if QUIET option was given" +) + +define_property(TARGET PROPERTY "INTERFACE_FIND_PACKAGE_EXACT" + BRIEF_DOCS "true if EXACT option was given" + FULL_DOCS "true if EXACT option was given" +) + +define_property(TARGET PROPERTY "INTERFACE_FIND_PACKAGE_VERSION" + BRIEF_DOCS "full requested version string" + FULL_DOCS "full requested version string" +) + +# Custom property to check if target exists +define_property(TARGET PROPERTY "INTERFACE_TARGET_EXISTS" + BRIEF_DOCS "True if target exists" + FULL_DOCS "True if target exists" +) +# Create shadow target to notify that the target exists +macro(cm_shadow_notify TARGET) + if(NOT TARGET _cm_shadow_target_${TARGET}) + add_library(_cm_shadow_target_${TARGET} INTERFACE IMPORTED GLOBAL) + endif() + set_target_properties(_cm_shadow_target_${TARGET} PROPERTIES INTERFACE_TARGET_EXISTS 1) +endmacro() +# Check if target exists by querying the shadow target +macro(cm_shadow_exists OUT TARGET) + if("${TARGET}" MATCHES "^[_a-zA-Z0-9:]+$") + if(NOT TARGET _cm_shadow_target_${TARGET}) + add_library(_cm_shadow_target_${TARGET} INTERFACE IMPORTED GLOBAL) + set_target_properties(_cm_shadow_target_${TARGET} PROPERTIES INTERFACE_TARGET_EXISTS 0) + endif() + set(${OUT} "$") + else() + set(${OUT} "0") + endif() +endmacro() +# Emulate rpath for windows +if(WIN32) + if(NOT COMMAND cm_add_rpath) + foreach(CONFIG ${CMAKE_CONFIGURATION_TYPES} "") + file(WRITE ${CMAKE_BINARY_DIR}/cm_set_rpath_pre-${CONFIG}.cmake "set(RPATH)\n") + file(GENERATE OUTPUT ${CMAKE_BINARY_DIR}/cm_set_rpath-${CONFIG}.cmake INPUT ${CMAKE_BINARY_DIR}/cm_set_rpath_pre-${CONFIG}.cmake CONDITION $) + endforeach() + function(cm_add_rpath) + foreach(_RPATH ${ARGN}) + foreach(CONFIG ${CMAKE_CONFIGURATION_TYPES} "") + file(APPEND ${CMAKE_BINARY_DIR}/cm_set_rpath_pre-${CONFIG}.cmake "list(APPEND RPATH \"${_RPATH}\")\n") + endforeach() + endforeach() + endfunction() + endif() +endif() +# Add library extension to track imported targets +if(NOT COMMAND cm_add_library_ext) + macro(cm_add_library_ext LIB) + set(ARG_LIST "${ARGN}") + if("IMPORTED" IN_LIST ARG_LIST) + if(CMAKE_FIND_PACKAGE_NAME) + set_target_properties(${LIB} PROPERTIES INTERFACE_FIND_PACKAGE_NAME ${CMAKE_FIND_PACKAGE_NAME}) + foreach(TYPE REQUIRED QUIETLY EXACT VERSION) + if(${CMAKE_FIND_PACKAGE_NAME}_FIND_${TYPE}) + set_target_properties(${LIB} PROPERTIES INTERFACE_FIND_PACKAGE_${TYPE} ${${CMAKE_FIND_PACKAGE_NAME}_FIND_${TYPE}}) + endif() + endforeach() + endif() + endif() + endmacro() + + macro(add_library) + _add_library(${ARGN}) + cm_add_library_ext(${ARGN}) + endmacro() + +endif() diff --git a/cmake/modules/share/modules/cmake/CMIgnorePackage.cmake b/cmake/modules/share/modules/cmake/CMIgnorePackage.cmake new file mode 100644 index 000000000..6de0f779d --- /dev/null +++ b/cmake/modules/share/modules/cmake/CMIgnorePackage.cmake @@ -0,0 +1,14 @@ +#---------------------------------------------------------------------------# +# Copyright (c) 2018-2019 Nil Foundation AG +# Copyright (c) 2018-2019 Mikhail Komarov +# +# Distributed under the Boost Software License, Version 1.0 +# See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt +#---------------------------------------------------------------------------# + +function(cm_ignore_package NAME) + set(${NAME}_DIR ${CMAKE_BINARY_DIR}/_cm_ignore_packages_/${NAME} CACHE PATH "") + file(WRITE ${${NAME}_DIR}/${NAME}Config.cmake "") +endfunction() + diff --git a/cmake/modules/share/modules/cmake/CMInstallTargets.cmake b/cmake/modules/share/modules/cmake/CMInstallTargets.cmake new file mode 100644 index 000000000..29adb3bb6 --- /dev/null +++ b/cmake/modules/share/modules/cmake/CMInstallTargets.cmake @@ -0,0 +1,51 @@ +#---------------------------------------------------------------------------# +# Copyright (c) 2018-2019 Nil Foundation AG +# Copyright (c) 2018-2019 Mikhail Komarov +# +# Distributed under the Boost Software License, Version 1.0 +# See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt +#---------------------------------------------------------------------------# + +include(GNUInstallDirs) + +function(cm_install_targets) + set(options SKIP_HEADER_INSTALL) + set(oneValueArgs EXPORT) + set(multiValueArgs TARGETS INCLUDE) + + cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER) + set(EXPORT_FILE ${PROJECT_NAME_LOWER}-targets) + if(PARSE_EXPORT) + set(EXPORT_FILE ${PARSE_EXPORT}) + endif() + + set(BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR}) + set(LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}) + set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}) + + foreach(TARGET ${PARSE_TARGETS}) + foreach(INCLUDE ${PARSE_INCLUDE}) + get_filename_component(INCLUDE_PATH ${INCLUDE} ABSOLUTE) + target_include_directories(${TARGET} INTERFACE $) + endforeach() + target_include_directories(${TARGET} INTERFACE $/${INCLUDE_INSTALL_DIR}>) + endforeach() + + + if(NOT PARSE_SKIP_HEADER_INSTALL) + foreach(INCLUDE ${PARSE_INCLUDE}) + install(DIRECTORY ${INCLUDE}/ DESTINATION ${INCLUDE_INSTALL_DIR}) + endforeach() + endif() + + install(TARGETS ${PARSE_TARGETS} + EXPORT ${EXPORT_FILE} + RUNTIME DESTINATION ${BIN_INSTALL_DIR} + LIBRARY DESTINATION ${LIB_INSTALL_DIR} + ARCHIVE DESTINATION ${LIB_INSTALL_DIR}) + +endfunction() + diff --git a/cmake/modules/share/modules/cmake/CMPkgConfig.cmake b/cmake/modules/share/modules/cmake/CMPkgConfig.cmake new file mode 100644 index 000000000..050638723 --- /dev/null +++ b/cmake/modules/share/modules/cmake/CMPkgConfig.cmake @@ -0,0 +1,258 @@ +#---------------------------------------------------------------------------# +# Copyright (c) 2018-2019 Nil Foundation AG +# Copyright (c) 2018-2019 Mikhail Komarov +# +# Distributed under the Boost Software License, Version 1.0 +# See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt +#---------------------------------------------------------------------------# + +include(GNUInstallDirs) + +define_property(TARGET PROPERTY "INTERFACE_DESCRIPTION" + BRIEF_DOCS "Description of the target" + FULL_DOCS "Description of the target" +) + +define_property(TARGET PROPERTY "INTERFACE_URL" + BRIEF_DOCS "An URL where people can get more information about and download the package." + FULL_DOCS "An URL where people can get more information about and download the package." +) + +define_property(TARGET PROPERTY "INTERFACE_PKG_CONFIG_REQUIRES" + BRIEF_DOCS "A list of packages required by this package. The versions of these packages may be specified using the comparison operators =, <, >, <= or >=." + FULL_DOCS "A list of packages required by this package. The versions of these packages may be specified using the comparison operators =, <, >, <= or >=." +) + +function(cm_generate_pkgconfig_file) + set(options) + set(oneValueArgs NAME LIB_DIR INCLUDE_DIR DESCRIPTION) + set(multiValueArgs TARGETS CFLAGS LIBS REQUIRES) + + cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + set(LIB_DIR ${CMAKE_INSTALL_LIBDIR}) + if(PARSE_LIB_DIR) + set(LIB_DIR ${PARSE_LIB_DIR}) + endif() + set(INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR}) + if(PARSE_INCLUDE_DIR) + set(INCLUDE_DIR ${PARSE_INCLUDE_DIR}) + endif() + + set(LIBS) + set(DESCRIPTION "No description") + if(PARSE_DESCRIPTION) + set(DESCRIPTION ${PARSE_DESCRIPTION}) + endif() + + foreach(TARGET ${PARSE_TARGETS}) + get_property(TARGET_NAME TARGET ${TARGET} PROPERTY NAME) + get_property(TARGET_TYPE TARGET ${TARGET} PROPERTY TYPE) + if(NOT TARGET_TYPE STREQUAL "INTERFACE_LIBRARY") + set(LIBS "${LIBS} -l${TARGET_NAME}") + endif() + endforeach() + + if(LIBS OR PARSE_LIBS) + set(LIBS "Libs: -L\${libdir} ${LIBS} ${PARSE_LIBS}") + endif() + + set(PKG_NAME ${PROJECT_NAME}) + if(PARSE_NAME) + set(PKG_NAME ${PARSE_NAME}) + endif() + + file(WRITE ${PKGCONFIG_FILENAME} +" +prefix=${CMAKE_INSTALL_PREFIX} +exec_prefix=\${prefix} +libdir=\${exec_prefix}/${LIB_DIR} +includedir=\${exec_prefix}/${INCLUDE_DIR} +Name: ${PKG_NAME} +Description: ${DESCRIPTION} +Version: ${PROJECT_VERSION} +Cflags: -I\${includedir} ${PARSE_CFLAGS} +${LIBS} +Requires: ${PARSE_REQUIRES} +" + ) + +endfunction() + +function(cm_preprocess_pkgconfig_property VAR TARGET PROP) + get_target_property(OUT_PROP ${TARGET} ${PROP}) + string(REPLACE "$/${CMAKE_INSTALL_INCLUDEDIR}" "\${includedir}" OUT_PROP "${OUT_PROP}") + string(REPLACE "$/${CMAKE_INSTALL_LIBDIR}" "\${libdir}" OUT_PROP "${OUT_PROP}") + string(REPLACE "$" "\${prefix}" OUT_PROP "${OUT_PROP}") + + set(${VAR} ${OUT_PROP} PARENT_SCOPE) + +endfunction() + +function(cm_auto_pkgconfig_each) + set(options) + set(oneValueArgs NAME TARGET) + set(multiValueArgs) + + cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + set(LIBS) + set(CFLAGS) + set(REQUIRES) + set(DESCRIPTION "No description") + + string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER) + set(PACKAGE_NAME ${PROJECT_NAME}) + + set(TARGET) + if(PARSE_TARGET) + set(TARGET ${PARSE_TARGET}) + else() + message(SEND_ERROR "Target is required for auto pkg config") + endif() + + if(PARSE_NAME) + set(PACKAGE_NAME ${PARSE_NAME}) + endif() + + string(TOUPPER ${PACKAGE_NAME} PACKAGE_NAME_UPPER) + string(TOLOWER ${PACKAGE_NAME} PACKAGE_NAME_LOWER) + + get_property(TARGET_NAME TARGET ${TARGET} PROPERTY NAME) + get_property(TARGET_TYPE TARGET ${TARGET} PROPERTY TYPE) + get_property(TARGET_DESCRIPTION TARGET ${TARGET} PROPERTY INTERFACE_DESCRIPTION) + get_property(TARGET_URL TARGET ${TARGET} PROPERTY INTERFACE_URL) + get_property(TARGET_REQUIRES TARGET ${TARGET} PROPERTY INTERFACE_PKG_CONFIG_REQUIRES) + if(NOT TARGET_TYPE STREQUAL "INTERFACE_LIBRARY") + set(LIBS "${LIBS} -l${TARGET_NAME}") + endif() + + if(TARGET_REQUIRES) + list(APPEND REQUIRES ${TARGET_REQUIRES}) + endif() + + cm_preprocess_pkgconfig_property(LINK_LIBS ${TARGET} INTERFACE_LINK_LIBRARIES) + foreach(LIB ${LINK_LIBS}) + if(TARGET ${LIB}) + get_property(LIB_PKGCONFIG_NAME TARGET ${LIB} PROPERTY INTERFACE_PKG_CONFIG_NAME) + # TODO: Error if this property is missing + if(LIB_PKGCONFIG_NAME) + list(APPEND REQUIRES ${LIB_PKGCONFIG_NAME}) + endif() + else() + if("${LIB}" MATCHES "::") + set(LIB_TARGET_NAME "$") + else() + set(LIB_TARGET_NAME "${LIB}") + endif() + cm_shadow_exists(HAS_LIB_TARGET ${LIB}) + list(APPEND REQUIRES "$<${HAS_LIB_TARGET}:$>") + set(LIBS "${LIBS} $<$:${LIB}>") + endif() + endforeach() + + cm_preprocess_pkgconfig_property(INCLUDE_DIRS ${TARGET} INTERFACE_INCLUDE_DIRECTORIES) + if(INCLUDE_DIRS) + set(CFLAGS "${CFLAGS} $<$:-I$>") + endif() + + cm_preprocess_pkgconfig_property(COMPILE_DEFS ${TARGET} INTERFACE_COMPILE_DEFINITIONS) + if(COMPILE_DEFS) + set(CFLAGS "${CFLAGS} $<$:-D$>") + endif() + + cm_preprocess_pkgconfig_property(COMPILE_OPTS ${TARGET} INTERFACE_COMPILE_OPTIONS) + if(COMPILE_OPTS) + set(CFLAGS "${CFLAGS} $<$:$>") + endif() + + set(CONTENT) + + if(TARGET_DESCRIPTION) + set(DESCRIPTION "${TARGET_DESCRIPTION}") + endif() + + if(TARGET_URL) + set(CONTENT "${CONTENT}\nUrl: ${TARGET_URL}") + endif() + + if(CFLAGS) + set(CONTENT "${CONTENT}\nCflags: ${CFLAGS}") + endif() + + if(LIBS) + set(CONTENT "${CONTENT}\n$<$:Libs: -L\${libdir} ${LIBS}>") + endif() + + if(REQUIRES) + string(REPLACE ";" "," REQUIRES_CONTENT "${REQUIRES}") + set(CONTENT "${CONTENT}\nRequires: ${REQUIRES_CONTENT}") + endif() + + file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME_LOWER}.pc CONTENT +" +prefix=${CMAKE_INSTALL_PREFIX} +exec_prefix=\${prefix} +libdir=\${exec_prefix}/${CMAKE_INSTALL_LIBDIR} +includedir=\${exec_prefix}/${CMAKE_INSTALL_INCLUDEDIR} +Name: ${PACKAGE_NAME_LOWER} +Description: ${DESCRIPTION} +Version: ${PROJECT_VERSION} +${CONTENT} +" + ) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME_LOWER}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + set_property(TARGET ${TARGET} PROPERTY INTERFACE_PKG_CONFIG_NAME ${PACKAGE_NAME_LOWER}) +endfunction() + +function(cm_auto_pkgconfig) + set(options) + set(oneValueArgs NAME) + set(multiValueArgs TARGET) # TODO: Rename to TARGETS + + cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + list(LENGTH PARSE_TARGET TARGET_COUNT) + + if(TARGET_COUNT EQUAL 1) + cm_auto_pkgconfig_each(TARGET ${PARSE_TARGET} NAME ${PARSE_NAME}) + else() + string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER) + set(PACKAGE_NAME ${PROJECT_NAME}) + + if(PARSE_NAME) + set(PACKAGE_NAME ${PARSE_NAME}) + endif() + + string(TOLOWER ${PACKAGE_NAME} PACKAGE_NAME_LOWER) + + set(GENERATE_PROJECT_PC On) + foreach(TARGET ${PARSE_TARGET}) + if("${TARGET}" STREQUAL "${PACKAGE_NAME_LOWER}") + set(GENERATE_PROJECT_PC Off) + endif() + cm_auto_pkgconfig_each(TARGET ${TARGET} NAME ${TARGET}) + endforeach() + + string(REPLACE ";" "," REQUIRES "${PARSE_TARGET}") + # TODO: Get description from project + set(DESCRIPTION "No description") + + if(GENERATE_PROJECT_PC) + file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME_LOWER}.pc CONTENT +" +Name: ${PACKAGE_NAME_LOWER} +Description: ${DESCRIPTION} +Version: ${PROJECT_VERSION} +Requires: ${REQUIRES} +" + ) + endif() + endif() + + +endfunction() diff --git a/cmake/modules/share/modules/cmake/CMProperties.cmake b/cmake/modules/share/modules/cmake/CMProperties.cmake new file mode 100644 index 000000000..89d72ed81 --- /dev/null +++ b/cmake/modules/share/modules/cmake/CMProperties.cmake @@ -0,0 +1,106 @@ +#---------------------------------------------------------------------------# +# Copyright (c) 2017 Niall Douglas +# Copyright (c) 2018-2019 Nil Foundation AG +# Copyright (c) 2018-2019 Mikhail Komarov +# +# Distributed under the Boost Software License, Version 1.0 +# See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt +#---------------------------------------------------------------------------# +# +# On MSVC very annoyingly cmake puts /EHsc and /MD(d) into the global flags which means you +# get a warning when you try to disable exceptions or use the static CRT. I hate to use this +# globally imposed solution, but we are going to hack the global flags to use properties to +# determine whether they are on or off +# +# Create custom properties called CXX_EXCEPTIONS, CXX_RTTI and CXX_STATIC_RUNTIME +# These get placed at global, directory and target scopes +foreach(scope GLOBAL DIRECTORY TARGET) + define_property(${scope} PROPERTY "CXX_EXCEPTIONS" INHERITED + BRIEF_DOCS "Enable C++ exceptions, defaults to TRUE at global scope" + FULL_DOCS "Enable C++ exceptions, defaults to TRUE at global scope" + ) + define_property(${scope} PROPERTY "CXX_RTTI" INHERITED + BRIEF_DOCS "Enable C++ runtime type information, defaults to TRUE at global scope" + FULL_DOCS "Enable C++ runtime type information, defaults to TRUE at global scope" + ) + define_property(${scope} PROPERTY "CXX_STATIC_RUNTIME" INHERITED + BRIEF_DOCS "Enable linking against the static C++ runtime, defaults to FALSE at global scope" + FULL_DOCS "Enable linking against the static C++ runtime, defaults to FALSE at global scope" + ) + define_property(${scope} PROPERTY "CXX_WARNINGS" INHERITED + BRIEF_DOCS "Controls the warning level of compilers, defaults to TRUE at global scope" + FULL_DOCS "Controls the warning level of compilers, defaults to TRUE at global scope" + ) + define_property(${scope} PROPERTY "CXX_WARNINGS_AS_ERRORS" INHERITED + BRIEF_DOCS "Treat warnings as errors and abort compilation on a warning, defaults to FALSE at global scope" + FULL_DOCS "Treat warnings as errors and abort compilation on a warning, defaults to FALSE at global scope" + ) + define_property(${scope} PROPERTY "BUILD_SHARED_LIBS" INHERITED + BRIEF_DOCS "Property indicates wether dynamic-linked libraries are going to be built, defaults to + FALSE at global scope" + FULL_DOCS "Property indicates wether dynamic-linked libraries are going to be built, defaults to + FALSE at global scope" + ) +endforeach() +# Set the default for these properties at global scope. If they are not set per target or +# whatever, the next highest scope will be looked up +option(CMAKE_CXX_EXCEPTIONS "Enable C++ exceptions, defaults to TRUE at global scope" TRUE) +option(CMAKE_CXX_RTTI "Enable C++ runtime type information, defaults to TRUE at global scope" TRUE) +option(CMAKE_CXX_STATIC_RUNTIME "Enable linking against the static C++ runtime, defaults to FALSE at global scope" FALSE) +option(CMAKE_CXX_WARNINGS "Controls the warning level of compilers, defaults to TRUE at global scope" TRUE) +option(CMAKE_CXX_WARNINGS_AS_ERRORS "Treat warnings as errors and abort compilation on a warning, defaults to FALSE at global scope" FALSE) + +set_property(GLOBAL PROPERTY CXX_EXCEPTIONS ${CMAKE_CXX_EXCEPTIONS}) +set_property(GLOBAL PROPERTY CXX_RTTI ${CMAKE_CXX_RTTI}) +set_property(GLOBAL PROPERTY CXX_STATIC_RUNTIME ${CMAKE_CXX_STATIC_RUNTIME}) +set_property(GLOBAL PROPERTY CXX_WARNINGS ${CMAKE_CXX_WARNINGS}) +set_property(GLOBAL PROPERTY CXX_WARNINGS_AS_ERRORS ${CMAKE_CXX_WARNINGS_AS_ERRORS}) +set_property(GLOBAL PROPERTY BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS}) + +if(MSVC) + # Purge unconditional use of /MDd, /MD and /EHsc. + foreach(flag + CMAKE_C_FLAGS CMAKE_CXX_FLAGS + CMAKE_C_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG + CMAKE_C_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELEASE + CMAKE_C_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_MINSIZEREL + CMAKE_C_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS_RELWITHDEBINFO + ) + string(REPLACE "/MDd" "" ${flag} "${${flag}}") + string(REPLACE "/MD" "" ${flag} "${${flag}}") + string(REPLACE "/EHsc" "" ${flag} "${${flag}}") + string(REPLACE "/GR" "" ${flag} "${${flag}}") + endforeach() + # Restore those same, but now selected by the properties + add_compile_options( + $<$>,TRUE>:/EHsc> + $<$>,FALSE>:/GR-> + $<$>,FALSE>:$<$:/MDd>$<$>:/MD>> + $<$>,TRUE>:$<$:/MTd>$<$>:/MT>> + $<$>,TRUE>:/W3> + $<$>,FALSE>:/W0> + $<$>,ALL>:/W4> + $<$>,TRUE>:/WX> + ) +else() + add_compile_options( + $<$>,FALSE>:-fno-exceptions> + $<$>,FALSE>:-fno-rtti> + $<$>,TRUE>:-static> + $<$>,TRUE>:-Wall> + $<$>,FALSE>:-w> + $<$>,ALL>:-Wall> + $<$>,ALL>:-pedantic> + $<$>,TRUE>:-Werror> + ) + if(CMAKE_${COMPILER}_COMPILER_ID MATCHES "Clang" OR CMAKE_${COMPILER}_COMPILER_ID MATCHES "AppleClang") + add_compile_options( + $<$>,ALL>:-Weverything> + $<$>,ALL>:-Wno-macro-redefined> + $<$>,ALL>:-Wall> + $<$>,ALL>:-Wno-c++98-compat> + $<$>,ALL>:-Wno-c++98-compat-pedantic> + ) + endif() +endif() \ No newline at end of file diff --git a/cmake/modules/share/modules/cmake/CMSetupVersion.cmake b/cmake/modules/share/modules/cmake/CMSetupVersion.cmake new file mode 100644 index 000000000..e61a1157f --- /dev/null +++ b/cmake/modules/share/modules/cmake/CMSetupVersion.cmake @@ -0,0 +1,61 @@ +#---------------------------------------------------------------------------# +# Copyright (c) 2018-2019 Nil Foundation AG +# Copyright (c) 2018-2019 Mikhail Komarov +# +# Distributed under the Boost Software License, Version 1.0 +# See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt +#---------------------------------------------------------------------------# + +include(GNUInstallDirs) +set(CM_HEADER_VERSION_TEMPLATE_FILE "${CMAKE_CURRENT_LIST_DIR}/version.hpp") + +macro(cm_set_parent VAR) + set(${VAR} ${ARGN} PARENT_SCOPE) + set(${VAR} ${ARGN}) +endmacro() + +function(cm_setup_version) + set(options) + set(oneValueArgs VERSION GENERATE_HEADER PARSE_HEADER PREFIX) + set(multiValueArgs) + + cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + string(TOUPPER ${PROJECT_NAME} PREFIX) + + if(PARSE_PREFIX) + set(PREFIX ${PARSE_PREFIX}) + endif() + + if(PARSE_VERSION) + cm_set_parent(PROJECT_VERSION ${PARSE_VERSION}) + cm_set_parent(${PROJECT_NAME}_VERSION ${PROJECT_VERSION}) + string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" _version_MAJOR "${PROJECT_VERSION}") + string(REGEX REPLACE "^[0-9]+\\.([0-9]+)\\.[0-9]+.*" "\\1" _version_MINOR "${PROJECT_VERSION}") + string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" _version_PATCH "${PROJECT_VERSION}") + foreach(level MAJOR MINOR PATCH) + cm_set_parent(${PROJECT_NAME}_VERSION_${level} ${_version_${level}}) + cm_set_parent(PROJECT_VERSION_${level} ${_version_${level}}) + endforeach() + elseif(PARSE_PARSE_HEADER) + foreach(level MAJOR MINOR PATCH) + file(STRINGS ${PARSE_PARSE_HEADER} + _define_${level} + REGEX "#define ${PREFIX}_VERSION_${level}") + string(REGEX MATCH "([0-9]+)" _version_${level} "${_define_${level}}") + # TODO: Check if it is empty + cm_set_parent(${PROJECT_NAME}_VERSION_${level} ${_version_${level}}) + cm_set_parent(PROJECT_VERSION_${level} ${_version_${level}}) + endforeach() + cm_set_parent(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") + cm_set_parent(${PROJECT_NAME}_VERSION ${PROJECT_VERSION}) + endif() + # TODO: Get version from the project + + if(PARSE_GENERATE_HEADER) + configure_file("${CM_HEADER_VERSION_TEMPLATE_FILE}" "${PARSE_GENERATE_HEADER}") + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PARSE_GENERATE_HEADER}" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + endif() + +endfunction() diff --git a/cmake/modules/share/modules/cmake/CMTest.cmake b/cmake/modules/share/modules/cmake/CMTest.cmake new file mode 100644 index 000000000..0deeadaa1 --- /dev/null +++ b/cmake/modules/share/modules/cmake/CMTest.cmake @@ -0,0 +1,241 @@ +#---------------------------------------------------------------------------# +# Copyright (c) 2018-2019 Nil Foundation AG +# Copyright (c) 2018-2019 Mikhail Komarov +# +# Distributed under the Boost Software License, Version 1.0 +# See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt +#---------------------------------------------------------------------------# + +option(BUILD_TESTS "Controls whether to build the tests as part of the main build" FALSE) + +enable_testing() + +foreach(scope GLOBAL DIRECTORY) + define_property(${scope} PROPERTY "ENABLE_TESTS" INHERITED + BRIEF_DOCS "Enable tests" + FULL_DOCS "Enable tests" + ) +endforeach() +option(CMAKE_ENABLE_TESTS "Enable tests" ON) +set_property(GLOBAL PROPERTY ENABLE_TESTS ${CMAKE_ENABLE_TESTS}) + +include(ProcessorCount) +processorcount(_cm_ctest_parallel_level) +set(CTEST_PARALLEL_LEVEL ${_cm_ctest_parallel_level} CACHE STRING "CTest parallel level") + +if(NOT TARGET check) + add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C ${CMAKE_CFG_INTDIR} -j ${CTEST_PARALLEL_LEVEL} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) +endif() + + +if(NOT TARGET tests) + add_custom_target(tests COMMENT "Build all tests.") + add_dependencies(check tests) +endif() + +if(NOT TARGET check-${PROJECT_NAME}) + add_custom_target(check-${PROJECT_NAME} COMMAND ${CMAKE_CTEST_COMMAND} -L ${PROJECT_NAME} --output-on-failure -C ${CMAKE_CFG_INTDIR} -j ${CTEST_PARALLEL_LEVEL} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) +endif() + +if(NOT TARGET tests-${PROJECT_NAME}) + add_custom_target(tests-${PROJECT_NAME} COMMENT "Build all tests for ${PROJECT_NAME}.") + add_dependencies(check-${PROJECT_NAME} tests-${PROJECT_NAME}) +endif() + +function(cm_mark_as_test) + foreach(TEST_TARGET ${ARGN}) + if(NOT BUILD_TESTS) + get_target_property(TEST_TARGET_TYPE ${TEST_TARGET} TYPE) + # We can onle use EXCLUDE_FROM_ALL on build targets + if(NOT "${TEST_TARGET_TYPE}" STREQUAL "INTERFACE_LIBRARY") + set_target_properties(${TEST_TARGET} + PROPERTIES EXCLUDE_FROM_ALL TRUE + ) + endif() + endif() + add_dependencies(tests ${TEST_TARGET}) + add_dependencies(tests-${PROJECT_NAME} ${TEST_TARGET}) + endforeach() +endfunction(cm_mark_as_test) + + +function(cm_create_internal_targets) + if(NOT TARGET _cm_internal_tests-${PROJECT_NAME}) + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/_cm_internal_tests-${PROJECT_NAME}.cpp "") + add_library(_cm_internal_tests-${PROJECT_NAME} STATIC ${CMAKE_CURRENT_BINARY_DIR}/_cm_internal_tests-${PROJECT_NAME}.cpp) + cm_mark_as_test(_cm_internal_tests-${PROJECT_NAME}) + endif() +endfunction() + +foreach(scope DIRECTORY TARGET) + define_property(${scope} PROPERTY "CM_TEST_DEPENDENCIES" INHERITED + BRIEF_DOCS "Default test dependencies" + FULL_DOCS "Default test dependencies" + ) +endforeach() + +function(cm_test_link_libraries) + cm_create_internal_targets() + if(BUILD_TESTS) + set_property(DIRECTORY APPEND PROPERTY CM_TEST_DEPENDENCIES ${ARGN}) + target_link_libraries(_cm_internal_tests-${PROJECT_NAME} ${ARGN}) + else() + foreach(TARGET ${ARGN}) + if(TARGET ${TARGET}) + set_property(DIRECTORY APPEND PROPERTY CM_TEST_DEPENDENCIES ${TARGET}) + target_link_libraries(_cm_internal_tests-${PROJECT_NAME} ${TARGET}) + elseif(${TARGET} MATCHES "::") + cm_shadow_exists(HAS_TARGET ${TARGET}) + set_property(DIRECTORY APPEND PROPERTY CM_TEST_DEPENDENCIES $<${HAS_TARGET}:${TARGET}>) + target_link_libraries(_cm_internal_tests-${PROJECT_NAME} $<${HAS_TARGET}:${TARGET}>) + else() + set_property(DIRECTORY APPEND PROPERTY CM_TEST_DEPENDENCIES ${TARGET}) + target_link_libraries(_cm_internal_tests-${PROJECT_NAME} ${TARGET}) + endif() + if(BUILD_SHARED_LIBS) + target_compile_definitions(_cm_internal_tests-${PROJECT_NAME} PRIVATE -DBOOST_TEST_DYN_LINK=1 -DBOOST_TEST_NO_AUTO_LINK=1) + endif() + endforeach() + endif() +endfunction() + +function(cm_target_link_test_libs TARGET) + # target_link_libraries(${TARGET} + # $ + # ) + get_property(DEPS DIRECTORY PROPERTY CM_TEST_DEPENDENCIES) + target_link_libraries(${TARGET} ${DEPS}) +endfunction() + + +function(cm_test) + set(options COMPILE_ONLY WILL_FAIL NO_TEST_LIBS) + set(oneValueArgs NAME SOURCES_PREFIX) + set(multiValueArgs SOURCES CONTENT ARGS) + + cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + if(PARSE_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "Unknown keywords given to cm_test(): \"${PARSE_UNPARSED_ARGUMENTS}\"") + endif() + + set(SOURCES ${PARSE_SOURCES}) + + if(PARSE_NAME) + set(TEST_NAME ${PARSE_NAME}) + else() + string(MAKE_C_IDENTIFIER "${PROJECT_NAME}_${SOURCES}_test" TEST_NAME) + endif() + + if(PARSE_CONTENT) + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generated-${TEST_NAME}.cpp "${PARSE_CONTENT}") + set(SOURCES ${CMAKE_CURRENT_BINARY_DIR}/generated-${TEST_NAME}.cpp) + endif() + + if(PARSE_COMPILE_ONLY) + add_library(${TEST_NAME} STATIC EXCLUDE_FROM_ALL ${SOURCES}) + add_test(NAME ${TEST_NAME} + COMMAND ${CMAKE_COMMAND} --build . --target ${TEST_NAME} --config $ + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) + if(PARSE_SOURCES_PREFIX) + target_include_directories(${TEST_NAME} PRIVATE ${PARSE_SOURCES_PREFIX}) + else() + target_include_directories(${TEST_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}) + endif() + + # set_tests_properties(${TEST_NAME} PROPERTIES RESOURCE_LOCK cm_test_compile_only) + else() + add_executable(${TEST_NAME} ${SOURCES}) + cm_mark_as_test(${TEST_NAME}) + if(PARSE_SOURCES_PREFIX) + target_include_directories(${TEST_NAME} PRIVATE ${PARSE_SOURCES_PREFIX}) + else() + target_include_directories(${TEST_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}) + endif() + if(WIN32) + foreach(CONFIG ${CMAKE_CONFIGURATION_TYPES} "") + file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME}-test-run-${CONFIG}.cmake CONTENT " +include(\"${CMAKE_BINARY_DIR}/cm_set_rpath-$.cmake\") +if(CMAKE_CROSSCOMPILING) +foreach(RP \${RPATH}) + execute_process(COMMAND winepath -w \${RP} OUTPUT_VARIABLE _RPATH) + string(STRIP \"\${_RPATH}\" _RPATH) + set(ENV{WINEPATH} \"\${_RPATH};\$ENV{WINEPATH}\") +endforeach() +else() +set(ENV{PATH} \"\${RPATH};\$ENV{PATH}\") +endif() +execute_process( + COMMAND $ ${PARSE_ARGS} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + RESULT_VARIABLE RESULT) +if(NOT RESULT EQUAL 0) + message(FATAL_ERROR \"Test failed\") +endif() +" CONDITION $) + endforeach() + add_test(NAME ${TEST_NAME} COMMAND ${CMAKE_COMMAND} -DCMAKE_CROSSCOMPILING=${CMAKE_CROSSCOMPILING} -P ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME}-test-run-$.cmake) + else() + add_test(NAME ${TEST_NAME} COMMAND ${TEST_NAME} ${PARSE_ARGS} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + endif() + endif() + + if(BUILD_SHARED_LIBS) + target_compile_definitions(${TEST_NAME} PRIVATE -DBOOST_TEST_DYN_LINK=1 -DBOOST_TEST_NO_AUTO_LINK=1) + endif() + + if(PARSE_WILL_FAIL) + set_tests_properties(${TEST_NAME} PROPERTIES WILL_FAIL TRUE) + endif() + set_tests_properties(${TEST_NAME} PROPERTIES LABELS ${PROJECT_NAME}) + if(NOT PARSE_NO_TEST_LIBS) + cm_target_link_test_libs(${TEST_NAME}) + endif() +endfunction(cm_test) + +function(cm_test_header) + set(options STATIC NO_TEST_LIBS) + set(oneValueArgs NAME HEADER) + set(multiValueArgs) + + cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + if(PARSE_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "Unknown keywords given to cm_test_header(): \"${PARSE_UNPARSED_ARGUMENTS}\"") + endif() + + if(PARSE_NAME) + set(TEST_NAME ${PARSE_NAME}) + else() + string(MAKE_C_IDENTIFIER "${PROJECT_NAME}_${PARSE_HEADER}_header_test" TEST_NAME) + endif() + + if(PARSE_STATIC) + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/header-main-include-${TEST_NAME}.cpp + "#include <${PARSE_HEADER}>\nint main() {}\n" + ) + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/header-static-include-${TEST_NAME}.cpp + "#include <${PARSE_HEADER}>\n" + ) + cm_test(NAME ${TEST_NAME} SOURCES + ${CMAKE_CURRENT_BINARY_DIR}/header-main-include-${TEST_NAME}.cpp + ${CMAKE_CURRENT_BINARY_DIR}/header-static-include-${TEST_NAME}.cpp + ) + else() + cm_test(NAME ${TEST_NAME} CONTENT + "#include <${PARSE_HEADER}>\nint main() {}\n" + ) + endif() + set_tests_properties(${TEST_NAME} PROPERTIES LABELS ${PROJECT_NAME}) +endfunction(cm_test_header) + +macro(cm_add_test_subdirectory) + get_directory_property(_enable_tests_property ENABLE_TESTS) + get_property(_enable_tests_global_property GLOBAL PROPERTY ENABLE_TESTS) + string(TOUPPER "${_enable_tests_property}" _enable_tests_property_upper) + if(_enable_tests_property_upper STREQUAL "OFF" OR _enable_tests_property_upper EQUAL 1) + set(CURRENT_SOURCES_DIR ${CURRENT_SOURCES_DIR}/test) + add_subdirectory(${ARGN}) + endif() +endmacro() diff --git a/cmake/modules/share/modules/cmake/CMToSnakeCase.cmake b/cmake/modules/share/modules/cmake/CMToSnakeCase.cmake new file mode 100644 index 000000000..7a609f338 --- /dev/null +++ b/cmake/modules/share/modules/cmake/CMToSnakeCase.cmake @@ -0,0 +1,19 @@ +#---------------------------------------------------------------------------# +# Copyright (c) 2018-2019 Nil Foundation AG +# Copyright (c) 2018-2019 Mikhail Komarov +# +# Distributed under the Boost Software License, Version 1.0 +# See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt +#---------------------------------------------------------------------------# + +function(to_snake_case str var) + # insert an underscore before any upper case letter + # which is not followed by another upper case letter + string(REGEX REPLACE "(.)([A-Z][a-z]+)" "\\1_\\2" value "${str}") + # insert an underscore before any upper case letter + # which is preseded by a lower case letter or number + string(REGEX REPLACE "([a-z0-9])([A-Z])" "\\1_\\2" value "${value}") + string(TOLOWER "${value}" value) + set(${var} "${value}" PARENT_SCOPE) +endfunction() diff --git a/cmake/modules/share/modules/cmake/version.hpp b/cmake/modules/share/modules/cmake/version.hpp new file mode 100644 index 000000000..74bc08cb6 --- /dev/null +++ b/cmake/modules/share/modules/cmake/version.hpp @@ -0,0 +1,18 @@ +//---------------------------------------------------------------------------// +// Copyright (c) 2018-2019 Nil Foundation AG +// Copyright (c) 2018-2019 Mikhail Komarov +// +// Distributed under the Boost Software License, Version 1.0 +// See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt +//---------------------------------------------------------------------------// + +#ifndef @PREFIX@_GUARD_VERSION_HPP +#define @PREFIX@_GUARD_VERSION_HPP + +#define @PREFIX@_VERSION_MAJOR @PROJECT_VERSION_MAJOR@ +#define @PREFIX@_VERSION_MINOR @PROJECT_VERSION_MINOR@ +#define @PREFIX@_VERSION_PATCH @PROJECT_VERSION_PATCH@ +#define @PREFIX@_VERSION (((@PREFIX@_VERSION_MAJOR) << 24) + ((@PREFIX@_VERSION_MINOR) << 16) + (@PREFIX@_VERSION_PATCH)) + +#endif diff --git a/cmake/packages/FindEigen3.cmake b/cmake/packages/FindEigen3.cmake new file mode 100644 index 000000000..08fcb9daa --- /dev/null +++ b/cmake/packages/FindEigen3.cmake @@ -0,0 +1,91 @@ +#---------------------------------------------------------------------------# +# Copyright (c) 2018-2019 Nil Foundation AG +# Copyright (c) 2018-2019 Mikhail Komarov +# +# Distributed under the Boost Software License, Version 1.0 +# See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt +#---------------------------------------------------------------------------# + +# Try to find Eigen3 library +# http://eigen.tuxfamily.org +# +# 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 + +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}) + +else(EIGEN3_INCLUDE_DIR) + + # specific additional paths for some OS + if(WIN32) + set(EIGEN_ADDITIONAL_SEARCH_PATHS ${EIGEN_ADDITIONAL_SEARCH_PATHS} "C:/Program Files/Eigen/include" "C:/Program Files (x86)/Eigen/include") + endif(WIN32) + + find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library + PATHS + include + ${EIGEN_ADDITIONAL_SEARCH_PATHS} + ${KDE4_INCLUDE_DIR} + PATH_SUFFIXES eigen3 eigen + ) + + if(EIGEN3_INCLUDE_DIR) + _eigen3_check_version() + endif(EIGEN3_INCLUDE_DIR) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK) + + mark_as_advanced(EIGEN3_INCLUDE_DIR) + +endif(EIGEN3_INCLUDE_DIR) \ No newline at end of file diff --git a/cmake/packages/FindGMP.cmake b/cmake/packages/FindGMP.cmake new file mode 100644 index 000000000..7f79e3e9b --- /dev/null +++ b/cmake/packages/FindGMP.cmake @@ -0,0 +1,86 @@ +#---------------------------------------------------------------------------# +# Copyright (c) 2018-2019 Nil Foundation AG +# Copyright (c) 2018-2019 Mikhail Komarov +# Copyright (c) 2018-2019 Alexey Moskvin +# +# Distributed under the Boost Software License, Version 1.0 +# See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt +#---------------------------------------------------------------------------# +# +# Try to find the GMP library +# https://gmplib.org/ +# +# This module supports requiring a minimum version, e.g. you can do +# find_package(GMP 6.0.0) +# to require version 6.0.0 to newer of GMP. +# +# Once done this will define +# +# GMP_FOUND - system has GMP lib with correct version +# GMP_INCLUDE_DIRS - the GMP include directory +# GMP_LIBRARIES - the GMP library +# GMP_VERSION - GMP version + +find_path(GMP_INCLUDE_DIRS NAMES gmp.h PATHS $ENV{GMPDIR} ${INCLUDE_INSTALL_DIR}) + +# Set GMP_FIND_VERSION to 5.1.0 if no minimum version is specified +if(NOT GMP_FIND_VERSION) + if(NOT GMP_FIND_VERSION_MAJOR) + set(GMP_FIND_VERSION_MAJOR 5) + endif() + if(NOT GMP_FIND_VERSION_MINOR) + set(GMP_FIND_VERSION_MINOR 1) + endif() + if(NOT GMP_FIND_VERSION_PATCH) + set(GMP_FIND_VERSION_PATCH 0) + endif() + set(GMP_FIND_VERSION + "${GMP_FIND_VERSION_MAJOR}.${GMP_FIND_VERSION_MINOR}.${GMP_FIND_VERSION_PATCH}") +endif() + +if(GMP_INCLUDE_DIRS) + # Since the GMP version macros may be in a file included by gmp.h of the form + # gmp-.*[_]?.*.h (e.g., gmp-x86_64.h), we search each of them. + file(GLOB GMP_HEADERS "${GMP_INCLUDE_DIRS}/gmp.h" "${GMP_INCLUDE_DIRS}/gmp-*.h") + foreach(gmp_header_filename ${GMP_HEADERS}) + file(READ "${gmp_header_filename}" _gmp_version_header) + string(REGEX MATCH + "define[ \t]+__GNU_MP_VERSION[ \t]+([0-9]+)" _gmp_major_version_match + "${_gmp_version_header}") + if(_gmp_major_version_match) + set(GMP_MAJOR_VERSION "${CMAKE_MATCH_1}") + string(REGEX MATCH "define[ \t]+__GNU_MP_VERSION_MINOR[ \t]+([0-9]+)" + _gmp_minor_version_match "${_gmp_version_header}") + set(GMP_MINOR_VERSION "${CMAKE_MATCH_1}") + string(REGEX MATCH "define[ \t]+__GNU_MP_VERSION_PATCHLEVEL[ \t]+([0-9]+)" + _gmp_patchlevel_version_match "${_gmp_version_header}") + set(GMP_PATCHLEVEL_VERSION "${CMAKE_MATCH_1}") + set(GMP_VERSION + ${GMP_MAJOR_VERSION}.${GMP_MINOR_VERSION}.${GMP_PATCHLEVEL_VERSION}) + endif() + endforeach() + + # Check whether found version exists and exceeds the minimum requirement + if(NOT GMP_VERSION) + set(GMP_VERSION_OK FALSE) + message(STATUS "GMP version was not detected") + elseif(${GMP_VERSION} VERSION_LESS ${GMP_FIND_VERSION}) + set(GMP_VERSION_OK FALSE) + message(STATUS "GMP version ${GMP_VERSION} found in ${GMP_INCLUDE_DIRS}, " + "but at least version ${GMP_FIND_VERSION} is required") + else() + set(GMP_VERSION_OK TRUE) + endif() +endif() + +find_library(GMP_LIBRARIES gmp PATHS $ENV{GMPDIR} ${LIB_INSTALL_DIR}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GMP DEFAULT_MSG + GMP_INCLUDE_DIRS GMP_LIBRARIES GMP_VERSION_OK) +if(GMP_FOUND) + set(HAVE_GMP "${GMP_FOUND}") +endif() + +mark_as_advanced(GMP_INCLUDE_DIRS GMP_LIBRARIES) \ No newline at end of file diff --git a/cmake/packages/FindGMPXX.cmake b/cmake/packages/FindGMPXX.cmake new file mode 100644 index 000000000..c07eb5026 --- /dev/null +++ b/cmake/packages/FindGMPXX.cmake @@ -0,0 +1,40 @@ +#---------------------------------------------------------------------------# +# Copyright (c) 2018-2019 Nil Foundation AG +# Copyright (c) 2018-2019 Mikhail Komarov +# Copyright (c) 2018-2019 Alexey Moskvin +# +# Distributed under the Boost Software License, Version 1.0 +# See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt +#---------------------------------------------------------------------------# +# +# Try to find the GMPXX libraries +# +# Once done this will define +# GMPXX_FOUND - system has GMPXX lib +# GMPXX_INCLUDE_DIRS - the GMPXX include directory +# GMPXX_LIBRARIES - Libraries needed to use GMPXX + +if(GMP_FOUND) + find_package(GMP QUIET) +else() + find_package(GMP) +endif() + +if(GMP_FOUND) + if(GMPXX_INCLUDE_DIRS AND GMPXX_LIBRARIES) + # Already in cache, be silent + set(GMPXX_FIND_QUIETLY TRUE) + endif() + + find_path(GMPXX_INCLUDE_DIRS NAMES gmpxx.h + PATHS ${GMP_INCLUDE_DIRS_SEARCH} + DOC "The directory containing the GMPXX include files") + + find_library(GMPXX_LIBRARIES NAMES gmpxx + PATHS ${GMP_LIBRARIES_DIR_SEARCH} + DOC "Path to the GMPXX library") + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(GMPXX "DEFAULT_MSG" GMPXX_LIBRARIES GMPXX_INCLUDE_DIRS) +endif() diff --git a/cmake/packages/FindMPC.cmake b/cmake/packages/FindMPC.cmake new file mode 100644 index 000000000..637c30ba1 --- /dev/null +++ b/cmake/packages/FindMPC.cmake @@ -0,0 +1,76 @@ +#---------------------------------------------------------------------------# +# Copyright (c) 2018-2019 Nil Foundation AG +# Copyright (c) 2018-2019 Mikhail Komarov +# Copyright (c) 2018-2019 Alexey Moskvin +# +# Distributed under the Boost Software License, Version 1.0 +# See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt +#---------------------------------------------------------------------------# +# +# Try to find the MPC library +# See http://www.multiprecision.org/index.php?prog=mpc&page=home +# +# This module supports requiring a minimum version, e.g. you can do +# find_package(MPC 1.0.3) +# to require version 1.0.3 to newer of MPC. +# +# Once done this will define +# +# MPC_FOUND - system has MPC lib with correct version +# MPC_INCLUDE_DIRS - the MPC include directory +# MPC_LIBRARIES - the MPC library +# MPC_VERSION - MPC version + +find_path(MPC_INCLUDE_DIRS NAMES mpc.h PATHS $ENV{GMPDIR} $ENV{MPFRDIR} $ENV{MPCDIR} + ${INCLUDE_INSTALL_DIR}) + +# Set MPC_FIND_VERSION to 1.0.0 if no minimum version is specified +if(NOT MPC_FIND_VERSION) + if(NOT MPC_FIND_VERSION_MAJOR) + set(MPC_FIND_VERSION_MAJOR 1) + endif() + if(NOT MPC_FIND_VERSION_MINOR) + set(MPC_FIND_VERSION_MINOR 0) + endif() + if(NOT MPC_FIND_VERSION_PATCH) + set(MPC_FIND_VERSION_PATCH 0) + endif() + set(MPC_FIND_VERSION + "${MPC_FIND_VERSION_MAJOR}.${MPC_FIND_VERSION_MINOR}.${MPC_FIND_VERSION_PATCH}") +endif() + +if(MPC_INCLUDE_DIRS) + # Query MPC_VERSION + file(READ "${MPC_INCLUDE_DIRS}/mpc.h" _mpc_version_header) + + string(REGEX MATCH "define[ \t]+MPC_VERSION_MAJOR[ \t]+([0-9]+)" + _mpc_major_version_match "${_mpc_version_header}") + set(MPC_MAJOR_VERSION "${CMAKE_MATCH_1}") + string(REGEX MATCH "define[ \t]+MPC_VERSION_MINOR[ \t]+([0-9]+)" + _mpc_minor_version_match "${_mpc_version_header}") + set(MPC_MINOR_VERSION "${CMAKE_MATCH_1}") + string(REGEX MATCH "define[ \t]+MPC_VERSION_PATCHLEVEL[ \t]+([0-9]+)" + _mpc_patchlevel_version_match "${_mpc_version_header}") + set(MPC_PATCHLEVEL_VERSION "${CMAKE_MATCH_1}") + + set(MPC_VERSION + ${MPC_MAJOR_VERSION}.${MPC_MINOR_VERSION}.${MPC_PATCHLEVEL_VERSION}) + + # Check whether found version exceeds minimum required + if(${MPC_VERSION} VERSION_LESS ${MPC_FIND_VERSION}) + set(MPC_VERSION_OK FALSE) + message(STATUS "MPC version ${MPC_VERSION} found in ${MPC_INCLUDE_DIRS}, " + "but at least version ${MPC_FIND_VERSION} is required") + else() + set(MPC_VERSION_OK TRUE) + endif() +endif(MPC_INCLUDE_DIRS) + +find_library(MPC_LIBRARIES mpc + PATHS $ENV{GMPDIR} $ENV{MPFRDIR} $ENV{MPCDIR} ${LIB_INSTALL_DIR}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(MPC DEFAULT_MSG + MPC_INCLUDE_DIRS MPC_LIBRARIES MPC_VERSION_OK) +mark_as_advanced(MPC_INCLUDE_DIRS MPC_LIBRARIES) diff --git a/cmake/packages/FindMPFI.cmake b/cmake/packages/FindMPFI.cmake new file mode 100644 index 000000000..b67e2228a --- /dev/null +++ b/cmake/packages/FindMPFI.cmake @@ -0,0 +1,103 @@ +#---------------------------------------------------------------------------# +# Copyright (c) 2018-2019 Nil Foundation AG +# Copyright (c) 2018-2019 Mikhail Komarov +# Copyright (c) 2018-2019 Alexey Moskvin +# +# Distributed under the Boost Software License, Version 1.0 +# See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt +#---------------------------------------------------------------------------# + +if(GMP_FOUND) + find_package(GMP QUIET) +else() + find_package(GMP) +endif() + +if(MPFR_FOUND) + find_package(MPFR QUIET) +else() + find_package(MPFR) +endif() + +if(GMP_FOUND AND MPFR_FOUND) + if(MPFI_INCLUDES AND MPFI_LIBRARIES) + set(MPFI_FOUND TRUE) + endif(MPFI_INCLUDES AND MPFI_LIBRARIES) + + find_path(MPFI_INCLUDES NAMES mpfi.h + HINTS ENV MPFI_INC_DIR + ENV MPFI_DIR + PATHS ${GMP_INCLUDE_DIR_SEARCH} + PATH_SUFFIXES include + DOC "The directory containing the MPFI header files" + ) + if(MPFI_INCLUDES) + file(READ "${MPFI_INCLUDES}/mpfi.h" _mpfr_version_header) + + string(REGEX MATCH "define[ \t]+MPFI_VERSION_MAJOR[ \t]+([0-9]+)" + _mpfr_major_version_match "${_mpfr_version_header}") + set(MPFI_MAJOR_VERSION "${CMAKE_MATCH_1}") + string(REGEX MATCH "define[ \t]+MPFI_VERSION_MINOR[ \t]+([0-9]+)" + _mpfr_minor_version_match "${_mpfr_version_header}") + set(MPFI_MINOR_VERSION "${CMAKE_MATCH_1}") + string(REGEX MATCH "define[ \t]+MPFI_VERSION_PATCHLEVEL[ \t]+([0-9]+)" + _mpfr_patchlevel_version_match "${_mpfr_version_header}") + set(MPFI_PATCHLEVEL_VERSION "${CMAKE_MATCH_1}") + + set(MPFI_VERSION + ${MPFI_MAJOR_VERSION}.${MPFI_MINOR_VERSION}.${MPFI_PATCHLEVEL_VERSION}) + endif() + + + find_library(MPFI_LIBRARIES NAMES mpfi + HINTS ENV MPFI_LIB_DIR + ENV MPFI_DIR + PATHS ${GMP_LIBRARIES_DIR_SEARCH} + PATH_SUFFIXES lib + DOC "Directory containing the MPFI library" + ) + + if(MPFI_LIBRARIES) + get_filename_component(MPFI_LIBRARIES_DIR ${MPFI_LIBRARIES} PATH CACHE) + endif(MPFI_LIBRARIES) + + if(NOT MPFI_INCLUDES OR NOT MPFI_LIBRARIES_DIR) + include(MPFIConfig OPTIONAL) + endif(NOT MPFI_INCLUDES OR NOT MPFI_LIBRARIES_DIR) + + include(FindPackageHandleStandardArgs) + + find_package_handle_standard_args(MPFI + "DEFAULT_MSG" + MPFI_LIBRARIES + MPFI_INCLUDES) + +else(GMP_FOUND AND MPFR_FOUND) + + message(STATUS "MPFI needs GMP and MPFR") + +endif(GMP_FOUND AND MPFR_FOUND) + +if(MPFI_FOUND) + if("${MPFR_VERSION}" VERSION_LESS "4.0.0") + set(_MPFR_OLD TRUE) + endif() + + if("${MPFI_VERSION}" VERSION_LESS "1.5.2") + set(_MPFI_OLD TRUE) + endif() + + if((_MPFR_OLD AND NOT _MPFI_OLD) OR (NOT _MPFR_OLD AND _MPFI_OLD)) + + message(STATUS "MPFI<1.5.2 requires MPFR<4.0.0; MPFI>=1.5.2 requires MPFR>=4.0.0") + + set(MPFI_FOUND FALSE) + + else((_MPFR_OLD AND NOT _MPFI_OLD) OR (NOT _MPFR_OLD AND _MPFI_OLD)) + + set(MPFI_USE_FILE "CGAL_UseMPFI") + + endif((_MPFR_OLD AND NOT _MPFI_OLD) OR (NOT _MPFR_OLD AND _MPFI_OLD)) + +endif(MPFI_FOUND) \ No newline at end of file diff --git a/cmake/packages/FindMPFR.cmake b/cmake/packages/FindMPFR.cmake new file mode 100644 index 000000000..de13d1904 --- /dev/null +++ b/cmake/packages/FindMPFR.cmake @@ -0,0 +1,76 @@ +#---------------------------------------------------------------------------# +# Copyright (c) 2018-2019 Nil Foundation AG +# Copyright (c) 2018-2019 Mikhail Komarov +# Copyright (c) 2018-2019 Alexey Moskvin +# +# Distributed under the Boost Software License, Version 1.0 +# See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt +#---------------------------------------------------------------------------# +# +# Try to find the MPFR library +# See http://www.mpfr.org/ +# +# This module supports requiring a minimum version, e.g. you can do +# find_package(MPFR 2.3.0) +# to require version 2.3.0 to newer of MPFR. +# +# Once done this will define +# +# MPFR_FOUND - system has MPFR lib with correct version +# MPFR_INCLUDE_DIRS - the MPFR include directory +# MPFR_LIBRARIES - the MPFR library +# MPFR_VERSION - MPFR version + +find_path(MPFR_INCLUDE_DIRS NAMES mpfr.h PATHS $ENV{GMPDIR} $ENV{MPFRDIR} + ${INCLUDE_INSTALL_DIR}) + +# Set MPFR_FIND_VERSION to 1.0.0 if no minimum version is specified +if(NOT MPFR_FIND_VERSION) + if(NOT MPFR_FIND_VERSION_MAJOR) + set(MPFR_FIND_VERSION_MAJOR 1) + endif() + if(NOT MPFR_FIND_VERSION_MINOR) + set(MPFR_FIND_VERSION_MINOR 0) + endif() + if(NOT MPFR_FIND_VERSION_PATCH) + set(MPFR_FIND_VERSION_PATCH 0) + endif() + set(MPFR_FIND_VERSION + "${MPFR_FIND_VERSION_MAJOR}.${MPFR_FIND_VERSION_MINOR}.${MPFR_FIND_VERSION_PATCH}") +endif() + +if(MPFR_INCLUDE_DIRS) + # Query MPFR_VERSION + file(READ "${MPFR_INCLUDE_DIRS}/mpfr.h" _mpfr_version_header) + + string(REGEX MATCH "define[ \t]+MPFR_VERSION_MAJOR[ \t]+([0-9]+)" + _mpfr_major_version_match "${_mpfr_version_header}") + set(MPFR_MAJOR_VERSION "${CMAKE_MATCH_1}") + string(REGEX MATCH "define[ \t]+MPFR_VERSION_MINOR[ \t]+([0-9]+)" + _mpfr_minor_version_match "${_mpfr_version_header}") + set(MPFR_MINOR_VERSION "${CMAKE_MATCH_1}") + string(REGEX MATCH "define[ \t]+MPFR_VERSION_PATCHLEVEL[ \t]+([0-9]+)" + _mpfr_patchlevel_version_match "${_mpfr_version_header}") + set(MPFR_PATCHLEVEL_VERSION "${CMAKE_MATCH_1}") + + set(MPFR_VERSION + ${MPFR_MAJOR_VERSION}.${MPFR_MINOR_VERSION}.${MPFR_PATCHLEVEL_VERSION}) + + # Check whether found version exceeds minimum required + if(${MPFR_VERSION} VERSION_LESS ${MPFR_FIND_VERSION}) + set(MPFR_VERSION_OK FALSE) + message(STATUS "MPFR version ${MPFR_VERSION} found in ${MPFR_INCLUDE_DIRS}, " + "but at least version ${MPFR_FIND_VERSION} is required") + else() + set(MPFR_VERSION_OK TRUE) + endif() +endif() + +find_library(MPFR_LIBRARIES mpfr + PATHS $ENV{GMPDIR} $ENV{MPFRDIR} ${LIB_INSTALL_DIR}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(MPFR DEFAULT_MSG + MPFR_INCLUDE_DIRS MPFR_LIBRARIES MPFR_VERSION_OK) +mark_as_advanced(MPFR_INCLUDE_DIRS MPFR_LIBRARIES) \ No newline at end of file diff --git a/cmake/packages/FindMPIR.cmake b/cmake/packages/FindMPIR.cmake new file mode 100644 index 000000000..4f3f441a0 --- /dev/null +++ b/cmake/packages/FindMPIR.cmake @@ -0,0 +1,85 @@ +#---------------------------------------------------------------------------# +# Copyright (c) 2018-2019 Nil Foundation AG +# Copyright (c) 2018-2019 Mikhail Komarov +# +# Distributed under the Boost Software License, Version 1.0 +# See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt +#---------------------------------------------------------------------------# +# +# Try to find the MPIR library +# https://mpir.org/ +# +# This module supports requiring a minimum version, e.g. you can do +# find_package(MPIR 6.0.0) +# to require version 6.0.0 to newer of MPIR. +# +# Once done this will define +# +# MPIR_FOUND - system has MPIR lib with correct version +# MPIR_INCLUDES - the MPIR include directory +# MPIR_LIBRARIES - the MPIR library +# MPIR_VERSION - MPIR version + +find_path(MPIR_INCLUDES NAMES gmp.h PATHS $ENV{MPIRDIR} ${INCLUDE_INSTALL_DIR}) + +# Set MPIR_FIND_VERSION to 5.1.0 if no minimum version is specified +if(NOT MPIR_FIND_VERSION) + if(NOT MPIR_FIND_VERSION_MAJOR) + set(MPIR_FIND_VERSION_MAJOR 5) + endif() + if(NOT MPIR_FIND_VERSION_MINOR) + set(MPIR_FIND_VERSION_MINOR 1) + endif() + if(NOT MPIR_FIND_VERSION_PATCH) + set(MPIR_FIND_VERSION_PATCH 0) + endif() + set(MPIR_FIND_VERSION + "${MPIR_FIND_VERSION_MAJOR}.${MPIR_FIND_VERSION_MINOR}.${MPIR_FIND_VERSION_PATCH}") +endif() + +if(MPIR_INCLUDES) + # Since the MPIR version macros may be in a file included by gmp.h of the form + # gmp-.*[_]?.*.h (e.g., gmp-x86_64.h), we search each of them. + file(GLOB MPIR_HEADERS "${MPIR_INCLUDES}/gmp.h" "${MPIR_INCLUDES}/gmp-*.h") + foreach(gmp_header_filename ${MPIR_HEADERS}) + file(READ "${gmp_header_filename}" _gmp_version_header) + string(REGEX MATCH + "define[ \t]+__GNU_MP_VERSION[ \t]+([0-9]+)" _gmp_major_version_match + "${_gmp_version_header}") + if(_gmp_major_version_match) + set(MPIR_MAJOR_VERSION "${CMAKE_MATCH_1}") + string(REGEX MATCH "define[ \t]+__GNU_MP_VERSION_MINOR[ \t]+([0-9]+)" + _gmp_minor_version_match "${_gmp_version_header}") + set(MPIR_MINOR_VERSION "${CMAKE_MATCH_1}") + string(REGEX MATCH "define[ \t]+__GNU_MP_VERSION_PATCHLEVEL[ \t]+([0-9]+)" + _gmp_patchlevel_version_match "${_gmp_version_header}") + set(MPIR_PATCHLEVEL_VERSION "${CMAKE_MATCH_1}") + set(MPIR_VERSION + ${MPIR_MAJOR_VERSION}.${MPIR_MINOR_VERSION}.${MPIR_PATCHLEVEL_VERSION}) + endif() + endforeach() + + # Check whether found version exists and exceeds the minimum requirement + if(NOT MPIR_VERSION) + set(MPIR_VERSION_OK FALSE) + message(STATUS "MPIR version was not detected") + elseif(${MPIR_VERSION} VERSION_LESS ${MPIR_FIND_VERSION}) + set(MPIR_VERSION_OK FALSE) + message(STATUS "MPIR version ${MPIR_VERSION} found in ${MPIR_INCLUDES}, " + "but at least version ${MPIR_FIND_VERSION} is required") + else() + set(MPIR_VERSION_OK TRUE) + endif() +endif() + +find_library(MPIR_LIBRARIES gmp PATHS $ENV{MPIRDIR} ${LIB_INSTALL_DIR}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(MPIR DEFAULT_MSG + MPIR_INCLUDES MPIR_LIBRARIES MPIR_VERSION_OK) +if(MPIR_FOUND) + set(HAVE_MPIR "${MPIR_FOUND}") +endif() + +mark_as_advanced(MPIR_INCLUDES MPIR_LIBRARIES) \ No newline at end of file diff --git a/cmake/packages/FindMPIRXX.cmake b/cmake/packages/FindMPIRXX.cmake new file mode 100644 index 000000000..afe6dcd60 --- /dev/null +++ b/cmake/packages/FindMPIRXX.cmake @@ -0,0 +1,37 @@ +#---------------------------------------------------------------------------# +# Copyright (c) 2018-2019 Nil Foundation AG +# Copyright (c) 2018-2019 Mikhail Komarov +# Copyright (c) 2018-2019 Alexey Moskvin +# +# Distributed under the Boost Software License, Version 1.0 +# See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt +#---------------------------------------------------------------------------# +# +# Try to find the MPIRXX libraries +# MPIRXX_FOUND - system has MPIRXX lib +# MPIRXX_INCLUDE_DIRS - the MPIRXX include directory +# MPIRXX_LIBRARIES - Libraries needed to use MPIRXX + +# MPIRXX needs MPIR +find_package(MPIR QUIET) + +if(MPIR_FOUND) + if(MPIRXX_INCLUDE_DIRS AND MPIRXX_LIBRARIES) + # Already in cache, be silent + set(MPIRXX_FIND_QUIETLY TRUE) + endif() + + find_path(MPIRXX_INCLUDE_DIRS NAMES mpirxx.h + PATHS ${MPIR_INCLUDE_DIR_SEARCH} + DOC "The directory containing the MPIRXX include files" + ) + + find_library(MPIRXX_LIBRARIES NAMES mpirxx + PATHS ${MPIR_LIBRARIES_DIR_SEARCH} + DOC "Path to the MPIRXX library" + ) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(MPIRXX "DEFAULT_MSG" MPIRXX_LIBRARIES MPIRXX_INCLUDE_DIRS) +endif() diff --git a/cmake/packages/FindQuadmath.cmake b/cmake/packages/FindQuadmath.cmake new file mode 100644 index 000000000..ee82d12b9 --- /dev/null +++ b/cmake/packages/FindQuadmath.cmake @@ -0,0 +1,60 @@ +#---------------------------------------------------------------------------# +# Copyright (c) 2018-2019 Nil Foundation AG +# Copyright (c) 2018-2019 Mikhail Komarov +# +# Distributed under the Boost Software License, Version 1.0 +# See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt +#---------------------------------------------------------------------------# +# +# Once done this will define +# QUADMATH_FOUND - system has Quadmath lib +# QUADMATH_INCLUDE_DIRS - the Quadmath include directory +# QUADMATH_LIBRARIES - Libraries needed to use Quadmath + +include(FindPackageHandleStandardArgs) +include(CMakePushCheckState) +include(CheckCXXSourceCompiles) + +if(QUADMATH_FOUND) + find_path(QUADMATH_INCLUDE_DIRS NAMES quadmath.h PATHS /usr/local/lib /usr/local/include /usr/include + /opt/loca/include) + find_library(QUADMATH_LIBRARY NAMES libquadmath.a PATHS /usr/local/lib/gcc/8/ /opt/local/lib /usr/local/lib/) +else() + find_path(QUADMATH_INCLUDE_DIRS NAMES quadmath.h PATHS /usr/local/lib /usr/local/include /usr/include + /opt/loca/include) + find_library(QUADMATH_LIBRARY NAMES libquadmath.a PATHS /usr/local/lib/gcc/8/ /opt/local/lib /usr/local/lib/) +endif() + +if(NOT QUADMATH_INCLUDE_DIRS OR NOT QUADMATH_LIBRARY) + cmake_push_check_state(RESET) + list(APPEND CMAKE_REQUIRED_LIBRARIES "quadmath") + check_cxx_source_compiles(" + #include + int main(void){ + _float128 foo = ::sqrtq(123.456); + }" + QUADMATH_USE_DIRECTLY) + cmake_pop_check_state() + if(QUADMATH_USE_DIRECTLY) + set(QUADMATH_INCLUDE_DIRS "unused" CACHE PATH "" FORCE) + set(QUADMATH_LIBRARY "quadmath" CACHE FILEPATH "" FORCE) + endif() +endif() + +find_package_handle_standard_args(Quadmath DEFAULT_MSG QUADMATH_LIBRARY QUADMATH_INCLUDE_DIRS) + +mark_as_advanced(QUADMATH_INCLUDE_DIRS QUADMATH_LIBRARY) + +if(QUADMATH_FOUND AND NOT TARGET Quadmath::quadmath) + if(QUADMATH_USE_DIRECTLY) + message(STATUS "libquadmath will be included and linked directly.") + add_library(Quadmath::quadmath INTERFACE IMPORTED) + set_target_properties(Quadmath::quadmath PROPERTIES INTERFACE_LINK_LIBRARIES "${QUADMATH_LIBRARY}") + else() + add_library(Quadmath::quadmath UNKNOWN IMPORTED) + set_target_properties(Quadmath::quadmath PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${QUADMATH_INCLUDE_DIRS}" + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + IMPORTED_LOCATION "${QUADMATH_LIBRARY}") + endif() +endif() diff --git a/cmake/packages/FindTomMath.cmake b/cmake/packages/FindTomMath.cmake new file mode 100644 index 000000000..e83b10731 --- /dev/null +++ b/cmake/packages/FindTomMath.cmake @@ -0,0 +1,31 @@ +#---------------------------------------------------------------------------# +# Copyright (c) 2018-2019 Nil Foundation AG +# Copyright (c) 2018-2019 Mikhail Komarov +# Copyright (c) 2018-2019 Alexey Moskvin +# +# Distributed under the Boost Software License, Version 1.0 +# See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt +#---------------------------------------------------------------------------# +# +# TomMath_FOUND - system has TomMath +# TomMath_INCLUDE_DIRS - the TomMath include directories +# TomMath_LIBRARY - link these to use TomMath + +find_path(TomMath_INCLUDE_DIR tommath.h) + +set(TomMath_NAMES ${TomMath_NAMES} tommath libtommath) +find_library(TomMath_LIBRARY NAMES ${TomMath_NAMES}) + +# handle the QUIETLY and REQUIRED arguments and set TIFF_FOUND to TRUE if +# all listed variables are TRUE +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(TomMath DEFAULT_MSG TomMath_LIBRARY TomMath_INCLUDE_DIR) + +if(TOMMATH_FOUND) + set(TomMath_FOUND true) + set(TomMath_LIBRARIES ${TomMath_LIBRARY}) + set(TomMath_INCLUDES ${TomMath_INCLUDE_DIR}) +endif(TOMMATH_FOUND) + +mark_as_advanced(TomMath_INCLUDE_DIR TomMath_LIBRARY TomMath_FOUND) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 000000000..1d0a5fafd --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,1524 @@ +#---------------------------------------------------------------------------# +# Copyright (c) 2018-2019 Nil Foundation AG +# Copyright (c) 2018-2019 Mikhail Komarov +# Copyright (c) 2018-2019 Alexey Moskvin +# +# Distributed under the Boost Software License, Version 1.0 +# See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt +#---------------------------------------------------------------------------# + +include(CMTest) + +find_package(GMP) +find_package(Quadmath) +find_package(TomMath) +find_package(MPFR) +find_package(MPFI) +find_package(MPC) +find_package(Eigen3) + +if(BOOST_CMAKE) + find_package(${CMAKE_WORKSPACE_NAME}_algorithm) + find_package(${CMAKE_WORKSPACE_NAME}_chrono) + find_package(${CMAKE_WORKSPACE_NAME}_exception) + find_package(${CMAKE_WORKSPACE_NAME}_timer) + find_package(${CMAKE_WORKSPACE_NAME}_numeric_ublas) + find_package(${CMAKE_WORKSPACE_NAME}_filesystem) + find_package(${CMAKE_WORKSPACE_NAME}_test) + find_package(${CMAKE_WORKSPACE_NAME}_serialization) + find_package(${CMAKE_WORKSPACE_NAME}_numeric_interval) + find_package(${CMAKE_WORKSPACE_NAME}_detail) + find_package(${CMAKE_WORKSPACE_NAME}_throw_exception) + find_package(${CMAKE_WORKSPACE_NAME}_math) + find_package(${CMAKE_WORKSPACE_NAME}_regexp) + + cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} + ${CMAKE_WORKSPACE_NAME}::algorithm + ${CMAKE_WORKSPACE_NAME}::chrono + ${CMAKE_WORKSPACE_NAME}::exception + ${CMAKE_WORKSPACE_NAME}::timer + ${CMAKE_WORKSPACE_NAME}::numeric_ublas + ${CMAKE_WORKSPACE_NAME}::filesystem + ${CMAKE_WORKSPACE_NAME}::test + ${CMAKE_WORKSPACE_NAME}::serialization + ${CMAKE_WORKSPACE_NAME}::numeric_interval + ${CMAKE_WORKSPACE_NAME}::detail + ${CMAKE_WORKSPACE_NAME}::throw_exception + ${CMAKE_WORKSPACE_NAME}::math + ${CMAKE_WORKSPACE_NAME}::regexp) +else() + find_package(Boost REQUIRED COMPONENTS chrono filesystem unit_test_framework serialization regex) + list(APPEND ${CURRENT_PROJECT_NAME}_LIBRARIES ${Boost_LIBRARIES}) + find_package(Boost COMPONENTS timer exception) + list(APPEND ${CURRENT_PROJECT_NAME}_LIBRARIES ${Boost_LIBRARIES}) + + cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} + ${${CURRENT_PROJECT_NAME}_LIBRARIES}) + + include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include" + "${CMAKE_CURRENT_BINARY_DIR}/include" + + ${Boost_INCLUDE_DIRS}) +endif() + +add_custom_target(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests) +add_custom_target(${CURRENT_PROJECT_NAME}_test_suite_functions_and_limits) +add_custom_target(${CURRENT_PROJECT_NAME}_test_suite_conversions) +add_custom_target(${CURRENT_PROJECT_NAME}_test_suite_cpp_int_tests) +add_custom_target(${CURRENT_PROJECT_NAME}_test_suite_misc) +add_custom_target(${CURRENT_PROJECT_NAME}_test_suite_specfun) +add_custom_target(${CURRENT_PROJECT_NAME}_test_suite_concepts) +add_custom_target(${CURRENT_PROJECT_NAME}_test_suite_examples) +add_custom_target(${CURRENT_PROJECT_NAME}_test_suite_compile_fail) + +# copyright John Maddock 2011 +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt. + +# HACK: Workaround broken includes +file(GLOB TEST_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp ${CMAKE_CURRENT_SOURCE_DIR}/*.ipp) +set(CMAKE_INCLUDE_CURRENT_DIR TRUE) +foreach(HEADER ${TEST_HEADERS}) + configure_file(${HEADER} ${CMAKE_CURRENT_BINARY_DIR}/libs/${CURRENT_PROJECT_NAME}/test/${HEADER} + @ONLY) +endforeach() + +add_library(${CURRENT_PROJECT_NAME}_test_settings INTERFACE) +target_include_directories(${CURRENT_PROJECT_NAME}_test_settings INTERFACE ${CURRENT_TEST_SOURCES_DIR}/include) +cm_test_link_libraries(${CURRENT_PROJECT_NAME}_test_settings) + +# We set these to make it easier to set up and test GMP and MPFR under Win32: +# Speed up compiles: +# We can't yet enable this - it breaks the STL in some tests... +#msvc,off:-RTCc +#msvc,off:_ALLOW_RTCc_IN_STL + +# add_library(no_eh_support STATIC no_eh_support.cpp) +# cm_mark_as_test(no_eh_support) +# target_link_libraries(no_eh_support boost_throw_exception) +# cm_target_link_test_libs(no_eh_support) + +if(GMP_FOUND) + try_compile(GMP_COMPILED ${CMAKE_BINARY_DIR} ${CURRENT_TEST_SOURCES_DIR}/../config/has_gmp.cpp + LINK_LIBRARIES ${GMP_LIBRARIES} + CMAKE_FLAGS "-DCMAKE_CXX_LINK_EXECUTABLE='echo not linking now...'" "-DINCLUDE_DIRECTORIES=${GMP_INCLUDES}") +endif() + +if(MPFR_FOUND) + try_compile(MPFR_COMPILED ${CMAKE_BINARY_DIR} ${CURRENT_TEST_SOURCES_DIR}/../config/has_mpfr.cpp + LINK_LIBRARIES ${MPFR_LIBRARIES} + CMAKE_FLAGS "-DCMAKE_CXX_LINK_EXECUTABLE='echo not linking now...'" "-DINCLUDE_DIRECTORIES=${MPFR_INCLUDES}") +endif() + +if(TOMMATH_FOUND) + try_compile(TOMMATH_COMPILED ${CMAKE_BINARY_DIR} ${CURRENT_TEST_SOURCES_DIR}/../config/has_tommath.cpp + LINK_LIBRARIES ${TomMath_LIBRARIES} + CMAKE_FLAGS "-DCMAKE_CXX_LINK_EXECUTABLE='echo not linking now...'" "-DINCLUDE_DIRECTORIES=${TomMath_INCLUDES}") +endif() + +try_compile(FLOAT128_COMPILED ${CMAKE_BINARY_DIR} ${CURRENT_TEST_SOURCES_DIR}/../config/has_float128.cpp) + +if(MPFI_FOUND) + try_compile(MPFI_COMPILED ${CMAKE_BINARY_DIR} ${CURRENT_TEST_SOURCES_DIR}/../config/has_mpfi.cpp + LINK_LIBRARIES ${MPFI_LIBRARIES} + CMAKE_FLAGS "-DCMAKE_CXX_LINK_EXECUTABLE='echo not linking now...'" "-DINCLUDE_DIRECTORIES=${MPFI_INCLUDES}") +endif() + +if(Quadmath_FOUND) + try_compile(INTEL_QUAD_COMPILED ${CMAKE_BINARY_DIR} ${CURRENT_TEST_SOURCES_DIR}/../config/has_intel_quad.cpp CMAKE_FLAGS + "-DCMAKE_CXX_LINK_EXECUTABLE='echo not linking now...'") +endif() + +if(MPC_FOUND) + try_compile(MPC_COMPILED ${CMAKE_BINARY_DIR} ${CURRENT_TEST_SOURCES_DIR}/../config/has_mpc.cpp + LINK_LIBRARIES ${MPC_LIBRARIES} + CMAKE_FLAGS "-DCMAKE_CXX_LINK_EXECUTABLE='echo not linking now...'" "-DINCLUDE_DIRECTORIES=${MPC_INCLUDES}") +endif() + +if(EIGEN_FOUND) + try_compile(EIGEN_COMPILED ${CMAKE_BINARY_DIR} ${CURRENT_TEST_SOURCES_DIR}/../config/has_eigen.cpp + CMAKE_FLAGS "-DCMAKE_CXX_LINK_EXECUTABLE='echo not linking now...'" "-DINCLUDE_DIRECTORIES=${EIGEN3_INCLUDE_DIR}") +endif() + +#cm_test(NAME GMP_MY SOURCES ${CURRENT_TEST_SOURCES_DIR}/../config/has_float128.cpp) +#target_link_libraries(GMP_MY ${Quadmath_LIBRARY}) +#target_include_directories(GMP_MY PRIVATE ${Quadmath_INCLUDE_DIR}) + +add_library(no_eh_support SHARED ${CURRENT_TEST_SOURCES_DIR}/no_eh_test_support.cpp) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_backend_concept SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_backend_concept.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_backend_concept no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_backend_concept) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_dec_float_1 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_cpp_dec_float_1.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_dec_float_1 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_dec_float_1) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_dec_float_2 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_cpp_dec_float_2.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_dec_float_2 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_dec_float_2) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_dec_float_3 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_cpp_dec_float_3.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_dec_float_3 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_dec_float_3) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_dec_float_3m SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_cpp_dec_float_3m.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_dec_float_3m no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_dec_float_3m) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_bin_float_1 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_cpp_bin_float_1.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_bin_float_1 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_bin_float_1) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_bin_float_2 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_cpp_bin_float_2.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_bin_float_2 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_bin_float_2) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_bin_float_2m SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_cpp_bin_float_2m.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_bin_float_2m no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_bin_float_2m) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_bin_float_3 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_cpp_bin_float_3.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_bin_float_3 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_bin_float_3) + +if(GMP_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpf_50 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_mpf_50.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpf_50 ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpf_50 PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpf_50) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpf SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_mpf.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpf ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpf PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpf) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpz SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_mpz.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpz ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpz PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpz) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpz_rat SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_mpz_rat.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpz_rat ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpz_rat PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpz_rat) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpz_br SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_mpz_br.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpz_br ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpz_br PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpz_br) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpq SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_mpq.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpq ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpq PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpq) +endif() + +if(MPFR_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpfr SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_mpfr.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpfr ${MPFR_LIBRARIES} ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpfr PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpfr) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpfr_50 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_mpfr_50.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpfr_50 ${MPFR_LIBRARIES} ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpfr_50 PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpfr_50) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpfr_50_static SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_mpfr_50_static.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpfr_50_static ${MPFR_LIBRARIES} ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpfr_50_static PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpfr_50_static) +endif() + +if(TOMMATH_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_tommath SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_tommath.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_tommath ${TomMath_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_arithmetic_tommath PRIVATE ${TomMath_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_tommath) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_tommath_rat SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_tommath_rat.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_tommath_rat ${TomMath_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_arithmetic_tommath_rat PRIVATE ${TomMath_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_tommath_rat) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_tommath_br SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_tommath_br.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_tommath_br ${TomMath_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_arithmetic_tommath_br PRIVATE ${TomMath_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_tommath_br) +endif() + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_1 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_cpp_int_1.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_1 no_eh_support) +if(MSVC) + target_compile_options(${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_1 PRIVATE /bigobj) +endif() +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_1) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_2 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_cpp_int_2.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_2 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_2) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_3 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_cpp_int_3.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_3 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_3) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_4 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_cpp_int_4.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_4 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_4) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_5 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_cpp_int_5.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_5 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_5) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_6 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_cpp_int_6.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_6 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_6) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_7 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_cpp_int_7.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_7 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_7) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_8 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_cpp_int_8.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_8 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_8) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_9 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_cpp_int_9.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_9 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_9) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_10 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_cpp_int_10.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_10 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_10) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_11 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_cpp_int_11.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_11 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_11) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_12 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_cpp_int_12.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_12 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_12) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_13 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_cpp_int_13.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_13 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_13) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_14 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_cpp_int_14.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_14 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_14) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_15 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_cpp_int_15.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_15 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_15) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_16 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_cpp_int_16.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_16 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_16) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_17 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_cpp_int_17.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_17 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_17) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_18 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_cpp_int_18.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_18 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_18) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_19 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_cpp_int_19.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_19 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_19) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_br SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_cpp_int_br.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_br no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_cpp_int_br) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_ab_1 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_ab_1.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_ab_1 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_ab_1) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_ab_2 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_ab_2.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_ab_2 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_ab_2) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_ab_3 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_ab_3.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_ab_3 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_ab_3) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_cpp_dec_float_round SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_cpp_dec_float_round.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_cpp_dec_float_round no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_cpp_dec_float_round) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_logged_1 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_logged_1.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_logged_1 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_logged_1) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_logged_2 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_logged_2.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_logged_2 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_logged_2) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_dbg_adptr1 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_dbg_adptr1.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_dbg_adptr1 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_dbg_adptr1) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_dbg_adptr1m SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_dbg_adptr1m.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_dbg_adptr1m no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_dbg_adptr1m) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_dbg_adptr2 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_dbg_adptr2.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_dbg_adptr2 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_dbg_adptr2) + +if(MPFI_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpfi_50 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_mpfi_50.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpfi_50 ${MPFI_LIBRARIES} ${MPFR_LIBRARIES} ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpfi_50 PRIVATE ${MPFI_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpfi_50) +endif() + +if(INTEL_QUAD_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_float_128 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_float_128.cpp) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_float_128) +endif() + +if(FLOAT128_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_float_128_quad SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_float_128.cpp) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_float_128_quad) +endif() + +if(MPC_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpc SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_mpc.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpc ${MPC_LIBRARIES} ${MPFR_LIBRARIES} ${GMP_LIBRARIES}) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpc PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_mpc) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_mpfr_mpc_precisions SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_mpfr_mpc_precisions.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_mpfr_mpc_precisions ${MPC_LIBRARIES} ${MPFR_LIBRARIES} ${GMP_LIBRARIES}) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_mpfr_mpc_precisions PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_mpfr_mpc_precisions) +endif() +if(MPFI_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_mpfi_precisions SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_mpfi_precisions.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_mpfi_precisions ${MPFI_LIBRARIES} ${MPFR_LIBRARIES} ${GMP_LIBRARIES}) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_mpfi_precisions PRIVATE ${MPFI_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_mpfi_precisions) +endif() + +if(GMP_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_mpf_precisions SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_mpf_precisions.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_mpf_precisions ${GMP_LIBRARIES}) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_mpf_precisions PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_mpf_precisions) +endif() + +if((MPC_COMPILED) AND (FLOAT128_COMPILED)) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_complex SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_complex.cpp) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_complex) +endif() + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_complex_adaptor SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_complex_adaptor.cpp) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_complex_adaptor) +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_complex_adaptor_2 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_complex_adaptor_2.cpp) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_arithmetic_complex_adaptor_2) + +if(FLOAT128_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_arithmetic_complex128 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_arithmetic_complex128.cpp) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_arithmetic_tests ${CURRENT_PROJECT_NAME}_test_test_complex128) +endif() + +set(LOCAL_SOURCES test_exp.cpp test_log.cpp test_pow.cpp test_sinh.cpp test_sqrt.cpp test_cosh.cpp test_tanh.cpp test_sin.cpp test_cos.cpp test_tan.cpp test_asin.cpp test_acos.cpp test_atan.cpp test_round.cpp test_fpclassify.cpp test_sf_import_c99.cpp) +foreach(FILE ${LOCAL_SOURCES}) + get_filename_component(NAME ${FILE} NAME_WE) + if(GMP_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_${NAME}_mpf50 SOURCES ${CURRENT_TEST_SOURCES_DIR}/${FILE}) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_${NAME}_mpf50 PUBLIC -DTEST_MPF_50) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_${NAME}_mpf50 ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_${NAME}_mpf50 PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_functions_and_limits ${CURRENT_PROJECT_NAME}_test_${NAME}_mpf50) + endif() + if(MPFR_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_${NAME}_mpfr50 SOURCES ${CURRENT_TEST_SOURCES_DIR}/${FILE}) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_${NAME}_mpfr50 PUBLIC -DTEST_MPFR_50) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_${NAME}_mpfr50 ${MPFR_LIBRARIES} ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_${NAME}_mpfr50 PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_functions_and_limits ${CURRENT_PROJECT_NAME}_test_${NAME}_mpfr50) + endif() + if(MPFI_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_${NAME}_mpfi50 SOURCES ${CURRENT_TEST_SOURCES_DIR}/${FILE}) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_${NAME}_mpfi50 PUBLIC -DTEST_MPFI_50) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_${NAME}_mpfi50 ${MPFI_LIBRARIES} ${MPFR_LIBRARIES} ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_${NAME}_mpfi50 PRIVATE ${MPFI_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_functions_and_limits ${CURRENT_PROJECT_NAME}_test_${NAME}_mpfi50) + endif() + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_${NAME}_cpp_dec_float SOURCES ${CURRENT_TEST_SOURCES_DIR}/${FILE}) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_${NAME}_cpp_dec_float PUBLIC -DTEST_CPP_DEC_FLOAT) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_${NAME}_cpp_dec_float no_eh_support) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_functions_and_limits ${CURRENT_PROJECT_NAME}_test_${NAME}_cpp_dec_float) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_${NAME}_cpp_bin_float SOURCES ${CURRENT_TEST_SOURCES_DIR}/${FILE}) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_${NAME}_cpp_bin_float PUBLIC -DTEST_CPP_BIN_FLOAT) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_${NAME}_cpp_bin_float no_eh_support) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_functions_and_limits ${CURRENT_PROJECT_NAME}_test_${NAME}_cpp_bin_float) + + if(FLOAT128_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_${NAME}_float128 SOURCES ${CURRENT_TEST_SOURCES_DIR}/${FILE}) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_${NAME}_float128 PUBLIC -DTEST_FLOAT128) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_${NAME}_float128 no_eh_support) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_functions_and_limits ${CURRENT_PROJECT_NAME}_test_${NAME}_float128) + endif() + + if(INTEL_QUAD_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_${NAME}_intel_quad SOURCES ${CURRENT_TEST_SOURCES_DIR}/${FILE}) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_${NAME}_intel_quad PUBLIC -DTEST_FLOAT128) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_${NAME}_intel_quad no_eh_support) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_functions_and_limits ${CURRENT_PROJECT_NAME}_test_${NAME}_intel_quad) + endif() +endforeach() + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_numeric_limits_backend_concept SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_numeric_limits.cpp) +target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_numeric_limits_backend_concept PUBLIC -DTEST_BACKEND) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_numeric_limits_backend_concept no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_functions_and_limits ${CURRENT_PROJECT_NAME}_test_test_numeric_limits_backend_concept) + +if(GMP_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_numeric_limits_mpf50 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_numeric_limits.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_numeric_limits_mpf50 PUBLIC -DTEST_MPF_50) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_numeric_limits_mpf50 ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_numeric_limits_mpf50 PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_functions_and_limits ${CURRENT_PROJECT_NAME}_test_test_numeric_limits_mpf50) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_numeric_limits_mpf SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_numeric_limits.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_numeric_limits_mpf PUBLIC -DTEST_MPF) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_numeric_limits_mpf ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_numeric_limits_mpf PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_functions_and_limits ${CURRENT_PROJECT_NAME}_test_test_numeric_limits_mpf) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_numeric_limits_mpz SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_numeric_limits.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_numeric_limits_mpz PUBLIC -DTEST_MPZ) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_numeric_limits_mpz ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_numeric_limits_mpz PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_functions_and_limits ${CURRENT_PROJECT_NAME}_test_test_numeric_limits_mpz) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_numeric_limits_mpq SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_numeric_limits.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_numeric_limits_mpq PUBLIC -DTEST_MPQ) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_numeric_limits_mpq ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_numeric_limits_mpq PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_functions_and_limits ${CURRENT_PROJECT_NAME}_test_test_numeric_limits_mpq) +endif() + +if(MPFR_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_numeric_limits_mpfr SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_numeric_limits.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_numeric_limits_mpfr PUBLIC -DTEST_MPFR) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_numeric_limits_mpfr ${MPFR_LIBRARIES} ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_numeric_limits_mpfr PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_functions_and_limits ${CURRENT_PROJECT_NAME}_test_test_numeric_limits_mpfr) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_numeric_limits_mpfr_50 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_numeric_limits.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_numeric_limits_mpfr_50 PUBLIC -DTEST_MPFR_50) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_numeric_limits_mpfr_50 ${MPFR_LIBRARIES} ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_numeric_limits_mpfr_50 PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_functions_and_limits ${CURRENT_PROJECT_NAME}_test_test_numeric_limits_mpfr_50) +endif() + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_numeric_limits_cpp_dec_float SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_numeric_limits.cpp) +target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_numeric_limits_cpp_dec_float PUBLIC -DTEST_CPP_DEC_FLOAT) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_numeric_limits_cpp_dec_float no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_functions_and_limits ${CURRENT_PROJECT_NAME}_test_test_numeric_limits_cpp_dec_float) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_numeric_limits_cpp_bin_float SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_numeric_limits.cpp) +target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_numeric_limits_cpp_bin_float PUBLIC -DTEST_CPP_BIN_FLOAT) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_numeric_limits_cpp_bin_float no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_functions_and_limits ${CURRENT_PROJECT_NAME}_test_test_numeric_limits_cpp_bin_float) + +if(TOMMATH_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_numeric_limits_tommath SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_numeric_limits.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_numeric_limits_tommath PUBLIC -DTEST_TOMMATH) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_numeric_limits_tommath ${TomMath_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_numeric_limits_tommath PRIVATE ${TomMath_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_functions_and_limits ${CURRENT_PROJECT_NAME}_test_test_numeric_limits_tommath) +endif() + +if(NOT CMAKE_CXX_COMPILER_ID MATCHES "GNU") + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_numeric_limits_cpp_int SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_numeric_limits.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_numeric_limits_cpp_int PUBLIC -DTEST_CPP_INT) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_numeric_limits_cpp_int no_eh_support) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_functions_and_limits ${CURRENT_PROJECT_NAME}_test_test_numeric_limits_cpp_int) +endif() + +if(MPFI_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_numeric_limits_mpfi_50 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_numeric_limits.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_numeric_limits_mpfi_50 PUBLIC -DTEST_MPFI_50) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_numeric_limits_mpfi_50 ${MPFI_LIBRARIES} ${MPFR_LIBRARIES} ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_numeric_limits_mpfi_50 PRIVATE ${MPFI_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_functions_and_limits ${CURRENT_PROJECT_NAME}_test_test_numeric_limits_mpfi_50) +endif() + +if(FLOAT128_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_numeric_limits_float128 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_numeric_limits.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_numeric_limits_float128 PUBLIC -DTEST_FLOAT128) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_functions_and_limits ${CURRENT_PROJECT_NAME}_test_test_numeric_limits_float128) +endif() + +if((INTEL_QUAD_COMPILED) AND (FLOAT128_COMPILED)) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_numeric_limits_intel_quad SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_numeric_limits.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_numeric_limits_intel_quad PUBLIC -DTEST_FLOAT128) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_functions_and_limits ${CURRENT_PROJECT_NAME}_test_test_numeric_limits_intel_quad) +endif() + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_sf_import_c99_cpp_dec_float_2 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_sf_import_c99.cpp) +target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_sf_import_c99_cpp_dec_float_2 PUBLIC -DTEST_CPP_DEC_FLOAT_2) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_functions_and_limits ${CURRENT_PROJECT_NAME}_test_test_sf_import_c99_cpp_dec_float_2) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_sf_import_c99_cpp_dec_float_3 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_sf_import_c99.cpp) +target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_sf_import_c99_cpp_dec_float_3 PUBLIC -DTEST_CPP_DEC_FLOAT_3) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_functions_and_limits ${CURRENT_PROJECT_NAME}_test_test_sf_import_c99_cpp_dec_float_3) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_sf_import_c99_cpp_dec_float_4 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_sf_import_c99.cpp) +target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_sf_import_c99_cpp_dec_float_4 PUBLIC -DTEST_CPP_DEC_FLOAT_4) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_functions_and_limits ${CURRENT_PROJECT_NAME}_test_test_sf_import_c99_cpp_dec_float_4) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_sf_import_c99_cpp_dec_float_5 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_sf_import_c99.cpp) +target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_sf_import_c99_cpp_dec_float_5 PUBLIC -DTEST_CPP_DEC_FLOAT_5) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_functions_and_limits ${CURRENT_PROJECT_NAME}_test_test_sf_import_c99_cpp_dec_float_5) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_sf_import_c99_cpp_dec_float_6 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_sf_import_c99.cpp) +target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_sf_import_c99_cpp_dec_float_6 PUBLIC -DTEST_CPP_DEC_FLOAT_6) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_functions_and_limits ${CURRENT_PROJECT_NAME}_test_test_sf_import_c99_cpp_dec_float_6) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_sf_import_c99_cpp_bin_float_2 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_sf_import_c99.cpp) +target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_sf_import_c99_cpp_bin_float_2 PUBLIC -DTEST_CPP_BIN_FLOAT_2) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_functions_and_limits ${CURRENT_PROJECT_NAME}_test_test_sf_import_c99_cpp_bin_float_2) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_sf_import_c99_cpp_bin_float_3 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_sf_import_c99.cpp) +target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_sf_import_c99_cpp_bin_float_3 PUBLIC -DTEST_CPP_BIN_FLOAT_2) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_functions_and_limits ${CURRENT_PROJECT_NAME}_test_test_sf_import_c99_cpp_bin_float_3) + +if(MPFR_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_move_mpfr SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_move.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_move_mpfr PUBLIC -DTEST_MPFR) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_move_mpfr ${MPFR_LIBRARIES} ${GMP_LIBRARIES} no_eh_support) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_functions_and_limits ${CURRENT_PROJECT_NAME}_test_test_move_mpfr) +endif() + +if(MPC_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_move_mpc SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_move.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_move_mpc PUBLIC -DTEST_MPC) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_move_mpc ${MPC_LIBRARIES} ${MPFR_LIBRARIES} ${GMP_LIBRARIES} no_eh_support) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_functions_and_limits ${CURRENT_PROJECT_NAME}_test_test_move_mpc) +endif() + +if(GMP_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_move_gmp SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_move.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_move_gmp PUBLIC -DTEST_GMP) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_move_gmp ${GMP_LIBRARIES} no_eh_support) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_functions_and_limits ${CURRENT_PROJECT_NAME}_test_test_move_gmp) +endif() + +if(TOMMATH_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_move_tommath SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_move.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_move_tommath PUBLIC -DTEST_TOMMATH) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_move_tommath ${TomMath_LIBRARIES} no_eh_support) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_functions_and_limits ${CURRENT_PROJECT_NAME}_test_test_move_tommath) +endif() + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_move_cpp_int SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_move.cpp) +target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_move_cpp_int PUBLIC -DTEST_CPP_INT) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_move_cpp_int no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_functions_and_limits ${CURRENT_PROJECT_NAME}_test_test_move_cpp_int) + +if(GMP_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_gmp_conversions SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_gmp_conversions.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_gmp_conversions ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_gmp_conversions PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_conversions ${CURRENT_PROJECT_NAME}_test_test_gmp_conversions) +endif() + +if(MPFR_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_mpfr_conversions SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_mpfr_conversions.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_mpfr_conversions ${MPFR_LIBRARIES} ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_mpfr_conversions PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_conversions ${CURRENT_PROJECT_NAME}_test_test_mpfr_conversions) +endif() + +if(MPC_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_mpc_conversions SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_mpfr_conversions.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_mpc_conversions ${MPC_LIBRARIES} ${MPFR_LIBRARIES} ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_mpc_conversions PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_conversions ${CURRENT_PROJECT_NAME}_test_test_mpc_conversions) +endif() + +if(GMP_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_constants_mpf50 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_constants.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_constants_mpf50 PUBLIC -DTEST_MPF_50) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_constants_mpf50 ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_constants_mpf50 PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_conversions ${CURRENT_PROJECT_NAME}_test_test_constants_mpf50) +endif() + +if(MPFR_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_constants_mpfr_50 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_constants.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_constants_mpfr_50 PUBLIC -DTEST_MPFR_50) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_constants_mpfr_50 ${MPFR_LIBRARIES} ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_constants_mpfr_50 PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_conversions ${CURRENT_PROJECT_NAME}_test_test_constants_mpfr_50) +endif() + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_constants_cpp_dec_float SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_constants.cpp) +target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_constants_cpp_dec_float PUBLIC -DTEST_CPP_DEC_FLOAT) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_constants_cpp_dec_float no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_conversions ${CURRENT_PROJECT_NAME}_test_test_constants_cpp_dec_float) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_test SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_test.cpp) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_cpp_int_lit SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_cpp_int_lit.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_cpp_int_lit no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_conversions ${CURRENT_PROJECT_NAME}_test_test_cpp_int_lit) + +if((GMP_COMPILED) AND (MPFR_COMPILED) AND (MPFI_COMPILED) AND (TOMMATH_COMPILED) AND (FLOAT128_COMPILED)) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_convert_from_cpp_int SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_convert_from_cpp_int.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_convert_from_cpp_int ${QUADMATH_LIBRARIES} ${TomMath_LIBRARIES} + ${MPFI_LIBRARIES} ${MPFR_LIBRARIES} ${GMP_LIBRARIES}) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_convert_from_cpp_int PRIVATE -DHAS_GMP -DHAS_MPFR -DHAS_MPFI -DHAS_TOMMATH -DFLOAT128_COMPILED) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_conversions ${CURRENT_PROJECT_NAME}_test_test_convert_from_cpp_int) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_convert_from_mpz_int SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_convert_from_mpz_int.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_convert_from_mpz_int ${QUADMATH_LIBRARIES} ${TomMath_LIBRARIES} + ${MPFI_LIBRARIES} ${MPFR_LIBRARIES} ${GMP_LIBRARIES}) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_convert_from_mpz_int PRIVATE -DHAS_GMP -DHAS_MPFR -DHAS_MPFI -DHAS_TOMMATH -DFLOAT128_COMPILED) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_conversions ${CURRENT_PROJECT_NAME}_test_test_convert_from_mpz_int) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_convert_from_tom_int SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_convert_from_tom_int.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_convert_from_tom_int ${QUADMATH_LIBRARIES} ${TomMath_LIBRARIES} + ${MPFI_LIBRARIES} ${MPFR_LIBRARIES} ${GMP_LIBRARIES}) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_convert_from_tom_int PRIVATE -DHAS_GMP -DHAS_MPFR -DHAS_MPFI -DHAS_TOMMATH -DFLOAT128_COMPILED) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_conversions ${CURRENT_PROJECT_NAME}_test_test_convert_from_tom_int) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_convert_from_cpp_rational SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_convert_from_cpp_rational.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_convert_from_cpp_rational ${QUADMATH_LIBRARIES} ${TomMath_LIBRARIES} + ${MPFI_LIBRARIES} ${MPFR_LIBRARIES} ${GMP_LIBRARIES}) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_convert_from_cpp_rational PRIVATE -DHAS_GMP -DHAS_MPFR -DHAS_MPFI -DHAS_TOMMATH -DFLOAT128_COMPILED) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_conversions ${CURRENT_PROJECT_NAME}_test_test_convert_from_cpp_rational) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_convert_from_gmp_rational SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_convert_from_gmp_rational.cpp) + target_link_libraries(test_convert_from_gmp_rational ${QUADMATH_LIBRARIES} ${TomMath_LIBRARIES} + ${MPFI_LIBRARIES} ${MPFR_LIBRARIES} ${GMP_LIBRARIES}) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_convert_from_gmp_rational PRIVATE -DHAS_GMP -DHAS_MPFR -DHAS_MPFI -DHAS_TOMMATH -DFLOAT128_COMPILED) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_conversions ${CURRENT_PROJECT_NAME}_test_test_convert_from_gmp_rational) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_convert_from_tom_rational SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_convert_from_tom_rational.cpp) + target_link_libraries(test_convert_from_tom_rational ${QUADMATH_LIBRARIES} ${TomMath_LIBRARIES} + ${MPFI_LIBRARIES} ${MPFR_LIBRARIES} ${GMP_LIBRARIES}) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_convert_from_tom_rational PRIVATE -DHAS_GMP -DHAS_MPFR -DHAS_MPFI -DHAS_TOMMATH -DFLOAT128_COMPILED) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_conversions ${CURRENT_PROJECT_NAME}_test_test_convert_from_tom_rational) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_convert_from_cpp_bin_float SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_convert_from_cpp_bin_float.cpp) + target_link_libraries(test_convert_from_cpp_bin_float ${QUADMATH_LIBRARIES} ${TomMath_LIBRARIES} + ${MPFI_LIBRARIES} ${MPFR_LIBRARIES} ${GMP_LIBRARIES}) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_convert_from_cpp_bin_float PRIVATE -DHAS_GMP -DHAS_MPFR -DHAS_MPFI -DHAS_TOMMATH -DFLOAT128_COMPILED) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_conversions ${CURRENT_PROJECT_NAME}_test_test_convert_from_cpp_bin_float) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_convert_from_cpp_dec_float SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_convert_from_cpp_dec_float.cpp) + target_link_libraries(test_convert_from_cpp_dec_float ${QUADMATH_LIBRARIES} ${TomMath_LIBRARIES} + ${MPFI_LIBRARIES} ${MPFR_LIBRARIES} ${GMP_LIBRARIES}) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_convert_from_cpp_dec_float PRIVATE -DHAS_GMP -DHAS_MPFR -DHAS_MPFI -DHAS_TOMMATH -DFLOAT128_COMPILED) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_conversions ${CURRENT_PROJECT_NAME}_test_test_convert_from_cpp_dec_float) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_convert_from_mpf_float SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_convert_from_mpf_float.cpp) + target_link_libraries(test_convert_from_mpf_float ${QUADMATH_LIBRARIES} ${TomMath_LIBRARIES} + ${MPFI_LIBRARIES} ${MPFR_LIBRARIES} ${GMP_LIBRARIES}) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_convert_from_mpf_float PRIVATE -DHAS_GMP -DHAS_MPFR -DHAS_MPFI -DHAS_TOMMATH -DFLOAT128_COMPILED) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_conversions ${CURRENT_PROJECT_NAME}_test_test_convert_from_mpf_float) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_convert_from_mpfr_float SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_convert_from_mpfr_float.cpp) + target_link_libraries(test_convert_from_mpfr_float ${QUADMATH_LIBRARIES} ${TomMath_LIBRARIES} + ${MPFI_LIBRARIES} ${MPFR_LIBRARIES} ${GMP_LIBRARIES}) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_convert_from_mpfr_float PRIVATE -DHAS_GMP -DHAS_MPFR -DHAS_MPFI -DHAS_TOMMATH -DFLOAT128_COMPILED) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_conversions ${CURRENT_PROJECT_NAME}_test_test_convert_from_mpfr_float) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_convert_from_mpfi_float SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_convert_from_mpfi_float.cpp) + target_link_libraries(test_convert_from_mpfi_float ${QUADMATH_LIBRARIES} ${TomMath_LIBRARIES} + ${MPFI_LIBRARIES} ${MPFR_LIBRARIES} ${GMP_LIBRARIES}) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_convert_from_mpfi_float PRIVATE -DHAS_GMP -DHAS_MPFR -DHAS_MPFI -DHAS_TOMMATH -DFLOAT128_COMPILED) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_conversions ${CURRENT_PROJECT_NAME}_test_test_convert_from_mpfi_float) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_convert_from_float128 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_convert_from_float128.cpp) + target_link_libraries(test_convert_from_float128 ${QUADMATH_LIBRARIES} ${TomMath_LIBRARIES} + ${MPFI_LIBRARIES} ${MPFR_LIBRARIES} ${GMP_LIBRARIES}) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_convert_from_float128 PRIVATE -DHAS_GMP -DHAS_MPFR -DHAS_MPFI -DHAS_TOMMATH -DFLOAT128_COMPILED) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_conversions ${CURRENT_PROJECT_NAME}_test_test_convert_from_float128) + +endif() + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_cpp_bin_float_conv SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_cpp_bin_float_conv.cpp) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_conversions ${CURRENT_PROJECT_NAME}_test_test_cpp_bin_float_conv) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_cpp_bin_float_io_1 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_cpp_bin_float_io.cpp) +target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_cpp_bin_float_io_1 PUBLIC -DTEST1 -DTEST_CPP_BIN_FLOAT) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_conversions ${CURRENT_PROJECT_NAME}_test_test_cpp_bin_float_io_1) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_cpp_bin_float_io_2 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_cpp_bin_float_io.cpp) +target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_cpp_bin_float_io_2 PUBLIC -DTEST2 -DTEST_CPP_BIN_FLOAT) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_conversions ${CURRENT_PROJECT_NAME}_test_test_cpp_bin_float_io_2) + +if(MPFR_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_cpp_bin_float SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_cpp_bin_float.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_cpp_bin_float PUBLIC -DTEST_MPFR) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_cpp_bin_float ${MPFR_LIBRARIES} ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_cpp_bin_float PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_conversions ${CURRENT_PROJECT_NAME}_test_test_cpp_bin_float) +endif() + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_cpp_dec_float SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_float_io.cpp) +target_compile_definitions(${CURRENT_PROJECT_NAME}_test_cpp_dec_float PUBLIC -DTEST_CPP_DEC_FLOAT) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_cpp_dec_float no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_conversions ${CURRENT_PROJECT_NAME}_test_cpp_dec_float) + +if(GMP_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_float_io_mpf SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_float_io.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_float_io_mpf PUBLIC -DTEST_MPF_50) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_float_io_mpf ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_float_io_mpf PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_conversions ${CURRENT_PROJECT_NAME}_test_test_float_io_mpf) +endif() + +if(MPFR_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_float_io_mpfr SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_float_io.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_float_io_mpfr PUBLIC -DTEST_MPFR_50) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_float_io_mpfr ${MPFR_LIBRARIES} ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_float_io_mpfr PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_conversions ${CURRENT_PROJECT_NAME}_test_test_float_io_mpfr) +endif() + +if(MPFI_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_float_io_mpfi SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_float_io.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_float_io_mpfi PUBLIC -DTEST_MPFI_50) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_float_io_mpfi ${MPFI_LIBRARIES} ${MPFR_LIBRARIES} ${GMP_LIBRARIES} ${TomMath_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_float_io_mpfi PRIVATE ${GMP_INCLUDES} ${MPFI_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_conversions ${CURRENT_PROJECT_NAME}_test_test_float_io_mpfi) +endif() + +if(FLOAT128_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_float_io_float128 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_float_io.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_float_io_float128 PUBLIC -DTEST_FLOAT128) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_float_io_float128 ${QUADMATH_LIBRARIES} no_eh_support) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_conversions ${CURRENT_PROJECT_NAME}_test_test_float_io_float128) +endif() + +if((INTEL_QUAD_COMPILED) AND (FLOAT128_COMPILED)) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_float_io_intel_quad SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_float_io.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_float_io_intel_quad PUBLIC -DTEST_FLOAT128) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_float_io_intel_quad no_eh_support) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_conversions ${CURRENT_PROJECT_NAME}_test_test_float_io_intel_quad) +endif() + +if(TOMMATH_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_int_io_tommath SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_int_io.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_int_io_tommath PUBLIC -DTEST_TOMMATH) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_int_io_tommath ${TomMath_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_int_io_tommath PRIVATE ${TomMath_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_conversions ${CURRENT_PROJECT_NAME}_test_test_int_io_tommath) +endif() + +if(GMP_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_int_io_mpz SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_int_io.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_int_io_mpz PUBLIC -DTEST_MPZ) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_int_io_mpz ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_int_io_mpz PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_conversions ${CURRENT_PROJECT_NAME}_test_test_int_io_mpz) +endif() + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_int_io_cpp_int SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_int_io.cpp) +target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_int_io_cpp_int PUBLIC -DTEST_CPP_INT) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_int_io_cpp_int no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_cpp_int_tests ${CURRENT_PROJECT_NAME}_test_test_int_io_cpp_int) + +if(GMP_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_cpp_int_left_shift SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_cpp_int_left_shift.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_cpp_int_left_shift ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_cpp_int_left_shift PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_cpp_int_tests ${CURRENT_PROJECT_NAME}_test_test_cpp_int_left_shift) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_cpp_int_1 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_cpp_int.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_cpp_int_1 PUBLIC -DTEST1) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_cpp_int_1 ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_cpp_int_1 PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_cpp_int_tests ${CURRENT_PROJECT_NAME}_test_test_cpp_int_1) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_cpp_int_2 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_cpp_int.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_cpp_int_2 PUBLIC -DTEST2) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_cpp_int_2 ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_cpp_int_2 PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_cpp_int_tests ${CURRENT_PROJECT_NAME}_test_test_cpp_int_2) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_cpp_int_3 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_cpp_int.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_cpp_int_3 PUBLIC -DTEST3) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_cpp_int_3 ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_cpp_int_3 PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_cpp_int_tests ${CURRENT_PROJECT_NAME}_test_test_cpp_int_3) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_cpp_int_4 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_cpp_int.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_cpp_int_4 PUBLIC -DTEST4) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_cpp_int_4 ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_cpp_int_4 PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_cpp_int_tests ${CURRENT_PROJECT_NAME}_test_test_cpp_int_4) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_cpp_int_5 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_cpp_int.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_cpp_int_5 PUBLIC -DTEST5) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_cpp_int_5 ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_cpp_int_5 PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_cpp_int_tests ${CURRENT_PROJECT_NAME}_test_test_cpp_int_5) +endif() + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_checked_cpp_int SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_checked_cpp_int.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_checked_cpp_int no_eh_support) +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_unchecked_cpp_int SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_unchecked_cpp_int.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_unchecked_cpp_int no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_cpp_int_tests ${CURRENT_PROJECT_NAME}_test_test_unchecked_cpp_int) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_cpp_int_serial_1 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_cpp_int_serial.cpp) +target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_cpp_int_serial_1 PUBLIC -DTEST1) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_cpp_int_tests ${CURRENT_PROJECT_NAME}_test_test_cpp_int_serial_1) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_cpp_int_serial_2 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_cpp_int_serial.cpp) +target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_cpp_int_serial_2 PUBLIC -DTEST2) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_cpp_int_tests ${CURRENT_PROJECT_NAME}_test_test_cpp_int_serial_2) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_cpp_int_serial_3 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_cpp_int_serial.cpp) +target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_cpp_int_serial_3 PUBLIC -DTEST3) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_cpp_int_tests ${CURRENT_PROJECT_NAME}_test_test_cpp_int_serial_3) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_cpp_int_serial_4 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_cpp_int_serial.cpp) +target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_cpp_int_serial_4 PUBLIC -DTEST4) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_cpp_int_tests ${CURRENT_PROJECT_NAME}_test_test_cpp_int_serial_4) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_cpp_int_deserial SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_cpp_int_deserial.cpp) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_cpp_int_tests ${CURRENT_PROJECT_NAME}_test_test_cpp_int_deserial) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_cpp_rat_serial SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_cpp_rat_serial.cpp) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_cpp_int_tests ${CURRENT_PROJECT_NAME}_test_test_cpp_rat_serial) + +if((FLOAT128_COMPILED) AND (QUADMATH_COMPILED)) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_constexpr SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_constexpr.cpp COMPILE_ONLY) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_constexpr PUBLIC -DHAVE_FLOAT128) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_constexpr) +endif() + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_nothrow_cpp_int SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_nothrow_cpp_int.cpp COMPILE_ONLY) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_nothrow_cpp_int) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_nothrow_cpp_rational SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_nothrow_cpp_rational.cpp COMPILE_ONLY) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_nothrow_cpp_rational) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_nothrow_cpp_bin_float SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_nothrow_cpp_bin_float.cpp COMPILE_ONLY) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_nothrow_cpp_bin_float) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_nothrow_cpp_dec_float SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_nothrow_cpp_dec_float.cpp COMPILE_ONLY) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_nothrow_cpp_dec_float) + +if(FLOAT128_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_nothrow_float128 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_nothrow_float128.cpp COMPILE_ONLY) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_nothrow_float128) +endif() + +if(GMP_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_nothrow_gmp SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_nothrow_gmp.cpp COMPILE_ONLY) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_nothrow_gmp) +endif() + +if(MPFR_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_nothrow_mpfr SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_nothrow_mpfr.cpp COMPILE_ONLY) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_nothrow_mpfr) +endif() + +if(GMP_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_miller_rabin SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_miller_rabin.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_miller_rabin ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_miller_rabin PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_miller_rabin) +endif() + +if(TOMMATH_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_rational_io_tommath SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_rational_io.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_rational_io_tommath PUBLIC -DTEST_TOMMATH) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_rational_io_tommath ${TomMath_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_rational_io_tommath PRIVATE ${TomMath_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_rational_io_tommath) +endif() + +if(GMP_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_rational_io_mpz SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_rational_io.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_rational_io_mpz PUBLIC -DTEST_MPQ) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_rational_io_mpz ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_rational_io_mpz PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_rational_io_mpz) +endif() + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_rational_io_cpp_int SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_rational_io.cpp) +target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_rational_io_cpp_int PUBLIC -DTEST_CPP_INT) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_rational_io_cpp_int no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_rational_io_cpp_int) + +if((GMP_COMPILED) AND (TOMMATH_COMPILED) AND (MPFR_COMPILED)) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_generic_conv SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_generic_conv.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_generic_conv PUBLIC -DTEST_GMP -DTEST_TOMMATH -DTEST_MPFR) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_generic_conv ${TomMath_LIBRARIES} ${MPFR_LIBRARIES} ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_generic_conv PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_generic_conv) +endif() + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_1 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_rat_float_interconv.cpp) +target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_1 PUBLIC -DTEST1) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_1 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_1) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_2 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_rat_float_interconv.cpp) +target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_2 PUBLIC -DTEST2) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_2 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_2) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_3 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_rat_float_interconv.cpp) +target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_3 PUBLIC -DTEST3) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_3 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_3) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_4 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_rat_float_interconv.cpp) +target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_4 PUBLIC -DTEST4) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_4 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_4) + +if(MPFR_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_5 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_rat_float_interconv.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_5 PUBLIC -DTEST5) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_5 ${MPFR_LIBRARIES} ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_5 PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_5) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_6 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_rat_float_interconv.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_6 PUBLIC -DTEST6) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_6 ${MPFR_LIBRARIES} ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_6 PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_6) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_7 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_rat_float_interconv.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_7 PUBLIC -DTEST7) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_7 ${MPFR_LIBRARIES} ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_7 PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_7) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_8 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_rat_float_interconv.cpp) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_8 PUBLIC -DTEST8) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_8 ${MPFR_LIBRARIES} ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_8 PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_rat_float_interconv_8) +endif() + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_cpp_int_conv SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_cpp_int_conv.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_cpp_int_conv no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_cpp_int_conv) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_cpp_int_import_export SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_cpp_int_import_export.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_cpp_int_import_export no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_cpp_int_import_export) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_native_integer SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_native_integer.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_native_integer no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_native_integer) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_mixed_cpp_int SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_mixed_cpp_int.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_mixed_cpp_int no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_mixed_cpp_int) + +if((GMP_COMPILED) AND (MPFR_COMPILED)) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_mixed_float SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_mixed_float.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_mixed_float ${MPFR_LIBRARIES} ${GMP_LIBRARIES} no_eh_support) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_mixed_float) +endif() + +if(MPFR_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_include_test_mpfr_include_test SOURCES ${CURRENT_TEST_SOURCES_DIR}/include_test/mpfr_include_test.cpp COMPILE_ONLY) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_include_test_mpfr_include_test) +endif() + +if(GMP_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_include_test_gmp_include_test SOURCES ${CURRENT_TEST_SOURCES_DIR}/include_test/gmp_include_test.cpp COMPILE_ONLY) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_include_test_gmp_include_test) +endif() + +if(TOMMATH_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_include_test_tommath_include_test SOURCES ${CURRENT_TEST_SOURCES_DIR}/include_test/tommath_include_test.cpp COMPILE_ONLY) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_include_test_tommath_include_test) +endif() + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_include_test_cpp_int_include_test SOURCES ${CURRENT_TEST_SOURCES_DIR}/include_test/cpp_int_include_test.cpp COMPILE_ONLY) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_include_test_cpp_int_include_test) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_include_test_cpp_dec_float_include_test SOURCES ${CURRENT_TEST_SOURCES_DIR}/include_test/cpp_dec_float_include_test.cpp COMPILE_ONLY) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_include_test_cpp_dec_float_include_test) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_ublas_interopinclude_test_cpp_bin_float_include_test SOURCES ${CURRENT_TEST_SOURCES_DIR}/include_test/cpp_bin_float_include_test.cpp COMPILE_ONLY) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_ublas_interopinclude_test_cpp_bin_float_include_test) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_ublas_interop_test1 SOURCES ${CURRENT_TEST_SOURCES_DIR}/ublas_interop/test1.cpp + ${CURRENT_TEST_SOURCES_DIR}/ublas_interop/test11.cpp + ${CURRENT_TEST_SOURCES_DIR}/ublas_interop/test12.cpp + ${CURRENT_TEST_SOURCES_DIR}/ublas_interop/test13.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_ublas_interop_test1 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_ublas_interop_test1) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_ublas_interop_test2 SOURCES ${CURRENT_TEST_SOURCES_DIR}/ublas_interop/test2.cpp + ${CURRENT_TEST_SOURCES_DIR}/ublas_interop/test21.cpp + ${CURRENT_TEST_SOURCES_DIR}/ublas_interop/test22.cpp + ${CURRENT_TEST_SOURCES_DIR}/ublas_interop/test23.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_ublas_interop_test2 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_ublas_interop_test2) + +#run ublas_interop/test3.cpp ublas_interop/test31.cpp ublas_interop/test32.cpp ublas_interop/test33.cpp ; +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_ublas_interop_test4 SOURCES ${CURRENT_TEST_SOURCES_DIR}/ublas_interop/test4.cpp + ${CURRENT_TEST_SOURCES_DIR}/ublas_interop/test42.cpp + ${CURRENT_TEST_SOURCES_DIR}/ublas_interop/test43.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_ublas_interop_test4 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_ublas_interop_test4) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_ublas_interop_test5 SOURCES ${CURRENT_TEST_SOURCES_DIR}/ublas_interop/test5.cpp + ${CURRENT_TEST_SOURCES_DIR}/ublas_interop/test52.cpp + ${CURRENT_TEST_SOURCES_DIR}/ublas_interop/test53.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_ublas_interop_test5 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_ublas_interop_test5) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_ublas_interop_test6 SOURCES ${CURRENT_TEST_SOURCES_DIR}/ublas_interop/test6.cpp + ${CURRENT_TEST_SOURCES_DIR}/ublas_interop/test62.cpp + ${CURRENT_TEST_SOURCES_DIR}/ublas_interop/test63.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_ublas_interop_test6 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_ublas_interop_test6) + +#run ublas_interop/test7.cpp ublas_interop/test71.cpp ublas_interop/test72.cpp ublas_interop/test73.cpp ; + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_ublas_interop_test1_et SOURCES + ${CURRENT_TEST_SOURCES_DIR}/ublas_interop/test1.cpp + ${CURRENT_TEST_SOURCES_DIR}/ublas_interop/test11.cpp + ${CURRENT_TEST_SOURCES_DIR}/ublas_interop/test12.cpp + ${CURRENT_TEST_SOURCES_DIR}/ublas_interop/test13.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_ublas_interop_test1_et no_eh_support) +target_compile_definitions(${CURRENT_PROJECT_NAME}_test_ublas_interop_test1_et PUBLIC -DTEST_ET=1) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_ublas_interop_test1_et) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_ublas_interop_test2_et SOURCES + ${CURRENT_TEST_SOURCES_DIR}/ublas_interop/test2.cpp + ${CURRENT_TEST_SOURCES_DIR}/ublas_interop/test21.cpp + ${CURRENT_TEST_SOURCES_DIR}/ublas_interop/test22.cpp + ${CURRENT_TEST_SOURCES_DIR}/ublas_interop/test23.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_ublas_interop_test2_et no_eh_support) +target_compile_definitions(${CURRENT_PROJECT_NAME}_test_ublas_interop_test2_et PUBLIC -DTEST_ET=1) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_ublas_interop_test2_et) + +#run ublas_interop/test3.cpp ublas_interop/test31.cpp ublas_interop/test32.cpp ublas_interop/test33.cpp ; +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_ublas_interop_test4_et SOURCES + ${CURRENT_TEST_SOURCES_DIR}/ublas_interop/test4.cpp + ${CURRENT_TEST_SOURCES_DIR}/ublas_interop/test42.cpp + ${CURRENT_TEST_SOURCES_DIR}/ublas_interop/test43.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_ublas_interop_test4_et no_eh_support) +target_compile_definitions(${CURRENT_PROJECT_NAME}_test_ublas_interop_test4_et PUBLIC -DTEST_ET=1) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_ublas_interop_test4_et) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_ublas_interop_test5_et SOURCES + ${CURRENT_TEST_SOURCES_DIR}/ublas_interop/test5.cpp + ${CURRENT_TEST_SOURCES_DIR}/ublas_interop/test52.cpp + ${CURRENT_TEST_SOURCES_DIR}/ublas_interop/test53.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_ublas_interop_test5_et no_eh_support) +target_compile_definitions(${CURRENT_PROJECT_NAME}_test_ublas_interop_test5_et PUBLIC -DTEST_ET=1) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_ublas_interop_test5_et) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_ublas_interop_test6_et SOURCES ${CURRENT_TEST_SOURCES_DIR}/ublas_interop/test6.cpp + ${CURRENT_TEST_SOURCES_DIR}/ublas_interop/test62.cpp + ${CURRENT_TEST_SOURCES_DIR}/ublas_interop/test63.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_ublas_interop_test6_et no_eh_support) +target_compile_definitions(${CURRENT_PROJECT_NAME}_test_ublas_interop_test6_et PUBLIC -DTEST_ET=1) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_ublas_interop_test6_et) + +#run ublas_interop/test7.cpp ublas_interop/test71.cpp ublas_interop/test72.cpp ublas_interop/test73.cpp ; + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_adapt_serial SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_adapt_serial.cpp) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_adapt_serial) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_cpp_dec_float_serial_1 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_cpp_dec_float_serial.cpp) +target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_cpp_dec_float_serial_1 PUBLIC -DTEST1) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_cpp_dec_float_serial_1) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_cpp_dec_float_serial_2 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_cpp_dec_float_serial.cpp) +target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_cpp_dec_float_serial_2 PUBLIC -DTEST2) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_cpp_dec_float_serial_2) + +if(QUADMATH_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_float128_serial SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_float128_serial.cpp) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_float128_serial) +endif() +#TODO: Enable this +#[[ +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_bin_dec_float_serial_1 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_cpp_bin_float_serial.cpp) +target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_bin_dec_float_serial_1 PUBLIC -DTEST1) +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_bin_dec_float_serial_2 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_cpp_bin_float_serial.cpp) +target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_bin_dec_float_serial_2 PUBLIC -DTEST2) +]] +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_checked_mixed_cpp_int SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_checked_mixed_cpp_int.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_checked_mixed_cpp_int no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_checked_mixed_cpp_int) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_mixed_cpp_bin_float SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_mixed_cpp_bin_float.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_mixed_cpp_bin_float no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_checked_mixed_cpp_int) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_mixed_cpp_dec_float SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_mixed_cpp_dec_float.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_mixed_cpp_dec_float no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_mixed_cpp_dec_float) + +if(GMP_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_mixed_mpf_float SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_mixed_mpf_float.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_mixed_mpf_float ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_mixed_mpf_float PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_mixed_mpf_float) +endif() +if(MPFR_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_mixed_mpfr_float SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_mixed_mpfr_float.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_mixed_mpfr_float ${MPFR_LIBRARIES} ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_mixed_mpfr_float PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_mixed_mpfr_float) +endif() + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_float_conversions SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_float_conversions.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_float_conversions no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_float_conversions) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_bug11922 SOURCES ${CURRENT_TEST_SOURCES_DIR}/bug11922.cpp COMPILE_ONLY) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_bug11922) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_bug12039 SOURCES ${CURRENT_TEST_SOURCES_DIR}/bug12039.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_bug12039 no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_bug12039) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_git_issue_30 SOURCES ${CURRENT_TEST_SOURCES_DIR}/git_issue_30.cpp COMPILE_ONLY) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_git_issue_30) + +if((GMP_COMPILED) AND (MPFR_COMPILED) AND (MPC_COMPILED) AND (FLOAT128_COMPILED)) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_git_issue_98 ${CURRENT_TEST_SOURCES_DIR}/git_issue_98.cpp COMPILE_ONLY) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_git_issue_98 ${QUADMATH_LIBRARIES} ${MPC_LIBRARIES} ${MPFR_LIBRARIES} ${GMP_LIBRARIES}) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_git_issue_98 PRIVATE -DHAS_GMP -DHAS_MPFR -DHAS_MPC -DFLOAT128_COMPILED) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_git_issue_98) +endif() + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_issue_13301 SOURCES ${CURRENT_TEST_SOURCES_DIR}/issue_13301.cpp) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_issue_13301) +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_issue_13148 SOURCES ${CURRENT_TEST_SOURCES_DIR}/issue_13148.cpp) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_issue_13148) + +if((GMP_COMPILED) AND (MPFR_COMPILED) AND (MPFI_COMPILED) AND (TomMath_COMPILED) AND (FLOAT128_COMPILED)) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_hash ${CURRENT_TEST_SOURCES_DIR}/test_hash.cpp COMPILE_ONLY) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_hash ${QUADMATH_LIBRARIES} ${MPFI_LIBRARIES} ${MPFR_LIBRARIES} + ${GMP_LIBRARIES} ${TomMath_LIBRARIES}) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_test_hash PRIVATE -DHAS_GMP -DHAS_MPFR -DHAS_MPFI -DHAS_TOMMATH -DFLOAT128_COMPILED) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_hash) +endif() + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_optional_compat SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_optional_compat.cpp) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_misc ${CURRENT_PROJECT_NAME}_test_test_optional_compat) + +# TODO: Fix this +#[[ +if (EIGEN_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_eigen_interop_cpp_int SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_eigen_interop_cpp_int.cpp) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_eigen_interop_cpp_int PRIVATE ${EIGEN3_INCLUDE_DIR}) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_eigen_interop_cpp_dec_float SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_eigen_interop_cpp_dec_float.cpp) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_eigen_interop_cpp_dec_float PRIVATE ${EIGEN3_INCLUDE_DIR}) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_eigen_interop_cpp_dec_float_2 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_eigen_interop_cpp_dec_float_2.cpp) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_eigen_interop_cpp_dec_float_2 PRIVATE ${EIGEN3_INCLUDE_DIR}) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_eigen_interop_cpp_dec_float_3 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_eigen_interop_cpp_dec_float_3.cpp) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_eigen_interop_cpp_dec_float_3 PRIVATE ${EIGEN3_INCLUDE_DIR}) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_eigen_interop_cpp_bin_float_1 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_eigen_interop_cpp_bin_float_1.cpp) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_eigen_interop_cpp_bin_float_1 PRIVATE ${EIGEN3_INCLUDE_DIR}) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_eigen_interop_cpp_bin_float_2 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_eigen_interop_cpp_bin_float_2.cpp) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_eigen_interop_cpp_bin_float_2 PRIVATE ${EIGEN3_INCLUDE_DIR}) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_eigen_interop_cpp_bin_float_3 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_eigen_interop_cpp_bin_float_3.cpp) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_eigen_interop_cpp_bin_float_3 PRIVATE ${EIGEN3_INCLUDE_DIR}) +endif() + +if ((EIGEN_COMPILED) AND (MPFR_COMPILED)) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_eigen_interop_mpfr_1 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_eigen_interop_mpfr_1.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_eigen_interop_mpfr_1 ${MPFR_LIBRARIES} ${GMP_LIBRARIES}) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_eigen_interop_mpfr_1 PRIVATE ${EIGEN3_INCLUDE_DIR} ${GMP_INCLUDES}) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_eigen_interop_mpfr_2 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_eigen_interop_mpfr_2.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_eigen_interop_mpfr_2 ${MPFR_LIBRARIES} ${GMP_LIBRARIES}) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_eigen_interop_mpfr_2 PRIVATE ${EIGEN3_INCLUDE_DIR} ${GMP_INCLUDES}) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_eigen_interop_mpfr_3 SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_eigen_interop_mpfr_3.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_eigen_interop_mpfr_3 ${MPFR_LIBRARIES} ${GMP_LIBRARIES}) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_eigen_interop_mpfr_3 PRIVATE ${EIGEN3_INCLUDE_DIR} ${GMP_INCLUDES}) +endif() + +if ((EIGEN_COMPILED) AND (GMP_COMPILED)) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_eigen_interop_gmp SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_eigen_interop_gmp.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_eigen_interop_gmp ${GMP_LIBRARIES}) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_eigen_interop_gmp PRIVATE ${EIGEN3_INCLUDE_DIR} ${GMP_INCLUDES}) +endif() + +if ((EIGEN_COMPILED) AND (MPC_COMPILED)) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_test_eigen_interop_mpc SOURCES ${CURRENT_TEST_SOURCES_DIR}/test_eigen_interop_mpc.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_test_eigen_interop_mpc ${MPC_LIBRARIES} ${MPFR_LIBRARIES} ${GMP_LIBRARIES}) + target_include_directories(${CURRENT_PROJECT_NAME}_test_test_eigen_interop_mpc PUBLIC ${EIGEN3_INCLUDE_DIR} ${GMP_INCLUDES}) +endif() +#]] + +#TODO: enable it +#[[ +if (BUILD_WITH_SOURCES_DIR) + file(GLOB TEST_FILES ${CURRENT_TEST_SOURCES_DIR}/math/*.cpp) + foreach(FILEB ${TEST_FILES}) + get_filename_component(NAME ${FILEB} NAME_WE) + if(MPFR_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_math_${NAME}_mpfr SOURCES ${FILEB}) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_math_${NAME}_mpfr PRIVATE -DTEST_MPFR_50 -DBOOST_ALL_NO_LIB -DBOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE) + target_include_directories(${CURRENT_PROJECT_NAME}_test_math_${NAME}_mpfr PRIVATE ${BUILD_WITH_SOURCES_DIR}/libs/math/include_private ${BUILD_WITH_SOURCES_DIR} ${GMP_INCLUDES}) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_math_${NAME}_mpfr ${MPFR_LIBRARIES} ${GMP_LIBRARIES}) + endif() + + if(GMP_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_math_${NAME}_mpf SOURCES ${FILEB}) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_math_${NAME}_mpf PRIVATE -DTEST_MPF_50 -DBOOST_ALL_NO_LIB -DBOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE) + target_include_directories(${CURRENT_PROJECT_NAME}_test_math_${NAME}_mpf PRIVATE ${GMP_INCLUDES} ${BUILD_WITH_SOURCES_DIR} ${BUILD_WITH_SOURCES_DIR}/libs/math/include_private) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_math_${NAME}_mpf ${GMP_LIBRARIES}) + endif() + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_math_${NAME}_cpp_dec_float SOURCES ${FILEB}) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_math_${NAME}_cpp_dec_float PRIVATE -DTEST_CPP_DEC_FLOAT -DBOOST_ALL_NO_LIB -DBOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE) + target_include_directories(${CURRENT_PROJECT_NAME}_test_math_${NAME}_cpp_dec_float PRIVATE ${BUILD_WITH_SOURCES_DIR} ${BUILD_WITH_SOURCES_DIR}/libs/math/include_private) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_math_${NAME}_cpp_bin_float SOURCES ${FILEB}) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_math_${NAME}_cpp_bin_float PRIVATE -DTEST_CPP_BIN_FLOAT -DBOOST_ALL_NO_LIB -DBOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE) + target_include_directories(${CURRENT_PROJECT_NAME}_test_math_${NAME}_cpp_bin_float PRIVATE ${BUILD_WITH_SOURCES_DIR} ${BUILD_WITH_SOURCES_DIR}/libs/math/include_private) + + if(FLOAT128_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_math_${NAME}_float128 SOURCES ${FILEB}) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_math_${NAME}_float128 PRIVATE -DTEST_FLOAT128 -DBOOST_ALL_NO_LIB -DBOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE) + target_include_directories(${CURRENT_PROJECT_NAME}_test_math_${NAME}_float128 PRIVATE ${BUILD_WITH_SOURCES_DIR} ${BUILD_WITH_SOURCES_DIR}/libs/math/include_private) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_math_${NAME}_float128 ${QUADMATH_LIBRARIES}) + endif() + + if((FLOAT128_COMPILED) AND (HAS_INTEL_QUAD)) + #TODO: fix test + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_math_${NAME}_intel_quad SOURCES ${FILEB}) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_math_${NAME}_intel_quad PRIVATE -DTEST_FLOAT128 -DBOOST_ALL_NO_LIB -DBOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE) + target_include_directories(${CURRENT_PROJECT_NAME}_test_math_${NAME}_intel_quad PRIVATE ${BUILD_WITH_SOURCES_DIR} ${BUILD_WITH_SOURCES_DIR}/libs/math/include_private) + endif() + endforeach() +endif() +]] + +#TODO: implicit entry/start for main executable +#[[ +if (BUILD_WITH_SOURCES_DIR) + file(GLOB TEST_FILES ${CURRENT_TEST_SOURCES_DIR}/math/high_prec/*.cpp) + foreach(FILEB ${TEST_FILES}) + if(MPFR_COMPILED) + get_filename_component(NAME ${FILEB} NAME_WE) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_math_high_prec_${NAME} SOURCES ${FILEB}) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_math_high_prec_${NAME} PRIVATE -DTEST_MPFR -DBOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE -DBOOST_ALL_NO_LIB) + target_include_directories(${CURRENT_PROJECT_NAME}_test_math_high_prec_${NAME} PRIVATE ${GMP_INCLUDES} ${BUILD_WITH_SOURCES_DIR} ${BUILD_WITH_SOURCES_DIR}/libs/math/include_private) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_math_high_prec_${NAME} ${GMP_LIBRARIES} ${MPFR_LIBRARIES}) + endif() + endforeach() +endif() +]] +file(GLOB TEST_FILES ${CURRENT_TEST_SOURCES_DIR}/compile_fail/*.cpp) +foreach(FILEB ${TEST_FILES}) + if((GMP_COMPILED) AND (MPFR_COMPILED)) + get_filename_component(NAME ${FILEB} NAME_WE) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_compile_fail_${NAME} SOURCES ${FILEB} COMPILE_ONLY WILL_FAIL) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_compile_fail_${NAME} PRIVATE -DTEST_GMP -DTEST_MPFR) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_compile_fail ${CURRENT_PROJECT_NAME}_test_compile_fail_${NAME}) + endif() +endforeach() + +if(BUILD_WITH_SOURCES_DIR) + file(GLOB TEST_FILES ${CURRENT_TEST_SOURCES_DIR}/concepts/*.cpp) + foreach(FILEB ${TEST_FILES}) + get_filename_component(NAME ${FILEB} NAME_WE) + + if(MPFR_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_mpfr_50 SOURCES ${FILEB} COMPILE_ONLY) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_mpfr_50 PUBLIC -DTEST_MPFR_50) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_mpfr_50 ${MPFR_LIBRARIES}) + target_include_directories(${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_mpfr_50 PRIVATE ${BUILD_WITH_SOURCES_DIR}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_concepts ${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_mpfr_50) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_mpfr_6 SOURCES ${FILEB} COMPILE_ONLY) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_mpfr_6 PUBLIC -DTEST_MPFR_6) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_mpfr_6 ${MPFR_LIBRARIES}) + target_include_directories(${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_mpfr_6 PRIVATE ${BUILD_WITH_SOURCES_DIR}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_concepts ${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_mpfr_6) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_mpfr_15 SOURCES ${FILEB} COMPILE_ONLY) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_mpfr_15 PUBLIC -DTEST_MPFR_15) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_mpfr_15 ${MPFR_LIBRARIES}) + target_include_directories(${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_mpfr_15 PRIVATE ${BUILD_WITH_SOURCES_DIR}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_concepts ${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_mpfr_15) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_mpfr_17 SOURCES ${FILEB} COMPILE_ONLY) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_mpfr_17 PUBLIC -DTEST_MPFR_17) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_mpfr_17 ${MPFR_LIBRARIES}) + target_include_directories(${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_mpfr_17 PRIVATE ${BUILD_WITH_SOURCES_DIR}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_concepts ${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_mpfr_17) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_mpfr_30 SOURCES ${FILEB} COMPILE_ONLY) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_mpfr_30 PUBLIC -DTEST_MPFR_30) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_mpfr_30 ${MPFR_LIBRARIES}) + target_include_directories(${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_mpfr_30 PRIVATE ${BUILD_WITH_SOURCES_DIR}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_concepts ${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_mpfr_30) + endif() + + if(GMP_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_mpf50 SOURCES ${FILEB} COMPILE_ONLY) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_mpf50 PUBLIC -DTEST_MPF_50) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_mpf50 ${GMP_LIBRARIES}) + target_include_directories(${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_mpf50 PRIVATE ${BUILD_WITH_SOURCES_DIR}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_concepts ${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_mpf50) + endif() + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_cpp_dec_float SOURCES ${FILEB} COMPILE_ONLY) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_cpp_dec_float PUBLIC -DTEST_CPP_DEC_FLOAT) + target_include_directories(${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_cpp_dec_float PRIVATE ${BUILD_WITH_SOURCES_DIR}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_concepts ${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_cpp_dec_float) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_cpp_bin_float SOURCES ${FILEB} COMPILE_ONLY) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_cpp_bin_float PUBLIC -DTEST_CPP_BIN_FLOAT) + target_include_directories(${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_cpp_bin_float PRIVATE ${BUILD_WITH_SOURCES_DIR}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_concepts ${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_cpp_bin_float) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_cpp_dec_float_no_et SOURCES ${FILEB} COMPILE_ONLY) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_cpp_dec_float_no_et PUBLIC -DTEST_CPP_DEC_FLOAT_NO_ET) + target_include_directories(${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_cpp_dec_float_no_et PRIVATE ${BUILD_WITH_SOURCES_DIR}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_concepts ${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_cpp_dec_float_no_et) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_backend_concept SOURCES ${FILEB} COMPILE_ONLY) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_backend_concept PUBLIC -DTEST_BACKEND) + target_include_directories(${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_backend_concept PRIVATE ${BUILD_WITH_SOURCES_DIR}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_concepts ${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_backend_concept) + + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_logged_adaptor SOURCES ${FILEB} COMPILE_ONLY) + target_compile_definitions(${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_logged_adaptor PUBLIC -DTEST_LOGGED_ADAPTER) + target_include_directories(${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_logged_adaptor PRIVATE ${BUILD_WITH_SOURCES_DIR}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_concepts ${CURRENT_PROJECT_NAME}_test_concepts_${NAME}_logged_adaptor) + endforeach() +endif() + +#test-suite examples + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_cpp_int_snips SOURCES ${CURRENT_TEST_SOURCES_DIR}/../example/cpp_int_snips.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_cpp_int_snips no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_examples ${CURRENT_PROJECT_NAME}_test_cpp_int_snips) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_cpp_int_import_export SOURCES ${CURRENT_TEST_SOURCES_DIR}/../example/cpp_int_import_export.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_cpp_int_import_export no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_examples ${CURRENT_PROJECT_NAME}_test_cpp_int_import_export) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_cpp_bin_float_import_export SOURCES ${CURRENT_TEST_SOURCES_DIR}/../example/cpp_bin_float_import_export.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_cpp_bin_float_import_export no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_examples ${CURRENT_PROJECT_NAME}_test_cpp_bin_float_import_export) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_cpp_dec_float_snips SOURCES ${CURRENT_TEST_SOURCES_DIR}/../example/cpp_dec_float_snips.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_cpp_dec_float_snips no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_examples ${CURRENT_PROJECT_NAME}_test_cpp_dec_float_snips) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_cpp_bin_float_snips SOURCES ${CURRENT_TEST_SOURCES_DIR}/../example/cpp_bin_float_snips.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_cpp_bin_float_snips no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_examples ${CURRENT_PROJECT_NAME}_test_cpp_bin_float_snips) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_debug_adaptor_snips SOURCES ${CURRENT_TEST_SOURCES_DIR}/../example/debug_adaptor_snips.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_debug_adaptor_snips no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_examples ${CURRENT_PROJECT_NAME}_test_debug_adaptor_snips) + +if(FLOAT128_COMPILED) + #TODO: fix this + #[ run float128_snips.cpp quadmath no_eh_eg_support : : : [ check-target-builds ../config//has_float128 : : no ] ] + # cm_test(NAME ${CURRENT_PROJECT_NAME}_test_debug_adaptor_snips SOURCES ${CURRENT_TEST_SOURCES_DIR}/../example/debug_adaptor_snips.cpp) + # target_link_libraries(${CURRENT_PROJECT_NAME}_test_debug_adaptor_snips no_eh_support) + # add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_examples ${CURRENT_PROJECT_NAME}_test_debug_adaptor_snips) +endif() + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_floating_point_examples SOURCES ${CURRENT_TEST_SOURCES_DIR}/../example/floating_point_examples.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_floating_point_examples no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_examples ${CURRENT_PROJECT_NAME}_test_floating_point_examples) + +#TODO: Enable this +#cm_test(NAME ${CURRENT_PROJECT_NAME}_test_gauss_laguerre_quadrature SOURCES ${CURRENT_TEST_SOURCES_DIR}/../example/gauss_laguerre_quadrature.cpp) +#target_link_libraries(${CURRENT_PROJECT_NAME}_test_gauss_laguerre_quadrature no_eh_support) + +#TODO: Fix this +#cm_test(NAME ${CURRENT_PROJECT_NAME}_test_hypergeometric_luke_algorithms SOURCES ${CURRENT_TEST_SOURCES_DIR}/../example/hypergeometric_luke_algorithms.cpp) +#target_link_libraries(${CURRENT_PROJECT_NAME}_test_hypergeometric_luke_algorithms no_eh_support) + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_integer_examples SOURCES ${CURRENT_TEST_SOURCES_DIR}/../example/integer_examples.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_integer_examples no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_examples ${CURRENT_PROJECT_NAME}_test_integer_examples) + +if(MPFI_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_logged_adaptor SOURCES ${CURRENT_TEST_SOURCES_DIR}/../example/logged_adaptor.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_logged_adaptor ${GMP_LIBRARIES} ${MPFR_LIBRARIES} ${MPFI_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_logged_adaptor PRIVATE ${GMP_INCLUDES} ${MPFI_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_examples ${CURRENT_PROJECT_NAME}_test_logged_adaptor) +endif() + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_mixed_integer_arithmetic SOURCES ${CURRENT_TEST_SOURCES_DIR}/../example/mixed_integer_arithmetic.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_mixed_integer_arithmetic no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_examples ${CURRENT_PROJECT_NAME}_test_mixed_integer_arithmetic) + +if(FLOAT128_COMPILED) + #TODO: fix this + #[ run numeric_limits_snips.cpp no_eh_eg_support /boost//test_exec_monitor : : : [ requires cxx11_numeric_limits ] [ check-target-builds ../config//has_float128 : quadmath ] ] +endif() + +if(GMP_COMPILED) + #TODO: enable this + #cm_test(NAME ${CURRENT_PROJECT_NAME}_test_random_snips SOURCES ${CURRENT_TEST_SOURCES_DIR}/../example/random_snips.cpp) + #target_link_libraries(${CURRENT_PROJECT_NAME}_test_random_snips ${GMP_LIBRARIES} no_eh_support) + #target_include_directories(${CURRENT_PROJECT_NAME}_test_random_snips PRIVATE ${GMP_INCLUDES}) +endif() + +cm_test(NAME ${CURRENT_PROJECT_NAME}_test_safe_prime SOURCES ${CURRENT_TEST_SOURCES_DIR}/../example/safe_prime.cpp) +target_link_libraries(${CURRENT_PROJECT_NAME}_test_safe_prime no_eh_support) +add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_examples ${CURRENT_PROJECT_NAME}_test_safe_prime) + +if(GMP_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_gmp_snips SOURCES ${CURRENT_TEST_SOURCES_DIR}/../example/gmp_snips.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_gmp_snips ${GMP_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_gmp_snips PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_examples ${CURRENT_PROJECT_NAME}_test_gmp_snips) +endif() + +if(MPFI_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_mpfi_snips SOURCES ${CURRENT_TEST_SOURCES_DIR}/../example/mpfi_snips.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_mpfi_snips ${GMP_LIBRARIES} ${MPFI_LIBRARIES} ${MPFR_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_mpfi_snips PRIVATE ${GMP_INCLUDES} ${MPFI_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_examples ${CURRENT_PROJECT_NAME}_test_mpfi_snips) +endif() + +if(MPFR_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_mpfr_snips SOURCES ${CURRENT_TEST_SOURCES_DIR}/../example/mpfr_snips.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_mpfr_snips ${GMP_LIBRARIES} ${MPFR_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_mpfr_snips PRIVATE ${GMP_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_examples ${CURRENT_PROJECT_NAME}_test_mpfr_snips) +endif() + +if(TOMMATH_COMPILED) + cm_test(NAME ${CURRENT_PROJECT_NAME}_test_tommath_snips SOURCES ${CURRENT_TEST_SOURCES_DIR}/../example/tommath_snips.cpp) + target_link_libraries(${CURRENT_PROJECT_NAME}_test_tommath_snips ${TomMath_LIBRARIES} no_eh_support) + target_include_directories(${CURRENT_PROJECT_NAME}_test_tommath_snips PRIVATE ${TomMath_INCLUDES}) + add_dependencies(${CURRENT_PROJECT_NAME}_test_suite_examples ${CURRENT_PROJECT_NAME}_test_tommath_snips) +endif() + +include_directories(${CMAKE_WORKSPACE_SOURCES_DIR})