diff --git a/.github/CONTRIBUTING.rst b/.github/CONTRIBUTING.rst index aaebabe490..24aefb4c03 100644 --- a/.github/CONTRIBUTING.rst +++ b/.github/CONTRIBUTING.rst @@ -1,3 +1,3 @@ -Please read `contributing guide `__ before sending pull requests. +Please read `contributing guide `__ before sending pull requests or reporting bugs. Thanks. diff --git a/.gitignore b/.gitignore index 24fed3ba03..920eb2be1b 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,7 @@ _Base # emacs junk *.*~ *~ + +# Clion +.idea/ + diff --git a/.travis.yml b/.travis.yml index dcb214230a..12c0549dd2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,11 @@ # OSX/Linux (https://github.com/travis-ci-tester/toolchain-table) +# Workaround for https://github.com/travis-ci/travis-ci/issues/8363 language: - - cpp + - minimal os: - linux - - osx # Container-based infrastructure (Linux) # * https://docs.travis-ci.com/user/migrating-from-legacy/#How-can-I-use-container-based-infrastructure%3F @@ -14,48 +14,16 @@ sudo: # Install packages differs for container-based infrastructure # * https://docs.travis-ci.com/user/migrating-from-legacy/#How-do-I-install-APT-sources-and-packages%3F -# * http://stackoverflow.com/a/30925448/2288008 addons: apt: - sources: - - ubuntu-toolchain-r-test packages: - - python3 - - python-enchant # for documentation + - python3-pip + - enchant # for documentation - # python3-pip package is not available, use 'easy_install3': - # * https://github.com/travis-ci/apt-package-whitelist/issues/768 - - python3-setuptools # easy_install3 - - # https://github.com/travis-ci-tester/travis-test-clang-cxx-11 - - libstdc++-4.8-dev - - # https://github.com/travis-ci-tester/travis-test-gcc-cxx-11 - - g++-4.8 +dist: + - trusty env: - - PROJECT_DIR=tests/simple TOOLCHAIN=default - - PROJECT_DIR=tests/issue/22 TOOLCHAIN=default - - PROJECT_DIR=tests/issue/24/unit TOOLCHAIN=default - - PROJECT_DIR=tests/issue/107 TOOLCHAIN=default - - PROJECT_DIR=tests/issue/109/unit TOOLCHAIN=default - - PROJECT_DIR=tests/autotools-merge-lipo TOOLCHAIN=default - - PROJECT_DIR=tests/hunter_create_args_file TOOLCHAIN=default - - PROJECT_DIR=tests/hunter_create_dependency_entry TOOLCHAIN=default - - PROJECT_DIR=tests/hunter_create_deps_info TOOLCHAIN=default - - PROJECT_DIR=tests/hunter_download_cache_meta_file TOOLCHAIN=default - - PROJECT_DIR=tests/hunter_download_cache_raw_file TOOLCHAIN=default - - PROJECT_DIR=tests/hunter_generate_qt_info TOOLCHAIN=default - - PROJECT_DIR=tests/hunter_get_package_deps TOOLCHAIN=default - - PROJECT_DIR=tests/hunter_get_package_deps_recurse TOOLCHAIN=default - - PROJECT_DIR=tests/hunter_pack_directory TOOLCHAIN=default - - PROJECT_DIR=tests/hunter_register_dependency TOOLCHAIN=default - - PROJECT_DIR=tests/hunter_setup_msvc TOOLCHAIN=default - - PROJECT_DIR=tests/hunter_sleep_before_download TOOLCHAIN=default - - PROJECT_DIR=tests/hunter_unpack_directory TOOLCHAIN=default - - PROJECT_DIR=tests/hunter_init_not_found_counter TOOLCHAIN=default - - PROJECT_DIR=tests/hunter_check_toolchain_definition TOOLCHAIN=default - - TOOLCHAIN=generate-documentation-test install: @@ -68,7 +36,7 @@ install: # Install Python package 'requests' # 'easy_install3' is not installed by 'brew install python3' on OS X 10.9 Maverick - if [[ "`uname`" == "Darwin" ]]; then pip3 install requests; fi - - if [[ "`uname`" == "Linux" ]]; then travis_retry easy_install3 --user requests==2.10.0; fi + - if [[ "`uname`" == "Linux" ]]; then travis_retry pip3 install --user requests; fi # Install latest Polly toolchains and scripts - wget https://github.com/ruslo/polly/archive/master.zip @@ -87,18 +55,8 @@ install: - export ANDROID_NDK_r11c="`pwd`/_ci/android-ndk-r11c" script: - - > - if [[ "${TOOLCHAIN}" == "generate-documentation-test" && "`uname`" == "Linux" ]]; - then - cd docs - ./jenkins.sh - fi - - - > - if [[ "${TOOLCHAIN}" != "generate-documentation-test" ]]; - then - python3 ./jenkins.py - fi + - cd docs + - ./jenkins.sh branches: except: diff --git a/LICENSE b/LICENSE index 519974325a..78567995a9 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2013-2016, Ruslan Baratov +Copyright (c) 2013-2017, Ruslan Baratov All rights reserved. Redistribution and use in source and binary forms, with or without modification, diff --git a/README.rst b/README.rst index b993ef1273..d0ba7e30da 100644 --- a/README.rst +++ b/README.rst @@ -7,31 +7,36 @@ https://github.com/ivsgroup/hunter_master Hunter ====== -Cross-platform package manager for C++ (based on CMake ``ExternalProject``). -Supported platforms: **Linux**, **Mac**, **Windows**, **iOS**, **Android**, **Raspberry Pi**. +|gitter| |rtfd| |travis| |appveyor| |license| +CMake-driven cross-platform package manager for C++. +Supported platforms: **Linux**, **Mac**, **Windows**, **iOS**, **Android**, **Raspberry Pi**. * Documentation: https://docs.hunter.sh -* Supported Packages: https://docs.hunter.sh/en/latest/packages.html +* Packages: https://docs.hunter.sh/en/latest/packages.html * Sources: https://github.com/ruslo/hunter * Reporting issues: https://github.com/ruslo/hunter/issues/new * Contributing guide: https://docs.hunter.sh/en/latest/contributing.html -* License: `BSD 2-Clause `_ * Contacts: https://docs.hunter.sh/en/latest/contacts.html -* |gitter| +* `Per package testing table `_ .. |gitter| image:: https://badges.gitter.im/ruslo/hunter.svg :target: https://gitter.im/ruslo/hunter - -CI --- - -* Travis CI OSX/Linux: |TravisCI| -* AppVeyor CI Windows: |AppVeyor| -* `Per package deep testing table `_ - -.. |TravisCI| image:: https://travis-ci.org/ruslo/hunter.svg?branch=master - :target: https://travis-ci.org/ruslo/hunter/builds + :alt: Gitter public chat room + +.. |rtfd| image:: https://readthedocs.org/projects/hunter/badge/?version=latest + :target: http://hunter.readthedocs.io/en/latest/?badge=latest + :alt: Documentation status + +.. |travis| image:: https://img.shields.io/travis/ingenue/hunter/pkg.gtest.svg?style=flat-square&label=Linux%20OSX%20Android%20iOS + :target: https://travis-ci.org/ingenue/hunter/builds + :alt: Travis CI + +.. |appveyor| image:: https://img.shields.io/appveyor/ci/ingenue/hunter/pkg.gtest.svg?style=flat-square&label=Windows + :target: https://ci.appveyor.com/project/ingenue/hunter/history + :alt: AppVeyor CI + +.. |license| image:: https://img.shields.io/github/license/ruslo/hunter.svg + :target: https://github.com/ruslo/hunter/blob/master/LICENSE + :alt: LICENSE -.. |AppVeyor| image:: https://ci.appveyor.com/api/projects/status/ubo6jse3lh5ciyvv/branch/master?svg=true - :target: https://ci.appveyor.com/project/ruslo/hunter/history diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index cbcca3c8c7..0000000000 --- a/appveyor.yml +++ /dev/null @@ -1,107 +0,0 @@ -# Windows (https://github.com/travis-ci-tester/toolchain-table) - -environment: - matrix: - - PROJECT_DIR: tests\simple - TOOLCHAIN: default - - - PROJECT_DIR: tests\issue\22 - TOOLCHAIN: default - - - PROJECT_DIR: tests\issue\24\unit - TOOLCHAIN: default - - - PROJECT_DIR: tests\issue\107 - TOOLCHAIN: default - - - PROJECT_DIR: tests\issue\109\unit - TOOLCHAIN: default - - # Leave this test for Linux - # (need to create separate etalon files with Windows EOL) - # * https://ci.appveyor.com/project/ruslo/hunter/build/1.0.12/job/a1yuqt10k5cssmiq - # - PROJECT_DIR: tests\hunter_create_args_file - # TOOLCHAIN: default - - - PROJECT_DIR: tests\hunter_create_dependency_entry - TOOLCHAIN: default - - # Leave this test for Linux - # (need to create separate etalon files with Windows EOL) - # * https://ci.appveyor.com/project/ruslo/hunter/build/1.0.102/job/w06ih7x8gkcugw49 - # - PROJECT_DIR: tests\hunter_create_deps_info - # TOOLCHAIN: default - - - PROJECT_DIR: tests\hunter_generate_qt_info - TOOLCHAIN: default - - - PROJECT_DIR: tests\hunter_get_package_deps - TOOLCHAIN: default - - - PROJECT_DIR: tests\hunter_get_package_deps_recurse - TOOLCHAIN: default - - - PROJECT_DIR: tests\hunter_pack_directory - TOOLCHAIN: default - - - PROJECT_DIR: tests\hunter_register_dependency - TOOLCHAIN: default - - - PROJECT_DIR: tests\hunter_setup_msvc - TOOLCHAIN: default - - - PROJECT_DIR: tests\hunter_unpack_directory - TOOLCHAIN: default - - - PROJECT_DIR: tests\hunter_download_cache_raw_file - TOOLCHAIN: default - - - PROJECT_DIR: tests\hunter_download_cache_meta_file - TOOLCHAIN: default - - - PROJECT_DIR: tests\autotools-merge-lipo - TOOLCHAIN: default - - - PROJECT_DIR: tests\hunter_sleep_before_download - TOOLCHAIN: default - - - PROJECT_DIR: tests\hunter_check_toolchain_definition - TOOLCHAIN: default - -install: - # Python 3 - - cmd: set PATH=C:\Python34-x64;C:\Python34-x64\Scripts;%PATH% - - # Install Python package 'requests' - - cmd: pip install requests - - # Install latest Polly toolchains and scripts - - cmd: appveyor DownloadFile https://github.com/ruslo/polly/archive/master.zip - - cmd: 7z x master.zip - - cmd: set POLLY_ROOT=%cd%\polly-master - - # Install dependencies (CMake, Ninja) - - cmd: python %POLLY_ROOT%\bin\install-ci-dependencies.py - - # Tune locations - - cmd: set PATH=%cd%\_ci\cmake\bin;%PATH% - - cmd: set PATH=%cd%\_ci\ninja;%PATH% - - - cmd: git submodule update --init --recursive - - # Remove entry with sh.exe from PATH to fix error with MinGW toolchain - # (For MinGW make to work correctly sh.exe must NOT be in your path) - # * http://stackoverflow.com/a/3870338/2288008 - - cmd: set PATH=%PATH:C:\Program Files\Git\usr\bin;=% - - # Use MinGW from Qt tools because version is higher - # * http://www.appveyor.com/docs/installed-software#qt - - cmd: set MINGW_PATH=C:\Qt\Tools\mingw492_32\bin - -build_script: - - cmd: python .\jenkins.py - -branches: - except: - - /^pr\..*/ - - /^v[0-9]+\.[0-9]+\.[0-9]+$/ diff --git a/cmake/configs/default.cmake b/cmake/configs/default.cmake index 7ebaab5fd1..61b46b6a4b 100644 --- a/cmake/configs/default.cmake +++ b/cmake/configs/default.cmake @@ -27,29 +27,38 @@ include(hunter_user_error) hunter_config(AllTheFlopsThreads VERSION 0.1-p0) hunter_config(Android-Apk VERSION 1.1.13) hunter_config(Android-Build-Tools VERSION 22.0.1) -hunter_config(Android-Google-Repository VERSION 25) +hunter_config(Android-Google-Repository VERSION 47) hunter_config(Android-Modules VERSION 1.0.0) -hunter_config(Android-SDK VERSION 0.0.4) -hunter_config(Android-SDK-Platform-tools VERSION r23.1.0) -hunter_config(Android-SDK-Tools VERSION 24.4.1) -hunter_config(Android-Support-Repository VERSION 28) +hunter_config(Android-SDK VERSION 0.0.5) +hunter_config(Android-SDK-Platform-tools VERSION r25.0.5) +hunter_config(Android-SDK-Tools VERSION 25.2.5) +hunter_config(Android-Support-Repository VERSION 47) +hunter_config(ARM_NEON_2_x86_SSE VERSION 1.0.0-p0) hunter_config(ArrayFire VERSION 3.3.1-p0) hunter_config(Assimp VERSION 3.2-p1) hunter_config(Async++ VERSION 0.0.3-hunter) hunter_config(Avahi VERSION 0.6.31) -hunter_config(BZip2 VERSION 1.0.6-p1) -hunter_config(Boost VERSION 1.63.0) +hunter_config(Beast VERSION 1.0.0-b84-hunter-0) +hunter_config(BZip2 VERSION 1.0.6-p3) +if(MSVC OR MINGW) + # FIXME: https://ci.appveyor.com/project/ingenue/hunter/build/1.0.2229 + hunter_config(Boost VERSION 1.64.0) +else() + hunter_config(Boost VERSION 1.65.0) +endif() hunter_config(BoostCompute VERSION 0.5-p0) hunter_config(BoostProcess VERSION 0.5) +hunter_config(CapnProto VERSION 0.6.1) hunter_config(CLAPACK VERSION 3.2.1) -hunter_config(CURL VERSION 7.49.1-DEV-v4) -hunter_config(Clang VERSION 3.6.2) -hunter_config(ClangToolsExtra VERSION ${HUNTER_Clang_VERSION}) +hunter_config(CURL VERSION 7.49.1-DEV-v8) +hunter_config(Clang VERSION 4.0.1-p0) +hunter_config(ClangToolsExtra VERSION 4.0.1) # Clang hunter_config(Comet VERSION 4.0.2) hunter_config(CppNetlib VERSION 0.10.1-hunter-3) hunter_config(CppNetlibUri VERSION 1.0.4-hunter) hunter_config(CsvParserCPlusPlus VERSION 1.0.1) -hunter_config(Eigen VERSION 3.3.1-p4) +hunter_config(Eigen VERSION 3.3.4-p0) +hunter_config(enet VERSION 1.3.13-p1) hunter_config(Expat VERSION 2.1.1) if(MSVC) hunter_config(getopt VERSION 1.0.0-p0) @@ -57,85 +66,125 @@ endif() hunter_config(GPUImage VERSION 0.1.6-p6) hunter_config(GSL VERSION 2.1.0-p2) hunter_config(Igloo VERSION 1.1.1-hunter) -hunter_config(IntSizeof VERSION 1.0.0) -hunter_config(Jpeg VERSION 9b-p1) +hunter_config(intsizeof VERSION 2.0.1) +hunter_config(Jpeg VERSION 9b-p3) hunter_config(JsonSpirit VERSION 0.0.4-hunter) if(MSVC_VERSION LESS 1600) # for VS10 - version without support C++11 hunter_config(jsoncpp VERSION 0.7.0) else() - hunter_config(jsoncpp VERSION 1.7.7) + hunter_config(jsoncpp VERSION 1.8.0) endif() -hunter_config(LLVM VERSION ${HUNTER_Clang_VERSION}) -hunter_config(LLVMCompilerRT VERSION ${HUNTER_Clang_VERSION}) +hunter_config(LAPACK VERSION 3.7.1) +hunter_config(LLVM VERSION 4.0.1-p0) # Clang +hunter_config(LLVMCompilerRT VERSION 4.0.1-patched) # Clang hunter_config(Leathers VERSION 0.1.6) -hunter_config(Libcxx VERSION ${HUNTER_Clang_VERSION}) -hunter_config(Libcxxabi VERSION ${HUNTER_Clang_VERSION}) +hunter_config(Leptonica VERSION 1.74.2-p4) +hunter_config(Libcxx VERSION 3.6.2) # Clang +hunter_config(Libcxxabi VERSION 3.6.2) # Clang hunter_config(librtmp VERSION 2.4.0-p0) hunter_config(Libssh2 VERSION 1.7.0) hunter_config(Lua VERSION 5.3.2) -hunter_config(MySQL-client VERSION 6.1.6) -hunter_config(OpenBLAS VERSION 0.2.19-p0) -hunter_config(OpenCL VERSION 2.1-p0) +hunter_config(MySQL-client VERSION 6.1.9-p0) +hunter_config(NASM VERSION 2.12.02) +hunter_config(OpenBLAS VERSION 0.2.20-p0) +hunter_config(OpenCL VERSION 2.1-p3) hunter_config(OpenCL-cpp VERSION 2.0.10-p0) -hunter_config(OpenCV VERSION 3.2.0-p0) -hunter_config(OpenCV-Extra VERSION 3.0.0) -hunter_config(OpenSSL VERSION 1.0.2j) +hunter_config(OpenCV VERSION 3.3.0-p2) +hunter_config(OpenCV-Extra VERSION 3.3.0) +hunter_config(OpenNMTTokenizer VERSION 0.2.0-p1) +if(MSVC) + # FIXME: https://ci.appveyor.com/project/ingenue/hunter/build/1.0.1470 + hunter_config(OpenSSL VERSION 1.0.2l) +else() + hunter_config(OpenSSL VERSION 1.1.0f) +endif() hunter_config(PNG VERSION 1.6.26-p1) -hunter_config(PocoCpp VERSION 1.7.6-p0) -hunter_config(PostgreSQL VERSION 9.5.0) +hunter_config(PocoCpp VERSION 1.7.8-p0) +hunter_config(PostgreSQL VERSION 9.6.3) hunter_config(Protobuf VERSION 3.0.0-p1) -hunter_config(Qt VERSION 5.5.1-cvpixelbuffer-2-p9) + +string(COMPARE EQUAL "${CMAKE_SYSTEM_NAME}" "Linux" _is_linux) +if(_is_linux OR MINGW) + # qt-qml example is broken on Linux + # qt-core example is broken on MinGW + hunter_config(Qt VERSION 5.5.1-cvpixelbuffer-2-p9) +else() + hunter_config(Qt VERSION 5.9.1-p0) +endif() + hunter_config(QtAndroidCMake VERSION 1.0.9) -hunter_config(QtCMakeExtra VERSION 1.0.22) +hunter_config(QtCMakeExtra VERSION 1.0.27) hunter_config(QtQmlManager VERSION 1.0.0) hunter_config(RapidJSON VERSION 1.0.2-p2) hunter_config(RapidXML VERSION 1.13) -hunter_config(SDL2 VERSION 2.0.4-p2) +hunter_config(SDL2 VERSION 2.0.4-p4) +hunter_config(SDL_image VERSION 2.0.1-p1) +hunter_config(SDL_mixer VERSION 2.0.1-p1) hunter_config(SQLite3 VERSION autoconf-3080803) #R-Tree enabled hunter_config(Sober VERSION 0.1.3) +hunter_config(stormlib VERSION 9.21-p1) hunter_config(Sugar VERSION 1.2.2) +hunter_config(SuiteSparse VERSION 4.5.1-p1) hunter_config(TIFF VERSION 4.0.2-p3) hunter_config(tommath VERSION 1.0-p2) +hunter_config(tomcrypt VERSION 1.17-p3) hunter_config(WTL VERSION 9.1.5321) +hunter_config(WDC VERSION 1.1.1) hunter_config(Washer VERSION 0.1.2) hunter_config(WinSparkle VERSION 0.4.0) hunter_config(ZLIB VERSION 1.2.8-p3) hunter_config(ZMQPP VERSION 4.1.2) -hunter_config(ZeroMQ VERSION 4.1.4-p2) +hunter_config(ZeroMQ VERSION 4.2.3-p1) hunter_config(caffe VERSION rc3-p2) -hunter_config(Catch VERSION 1.5.9) +hunter_config(Catch VERSION 1.8.2-p0) +hunter_config(aes VERSION 0.0.1-p1) +hunter_config(aglet VERSION 1.2.0) hunter_config(autobahn-cpp VERSION 0.2.0) +hunter_config(bison VERSION 3.0.4) +hunter_config(boost-pba VERSION 1.0.0-p0) hunter_config(ccv VERSION 0.7-p6) -hunter_config(cereal VERSION 1.2.1-p1) +hunter_config(cereal VERSION 1.2.2-p0) +hunter_config(ceres-solver VERSION 1.12.0-p2) hunter_config(clBLAS VERSION 2.10.0-p0) hunter_config(convertutf VERSION 1.0.1) hunter_config(crashpad VERSION v0.0.1-p0) hunter_config(crashup VERSION 0.0.2) +hunter_config(cryptopp VERSION 5.6.5) hunter_config(cvmatio VERSION 1.0.27-p3) hunter_config(cxxopts VERSION 1.0.0-p0) +hunter_config(czmq VERSION 4.0.2-p1) hunter_config(damageproto VERSION 1.2.1) hunter_config(dbus VERSION 1.10.0-hunter-4) hunter_config(dest VERSION 0.8.0-p4) -hunter_config(dlib VERSION 19.2-p1) +hunter_config(dlib VERSION 19.6-p0) +hunter_config(doctest VERSION 1.2.0) +hunter_config(double-conversion VERSION 3.0.0) hunter_config(dri2proto VERSION 2.8) hunter_config(dri3proto VERSION 1.0) +hunter_config(drishti_assets VERSION 1.8) +hunter_config(drishti_faces VERSION 1.2) hunter_config(drm VERSION 2.4.67) -hunter_config(eos VERSION 0.6.1-p1) +hunter_config(eigen3-nnls VERSION 1.0.0) +hunter_config(eos VERSION 0.12.1) +hunter_config(FakeIt VERSION 2.0.3) hunter_config(fixesproto VERSION 5.0) hunter_config(flatbuffers VERSION 1.3.0-p3) -hunter_config(fmt VERSION 3.0.0) +hunter_config(flex VERSION 2.6.4) +hunter_config(fmt VERSION 4.0.0) hunter_config(freetype VERSION 2.6.2) +hunter_config(gauze VERSION 0.1.1) hunter_config(geos VERSION 3.4.2) -hunter_config(gflags VERSION 2.1.2-p1) +hunter_config(gflags VERSION 2.2.1) hunter_config(glew VERSION 2.0.0) -hunter_config(glfw VERSION 3.2-p0) -hunter_config(glm VERSION 0.9.7.6) -hunter_config(glog VERSION 0.3.4-p2) +hunter_config(glfw VERSION 3.3.0-p4) +hunter_config(glm VERSION 0.9.8.5) +hunter_config(glog VERSION 0.3.5-p1) hunter_config(glproto VERSION 1.4.17) hunter_config(half VERSION 1.1.0-p1) hunter_config(hdf5 VERSION 1.8.15-p1) hunter_config(ice VERSION 1.0.8) +hunter_config(imshow VERSION 1.0.0-p0) hunter_config(inputproto VERSION 2.2) hunter_config(intltool VERSION 0.51.0) hunter_config(ios_sim VERSION 3.1.1) @@ -143,46 +192,57 @@ hunter_config(ippicv VERSION 20151201) hunter_config(irrXML VERSION 1.2) hunter_config(kbproto VERSION 1.0.6) hunter_config(libdaemon VERSION 0.14) +hunter_config(libjson-rpc-cpp VERSION 0.7.0-p3) hunter_config(libogg VERSION 1.3.2-cmake3) hunter_config(libsodium VERSION 1.0.10) +hunter_config(libuv VERSION 1.14.0-p1) hunter_config(libxml2 VERSION 2.9.4) hunter_config(libyuv VERSION 1514-p3) hunter_config(log4cplus VERSION 1.2.0-p0) +hunter_config(lzma VERSION 5.2.3-p4) hunter_config(mini_chromium VERSION 0.0.1-p2) hunter_config(minizip VERSION 1.0.1-p1) hunter_config(mpark_variant VERSION 1.0.0) hunter_config(msgpack VERSION 1.4.1-p2) -hunter_config(nlohmann-json VERSION 1.0.0-rc1-hunter-3) +hunter_config(mtplz VERSION 0.1-p3) +hunter_config(nanoflann VERSION 1.2.3-p0) +hunter_config(nlohmann_json VERSION 2.1.1-p1) hunter_config(odb VERSION 2.4.0) hunter_config(odb-boost VERSION 2.4.0) hunter_config(odb-compiler VERSION 2.4.0) hunter_config(odb-mysql VERSION 2.4.0) hunter_config(odb-pgsql VERSION 2.4.0) hunter_config(odb-sqlite VERSION 2.4.0) -hunter_config(ogles_gpgpu VERSION 0.1.6-p2) +hunter_config(ogles_gpgpu VERSION 0.2.4) +hunter_config(onmt VERSION 0.4.1-p2) hunter_config(openddlparser VERSION 0.1.0-p2) hunter_config(pciaccess VERSION 0.13.4) hunter_config(poly2tri VERSION 1.0.0) hunter_config(polyclipping VERSION 4.8.8-p0) # for Assimp hunter_config(presentproto VERSION 1.0) hunter_config(pthread-stubs VERSION 0.3) +hunter_config(pugixml VERSION 1.8.1) hunter_config(rabbitmq-c VERSION 0.7.0-p1) hunter_config(randrproto VERSION 1.3.2) hunter_config(renderproto VERSION 0.11.1) hunter_config(sm VERSION 1.2.1) +hunter_config(Snappy VERSION 1.1.6-p0) +hunter_config(sse2neon VERSION 1.0.0-p0) hunter_config(sparsehash VERSION 2.0.2) -if(MSVC_VERSION LESS 1900) +if(MSVC_VERSION LESS 1800) # for VS12 - version without support C++11 hunter_config(spdlog VERSION 1.0.0-p0) else() - hunter_config(spdlog VERSION 0.11.0-p0) + hunter_config(spdlog VERSION 0.13.0-p1) endif() hunter_config(szip VERSION 2.1.0-p1) -hunter_config(thread-pool-cpp VERSION 1.0.0-p3) +hunter_config(Tesseract VERSION 3.05.01-hunter-3) +hunter_config(thread-pool-cpp VERSION 1.1.0) hunter_config(tinydir VERSION 1.2-p0) hunter_config(websocketpp VERSION 0.7.0-p2) hunter_config(wxWidgets VERSION 3.0.2) hunter_config(x11 VERSION 1.5.0) +hunter_config(x264 VERSION snapshot-20170420-2245) hunter_config(xau VERSION 1.0.7) hunter_config(xcb VERSION 1.11.1) hunter_config(xcb-proto VERSION 1.11) @@ -192,7 +252,8 @@ hunter_config(xext VERSION 1.3.1) hunter_config(xextproto VERSION 7.2.1) hunter_config(xf86vidmodeproto VERSION 2.3.1) hunter_config(xfixes VERSION 5.0.1) -hunter_config(xgboost VERSION 0.40-p5) +hunter_config(xgboost VERSION 0.40-p9) +hunter_config(xi VERSION 1.6.1) hunter_config(xinerama VERSION 1.1.2) hunter_config(xineramaproto VERSION 1.1.2) hunter_config(xorg-macros VERSION 1.17) @@ -204,10 +265,10 @@ hunter_config(xtrans VERSION 1.2.7) hunter_config(xxf86vm VERSION 1.1.2) hunter_config(yaml-cpp VERSION 0.5.3) -if(MINGW OR MSVC80) +if(MSVC80) hunter_config(GTest VERSION 1.7.0-hunter-6) else() - hunter_config(GTest VERSION 1.8.0-hunter-p5) + hunter_config(GTest VERSION 1.8.0-hunter-p7) endif() if(ANDROID) @@ -226,11 +287,13 @@ if(ANDROID) hunter_config(Android-Intel-x86-Atom-System-Image VERSION 21) hunter_config(Android-SDK-Platform VERSION 21_r02) hunter_config(Sources-for-Android-SDK VERSION 21) + hunter_config(Android-ARM-EABI-v7a-System-Image VERSION 21_r04) elseif(_is_api_19) hunter_config(Android-Google-APIs VERSION 19_r18) hunter_config(Android-Intel-x86-Atom-System-Image VERSION 19) hunter_config(Android-SDK-Platform VERSION 19_r04) hunter_config(Sources-for-Android-SDK VERSION 19) + hunter_config(Android-ARM-EABI-v7a-System-Image VERSION 19_r05) elseif(_is_api_16) hunter_config(Android-Google-APIs VERSION 16_r04) hunter_config(Android-Intel-x86-Atom-System-Image VERSION 16) @@ -246,3 +309,5 @@ if(ANDROID) endif() hunter_config(zookeeper VERSION 3.4.9-p2) +hunter_config(tacopie VERSION 2.4.0-h1) +hunter_config(cpp_redis VERSION 3.5.0-h1) diff --git a/cmake/find/FindOpenSSL.cmake b/cmake/find/FindOpenSSL.cmake index e765c99e24..9e0a92f2cd 100644 --- a/cmake/find/FindOpenSSL.cmake +++ b/cmake/find/FindOpenSSL.cmake @@ -362,8 +362,9 @@ if(OPENSSL_FOUND) add_library(OpenSSL::Crypto UNKNOWN IMPORTED) set_target_properties(OpenSSL::Crypto PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${OPENSSL_INCLUDE_DIR}") + find_package(Threads REQUIRED) set_target_properties(OpenSSL::Crypto PROPERTIES - INTERFACE_LINK_LIBRARIES "${CMAKE_DL_LIBS}") + INTERFACE_LINK_LIBRARIES "${CMAKE_DL_LIBS};Threads::Threads") if(EXISTS "${OPENSSL_CRYPTO_LIBRARY}") set_target_properties(OpenSSL::Crypto PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "C" diff --git a/cmake/find/Findaccelerate.cmake b/cmake/find/Findaccelerate.cmake new file mode 100644 index 0000000000..4ed1c187ef --- /dev/null +++ b/cmake/find/Findaccelerate.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper_framework) +hunter_find_helper_framework(FRAMEWORK "Accelerate") diff --git a/cmake/find/Findandroid.cmake b/cmake/find/Findandroid.cmake new file mode 100644 index 0000000000..dfc12b58ba --- /dev/null +++ b/cmake/find/Findandroid.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper) +hunter_find_helper(LIBRARY "android" HEADER "android/api-level.h") diff --git a/cmake/find/Findandroid_log.cmake b/cmake/find/Findandroid_log.cmake new file mode 100644 index 0000000000..ff6a4c7701 --- /dev/null +++ b/cmake/find/Findandroid_log.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper) +hunter_find_helper(LIBRARY "log" HEADER "android/log.h") diff --git a/cmake/find/Findappkit.cmake b/cmake/find/Findappkit.cmake new file mode 100644 index 0000000000..0d171d6820 --- /dev/null +++ b/cmake/find/Findappkit.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper_framework) +hunter_find_helper_framework(FRAMEWORK "AppKit") diff --git a/cmake/find/Findassetslibrary.cmake b/cmake/find/Findassetslibrary.cmake new file mode 100644 index 0000000000..5f4af55167 --- /dev/null +++ b/cmake/find/Findassetslibrary.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper_framework) +hunter_find_helper_framework(FRAMEWORK "AssetsLibrary") diff --git a/cmake/find/Findaudiotoolbox.cmake b/cmake/find/Findaudiotoolbox.cmake new file mode 100644 index 0000000000..d9f8613258 --- /dev/null +++ b/cmake/find/Findaudiotoolbox.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper_framework) +hunter_find_helper_framework(FRAMEWORK "AudioToolbox") diff --git a/cmake/find/Findavfoundation.cmake b/cmake/find/Findavfoundation.cmake new file mode 100644 index 0000000000..f17e61a6ff --- /dev/null +++ b/cmake/find/Findavfoundation.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper_framework) +hunter_find_helper_framework(FRAMEWORK "AVFoundation") diff --git a/cmake/find/Findcoredata.cmake b/cmake/find/Findcoredata.cmake new file mode 100644 index 0000000000..308ec63ca1 --- /dev/null +++ b/cmake/find/Findcoredata.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper_framework) +hunter_find_helper_framework(FRAMEWORK "CoreData") diff --git a/cmake/find/Findcorefoundation.cmake b/cmake/find/Findcorefoundation.cmake new file mode 100644 index 0000000000..fc820c9895 --- /dev/null +++ b/cmake/find/Findcorefoundation.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper_framework) +hunter_find_helper_framework(FRAMEWORK "CoreFoundation") diff --git a/cmake/find/Findcoregraphics.cmake b/cmake/find/Findcoregraphics.cmake new file mode 100644 index 0000000000..e6cc3bba9e --- /dev/null +++ b/cmake/find/Findcoregraphics.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper_framework) +hunter_find_helper_framework(FRAMEWORK "CoreGraphics") diff --git a/cmake/find/Findcorelocation.cmake b/cmake/find/Findcorelocation.cmake new file mode 100644 index 0000000000..d26a8318bd --- /dev/null +++ b/cmake/find/Findcorelocation.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper_framework) +hunter_find_helper_framework(FRAMEWORK "CoreLocation") diff --git a/cmake/find/Findcoremedia.cmake b/cmake/find/Findcoremedia.cmake new file mode 100644 index 0000000000..19e2d1d01e --- /dev/null +++ b/cmake/find/Findcoremedia.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper_framework) +hunter_find_helper_framework(FRAMEWORK "CoreMedia") diff --git a/cmake/find/Findcorevideo.cmake b/cmake/find/Findcorevideo.cmake new file mode 100644 index 0000000000..8533f7262e --- /dev/null +++ b/cmake/find/Findcorevideo.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper_framework) +hunter_find_helper_framework(FRAMEWORK "CoreVideo") diff --git a/cmake/find/Findegl.cmake b/cmake/find/Findegl.cmake new file mode 100644 index 0000000000..72c1323418 --- /dev/null +++ b/cmake/find/Findegl.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper) +hunter_find_helper(LIBRARY "EGL" HEADER "EGL/egl.h") diff --git a/cmake/find/Findfoundation.cmake b/cmake/find/Findfoundation.cmake new file mode 100644 index 0000000000..b825aafa79 --- /dev/null +++ b/cmake/find/Findfoundation.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper_framework) +hunter_find_helper_framework(FRAMEWORK "Foundation") diff --git a/cmake/find/Findglapi.cmake b/cmake/find/Findglapi.cmake new file mode 100644 index 0000000000..746c2eea39 --- /dev/null +++ b/cmake/find/Findglapi.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper) +hunter_find_helper(LIBRARY "glapi" HEADER "GL/gl.h") diff --git a/cmake/find/Findgles2.cmake b/cmake/find/Findgles2.cmake new file mode 100644 index 0000000000..3f484274f8 --- /dev/null +++ b/cmake/find/Findgles2.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper) +hunter_find_helper(LIBRARY "GLESv2" HEADER "GLES2/gl2.h") diff --git a/cmake/find/Findgles3.cmake b/cmake/find/Findgles3.cmake new file mode 100644 index 0000000000..736036697c --- /dev/null +++ b/cmake/find/Findgles3.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper) +hunter_find_helper(LIBRARY "GLESv3" HEADER "GLES3/gl3.h") diff --git a/cmake/find/Findglkit.cmake b/cmake/find/Findglkit.cmake new file mode 100644 index 0000000000..aa118ab274 --- /dev/null +++ b/cmake/find/Findglkit.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper_framework) +hunter_find_helper_framework(FRAMEWORK "GLKit") diff --git a/cmake/find/Findimageio.cmake b/cmake/find/Findimageio.cmake new file mode 100644 index 0000000000..9e51ece105 --- /dev/null +++ b/cmake/find/Findimageio.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper_framework) +hunter_find_helper_framework(FRAMEWORK "ImageIO") diff --git a/cmake/find/Findiokit.cmake b/cmake/find/Findiokit.cmake new file mode 100644 index 0000000000..65ea2258cc --- /dev/null +++ b/cmake/find/Findiokit.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper_framework) +hunter_find_helper_framework(FRAMEWORK "IOKit") diff --git a/cmake/find/Findmetal.cmake b/cmake/find/Findmetal.cmake new file mode 100644 index 0000000000..949aa7825e --- /dev/null +++ b/cmake/find/Findmetal.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper_framework) +hunter_find_helper_framework(FRAMEWORK "Metal") diff --git a/cmake/find/Findmobilecoreservices.cmake b/cmake/find/Findmobilecoreservices.cmake new file mode 100644 index 0000000000..1143c56d55 --- /dev/null +++ b/cmake/find/Findmobilecoreservices.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper_framework) +hunter_find_helper_framework(FRAMEWORK "MobileCoreServices") diff --git a/cmake/find/Findopengles.cmake b/cmake/find/Findopengles.cmake new file mode 100644 index 0000000000..e3824a3061 --- /dev/null +++ b/cmake/find/Findopengles.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper_framework) +hunter_find_helper_framework(FRAMEWORK "OpenGLES") diff --git a/cmake/find/Findosmesa.cmake b/cmake/find/Findosmesa.cmake new file mode 100644 index 0000000000..cb4b756b7b --- /dev/null +++ b/cmake/find/Findosmesa.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper) +hunter_find_helper(LIBRARY "OSMesa" HEADER "GL/osmesa.h") diff --git a/cmake/find/Findquartzcore.cmake b/cmake/find/Findquartzcore.cmake new file mode 100644 index 0000000000..091f550dcc --- /dev/null +++ b/cmake/find/Findquartzcore.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper_framework) +hunter_find_helper_framework(FRAMEWORK "QuartzCore") diff --git a/cmake/find/Finduikit.cmake b/cmake/find/Finduikit.cmake new file mode 100644 index 0000000000..f3dad94de3 --- /dev/null +++ b/cmake/find/Finduikit.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper_framework) +hunter_find_helper_framework(FRAMEWORK "UIKit") diff --git a/cmake/modules/hunter_add_package.cmake b/cmake/modules/hunter_add_package.cmake index 5b6c03338b..ec47f09619 100644 --- a/cmake/modules/hunter_add_package.cmake +++ b/cmake/modules/hunter_add_package.cmake @@ -5,6 +5,7 @@ include(CMakeParseArguments) # cmake_parse_arguments include(hunter_fatal_error) include(hunter_finalize) +include(hunter_get_project_files_to_load) include(hunter_internal_error) include(hunter_status_debug) include(hunter_test_string_not_empty) @@ -36,54 +37,19 @@ macro(hunter_add_package) endif() list(GET _hunter_ap_arg_UNPARSED_ARGUMENTS 0 _hunter_ap_project) - hunter_test_string_not_empty("${HUNTER_SELF}") - set( - _hunter_ap_project_dir - "${HUNTER_SELF}/cmake/projects/${_hunter_ap_project}" + hunter_get_project_files_to_load( + PROJECT_NAME "${_hunter_ap_project}" + COMPONENTS "${_hunter_ap_arg_COMPONENTS}" + FILES _hunter_ap_list ) - if(NOT EXISTS "${_hunter_ap_project_dir}") - hunter_internal_error("Project '${_hunter_ap_project}' not found") - endif() - if(NOT IS_DIRECTORY "${_hunter_ap_project_dir}") - hunter_internal_error("Project '${_hunter_ap_project}' not found") - endif() - - # Check components - foreach(_hunter_ap_component ${_hunter_ap_arg_COMPONENTS}) - set( - _hunter_ap_component_dir - "${_hunter_ap_project_dir}/${_hunter_ap_component}" - ) - if(NOT EXISTS "${_hunter_ap_component_dir}") - hunter_internal_error( - "Component '${_hunter_ap_component}' not found " - "in project '${_hunter_ap_project}'" - ) - endif() - if(NOT IS_DIRECTORY "${_hunter_ap_component_dir}") - hunter_internal_error( - "Component '${_hunter_ap_component}' not found " - "in project '${_hunter_ap_project}'" - ) - endif() - endforeach() - - unset(_hunter_ap_list) - list(APPEND _hunter_ap_list "${_hunter_ap_project_dir}/hunter.cmake") - - # Load components - foreach(_hunter_ap_component ${_hunter_ap_arg_COMPONENTS}) - list( - APPEND - _hunter_ap_list - "${_hunter_ap_project_dir}/${_hunter_ap_component}/hunter.cmake" - ) - endforeach() # do not use any variables after this 'foreach', because included files # may call 'hunter_add_package' and rewrite it foreach(x ${_hunter_ap_list}) hunter_status_debug("load: ${x}") + if(NOT EXISTS "${x}") + hunter_internal_error("File not found: '${x}'") + endif() include("${x}") hunter_status_debug("load: ${x} ... end") endforeach() diff --git a/cmake/modules/hunter_add_version.cmake b/cmake/modules/hunter_add_version.cmake index fe0ae90094..f7882fcf7e 100644 --- a/cmake/modules/hunter_add_version.cmake +++ b/cmake/modules/hunter_add_version.cmake @@ -47,9 +47,6 @@ function(hunter_add_version) endif() string(COMPARE NOTEQUAL "${${expected_version}}" "${h_VERSION}" version_diff) if(version_diff) - hunter_status_debug( - "Skip '${h_VERSION}' (looking for '${${expected_version}}')" - ) return() endif() diff --git a/cmake/modules/hunter_append_component.cmake b/cmake/modules/hunter_append_component.cmake new file mode 100644 index 0000000000..b42468ffda --- /dev/null +++ b/cmake/modules/hunter_append_component.cmake @@ -0,0 +1,57 @@ +# Copyright (c) 2017 NeroBurner +# All rights reserved. + +include(CMakeParseArguments) # cmake_parse_arguments + +include(hunter_test_string_not_empty) + +# check if component is in specified version range, add to 'varname' if valid +# - varname: name of the variable of the list to append component names +# - name: name of the component to add to list if version is valid +# - given_version: version to check +# - version_since: first version the component is included +# - version_until: first version the component isn't included anymore +function(hunter_append_component) + set(function_name "hunter_append_component") + set(function_synopsis "${function_name}(LIST varname VERSION given-version COMPONENT name SINCE version_since [UNTIL version_until])") + + # parse arguments + set(one_value_args LIST VERSION COMPONENT SINCE UNTIL) + cmake_parse_arguments(x "" "${one_value_args}" "" ${ARGV}) + + # No free arguments allowed + list(LENGTH x_UNPARSED_ARGUMENTS x_len) + if(NOT x_len EQUAL 0) + hunter_internal_error( + "'${function_name}' incorrect usage," + " expected no free arguments '${x_UNPARSED_ARGUMENTS}'." + " Synopsis: ${function_synopsis}" + ) + endif() + + # check mandatory arguments + foreach(arg LIST VERSION COMPONENT SINCE) + string(COMPARE EQUAL "${x_${arg}}" "" is_empty) + if(is_empty) + hunter_internal_error( + "'${function_name}' incorrect usage," + " option '${arg}' with one argument is mandatory." + " Synopsis: ${function_synopsis}" + ) + endif() + endforeach() + + set(component_list ${${x_LIST}}) + if(NOT x_VERSION VERSION_LESS x_SINCE) + # check until only if set + string(COMPARE EQUAL "${x_UNTIL}" "" _is_empty) + if(_is_empty) + list(APPEND component_list ${x_COMPONENT}) + elseif(x_VERSION VERSION_LESS x_UNTIL) + list(APPEND component_list ${x_COMPONENT}) + endif() + endif() + + # set output_var to found definition + set(${x_LIST} ${component_list} PARENT_SCOPE) +endfunction() diff --git a/cmake/modules/hunter_apply_gate_settings.cmake b/cmake/modules/hunter_apply_gate_settings.cmake index 52fb2c236a..ec8b770bcb 100644 --- a/cmake/modules/hunter_apply_gate_settings.cmake +++ b/cmake/modules/hunter_apply_gate_settings.cmake @@ -53,6 +53,16 @@ function(hunter_apply_gate_settings) if(gate_done) if(cache_init) + # set *_ID_PATH variables in parent scope + string(SUBSTRING "${HUNTER_SHA1}" 0 7 HUNTER_ID) + string(SUBSTRING "${HUNTER_CONFIG_SHA1}" 0 7 HUNTER_CONFIG_ID) + string(SUBSTRING "${HUNTER_TOOLCHAIN_SHA1}" 0 7 HUNTER_TOOLCHAIN_ID) + set(HUNTER_ID_PATH "${HUNTER_CACHED_ROOT}/_Base/${HUNTER_ID}") + set(HUNTER_TOOLCHAIN_ID_PATH "${HUNTER_ID_PATH}/${HUNTER_TOOLCHAIN_ID}") + set(HUNTER_CONFIG_ID_PATH "${HUNTER_TOOLCHAIN_ID_PATH}/${HUNTER_CONFIG_ID}") + set(HUNTER_ID_PATH "${HUNTER_ID_PATH}" PARENT_SCOPE) + set(HUNTER_TOOLCHAIN_ID_PATH "${HUNTER_TOOLCHAIN_ID_PATH}" PARENT_SCOPE) + set(HUNTER_CONFIG_ID_PATH "${HUNTER_CONFIG_ID_PATH}" PARENT_SCOPE) hunter_status_debug("Reuse cached values") return() endif() @@ -74,11 +84,7 @@ function(hunter_apply_gate_settings) set(hunter_base "${HUNTER_GATE_ROOT}/_Base") - # HUNTER_GATE_CONFIG_SHA1 - hunter_calculate_config_sha1( - "${hunter_self}" "${hunter_base}" "${config_location}" - ) - + # define configuration type variables string(COMPARE EQUAL "${HUNTER_CONFIGURATION_TYPES}" "" use_default) if(use_default) set(HUNTER_CONFIGURATION_TYPES "Release;Debug") @@ -102,9 +108,40 @@ function(hunter_apply_gate_settings) endif() endforeach() - # HUNTER_GATE_TOOLCHAIN_SHA1 + # * defines: HUNTER_GATE_TOOLCHAIN_SHA1 + # * needs: HUNTER_CONFIGURATION_TYPES + # * creates: global_toolchain_info at + # "${hunter_base}/${HUNTER_GATE_SHA1}/${HUNTER_GATE_TOOLCHAIN_SHA1}/toolchain.info" hunter_calculate_toolchain_sha1("${hunter_self}" "${hunter_base}") + # set PATH variables for hunter and toolchain + hunter_make_directory("${hunter_base}" "${HUNTER_GATE_SHA1}" hunter_id_path) + hunter_make_directory( + "${hunter_id_path}" + "${HUNTER_GATE_TOOLCHAIN_SHA1}" + hunter_toolchain_id_path + ) + set(HUNTER_ID_PATH "${hunter_id_path}" PARENT_SCOPE) + set(HUNTER_TOOLCHAIN_ID_PATH "${hunter_toolchain_id_path}") + set(HUNTER_TOOLCHAIN_ID_PATH "${hunter_toolchain_id_path}" PARENT_SCOPE) + + # * defines: HUNTER_GATE_CONFIG_SHA1 + # * needs: HUNTER_TOOLCHAIN_ID_PATH + # * creates: unified global config file at + # "${hunter_base}/${HUNTER_GATE_SHA1}/${HUNTER_GATE_TOOLCHAIN_SHA1}/${HUNTER_GATE_CONFIG_SHA1/config.cmake" + hunter_calculate_config_sha1( + "${hunter_self}" "${hunter_base}" "${config_location}" + ) + # set PATH variables for config folder + hunter_make_directory( + "${hunter_toolchain_id_path}" + "${HUNTER_GATE_CONFIG_SHA1}" + hunter_config_id_path + ) + set(HUNTER_CONFIG_ID_PATH "${hunter_config_id_path}" PARENT_SCOPE) + + + # test if mandatory variables are set hunter_test_string_not_empty("${HUNTER_GATE_ROOT}") hunter_test_string_not_empty("${HUNTER_GATE_SHA1}") hunter_test_string_not_empty("${HUNTER_GATE_CONFIG_SHA1}") diff --git a/cmake/modules/hunter_autotools_configure_command.cmake b/cmake/modules/hunter_autotools_configure_command.cmake new file mode 100644 index 0000000000..9b3d2e3733 --- /dev/null +++ b/cmake/modules/hunter_autotools_configure_command.cmake @@ -0,0 +1,229 @@ +# Copyright (c) 2017 Ruslan Baratov, Alexandre Pretyman +# All rights reserved. +# +# This function generates a ./configure command line for autotools +# +# Usage example: +# hunter_autotools_project(out_command_line # saves the result in this var +# PACKAGE_CONFIGURATION_TYPES +# "Release" # Mandatory ONE build config type +# CONFIGURE_HOST +# "armv7" # passed to --configure-host= +# PACKAGE_INSTALL_DIR +# "${HUNTER_PACKAGE_INSTALL_DIR}" # passed to --prefix= +# INSTALL_DIR +# "${HUNTER_INSTALL_DIR}" # of hunter +# CPPFLAGS +# "-DEXTRA_CPP_FLAGS" # extra preprocessor flags +# CFLAGS +# "-O2" # extra c compilation flags +# CXXFLAGS +# "-Wall" # extra c++ compilation flags +# LDFLAGS +# "-lmycrazylib" # extra linking flags +# EXTRA_FLAGS +# --any-other # extra flags to be appended +# --flags +# --needed +# ) +include(CMakeParseArguments) + +include(hunter_dump_cmake_flags) +include(hunter_fatal_error) +include(hunter_get_build_flags) +include(hunter_get_toolchain_binaries) +include(hunter_internal_error) +include(hunter_status_debug) + +function(hunter_autotools_configure_command out_command_line) + set(optional_params) + set(one_value_params + CONFIGURE_HOST + PACKAGE_INSTALL_DIR + INSTALL_DIR + CPPFLAGS + CFLAGS + CXXFLAGS + LDFLAGS + ) + set(multi_value_params + PACKAGE_CONFIGURATION_TYPES + EXTRA_FLAGS + ) + cmake_parse_arguments( + PARAM + "${optional_params}" + "${one_value_params}" + "${multi_value_params}" + ${ARGN} + ) + + if(PARAM_UNPARSED_ARGUMENTS) + hunter_internal_error( + "Invalid arguments passed to hunter_autotools_configure_command" + " ${PARAM_UNPARSED_ARGUMENTS}" + ) + endif() + + set(configure_host) + string(COMPARE NOTEQUAL "${ANDROID}" "" is_android) + string(COMPARE NOTEQUAL "${IPHONEOS_ARCHS}${IPHONESIMULATOR_ARCHS}" "" is_ios) + string(COMPARE NOTEQUAL "${CROSS_COMPILE_TOOLCHAIN_PREFIX}" "" is_cross_compile) + if(is_android) + set(configure_host --host=${CMAKE_CXX_ANDROID_TOOLCHAIN_MACHINE}) + elseif(is_ios) + string(COMPARE NOTEQUAL "${PARAM_CONFIGURE_HOST}" "" has_configure_host) + if(has_configure_host) + set(configure_host --host=${PARAM_CONFIGURE_HOST}) + else() + hunter_fatal_error("hunter_autotools_configure_command on iOS build must supply a CONFIGURE_HOST") + endif() + elseif(is_cross_compile) + set(configure_host --host=${CROSS_COMPILE_TOOLCHAIN_PREFIX}) + endif() + + + + # Build the configure command line options + set(configure_command) + + list(APPEND configure_command "./configure") + string(COMPARE NOTEQUAL "${configure_host}" "" has_configure_host) + if(has_configure_host) + list(APPEND configure_command ${configure_host}) + endif() + + hunter_get_toolchain_binaries( + OUT_AR + ar + OUT_AS + as + OUT_LD + ld + OUT_NM + nm + OUT_OBJCOPY + objcopy + OUT_OBJDUMP + objdump + OUT_RANLIB + ranlib + OUT_STRIP + strip + OUT_CPP + cpp + OUT_CC + cc + OUT_CXX + cxx + ) + + set(toolchain_binaries) + if(ar) + list(APPEND toolchain_binaries "AR=${ar}") + endif() + if(as) + list(APPEND toolchain_binaries "AS=${as}") + endif() + if(ld) + list(APPEND toolchain_binaries "LD=${ld}") + endif() + if(nm) + list(APPEND toolchain_binaries "NM=${nm}") + endif() + if(objcopy) + list(APPEND toolchain_binaries "OBJCOPY=${objcopy}") + endif() + if(objdump) + list(APPEND toolchain_binaries "OBJDUMP=${objdump}") + endif() + if(ranlib) + list(APPEND toolchain_binaries "RANLIB=${ranlib}") + endif() + if(strip) + list(APPEND toolchain_binaries "STRIP=${strip}") + endif() + if(cpp) + list(APPEND toolchain_binaries "CPP=${cpp}") + endif() + if(cc) + list(APPEND toolchain_binaries "CC=${cc}") + endif() + if(cxx) + list(APPEND toolchain_binaries "CXX=${cxx}") + endif() + + if(toolchain_binaries) + list(APPEND configure_command ${toolchain_binaries}) + endif() + + list(LENGTH PARAM_PACKAGE_CONFIGURATION_TYPES len) + if(NOT "${len}" EQUAL "1") + hunter_fatal_error( + "Autotools PACKAGE_CONFIGURATION_TYPES has ${len} elements: ${PARAM_PACKAGE_CONFIGURATION_TYPES}. Only 1 is allowed" + WIKI "autools.package.configuration.types" + ) + endif() + string(TOUPPER ${PARAM_PACKAGE_CONFIGURATION_TYPES} config_type) + + hunter_get_build_flags( + INSTALL_DIR + ${PARAM_INSTALL_DIR} + PACKAGE_CONFIGURATION_TYPES + ${PARAM_PACKAGE_CONFIGURATION_TYPES} + OUT_CPPFLAGS + cppflags + OUT_CFLAGS + cflags + OUT_CXXFLAGS + cxxflags + OUT_LDFLAGS + ldflags + ) + # -> CMAKE_C_FLAGS + # -> CMAKE_CXX_FLAGS + hunter_status_debug("Autotools complation/linking flags:") + set(cppflags "${cppflags} ${PARAM_CPPFLAGS}") + string(STRIP "${cppflags}" cppflags) + hunter_status_debug(" CPPFLAGS=${cppflags}") + list(APPEND configure_command CPPFLAGS=${cppflags}) + + set(cflags "${cflags} ${PARAM_CFLAGS}") + string(STRIP "${cflags}" cflags) + hunter_status_debug(" CFLAGS=${cflags}") + list(APPEND configure_command CFLAGS=${cflags}) + + set(cxxflags "${cxxflags} ${PARAM_CXXFLAGS}") + string(STRIP "${cxxflags}" cxxflags) + hunter_status_debug(" CXXFLAGS=${cxxflags}") + list(APPEND configure_command CXXFLAGS=${cxxflags}) + + hunter_status_debug(" PARAM_LDFLAGS=${PARAM_LDFLAGS}") + set(ldflags "${ldflags} ${PARAM_LDFLAGS}") + string(STRIP "${ldflags}" ldflags) + hunter_status_debug(" LDFLAGS=${ldflags}") + list(APPEND configure_command LDFLAGS=${ldflags}) + + + if(PARAM_EXTRA_FLAGS) + list(APPEND configure_command ${PARAM_EXTRA_FLAGS}) + endif() + + # Hunter builds static libraries by default + if(BUILD_SHARED_LIBS) + list(APPEND configure_command --enable-shared --disable-static) + else() + list(APPEND configure_command --disable-shared --enable-static) + endif() + + list(APPEND configure_command "--prefix=${PARAM_PACKAGE_INSTALL_DIR}") + + if(HUNTER_STATUS_DEBUG) + string(REPLACE ";" " " final_configure_command "${configure_command}") + hunter_status_debug("Final configure command:") + hunter_status_debug(" ${final_configure_command}") + endif() + + set(${out_command_line} ${configure_command} PARENT_SCOPE) +endfunction() + diff --git a/cmake/modules/hunter_autotools_project.cmake b/cmake/modules/hunter_autotools_project.cmake index bc328498d8..69f1536881 100644 --- a/cmake/modules/hunter_autotools_project.cmake +++ b/cmake/modules/hunter_autotools_project.cmake @@ -8,7 +8,7 @@ # # Adds to the environment variables: # PATH=/bin -# PKG_CONFIG_PATH=/{lib,share}/pkgconfig +# PKG_CONFIG_LIBDIR=/{lib,share}/pkgconfig # # Adds to autotools flags: # CPPFLAGS=-I/include @@ -56,12 +56,13 @@ include(ExternalProject) # ExternalProject_Add include(CMakeParseArguments) # cmake_parse_arguments -include(hunter_dump_cmake_flags) +include(hunter_autotools_configure_command) include(hunter_fatal_error) -include(hunter_finalize) include(hunter_status_debug) include(hunter_test_string_not_empty) +# Packages to test this function: +# * xau function(hunter_autotools_project target_name) set(optional_params) set(one_value_params @@ -97,7 +98,7 @@ function(hunter_autotools_project target_name) if(PARAM_UNPARSED_ARGUMENTS) hunter_internal_error( - "Invalid arguments passed to hunter_autotools_configure:" + "Invalid arguments passed to hunter_autotools_project:" " ${PARAM_UNPARSED_ARGUMENTS}" ) endif() @@ -107,264 +108,64 @@ function(hunter_autotools_project target_name) hunter_test_string_not_empty("${PARAM_INSTALL_DIR}") hunter_test_string_not_empty("${PARAM_PACKAGE_CONFIGURATION_TYPES}") - list(LENGTH PARAM_PACKAGE_CONFIGURATION_TYPES len) - if(NOT "${len}" EQUAL "1") - hunter_fatal_error( - "Autotools PACKAGE_CONFIGURATION_TYPES has ${len} elements: ${PARAM_PACKAGE_CONFIGURATION_TYPES}. Only 1 is allowed" - WIKI "autools.package.configuration.types" - ) - endif() - - if(ANDROID) - hunter_test_string_not_empty("${CMAKE_C_ANDROID_TOOLCHAIN_PREFIX}") - # CMAKE_C_ANDROID_TOOLCHAIN_SUFFIX can be empty - - # Extra Android variables that can't be set in toolchain - # (some variables available only after toolchain processed). - set( - CMAKE_C_PREPROCESSOR - "${CMAKE_C_ANDROID_TOOLCHAIN_PREFIX}cpp${CMAKE_C_ANDROID_TOOLCHAIN_SUFFIX}" - ) - if(NOT EXISTS "${CMAKE_C_PREPROCESSOR}") - hunter_internal_error("File not found: ${CMAKE_C_PREPROCESSOR}") - endif() - endif() + set(default_path "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin") + set(shell_env_path "PATH=${PARAM_GLOBAL_INSTALL_DIR}/bin:${default_path}") - string(TOUPPER ${PARAM_PACKAGE_CONFIGURATION_TYPES} config_type) - # Sets the toolchain binaries - # AR=${CMAKE_AR} - # AS=${CMAKE_ASM_COMPILER} - # LD=${CMAKE_LINKER} - # NM=${CMAKE_NM} - # OBJCOPY=${CMAKE_OBJCOPY} - # OBJDUMP=${CMAKE_OBJDUMP} - # RANLIB=${CMAKE_RANLIB} - # STRIP=${CMAKE_STRIP} - # CPP=${CMAKE_C_PREPROCESSOR} - # CC=${CMAKE_C_COMPILER} - # CXX=${CMAKE_CXX_COMPILER} - # - set(toolchain_binaries) - if(CMAKE_AR) - list(APPEND toolchain_binaries AR=${CMAKE_AR}) - endif() - if(CMAKE_ASM_COMPILER) - list(APPEND toolchain_binaries AS=${CMAKE_ASM_COMPILER}) - endif() - if(CMAKE_LINKER) - list(APPEND toolchain_binaries LD=${CMAKE_LINKER}) - endif() - if(CMAKE_NM) - list(APPEND toolchain_binaries NM=${CMAKE_NM}) - endif() - if(CMAKE_OBJCOPY) - list(APPEND toolchain_binaries OBJCOPY=${CMAKE_OBJCOPY}) - endif() - if(CMAKE_OBJDUMP) - list(APPEND toolchain_binaries OBJDUMP=${CMAKE_OBJDUMP}) - endif() - if(CMAKE_RANLIB) - list(APPEND toolchain_binaries RANLIB=${CMAKE_RANLIB}) - endif() - if(CMAKE_STRIP) - list(APPEND toolchain_binaries STRIP=${CMAKE_STRIP}) - endif() - if(CMAKE_C_PREPROCESSOR) - list(APPEND toolchain_binaries CPP=${CMAKE_C_PREPROCESSOR}) - endif() - if(CMAKE_C_COMPILER) - list(APPEND toolchain_binaries CC=${CMAKE_C_COMPILER}) - endif() - if(CMAKE_CXX_COMPILER) - list(APPEND toolchain_binaries CXX=${CMAKE_CXX_COMPILER}) - endif() + set(d1 "${PARAM_GLOBAL_INSTALL_DIR}/lib/pkgconfig") + set(d2 "${PARAM_GLOBAL_INSTALL_DIR}/share/pkgconfig") + set(shell_pkg_config_libdir "PKG_CONFIG_LIBDIR=${d1}:${d2}") - string(STRIP "${toolchain_binaries}" toolchain_binaries) - if(HUNTER_STATUS_DEBUG) - string( - REPLACE ";" "\n" toolchain_binaries_new_line "${toolchain_binaries}" - ) - hunter_status_debug("Toolchain Binaries:") - foreach(x ${toolchain_binaries}) - hunter_status_debug(" ${x}") - endforeach() - endif() + set(clear_vars_shell_script "${PARAM_HUNTER_SELF}/scripts/clear-all.sh") - # CPPFLAGS=${PARAM_CPPFLAGS} [-D${COMPILE_DEFINITIONS}] - # [-I${INCLUDE_DIRECTORIES}] - # - # C Preprocessor flags - set(cppflags "-I${PARAM_GLOBAL_INSTALL_DIR}/include") - # build config type definitions - get_directory_property(defs - COMPILE_DEFINITIONS_${config_type} + set(shell_env + . + ${clear_vars_shell_script} + && + ${shell_env_path} + ${shell_pkg_config_libdir} ) - foreach(def ${defs}) - set(cppflags "${cppflags} -D${def}") - endforeach() - # non-build config specific definitions - get_directory_property(defs COMPILE_DEFINITIONS) - foreach(def ${defs}) - set(cppflags "${cppflags} -D${def}") - endforeach() - - get_directory_property(include_dirs INCLUDE_DIRECTORIES) - foreach(include_dir ${include_dirs}) - set(cppflags - "${cppflags} ${CMAKE_INCLUDE_SYSTEM_FLAG_CXX} ${include_dir}" - ) - endforeach() - - hunter_dump_cmake_flags(CPPFLAGS cppflags) - # -> CMAKE_C_FLAGS - # -> CMAKE_CXX_FLAGS - - set(cppflags "${cppflags} ${PARAM_CPPFLAGS}") - string(STRIP "${cppflags}" cppflags) - hunter_status_debug("CPPFLAGS=${cppflags}") - # CFLAGS=${cflags} ${CMAKE_C_FLAGS} - # - # C Compiler Flags (defines or include directories should not be needed here) - set(cflags "${CMAKE_C_FLAGS_${config_type}} ${CMAKE_C_FLAGS} ${PARAM_CFLAGS}") - string(STRIP "${cflags}" cflags) - hunter_status_debug("CFLAGS=${cflags}") - - # CXXFLAGS=${cxxflags} ${CMAKE_CXX_FLAGS} - # - # C++ Compiler flags (defines or include directories should not be needed here) - set(cxxflags "${CMAKE_CXX_FLAGS_${config_type}} ${CMAKE_CXX_FLAGS} ${PARAM_CXXFLAGS}") - string(STRIP "${cxxflags}" cxxflags) - hunter_status_debug("CXXFLAGS=${cxxflags}") + # Build command and options + set(autotools_build_command "make") + string(COMPARE NOTEQUAL "${PARAM_PARALLEL_JOBS}" "" have_jobs) + if(have_jobs) + list(APPEND autotools_build_command "-j" "${PARAM_PARALLEL_JOBS}") + endif() - # LDFLAGS=${ldflags} - # - # Linker flags - set(ldflags "-L${PARAM_GLOBAL_INSTALL_DIR}/lib") - set(ldflags "${ldflags} ${CMAKE_EXE_LINKER_FLAGS_${config_type}}") - string(STRIP "${ldflags}" ldflags) - set(ldflags "${ldflags} ${CMAKE_EXE_LINKER_FLAGS}") - string(STRIP "${ldflags}" ldflags) - set(ldflags "${ldflags} ${PARAM_LDFLAGS}") - string(STRIP "${ldflags}" ldflags) - hunter_status_debug("LDFLAGS=${ldflags}") + set(build_command ${shell_env} ${autotools_build_command}) - set(configure_host) - string(COMPARE NOTEQUAL "${ANDROID}" "" is_android) string(COMPARE NOTEQUAL "${IPHONEOS_ARCHS}${IPHONESIMULATOR_ARCHS}" "" is_ios) - string(COMPARE NOTEQUAL "${CROSS_COMPILE_TOOLCHAIN_PREFIX}" "" is_cross_compile) - if(is_android) - # AWP: the checks below should also be done for the Raspberry Pi - # how could we do it without repetition? - hunter_test_string_not_empty("${CMAKE_C_FLAGS}") - hunter_test_string_not_empty("${CMAKE_CXX_FLAGS}") - hunter_test_string_not_empty("${CMAKE_AR}") - hunter_test_string_not_empty("${CMAKE_C_PREPROCESSOR}") - hunter_test_string_not_empty("${CMAKE_C_COMPILER}") - hunter_test_string_not_empty("${CMAKE_CXX_COMPILER}") - hunter_test_string_not_empty("${CMAKE_LINKER}") - hunter_test_string_not_empty("${CMAKE_NM}") - hunter_test_string_not_empty("${CMAKE_OBJCOPY}") - hunter_test_string_not_empty("${CMAKE_OBJDUMP}") - hunter_test_string_not_empty("${CMAKE_RANLIB}") - hunter_test_string_not_empty("${CMAKE_STRIP}") - - hunter_test_string_not_empty("${CMAKE_CXX_ANDROID_TOOLCHAIN_MACHINE}") - set(configure_host --host=${CMAKE_CXX_ANDROID_TOOLCHAIN_MACHINE}) - set(ldflags "${ldflags} ${__libstl}") - elseif(is_ios) + if(is_ios) hunter_status_debug("Autotools iOS IPHONEOS_ARCHS: ${IPHONEOS_ARCHS} IPHONESIMULATOR_ARCHS: ${IPHONESIMULATOR_ARCHS}") if(BUILD_SHARED_LIBS) hunter_fatal_error("Autotools: building iOS libraries as shared is not supported") endif() set(ios_architectures) list(APPEND ios_architectures ${IPHONEOS_ARCHS} ${IPHONESIMULATOR_ARCHS}) - elseif(is_cross_compile) - set(configure_host --host=${CROSS_COMPILE_TOOLCHAIN_PREFIX}) - endif() - - # Hunter builds static libraries by default - if(BUILD_SHARED_LIBS) - list(APPEND PARAM_EXTRA_FLAGS --enable-shared --disable-static) - else() - list(APPEND PARAM_EXTRA_FLAGS --disable-shared --enable-static) - endif() - - if(HUNTER_STATUS_DEBUG) - string(REPLACE ";" " " extra_flags "${PARAM_EXTRA_FLAGS}") - hunter_status_debug("EXTRA_FLAGS=${extra_flags}") endif() - # Build command and options - set(build_command . "${PARAM_HUNTER_SELF}/scripts/clear-all.sh" && make) - set(build_opts) - string(COMPARE NOTEQUAL "${PARAM_PARALLEL_JOBS}" "" have_jobs) - if(have_jobs) - list(APPEND build_opts "-j" "${PARAM_PARALLEL_JOBS}") - endif() - - set(configure_command . "${PARAM_HUNTER_SELF}/scripts/clear-all.sh" &&) - list(APPEND configure_command AR=${CMAKE_AR}) - - # see clear-all.sh - # PATH environment variable - set(default_path "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin") - list( - APPEND - configure_command - "PATH=${PARAM_GLOBAL_INSTALL_DIR}/bin:${default_path}" - ) - - # PKG_CONFIG_PATH environment variable - set(d1 "${PARAM_GLOBAL_INSTALL_DIR}/lib/pkgconfig") - set(d2 "${PARAM_GLOBAL_INSTALL_DIR}/share/pkgconfig") - list(APPEND configure_command "PKG_CONFIG_PATH=${d1}:${d2}") - - string(COMPARE NOTEQUAL "${PARAM_BOOTSTRAP}" "" have_bootstrap) - if(have_bootstrap) - list(APPEND configure_command "${PARAM_BOOTSTRAP}" &&) - endif() - - list(APPEND configure_command "./configure") - - # Build the configure command line options - set(configure_opts) - string(COMPARE NOTEQUAL "${configure_host}" "" has_configure_host) - if(has_configure_host) - list(APPEND configure_opts ${configure_host}) - endif() - - string(COMPARE NOTEQUAL "${toolchain_binaries}" "" has_changes) - if(has_changes) - list(APPEND configure_opts ${toolchain_binaries}) - endif() - - string(COMPARE NOTEQUAL "${cppflags}" "" has_cppflags) - if(has_cppflags) - list(APPEND configure_opts CPPFLAGS=${cppflags}) - endif() - - string(COMPARE NOTEQUAL "${cflags}" "" has_cflags) - if(has_cflags) - list(APPEND configure_opts CFLAGS=${cflags}) - endif() - - string(COMPARE NOTEQUAL "${cxxflags}" "" has_cxxflags) - if(has_cxxflags) - list(APPEND configure_opts CXXFLAGS=${cxxflags}) - endif() - - string(COMPARE NOTEQUAL "${ldflags}" "" hasldflags) - if(hasldflags) - list(APPEND configure_opts LDFLAGS=${ldflags}) - endif() + if(NOT is_ios) + hunter_autotools_configure_command(autotools_configure_command + PACKAGE_INSTALL_DIR + ${PARAM_INSTALL_DIR} + EXTRA_FLAGS + ${PARAM_EXTRA_FLAGS} + INSTALL_DIR + ${PARAM_GLOBAL_INSTALL_DIR} + PACKAGE_CONFIGURATION_TYPES + ${PARAM_PACKAGE_CONFIGURATION_TYPES} + CPPFLAGS + ${PARAM_CPPFLAGS} + CFLAGS + ${PARAM_CFLAGS} + CXXFLAGS + ${PARAM_CXXFLAGS} + LDFLAGS + ${PARAM_LDFLAGS} + ) - if(PARAM_EXTRA_FLAGS) - list(APPEND configure_opts ${PARAM_EXTRA_FLAGS}) - endif() + set(configure_command ${shell_env} ${autotools_configure_command}) - if(NOT is_ios) - hunter_status_debug("Autotools configure_opts: ${configure_opts} ") ExternalProject_Add(${target_name} URL ${PARAM_URL} @@ -378,12 +179,11 @@ function(hunter_autotools_project target_name) ${PARAM_INSTALL_DIR} # not used, just avoid creating Install/ empty directory CONFIGURE_COMMAND + "${PARAM_BOOTSTRAP}" + COMMAND ${configure_command} - ${configure_opts} - "--prefix=${PARAM_INSTALL_DIR}" BUILD_COMMAND ${build_command} - ${build_opts} BUILD_IN_SOURCE 1 INSTALL_COMMAND @@ -434,7 +234,6 @@ function(hunter_autotools_project target_name) endif() set(arch_flags) - set(configure_opts) # Extra space at the end of the arch_flags is needed below when appending # to configure_opts, please do not remove! if(is_simulator) @@ -442,13 +241,30 @@ function(hunter_autotools_project target_name) else() set(arch_flags "-arch ${ios_architecture} -isysroot ${IPHONEOS_SDK_ROOT} -miphoneos-version-min=${IOS_SDK_VERSION} ") endif() - list(APPEND configure_opts --host=${configure_host}) - list(APPEND configure_opts ${toolchain_binaries}) - list(APPEND configure_opts CPPFLAGS=${arch_flags}${cppflags}) - list(APPEND configure_opts CFLAGS=${arch_flags}${cflags}) - list(APPEND configure_opts CXXFLAGS=${arch_flags}${cxxflags}) - list(APPEND configure_opts LDFLAGS=${arch_flags}${ldflags}) - list(APPEND configure_opts ${PARAM_EXTRA_FLAGS}) + set(arch_install_dir + ${multi_arch_install_root}/${ios_architecture} + ) + hunter_autotools_configure_command(autotools_configure_command + PACKAGE_INSTALL_DIR + ${arch_install_dir} + EXTRA_FLAGS + ${PARAM_EXTRA_FLAGS} + CONFIGURE_HOST + ${configure_host} + INSTALL_DIR + ${PARAM_GLOBAL_INSTALL_DIR} + PACKAGE_CONFIGURATION_TYPES + ${PARAM_PACKAGE_CONFIGURATION_TYPES} + CPPFLAGS + ${arch_flags}${PARAM_CPPFLAGS} + CFLAGS + ${arch_flags}${PARAM_CFLAGS} + CXXFLAGS + ${arch_flags}${PARAM_CXXFLAGS} + LDFLAGS + ${arch_flags}${PARAM_LDFLAGS} + ) + set(configure_command ${shell_env} ${autotools_configure_command}) # architecture specific source dir set(arch_source_dir @@ -457,9 +273,6 @@ function(hunter_autotools_project target_name) set(arch_target ${target_name}-${ios_architecture} ) - set(arch_install_dir - ${multi_arch_install_root}/${ios_architecture} - ) ExternalProject_Add(${arch_target} URL ${PARAM_URL} @@ -473,12 +286,11 @@ function(hunter_autotools_project target_name) ${arch_install_dir} # not used, just avoid creating Install/ empty directory CONFIGURE_COMMAND + "${PARAM_BOOTSTRAP}" + COMMAND ${configure_command} - ${configure_opts} - "--prefix=${arch_install_dir}" BUILD_COMMAND ${build_command} - ${build_opts} BUILD_IN_SOURCE 1 INSTALL_COMMAND diff --git a/cmake/modules/hunter_calculate_config_sha1.cmake b/cmake/modules/hunter_calculate_config_sha1.cmake index 5e2724538d..f389c81af0 100644 --- a/cmake/modules/hunter_calculate_config_sha1.cmake +++ b/cmake/modules/hunter_calculate_config_sha1.cmake @@ -70,6 +70,11 @@ function(hunter_calculate_config_sha1 hunter_self hunter_base user_config) endif() set(projects "${real_projects}") + get_property(submodule_projects GLOBAL PROPERTY HUNTER_SUBMODULE_PROJECTS) + if(submodule_projects) + list(APPEND projects "${submodule_projects}") + endif() + list(REMOVE_DUPLICATES projects) list(SORT projects) # Create unified version @@ -88,6 +93,7 @@ function(hunter_calculate_config_sha1 hunter_self hunter_base user_config) "hunter_config(${x} " "VERSION ${version}" ) + string(COMPARE NOTEQUAL "${HUNTER_${x}_CMAKE_ARGS}" "" have_args) if(have_args) file(APPEND "${input_file}" " CMAKE_ARGS") @@ -95,6 +101,7 @@ function(hunter_calculate_config_sha1 hunter_self hunter_base user_config) file(APPEND "${input_file}" " \"${y}\"") endforeach() endif() + string(COMPARE NOTEQUAL "${HUNTER_${x}_CONFIGURATION_TYPES}" "" have_types) if(have_types) file(APPEND "${input_file}" " CONFIGURATION_TYPES") @@ -102,6 +109,25 @@ function(hunter_calculate_config_sha1 hunter_self hunter_base user_config) file(APPEND "${input_file}" " ${y}") endforeach() endif() + + list(FIND submodule_projects "${x}" submodule_found) + if(NOT submodule_found EQUAL -1) + get_property( + git_submodule_dir + GLOBAL + PROPERTY + "HUNTER_${x}_GIT_SUBMODULE_DIR" + ) + if(NOT EXISTS "${git_submodule_dir}") + hunter_internal_error("Property not found") + endif() + file( + APPEND + "${input_file}" + " GIT_SUBMODULE_DIR \"${git_submodule_dir}\"" + ) + endif() + file(APPEND "${input_file}" ")\n") endif() endforeach() @@ -109,10 +135,20 @@ function(hunter_calculate_config_sha1 hunter_self hunter_base user_config) file(SHA1 "${work_dir}/config.cmake" HUNTER_GATE_CONFIG_SHA1) set(HUNTER_GATE_CONFIG_SHA1 "${HUNTER_GATE_CONFIG_SHA1}" PARENT_SCOPE) hunter_make_directory("${hunter_base}" "${HUNTER_GATE_SHA1}" hunter_id_path) + hunter_make_directory( - "${hunter_id_path}" "${HUNTER_GATE_CONFIG_SHA1}" hunter_config_id_path + "${hunter_id_path}" + "${HUNTER_GATE_TOOLCHAIN_SHA1}" + hunter_toolchain_id_path ) + hunter_make_directory( + "${hunter_toolchain_id_path}" + "${HUNTER_GATE_CONFIG_SHA1}" + hunter_config_id_path + ) + + set(dst "${hunter_config_id_path}/config.cmake") if(EXISTS "${dst}") diff --git a/cmake/modules/hunter_calculate_toolchain_sha1.cmake b/cmake/modules/hunter_calculate_toolchain_sha1.cmake index afb7a78d58..0d2fd88fc1 100644 --- a/cmake/modules/hunter_calculate_toolchain_sha1.cmake +++ b/cmake/modules/hunter_calculate_toolchain_sha1.cmake @@ -112,12 +112,6 @@ function(hunter_calculate_toolchain_sha1 hunter_self hunter_base) hunter_make_directory( "${hunter_id_path}" - "${HUNTER_GATE_CONFIG_SHA1}" - hunter_config_id_path - ) - - hunter_make_directory( - "${hunter_config_id_path}" "${HUNTER_GATE_TOOLCHAIN_SHA1}" hunter_toolchain_id_path ) diff --git a/cmake/modules/hunter_check_download_error_message.cmake b/cmake/modules/hunter_check_download_error_message.cmake index 126673c39e..654215486c 100644 --- a/cmake/modules/hunter_check_download_error_message.cmake +++ b/cmake/modules/hunter_check_download_error_message.cmake @@ -52,6 +52,8 @@ function(hunter_check_download_error_message) set(expected_message "\"Timeout was reached\"") elseif(x_ERROR_CODE EQUAL 1) set(expected_message "\"Unsupported protocol\"") + elseif(x_ERROR_CODE EQUAL 52) + set(expected_message "\"Server returned nothing (no headers, no data)\"") else() file(REMOVE "${x_REMOVE_ON_ERROR}") hunter_internal_error( diff --git a/cmake/modules/hunter_config.cmake b/cmake/modules/hunter_config.cmake index 5b13f56192..96c22dbbad 100644 --- a/cmake/modules/hunter_config.cmake +++ b/cmake/modules/hunter_config.cmake @@ -4,8 +4,10 @@ include(CMakeParseArguments) # cmake_parse_arguments include(hunter_fatal_error) +include(hunter_pack_git_submodule) include(hunter_unsetvar) include(hunter_user_error) +include(hunter_parse_cmake_args_for_keyword) macro(hunter_config) if(NOT HUNTER_ALLOW_CONFIG_LOADING) @@ -16,7 +18,7 @@ macro(hunter_config) "error.unexpected.hunter_config" ) endif() - set(_hunter_one_value VERSION) + set(_hunter_one_value VERSION GIT_SUBMODULE GIT_SUBMODULE_DIR) set(_hunter_multiple_values CMAKE_ARGS CONFIGURATION_TYPES) cmake_parse_arguments( _hunter @@ -41,6 +43,40 @@ macro(hunter_config) # clear all hunter_unsetvar(${_hunter_root}) + string(COMPARE NOTEQUAL "${_hunter_GIT_SUBMODULE}" "" _hunter_submodule_create) + if(_hunter_submodule_create) + # get HUNTER_SUBMODULE_SOURCE_SUBDIR from CMAKE_ARGS + hunter_parse_cmake_args_for_keyword( + CMAKE_ARGS ${_hunter_CMAKE_ARGS} + KEYWORD HUNTER_SUBMODULE_SOURCE_SUBDIR + OUTPUT _source_subdir + ) + + hunter_pack_git_submodule( + GIT_SUBMODULE "${_hunter_GIT_SUBMODULE}" + VERSION _hunter_VERSION + SUBMODULE_SOURCE_SUBDIR "${_source_subdir}" + ) + endif() + + string(COMPARE NOTEQUAL "${_hunter_GIT_SUBMODULE_DIR}" "" _hunter_submodule_consume) + if(_hunter_submodule_consume) + set_property( + GLOBAL + PROPERTY + "HUNTER_${_hunter_current_project}_GIT_SUBMODULE_DIR" + "${_hunter_GIT_SUBMODULE_DIR}" + ) + + set_property( + GLOBAL + APPEND + PROPERTY + HUNTER_SUBMODULE_PROJECTS + "${_hunter_current_project}" + ) + endif() + if(_hunter_VERSION) set(HUNTER_${_hunter_current_project}_VERSION ${_hunter_VERSION}) set(HUNTER_${_hunter_current_project}_CMAKE_ARGS ${_hunter_CMAKE_ARGS}) diff --git a/cmake/modules/hunter_create_cache_file.cmake b/cmake/modules/hunter_create_cache_file.cmake index 2dd3b0bc34..86340bc402 100644 --- a/cmake/modules/hunter_create_cache_file.cmake +++ b/cmake/modules/hunter_create_cache_file.cmake @@ -10,15 +10,15 @@ function(hunter_create_cache_file cache_path) hunter_test_string_not_empty("${HUNTER_CACHED_ROOT}") hunter_test_string_not_empty("${HUNTER_SHA1}") hunter_test_string_not_empty("${HUNTER_CONFIG_SHA1}") + hunter_test_string_not_empty("${HUNTER_CONFIG_ID_PATH}") hunter_test_string_not_empty("${HUNTER_VERSION}") hunter_test_string_not_empty("${HUNTER_TOOLCHAIN_SHA1}") - hunter_test_string_not_empty("${HUNTER_TOOLCHAIN_ID_PATH}") if(EXISTS "${cache_path}") return() endif() - hunter_lock_directory("${HUNTER_TOOLCHAIN_ID_PATH}" "") + hunter_lock_directory("${HUNTER_CONFIG_ID_PATH}" "") # While waiting for lock other instance can create this file if(EXISTS "${cache_path}") @@ -178,6 +178,14 @@ function(hunter_create_cache_file cache_path) "set(HUNTER_CACHED_CONFIGURATION_TYPES \"${HUNTER_CACHED_CONFIGURATION_TYPES}\" CACHE INTERNAL \"\")\n" ) + # CMP0069 should be set to NEW so we can build old projects with LTO + # without modifying source code + file( + APPEND + "${temp_path}" + "set(CMAKE_POLICY_DEFAULT_CMP0069 NEW CACHE INTERNAL \"\")\n" + ) + # Atomic operation file(RENAME "${temp_path}" "${cache_path}") endfunction() diff --git a/cmake/modules/hunter_create_dependency_entry.cmake b/cmake/modules/hunter_create_dependency_entry.cmake index f81a9b94cb..926ea80268 100644 --- a/cmake/modules/hunter_create_dependency_entry.cmake +++ b/cmake/modules/hunter_create_dependency_entry.cmake @@ -16,7 +16,7 @@ function(hunter_create_dependency_entry) hunter_test_string_not_empty("${x_PACKAGE}") hunter_test_string_not_empty("${x_RESULT}") - hunter_test_string_not_empty("${HUNTER_TOOLCHAIN_ID_PATH}") + hunter_test_string_not_empty("${HUNTER_CONFIG_ID_PATH}") string(COMPARE NOTEQUAL "${x_COMPONENT}" "" has_component) string(COMPARE NOTEQUAL "${x_UNPARSED_ARGUMENTS}" "" has_unparsed) @@ -24,7 +24,7 @@ function(hunter_create_dependency_entry) hunter_internal_error("Unparsed: ${x_UNPARSED_ARGUMENTS}") endif() - set(top_dir "${HUNTER_TOOLCHAIN_ID_PATH}/Build") + set(top_dir "${HUNTER_CONFIG_ID_PATH}/Build") set(dep_dir "${top_dir}/${x_PACKAGE}") if(has_component) diff --git a/cmake/modules/hunter_download.cmake b/cmake/modules/hunter_download.cmake index e3fc552ae7..b6c8abd5c5 100644 --- a/cmake/modules/hunter_download.cmake +++ b/cmake/modules/hunter_download.cmake @@ -1,4 +1,5 @@ -# Copyright (c) 2013-2015, Ruslan Baratov, Aaditya Kalsi +# Copyright (c) 2013-2017, Ruslan Baratov +# Copyright (c) 2015, Aaditya Kalsi # All rights reserved. include(CMakeParseArguments) # cmake_parse_arguments @@ -21,12 +22,11 @@ include(hunter_user_error) # Note: 'hunter_find_licenses' should be called before each return point function(hunter_download) set(one PACKAGE_NAME PACKAGE_COMPONENT PACKAGE_INTERNAL_DEPS_ID) - set(multiple PACKAGE_DEPENDS_ON PACKAGE_UNRELOCATABLE_TEXT_FILES) + set(multiple PACKAGE_UNRELOCATABLE_TEXT_FILES) cmake_parse_arguments(HUNTER "" "${one}" "${multiple}" ${ARGV}) # -> HUNTER_PACKAGE_NAME # -> HUNTER_PACKAGE_COMPONENT - # -> HUNTER_PACKAGE_DEPENDS_ON # -> HUNTER_PACKAGE_INTERNAL_DEPS_ID # -> HUNTER_PACKAGE_UNRELOCATABLE_TEXT_FILES @@ -44,7 +44,7 @@ function(hunter_download) hunter_test_string_not_empty("${HUNTER_INSTALL_PREFIX}") hunter_test_string_not_empty("${HUNTER_PACKAGE_NAME}") - hunter_test_string_not_empty("${HUNTER_TOOLCHAIN_ID_PATH}") + hunter_test_string_not_empty("${HUNTER_CONFIG_ID_PATH}") hunter_test_string_not_empty("${HUNTER_CACHE_FILE}") string(COMPARE NOTEQUAL "${HUNTER_BINARY_DIR}" "" hunter_has_binary_dir) @@ -147,7 +147,7 @@ function(hunter_download) set(HUNTER_PACKAGE_SETUP_DIR "${HUNTER_SELF}/cmake/projects/${HUNTER_PACKAGE_NAME}") set(HUNTER_GLOBAL_SCRIPT_DIR "${HUNTER_SELF}/scripts") set(HUNTER_PACKAGE_SCRIPT_DIR "${HUNTER_PACKAGE_SETUP_DIR}/scripts/") - set(HUNTER_PACKAGE_HOME_DIR "${HUNTER_TOOLCHAIN_ID_PATH}/Build") + set(HUNTER_PACKAGE_HOME_DIR "${HUNTER_CONFIG_ID_PATH}/Build") set( HUNTER_PACKAGE_HOME_DIR "${HUNTER_PACKAGE_HOME_DIR}/${HUNTER_PACKAGE_NAME}" @@ -158,7 +158,6 @@ function(hunter_download) "${HUNTER_PACKAGE_HOME_DIR}/__${HUNTER_PACKAGE_COMPONENT}" ) endif() - set(HUNTER_PACKAGE_DONE_STAMP "${HUNTER_PACKAGE_HOME_DIR}/DONE") if(hunter_has_binary_dir) set( HUNTER_PACKAGE_BUILD_DIR @@ -173,7 +172,6 @@ function(hunter_download) else() set(HUNTER_PACKAGE_BUILD_DIR "${HUNTER_PACKAGE_HOME_DIR}/Build") endif() - set(HUNTER_PACKAGE_SOURCE_DIR "${HUNTER_PACKAGE_HOME_DIR}/Source") if(HUNTER_PACKAGE_CACHEABLE) if(NOT HUNTER_PACKAGE_SCHEME_INSTALL) @@ -184,6 +182,25 @@ function(hunter_download) set(HUNTER_PACKAGE_INSTALL_PREFIX "${HUNTER_INSTALL_PREFIX}") endif() + if(HUNTER_PACKAGE_SCHEME_UNPACK) + string(SUBSTRING "${HUNTER_PACKAGE_SHA1}" 0 7 x) + set(hunter_lock_sources TRUE) + set( + hunter_lock_sources_dir + "${HUNTER_CACHED_ROOT}/_Base/Cellar/${HUNTER_PACKAGE_SHA1}/${x}" + ) + set(HUNTER_PACKAGE_SOURCE_DIR "${hunter_lock_sources_dir}/raw") + set(HUNTER_PACKAGE_DONE_STAMP "${hunter_lock_sources_dir}/unpack.DONE") + set(HUNTER_PACKAGE_LICENSE_DIR "${hunter_lock_sources_dir}/licenses") + set(HUNTER_PACKAGE_LICENSE_SEARCH_DIR "${HUNTER_PACKAGE_LICENSE_DIR}") + else() + set(hunter_lock_sources FALSE) + set(HUNTER_PACKAGE_SOURCE_DIR "${HUNTER_PACKAGE_HOME_DIR}/Source") + set(HUNTER_PACKAGE_DONE_STAMP "${HUNTER_PACKAGE_HOME_DIR}/DONE") + set(HUNTER_PACKAGE_LICENSE_DIR "${HUNTER_PACKAGE_INSTALL_PREFIX}/licenses/${HUNTER_PACKAGE_NAME}") + set(HUNTER_PACKAGE_LICENSE_SEARCH_DIR "${HUNTER_INSTALL_PREFIX}/licenses/${HUNTER_PACKAGE_NAME}") + endif() + if(HUNTER_PACKAGE_SCHEME_INSTALL) set(${root_name} "${HUNTER_INSTALL_PREFIX}") hunter_status_debug("Install to: ${HUNTER_INSTALL_PREFIX}") @@ -208,9 +225,6 @@ function(hunter_download) endif() endif() - # license file variable - set(HUNTER_PACKAGE_LICENSE_DIR "${HUNTER_PACKAGE_INSTALL_PREFIX}/licenses/${HUNTER_PACKAGE_NAME}") - set(${root_name} "${${root_name}}" PARENT_SCOPE) set(ENV{${root_name}} "${${root_name}}") hunter_status_print("${root_name}: ${${root_name}} (ver.: ${ver})") @@ -240,17 +254,6 @@ function(hunter_download) DEPENDS_ON_COMPONENT "${HUNTER_PACKAGE_COMPONENT}" ) - foreach(deps ${HUNTER_PACKAGE_DEPENDS_ON}) - if(NOT HUNTER_PACKAGE_SCHEME_INSTALL) - hunter_internal_error("Non-install scheme can't depends on anything") - endif() - # Register explicit dependency - hunter_register_dependency( - PACKAGE "${HUNTER_PACKAGE_NAME};${HUNTER_PACKAGE_COMPONENT}" - DEPENDS_ON_PACKAGE "${deps}" - ) - endforeach() - if(EXISTS "${HUNTER_PACKAGE_DONE_STAMP}") hunter_status_debug("Package already installed: ${HUNTER_PACKAGE_NAME}") if(hunter_has_component) @@ -258,8 +261,11 @@ function(hunter_download) endif() # In: - # * HUNTER_INSTALL_PREFIX + # * HUNTER_PACKAGE_HOME_DIR + # * HUNTER_PACKAGE_LICENSE_SEARCH_DIR # * HUNTER_PACKAGE_NAME + # * HUNTER_PACKAGE_SCHEME_UNPACK + # * HUNTER_PACKAGE_SHA1 # Out: # * ${HUNTER_PACKAGE_NAME}_LICENSES (parent scope) hunter_find_licenses() @@ -271,13 +277,18 @@ function(hunter_download) "${HUNTER_PACKAGE_DOWNLOAD_DIR}" HUNTER_ALREADY_LOCKED_DIRECTORIES ) hunter_lock_directory( - "${HUNTER_TOOLCHAIN_ID_PATH}" HUNTER_ALREADY_LOCKED_DIRECTORIES + "${HUNTER_CONFIG_ID_PATH}" HUNTER_ALREADY_LOCKED_DIRECTORIES ) if(hunter_has_binary_dir) hunter_lock_directory( "${HUNTER_BINARY_DIR}" HUNTER_ALREADY_LOCKED_DIRECTORIES ) endif() + if(hunter_lock_sources) + hunter_lock_directory( + "${hunter_lock_sources_dir}" HUNTER_ALREADY_LOCKED_DIRECTORIES + ) + endif() # While locking other instance can finish package building if(EXISTS "${HUNTER_PACKAGE_DONE_STAMP}") @@ -287,8 +298,11 @@ function(hunter_download) endif() # In: - # * HUNTER_INSTALL_PREFIX + # * HUNTER_PACKAGE_HOME_DIR + # * HUNTER_PACKAGE_LICENSE_SEARCH_DIR # * HUNTER_PACKAGE_NAME + # * HUNTER_PACKAGE_SCHEME_UNPACK + # * HUNTER_PACKAGE_SHA1 # Out: # * ${HUNTER_PACKAGE_NAME}_LICENSES (parent scope) hunter_find_licenses() @@ -318,8 +332,11 @@ function(hunter_download) endif() # In: - # * HUNTER_INSTALL_PREFIX + # * HUNTER_PACKAGE_HOME_DIR + # * HUNTER_PACKAGE_LICENSE_SEARCH_DIR # * HUNTER_PACKAGE_NAME + # * HUNTER_PACKAGE_SCHEME_UNPACK + # * HUNTER_PACKAGE_SHA1 # Out: # * ${HUNTER_PACKAGE_NAME}_LICENSES (parent scope) hunter_find_licenses() @@ -390,6 +407,16 @@ function(hunter_download) "${HUNTER_DOWNLOAD_TOOLCHAIN}" "set(HUNTER_PASSWORDS_PATH \"${HUNTER_PASSWORDS_PATH}\" CACHE INTERNAL \"\")\n" ) + file( + APPEND + "${HUNTER_DOWNLOAD_TOOLCHAIN}" + "set(HUNTER_KEEP_PACKAGE_SOURCES \"${HUNTER_KEEP_PACKAGE_SOURCES}\" CACHE INTERNAL \"\")\n" + ) + file( + APPEND + "${HUNTER_DOWNLOAD_TOOLCHAIN}" + "set(HUNTER_SUPPRESS_LIST_OF_FILES \"${HUNTER_SUPPRESS_LIST_OF_FILES}\" CACHE INTERNAL \"\")\n" + ) string(COMPARE NOTEQUAL "${CMAKE_MAKE_PROGRAM}" "" has_make) if(has_make) @@ -426,15 +453,15 @@ function(hunter_download) "Internal dependencies ID: ${HUNTER_PACKAGE_INTERNAL_DEPS_ID}" ) endif() - + set(_hunter_schemes_search_dirs "") - + set( download_scheme "${HUNTER_PACKAGE_SETUP_DIR}/schemes/${HUNTER_DOWNLOAD_SCHEME}.cmake.in" ) set(_hunter_schemes_search_dirs "${_hunter_schemes_search_dirs}, ${download_scheme}") - + if(NOT EXISTS "${download_scheme}") set( download_scheme @@ -445,7 +472,7 @@ function(hunter_download) hunter_internal_error("Download scheme `${download_scheme}` not found. Search locations: ${_hunter_schemes_search_dirs}") endif() endif() - + hunter_status_debug( "Scheme file used: ${download_scheme}" ) @@ -474,6 +501,18 @@ function(hunter_download) set(allow_builds FALSE) endif() + # Always allow builds of submodules + get_property(submodule_projects GLOBAL PROPERTY HUNTER_SUBMODULE_PROJECTS) + if(submodule_projects) + list(FIND submodule_projects "${HUNTER_PACKAGE_NAME}" submodule_found) + if(NOT submodule_found EQUAL -1) + set(allow_builds TRUE) + if(hunter_has_component) + hunter_internal_error("Submodule with components") + endif() + endif() + endif() + if(NOT allow_builds AND HUNTER_PACKAGE_SCHEME_INSTALL) hunter_fatal_error( "Building package from source is disabled (dir: ${HUNTER_PACKAGE_HOME_DIR})" @@ -572,8 +611,12 @@ function(hunter_download) file(REMOVE_RECURSE "${HUNTER_PACKAGE_BUILD_DIR}") if(HUNTER_PACKAGE_SCHEME_INSTALL) - # Unpacked directory not needed (save some disk space) - file(REMOVE_RECURSE "${HUNTER_PACKAGE_SOURCE_DIR}") + if(HUNTER_KEEP_PACKAGE_SOURCES) + hunter_status_debug("Keep source directory '${HUNTER_PACKAGE_SOURCE_DIR}'") + else() + # Unpacked directory not needed (save some disk space) + file(REMOVE_RECURSE "${HUNTER_PACKAGE_SOURCE_DIR}") + endif() endif() file(REMOVE "${HUNTER_PACKAGE_HOME_DIR}/CMakeLists.txt") @@ -589,8 +632,11 @@ function(hunter_download) file(WRITE "${HUNTER_PACKAGE_DONE_STAMP}" "") # In: - # * HUNTER_INSTALL_PREFIX + # * HUNTER_PACKAGE_HOME_DIR + # * HUNTER_PACKAGE_LICENSE_SEARCH_DIR # * HUNTER_PACKAGE_NAME + # * HUNTER_PACKAGE_SCHEME_UNPACK + # * HUNTER_PACKAGE_SHA1 # Out: # * ${HUNTER_PACKAGE_NAME}_LICENSES (parent scope) hunter_find_licenses() diff --git a/cmake/modules/hunter_download_cache_meta_file.cmake b/cmake/modules/hunter_download_cache_meta_file.cmake index df9fc22175..a0384915bb 100644 --- a/cmake/modules/hunter_download_cache_meta_file.cmake +++ b/cmake/modules/hunter_download_cache_meta_file.cmake @@ -65,20 +65,21 @@ function(hunter_download_cache_meta_file) foreach(server ${HUNTER_CACHE_SERVERS}) string(REGEX MATCH "^https://github.com/" is_github "${server}") if(NOT is_github) - hunter_user_error("Unknown cache server: ${server}") + set(local_url "${server}/meta/${local_suffix}") + set(done_url "${server}/meta/${done_suffix}") + else() + string( + REPLACE + "https://github.com/" + "https://raw.githubusercontent.com/" + url + "${server}" + ) + + set(local_url "${url}/master/${local_suffix}") + set(done_url "${url}/master/${done_suffix}") endif() - string( - REPLACE - "https://github.com/" - "https://raw.githubusercontent.com/" - url - "${server}" - ) - - set(local_url "${url}/master/${local_suffix}") - set(done_url "${url}/master/${done_suffix}") - hunter_status_debug("Downloading file (try #${x} of ${total_retry}):") hunter_status_debug(" ${done_url}") hunter_status_debug(" -> ${x_DONE}") diff --git a/cmake/modules/hunter_download_cache_raw_file.cmake b/cmake/modules/hunter_download_cache_raw_file.cmake index 1adb782015..307cc47ed3 100644 --- a/cmake/modules/hunter_download_cache_raw_file.cmake +++ b/cmake/modules/hunter_download_cache_raw_file.cmake @@ -71,11 +71,11 @@ function(hunter_download_cache_raw_file) foreach(server ${HUNTER_CACHE_SERVERS}) string(REGEX MATCH "^https://github.com/" is_github "${server}") if(NOT is_github) - hunter_user_error("Unknown cache server: ${server}") + set(url "${server}/raw/${suffix}") + else() + set(url "${server}/releases/download/cache/${suffix}") endif() - set(url "${server}/releases/download/cache/${suffix}") - hunter_status_debug("Downloading file (try #${x} of ${total_retry}):") hunter_status_debug(" ${url}") hunter_status_debug(" -> ${x_LOCAL}") diff --git a/cmake/modules/hunter_dump_cmake_flags.cmake b/cmake/modules/hunter_dump_cmake_flags.cmake index 8f4539fbb0..f0a680e9de 100644 --- a/cmake/modules/hunter_dump_cmake_flags.cmake +++ b/cmake/modules/hunter_dump_cmake_flags.cmake @@ -4,6 +4,8 @@ include(CMakeParseArguments) # cmake_parse_arguments include(hunter_internal_error) +include(hunter_get_lang_standard_flag) +include(hunter_test_string_not_empty) # Packages to test this function: # * Boost @@ -19,6 +21,24 @@ function(hunter_dump_cmake_flags) hunter_internal_error("Unparsed arguments: ${x_UNPARSED_ARGUMENTS}") endif() + + if(IOS) + hunter_test_string_not_empty("${IOS_SDK_VERSION}") + string(COMPARE EQUAL "${IOS_DEPLOYMENT_SDK_VERSION}" "" _no_deployment_sdk_version) + if(_no_deployment_sdk_version) + set(CMAKE_CXX_FLAGS "-miphoneos-version-min=${IOS_SDK_VERSION}") + set(CMAKE_C_FLAGS "-miphoneos-version-min=${IOS_SDK_VERSION}") + else() + set(CMAKE_CXX_FLAGS "-miphoneos-version-min=${IOS_DEPLOYMENT_SDK_VERSION}") + set(CMAKE_C_FLAGS "-miphoneos-version-min=${IOS_DEPLOYMENT_SDK_VERSION}") + endif() + + if(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fembed-bitcode") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fembed-bitcode") + endif() + endif() + set(cppflags "") if(ANDROID) @@ -53,6 +73,18 @@ function(hunter_dump_cmake_flags) endforeach() endif() + hunter_get_lang_standard_flag(CXX flag) + string(COMPARE NOTEQUAL "${flag}" "" has_flag) + if(has_flag) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") + endif() + + hunter_get_lang_standard_flag(C flag) + string(COMPARE NOTEQUAL "${flag}" "" has_flag) + if(has_flag) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}") + endif() + string(COMPARE NOTEQUAL "${CMAKE_CXX_COMPILER_TARGET}" "" has_value) string(COMPARE NOTEQUAL "${CMAKE_CXX_COMPILE_OPTIONS_TARGET}" "" has_option) if(has_value AND has_option) @@ -89,6 +121,43 @@ function(hunter_dump_cmake_flags) ) endif() + # PIC { + string(COMPARE NOTEQUAL "${CMAKE_CXX_COMPILE_OPTIONS_PIC}" "" has_pic) + if(CMAKE_POSITION_INDEPENDENT_CODE AND has_pic) + set( + CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_COMPILE_OPTIONS_PIC}" + ) + endif() + + string(COMPARE NOTEQUAL "${CMAKE_C_COMPILE_OPTIONS_PIC}" "" has_pic) + if(CMAKE_POSITION_INDEPENDENT_CODE AND has_pic) + set( + CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_COMPILE_OPTIONS_PIC}" + ) + endif() + # } + + # IPO { + string(COMPARE NOTEQUAL "${CMAKE_CXX_COMPILE_OPTIONS_IPO}" "" has_ipo) + if(CMAKE_INTERPROCEDURAL_OPTIMIZATION AND has_ipo) + foreach(x ${CMAKE_CXX_COMPILE_OPTIONS_IPO}) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${x}") + endforeach() + endif() + + string(COMPARE NOTEQUAL "${CMAKE_C_COMPILE_OPTIONS_IPO}" "" has_ipo) + if(CMAKE_INTERPROCEDURAL_OPTIMIZATION AND has_ipo) + foreach(x ${CMAKE_C_COMPILE_OPTIONS_IPO}) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${x}") + endforeach() + endif() + + string(COMPARE NOTEQUAL "${CMAKE_CXX_LINK_OPTIONS_IPO}" "" has_ipo) + if(CMAKE_INTERPROCEDURAL_OPTIMIZATION AND has_ipo) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_CXX_LINK_OPTIONS_IPO}") + endif() + # } + string(COMPARE EQUAL "${x_CPPFLAGS}" "" is_empty) if(NOT is_empty) set("${x_CPPFLAGS}" "${${x_CPPFLAGS}} ${cppflags}" PARENT_SCOPE) diff --git a/cmake/modules/hunter_fatal_error.cmake b/cmake/modules/hunter_fatal_error.cmake index 4eb5745f93..e58b00aef4 100644 --- a/cmake/modules/hunter_fatal_error.cmake +++ b/cmake/modules/hunter_fatal_error.cmake @@ -7,15 +7,15 @@ include(hunter_internal_error) include(hunter_wiki) function(hunter_fatal_error) - cmake_parse_arguments(hunter "" "WIKI" "" "${ARGV}") - if(NOT hunter_WIKI) - hunter_internal_error("Expected wiki") + cmake_parse_arguments(x "" "WIKI" "" "${ARGV}") + if(NOT x_WIKI) + hunter_internal_error("Expected argument WIKI") endif() message("") - foreach(x ${hunter_UNPARSED_ARGUMENTS}) + foreach(x ${x_UNPARSED_ARGUMENTS}) message("[hunter ** FATAL ERROR **] ${x}") endforeach() message("[hunter ** FATAL ERROR **] [Directory:${CMAKE_CURRENT_LIST_DIR}]") message("") - hunter_wiki("${hunter_WIKI}") + hunter_wiki("${x_WIKI}") endfunction() diff --git a/cmake/modules/hunter_finalize.cmake b/cmake/modules/hunter_finalize.cmake index 4409e29cf9..20d15aed02 100644 --- a/cmake/modules/hunter_finalize.cmake +++ b/cmake/modules/hunter_finalize.cmake @@ -63,21 +63,27 @@ macro(hunter_finalize) # * Read HUNTER_GATE_* variables # * Check cache HUNTER_* variables is up-to-date # * Update cache if needed + # * define HUNTER_ID_PATH + # * define HUNTER_TOOLCHAIN_ID_PATH + # * define HUNTER_CONFIG_ID_PATH hunter_apply_gate_settings() string(SUBSTRING "${HUNTER_SHA1}" 0 7 HUNTER_ID) string(SUBSTRING "${HUNTER_CONFIG_SHA1}" 0 7 HUNTER_CONFIG_ID) string(SUBSTRING "${HUNTER_TOOLCHAIN_SHA1}" 0 7 HUNTER_TOOLCHAIN_ID) - set(HUNTER_ID_PATH "${HUNTER_CACHED_ROOT}/_Base/${HUNTER_ID}") - set(HUNTER_CONFIG_ID_PATH "${HUNTER_ID_PATH}/${HUNTER_CONFIG_ID}") - set( - HUNTER_TOOLCHAIN_ID_PATH - "${HUNTER_CONFIG_ID_PATH}/${HUNTER_TOOLCHAIN_ID}" - ) - - set(HUNTER_INSTALL_PREFIX "${HUNTER_TOOLCHAIN_ID_PATH}/Install") + set(HUNTER_INSTALL_PREFIX "${HUNTER_CONFIG_ID_PATH}/Install") list(APPEND CMAKE_PREFIX_PATH "${HUNTER_INSTALL_PREFIX}") + + # Override pkg-config default search path + # https://github.com/ruslo/hunter/issues/762 + if(NOT MSVC) + set(_pkg_config_dir1 "${HUNTER_INSTALL_PREFIX}/lib/pkgconfig") + set(_pkg_config_dir2 "${HUNTER_INSTALL_PREFIX}/share/pkgconfig") + # This info is also in hunter_autotools_project.cmake + set(ENV{PKG_CONFIG_LIBDIR} "${_pkg_config_dir1}:${_pkg_config_dir2}") + endif() + if(ANDROID) # OpenCV support: https://github.com/ruslo/hunter/issues/153 list(APPEND CMAKE_PREFIX_PATH "${HUNTER_INSTALL_PREFIX}/sdk/native/jni") @@ -91,12 +97,12 @@ macro(hunter_finalize) ) set(_id_info "[ Hunter-ID: ${HUNTER_ID} |") - set(_id_info "${_id_info} Config-ID: ${HUNTER_CONFIG_ID} |") - set(_id_info "${_id_info} Toolchain-ID: ${HUNTER_TOOLCHAIN_ID} ]") + set(_id_info "${_id_info} Toolchain-ID: ${HUNTER_TOOLCHAIN_ID} |") + set(_id_info "${_id_info} Config-ID: ${HUNTER_CONFIG_ID} ]") hunter_status_print("${_id_info}") - set(HUNTER_CACHE_FILE "${HUNTER_TOOLCHAIN_ID_PATH}/cache.cmake") + set(HUNTER_CACHE_FILE "${HUNTER_CONFIG_ID_PATH}/cache.cmake") hunter_create_cache_file("${HUNTER_CACHE_FILE}") if(MSVC) @@ -151,4 +157,15 @@ macro(hunter_finalize) # original path expected. E.g. NMake build: # * https://ci.appveyor.com/project/ingenue/hunter/build/1.0.1412/job/o8a21ue85ivt5d0p string(REPLACE "\\" "\\\\" CMAKE_MAKE_PROGRAM "${CMAKE_MAKE_PROGRAM}") + + if(CMAKE_INTERPROCEDURAL_OPTIMIZATION AND NOT POLICY CMP0069) + hunter_user_error("Unsuitable CMake version") + endif() + + if(IOS AND NOT CMAKE_CROSSCOMPILING) + hunter_user_error( + "CMAKE_CROSSCOMPILING should be set on iOS." + " Please update your toolchain." + ) + endif() endmacro() diff --git a/cmake/modules/hunter_find_helper.cmake b/cmake/modules/hunter_find_helper.cmake new file mode 100644 index 0000000000..b6260e8f9a --- /dev/null +++ b/cmake/modules/hunter_find_helper.cmake @@ -0,0 +1,114 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +include(CMakeParseArguments) # cmake_parse_arguments + +include(hunter_internal_error) +include(hunter_status_debug) +include(hunter_user_error) + +# Test examples: +# * android +# * android_log +# * egl +# * glapi +# * gles2 +# * gles3 +# * osmesa +function(hunter_find_helper) + set(optional "") + set(one LIBRARY HEADER) + set(multiple "") + + # Introduce: + # * x_LIBRARY + # * x_HEADER + cmake_parse_arguments(x "${optional}" "${one}" "${multiple}" "${ARGV}") + + string(COMPARE NOTEQUAL "${x_UNPARSED_ARGUMENTS}" "" has_unparsed) + if(has_unparsed) + hunter_internal_error(FATAL_ERROR "Unparsed arguments: ${x_UNPARSED_ARGUMENTS}") + endif() + + string(COMPARE EQUAL "${x_LIBRARY}" "" is_empty) + if(is_empty) + hunter_internal_error("No LIBRARY") + endif() + + string(COMPARE EQUAL "${x_HEADER}" "" is_empty) + if(is_empty) + hunter_internal_error("No HEADER") + endif() + + string(COMPARE EQUAL "${CMAKE_FIND_PACKAGE_NAME}" "" is_empty) + if(is_empty) + hunter_internal_error("CMAKE_FIND_PACKAGE_NAME is empty") + endif() + + set(package_name "${CMAKE_FIND_PACKAGE_NAME}") + + get_filename_component(parent_name "${CMAKE_PARENT_LIST_FILE}" NAME) + string(COMPARE EQUAL "${parent_name}" "Find${package_name}.cmake" is_equal) + if(NOT is_equal) + hunter_internal_error("Unexpected filename: ${CMAKE_PARENT_LIST_FILE}") + endif() + + set(err_msg "'find_package(${package_name})' should be called") + + if(NOT ${package_name}_FIND_REQUIRED) + hunter_user_error("${err_msg} with REQUIRED") + endif() + + if(${package_name}_FIND_QUIETLY) + hunter_user_error("${err_msg} without QUIET") + endif() + + string(COMPARE EQUAL "${${package_name}_FIND_VERSION}" "" is_empty) + if(NOT is_empty) + hunter_user_error("${err_msg} without version") + endif() + + string(COMPARE EQUAL "${${package_name}_FIND_COMPONENTS}" "" is_empty) + if(NOT is_empty) + hunter_user_error("${err_msg} without components") + endif() + + set(target_name "${package_name}::${package_name}") + if(TARGET "${target_name}") + return() + endif() + + add_library("${target_name}" UNKNOWN IMPORTED) + + unset(_hunter_library CACHE) + unset(_hunter_header CACHE) + + find_library(_hunter_library "${x_LIBRARY}") + find_path(_hunter_header "${x_HEADER}") + + set(wiki "https://github.com/ruslo/hunter/wiki/pkg.${package_name}") + set(details "See ${wiki} for details.") + + if(NOT _hunter_library) + hunter_user_error("Library '${x_LIBRARY}' not found in system. ${details}") + endif() + + if(NOT _hunter_header) + hunter_user_error("Header '${x_HEADER}' not found in system. ${details}") + endif() + + hunter_status_debug("Creating target '${target_name}':") + hunter_status_debug("* library: '${_hunter_library}'") + hunter_status_debug("* header: '${_hunter_header}'") + + set_target_properties( + "${target_name}" + PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGE "CXX" + IMPORTED_LOCATION "${_hunter_library}" + INTERFACE_INCLUDE_DIRECTORIES "${_hunter_header}" + ) + + unset(_hunter_library CACHE) + unset(_hunter_header CACHE) +endfunction() diff --git a/cmake/modules/hunter_find_helper_framework.cmake b/cmake/modules/hunter_find_helper_framework.cmake new file mode 100644 index 0000000000..31ebff2645 --- /dev/null +++ b/cmake/modules/hunter_find_helper_framework.cmake @@ -0,0 +1,76 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +include(CMakeParseArguments) # cmake_parse_arguments + +include(hunter_internal_error) +include(hunter_user_error) + +# Test examples: +# * opengles +function(hunter_find_helper_framework) + set(optional "") + set(one FRAMEWORK) + set(multiple "") + + # Introduce: + # * x_FRAMEWORK + cmake_parse_arguments(x "${optional}" "${one}" "${multiple}" "${ARGV}") + + string(COMPARE NOTEQUAL "${x_UNPARSED_ARGUMENTS}" "" has_unparsed) + if(has_unparsed) + hunter_internal_error(FATAL_ERROR "Unparsed arguments: ${x_UNPARSED_ARGUMENTS}") + endif() + + string(COMPARE EQUAL "${x_FRAMEWORK}" "" is_empty) + if(is_empty) + hunter_internal_error("No FRAMEWORK") + endif() + + string(COMPARE EQUAL "${CMAKE_FIND_PACKAGE_NAME}" "" is_empty) + if(is_empty) + hunter_internal_error("CMAKE_FIND_PACKAGE_NAME is empty") + endif() + + set(package_name "${CMAKE_FIND_PACKAGE_NAME}") + + get_filename_component(parent_name "${CMAKE_PARENT_LIST_FILE}" NAME) + string(COMPARE EQUAL "${parent_name}" "Find${package_name}.cmake" is_equal) + if(NOT is_equal) + hunter_internal_error("Unexpected filename: ${CMAKE_PARENT_LIST_FILE}") + endif() + + set(err_msg "'find_package(${package_name})' should be called") + + if(NOT ${package_name}_FIND_REQUIRED) + hunter_user_error("${err_msg} with REQUIRED") + endif() + + if(${package_name}_FIND_QUIETLY) + hunter_user_error("${err_msg} without QUIET") + endif() + + string(COMPARE EQUAL "${${package_name}_FIND_VERSION}" "" is_empty) + if(NOT is_empty) + hunter_user_error("${err_msg} without version") + endif() + + string(COMPARE EQUAL "${${package_name}_FIND_COMPONENTS}" "" is_empty) + if(NOT is_empty) + hunter_user_error("${err_msg} without components") + endif() + + set(target_name "${package_name}::${package_name}") + if(TARGET "${target_name}") + return() + endif() + + add_library("${target_name}" IMPORTED INTERFACE) + + set_target_properties( + "${target_name}" + PROPERTIES + INTERFACE_LINK_LIBRARIES + "-framework ${x_FRAMEWORK}" + ) +endfunction() diff --git a/cmake/modules/hunter_find_licenses.cmake b/cmake/modules/hunter_find_licenses.cmake index bfbd5f4d50..c2d5d40af8 100644 --- a/cmake/modules/hunter_find_licenses.cmake +++ b/cmake/modules/hunter_find_licenses.cmake @@ -8,19 +8,30 @@ include(hunter_test_string_not_empty) # We must use macro to set variable to parent scope of the caller. # # In: -# * HUNTER_INSTALL_PREFIX +# * HUNTER_PACKAGE_HOME_DIR +# * HUNTER_PACKAGE_LICENSE_SEARCH_DIR # * HUNTER_PACKAGE_NAME +# * HUNTER_PACKAGE_SCHEME_UNPACK +# * HUNTER_PACKAGE_SHA1 # Out: # * ${HUNTER_PACKAGE_NAME}_LICENSES (parent scope) macro(hunter_find_licenses) - hunter_test_string_not_empty("${HUNTER_INSTALL_PREFIX}") + hunter_test_string_not_empty("${HUNTER_PACKAGE_LICENSE_SEARCH_DIR}") hunter_test_string_not_empty("${HUNTER_PACKAGE_NAME}") - file( - GLOB - _licenses - "${HUNTER_INSTALL_PREFIX}/licenses/${HUNTER_PACKAGE_NAME}/*" - ) + file(GLOB _licenses "${HUNTER_PACKAGE_LICENSE_SEARCH_DIR}/*") set("${HUNTER_PACKAGE_NAME}_LICENSES" "${_licenses}" PARENT_SCOPE) + + # HACK (to refactor) { + if(HUNTER_PACKAGE_SCHEME_UNPACK) + hunter_test_string_not_empty("${HUNTER_PACKAGE_HOME_DIR}") + hunter_test_string_not_empty("${HUNTER_PACKAGE_SHA1}") + file( + WRITE + "${HUNTER_PACKAGE_HOME_DIR}/cache.sha1" + "${HUNTER_PACKAGE_SHA1}" + ) + endif() + # } endmacro() diff --git a/cmake/modules/hunter_flush_cache_variables.cmake b/cmake/modules/hunter_flush_cache_variables.cmake index ed7d8411ef..99556edb34 100644 --- a/cmake/modules/hunter_flush_cache_variables.cmake +++ b/cmake/modules/hunter_flush_cache_variables.cmake @@ -39,6 +39,16 @@ function(hunter_flush_cache_variables hunter_self) endif() # } + # From OpenCV Android { + if(x MATCHES "^OpenCV_3RDPARTY_LIB_DIR_(OPT|DBG)$") + set(cleanup TRUE) + endif() + + if(x MATCHES "^OpenCV_CONFIG_PATH$") + set(cleanup TRUE) + endif() + # } + # Exclude standard variables { set( std_variables_list diff --git a/cmake/modules/hunter_generate_qt_5_9_info.cmake b/cmake/modules/hunter_generate_qt_5_9_info.cmake new file mode 100644 index 0000000000..3c256fd006 --- /dev/null +++ b/cmake/modules/hunter_generate_qt_5_9_info.cmake @@ -0,0 +1,190 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# All rights reserved. + +include(hunter_internal_error) +include(hunter_qt_add_module) +include(hunter_test_string_not_empty) + +# See cmake/projects/Qt/generate.sh + +# This function will be used in build scheme too so it's better to set +# regular CMake variables like WIN32 or ANDROID explicitly by is_{android,win32} + +function( + hunter_generate_qt_5_9_info + component_name + skip_components_varname + component_depends_on_varname + is_android + is_win32 +) + hunter_test_string_not_empty("${component_name}") + hunter_test_string_not_empty("${skip_components_varname}") + hunter_test_string_not_empty("${component_depends_on_varname}") + + string(COMPARE NOTEQUAL "${ARGN}" "" has_unparsed) + if(has_unparsed) + hunter_internal_error("Unparsed argument: ${ARGN}") + endif() + + set( + all_components + qt3d + qtactiveqt + qtandroidextras + qtbase + qtcanvas3d + qtcharts + qtconnectivity + qtdatavis3d + qtdeclarative + qtdoc + qtdocgallery + qtenginio + qtfeedback + qtgamepad + qtgraphicaleffects + qtimageformats + qtlocation + qtmacextras + qtmultimedia + qtnetworkauth + qtpim + qtpurchasing + qtqa + qtquick1 + qtquickcontrols + qtquickcontrols2 + qtremoteobjects + qtrepotools + qtscript + qtscxml + qtsensors + qtserialbus + qtserialport + qtspeech + qtsvg + qtsystems + qttools + qttranslations + qtvirtualkeyboard + qtwayland + qtwebchannel + qtwebengine + qtwebkit + qtwebkit-examples + qtwebsockets + qtwebview + qtwinextras + qtx11extras + qtxmlpatterns + ) + + # This is modified copy/paste code from /qt.pro + + if(is_android) + set(ANDROID_EXTRAS qtandroidextras) + else() + set(ANDROID_EXTRAS "") + endif() + + if(is_win32) + set(ACTIVE_QT qtactiveqt) + else() + # Project MESSAGE: ActiveQt is a Windows Desktop-only module. Will just generate a docs target. + set(ACTIVE_QT "") + endif() + + # Order is important. Component of each section should not depends on entry + # from section below. + + # Components are in list but not exists in fact: + # * qtdocgallery + # * qtfeedback + # * qtpim + # * qtsystems + + # Depends on nothing + hunter_qt_add_module(NAME qtbase) + # -- + + # Depends only on qtbase + hunter_qt_add_module(NAME qtandroidextras COMPONENTS qtbase) + hunter_qt_add_module(NAME qtmacextras COMPONENTS qtbase) + hunter_qt_add_module(NAME qtx11extras COMPONENTS qtbase) + hunter_qt_add_module(NAME qtsvg COMPONENTS qtbase) + hunter_qt_add_module(NAME qtxmlpatterns COMPONENTS qtbase) + hunter_qt_add_module(NAME ${ACTIVE_QT} COMPONENTS qtbase) + hunter_qt_add_module(NAME qtimageformats COMPONENTS qtbase) + hunter_qt_add_module(NAME qtserialport COMPONENTS qtbase) + # -- + + # -- + hunter_qt_add_module(NAME qtdeclarative COMPONENTS qtbase qtsvg qtxmlpatterns) + # -- + + # Depends only on qtbase/qtdeclarative + hunter_qt_add_module(NAME qtcanvas3d COMPONENTS qtdeclarative) + hunter_qt_add_module(NAME qtdoc COMPONENTS qtdeclarative) + hunter_qt_add_module(NAME qtenginio COMPONENTS qtdeclarative) + hunter_qt_add_module(NAME qtgraphicaleffects COMPONENTS qtdeclarative) + hunter_qt_add_module(NAME qtmultimedia COMPONENTS qtbase qtdeclarative) + hunter_qt_add_module(NAME qtsensors COMPONENTS qtbase qtdeclarative) + hunter_qt_add_module(NAME qtwayland COMPONENTS qtbase qtdeclarative) + hunter_qt_add_module(NAME qtwebsockets COMPONENTS qtbase qtdeclarative) + # -- + + # -- + hunter_qt_add_module(NAME qtquickcontrols COMPONENTS qtdeclarative qtgraphicaleffects) + hunter_qt_add_module(NAME qtwinextras COMPONENTS qtbase qtdeclarative qtmultimedia) + hunter_qt_add_module(NAME qtconnectivity COMPONENTS qtbase ${ANDROID_EXTRAS} qtdeclarative) + hunter_qt_add_module(NAME qtwebchannel COMPONENTS qtbase qtdeclarative qtwebsockets) + hunter_qt_add_module(NAME qt3d COMPONENTS qtdeclarative qtimageformats) + # -- + + # -- + hunter_qt_add_module(NAME qtlocation COMPONENTS qtbase qtdeclarative qtquickcontrols) + hunter_qt_add_module(NAME qtquickcontrols2 COMPONENTS qtquickcontrols) + # -- + + # -- + hunter_qt_add_module(NAME qttools COMPONENTS qtbase qtdeclarative ${ACTIVE_QT}) + hunter_qt_add_module(NAME qtwebengine COMPONENTS qtquickcontrols qtwebchannel qtlocation) + # -- + + # -- + hunter_qt_add_module(NAME qtwebview COMPONENTS qtdeclarative qtwebengine) + hunter_qt_add_module(NAME qtscript COMPONENTS qtbase qttools) + hunter_qt_add_module(NAME qttranslations COMPONENTS qttools) + # -- + + string(COMPARE EQUAL "${component_name}" "qtbase" is_qtbase) + string(COMPARE EQUAL "${component_${component_name}_depends_on}" "" depends_on_nothing) + if(is_qtbase) + if(NOT depends_on_nothing) + hunter_internal_error("qtbase should not depends on anything") + endif() + else() + if(depends_on_nothing) + hunter_internal_error( + "component `${component_name}` should have at least one dependency:" + " qtbase" + ) + endif() + endif() + + set( + "${component_depends_on_varname}" + "${component_${component_name}_depends_on}" + PARENT_SCOPE + ) + + set(skip_list ${all_components}) + list( + REMOVE_ITEM + skip_list + "${component_name}" + ${component_${component_name}_depends_on} + ) + set("${skip_components_varname}" "${skip_list}" PARENT_SCOPE) +endfunction() diff --git a/cmake/modules/hunter_generate_qt_info.cmake b/cmake/modules/hunter_generate_qt_info.cmake index 7104daa941..e93f077894 100644 --- a/cmake/modules/hunter_generate_qt_info.cmake +++ b/cmake/modules/hunter_generate_qt_info.cmake @@ -3,6 +3,7 @@ include(hunter_generate_qt_5_5_info) include(hunter_generate_qt_5_6_info) +include(hunter_generate_qt_5_9_info) include(hunter_test_string_not_empty) include(hunter_user_error) @@ -44,6 +45,14 @@ function( "${is_android}" "${is_win32}" ) + elseif(qt_version MATCHES "^5\\.9\\.") + hunter_generate_qt_5_9_info( + "${component_name}" + toskip + depends_on + "${is_android}" + "${is_win32}" + ) else() hunter_user_error("Unexpected Qt version") endif() diff --git a/cmake/modules/hunter_get_boost_libs.cmake b/cmake/modules/hunter_get_boost_libs.cmake new file mode 100644 index 0000000000..cf02b2ab21 --- /dev/null +++ b/cmake/modules/hunter_get_boost_libs.cmake @@ -0,0 +1,86 @@ +# Copyright (c) 2017 NeroBurner +# All rights reserved. + +include(CMakeParseArguments) # cmake_parse_arguments + +include(hunter_test_string_not_empty) +include(hunter_append_component) + +function(hunter_get_boost_libs) + set(function_name "hunter_get_boost_libs") + set(function_synopsis "${function_name}(VERSION requested_boost_version LIBS found_libs)") + + # parse arguments + set(one_value_args VERSION LIBS) + cmake_parse_arguments(x "" "${one_value_args}" "" ${ARGV}) + + # No free arguments allowed + list(LENGTH x_UNPARSED_ARGUMENTS x_len) + if(NOT x_len EQUAL 0) + hunter_internal_error( + "'${function_name}' incorrect usage," + " expected no free arguments '${x_UNPARSED_ARGUMENTS}'." + " Synopsis: ${function_synopsis}" + ) + endif() + + # check mandatory arguments + foreach(arg VERSION LIBS) + string(COMPARE EQUAL "${x_${arg}}" "" is_empty) + if(is_empty) + hunter_internal_error( + "'${function_name}' incorrect usage," + " option '${arg}' with one argument is mandatory." + " Synopsis: ${function_synopsis}" + ) + endif() + + string(FIND "${x_${arg}}" " " arg_whitespace_position) + if(NOT arg_whitespace_position EQUAL -1) + hunter_internal_error( + "'${function_name}' incorrect usage," + " argument '${arg}' with whitespaces not allowed." + " offending value '${x_${arg}}'" + ) + endif() + endforeach() + + # list of all boost components valid for given version + set(boost_libs) + # common arguments for hunter_append_component + set(common_args LIST boost_libs VERSION ${x_VERSION}) + hunter_append_component(${common_args} COMPONENT atomic SINCE 1.53.0) + hunter_append_component(${common_args} COMPONENT chrono SINCE 1.47.0) + hunter_append_component(${common_args} COMPONENT container SINCE 1.56.0) + hunter_append_component(${common_args} COMPONENT context SINCE 1.51.0) + hunter_append_component(${common_args} COMPONENT coroutine SINCE 1.53.0) + hunter_append_component(${common_args} COMPONENT coroutine2 SINCE 1.60.0 UNTIL 1.65.0) + hunter_append_component(${common_args} COMPONENT date_time SINCE 1.29.0) + hunter_append_component(${common_args} COMPONENT exception SINCE 1.36.0) + hunter_append_component(${common_args} COMPONENT fiber SINCE 1.62.0) + hunter_append_component(${common_args} COMPONENT filesystem SINCE 1.30.0) + hunter_append_component(${common_args} COMPONENT graph SINCE 1.18.0) + hunter_append_component(${common_args} COMPONENT graph_parallel SINCE 1.18.0) + hunter_append_component(${common_args} COMPONENT iostreams SINCE 1.33.0) + hunter_append_component(${common_args} COMPONENT locale SINCE 1.48.0) + hunter_append_component(${common_args} COMPONENT log SINCE 1.54.0) + hunter_append_component(${common_args} COMPONENT math SINCE 1.23.0) + hunter_append_component(${common_args} COMPONENT metaparse SINCE 1.61.0) + hunter_append_component(${common_args} COMPONENT mpi SINCE 1.35.0) + hunter_append_component(${common_args} COMPONENT program_options SINCE 1.32.0) + hunter_append_component(${common_args} COMPONENT python SINCE 1.19.0) + hunter_append_component(${common_args} COMPONENT random SINCE 1.15.0) + hunter_append_component(${common_args} COMPONENT regex SINCE 1.18.0) + hunter_append_component(${common_args} COMPONENT serialization SINCE 1.32.0) + hunter_append_component(${common_args} COMPONENT signals SINCE 1.29.0) + hunter_append_component(${common_args} COMPONENT stacktrace SINCE 1.65.0) + hunter_append_component(${common_args} COMPONENT system SINCE 1.35.0) + hunter_append_component(${common_args} COMPONENT test SINCE 1.21.0) + hunter_append_component(${common_args} COMPONENT thread SINCE 1.25.0) + hunter_append_component(${common_args} COMPONENT timer SINCE 1.9.0) + hunter_append_component(${common_args} COMPONENT type_erasure SINCE 1.60.0) + hunter_append_component(${common_args} COMPONENT wave SINCE 1.33.0) + + # set output_var to found definition + set(${x_LIBS} ${boost_libs} PARENT_SCOPE) +endfunction() diff --git a/cmake/modules/hunter_get_build_flags.cmake b/cmake/modules/hunter_get_build_flags.cmake new file mode 100644 index 0000000000..1d6312eeaf --- /dev/null +++ b/cmake/modules/hunter_get_build_flags.cmake @@ -0,0 +1,152 @@ +# Copyright (c) 2017 Ruslan Baratov, Alexandre Pretyman +# All rights reserved. +# +# This function dump build flags. +# Only OUT_* paramaters which are passed will be written too (i.e. optional) +# +# Usage example: +# hunter_get_build_flags( +# PACKAGE_CONFIGURATION_TYPES +# "Release" # Mandatory ONE build config type +# INSTALL_DIR +# "${HUNTER_INSTALL_DIR}" # Mandatory of hunter +# OUT_CPPFLAGS +# cppflags # set cppflags with preprocessor flags +# OUT_CFLAGS +# cflags # set cflags with c compilation flags +# OUT_CXXFLAGS +# cxxflags # set cxxflags with c++ compilation flags +# OUT_LDFLAGS +# ldflags # set ldflags with linking flags +# ) + +include(CMakeParseArguments) + +include(hunter_dump_cmake_flags) +include(hunter_fatal_error) +include(hunter_internal_error) +include(hunter_status_debug) + +function(hunter_get_build_flags) + set(optional_params) + set(one_value_params + INSTALL_DIR + OUT_CPPFLAGS + OUT_CFLAGS + OUT_CXXFLAGS + OUT_LDFLAGS + ) + set(multi_value_params + PACKAGE_CONFIGURATION_TYPES + ) + cmake_parse_arguments( + PARAM + "${optional_params}" + "${one_value_params}" + "${multi_value_params}" + ${ARGN} + ) + + if(PARAM_UNPARSED_ARGUMENTS) + hunter_internal_error( + "Invalid arguments passed to hunter_get_build_flags" + " ${PARAM_UNPARSED_ARGUMENTS}" + ) + endif() + + string(COMPARE NOTEQUAL "${PARAM_INSTALL_DIR}" "" has_install_dir) + if (NOT has_install_dir) + hunter_internal_error( + "hunter_get_build_flags expects INSTALL_DIR, it must be provided" + ) + endif() + + list(LENGTH PARAM_PACKAGE_CONFIGURATION_TYPES len) + if(NOT "${len}" EQUAL "1") + hunter_fatal_error( + "hunter_get_build_flags expects PACKAGE_CONFIGURATION_TYPES to have exactly 1 value, but has ${len} with elements: ${PARAM_PACKAGE_CONFIGURATION_TYPES}" + ) + endif() + string(TOUPPER ${PARAM_PACKAGE_CONFIGURATION_TYPES} config_type) + + hunter_status_debug( + "Build flags config ${config_type} on dir ${PARAM_GLOBAL_INSTALLDIR}" + ) + string(COMPARE NOTEQUAL "${PARAM_OUT_CPPFLAGS}" "" has_out_cppflags) + string(COMPARE NOTEQUAL "${PARAM_OUT_CFLAGS}" "" has_out_cflags) + string(COMPARE NOTEQUAL "${PARAM_OUT_CXXFLAGS}" "" has_out_cxxflags) + string(COMPARE NOTEQUAL "${PARAM_OUT_LDFLAGS}" "" has_out_ldflags) + + if(has_out_cppflags) + # CPPFLAGS=${PARAM_CPPFLAGS} [-D${COMPILE_DEFINITIONS}] + # [-I${INCLUDE_DIRECTORIES}] + # + # C Preprocessor flags + + hunter_dump_cmake_flags(CPPFLAGS cppflags) + set(cppflags "${cppflags} -I${PARAM_INSTALL_DIR}/include") + string(STRIP "${cppflags}" cppflags) + # build config type definitions + get_directory_property(defs + COMPILE_DEFINITIONS_${config_type} + ) + foreach(def ${defs}) + set(cppflags "${cppflags} -D${def}") + endforeach() + # non-build config specific definitions + get_directory_property(defs COMPILE_DEFINITIONS) + foreach(def ${defs}) + set(cppflags "${cppflags} -D${def}") + endforeach() + + get_directory_property(include_dirs INCLUDE_DIRECTORIES) + foreach(include_dir ${include_dirs}) + set(cppflags + "${cppflags} ${CMAKE_INCLUDE_SYSTEM_FLAG_CXX} ${include_dir}" + ) + endforeach() + + hunter_status_debug(" CPPFLAGS=${cppflags}") + set(${PARAM_OUT_CPPFLAGS} ${cppflags} PARENT_SCOPE) + endif() + + if(has_out_cflags) + # CFLAGS=${cflags} ${CMAKE_C_FLAGS} + # + # C Compiler Flags (defines or include directories should not be needed here) + set(cflags "${CMAKE_C_FLAGS_${config_type}} ${CMAKE_C_FLAGS}") + string(STRIP "${cflags}" cflags) + hunter_status_debug(" CFLAGS=${cflags}") + set(${PARAM_OUT_CFLAGS} ${cflags} PARENT_SCOPE) + endif() + + if(has_out_cxxflags) + # CXXFLAGS=${cxxflags} ${CMAKE_CXX_FLAGS} + # + # C++ Compiler flags (defines or include directories should not be needed here) + set(cxxflags + "${CMAKE_CXX_FLAGS_${config_type}} ${CMAKE_CXX_FLAGS} ${PARAM_CXXFLAGS}" + ) + string(STRIP "${cxxflags}" cxxflags) + hunter_status_debug(" CXXFLAGS=${cxxflags}") + set(${PARAM_OUT_CXXFLAGS} ${cflags} PARENT_SCOPE) + endif() + + if(has_out_ldflags) + # LDFLAGS=${ldflags} + # + # Linker flags + set(ldflags "-L${PARAM_INSTALL_DIR}/lib") + set(ldflags "${ldflags} ${CMAKE_EXE_LINKER_FLAGS_${config_type}}") + string(STRIP "${ldflags}" ldflags) + set(ldflags "${ldflags} ${CMAKE_EXE_LINKER_FLAGS}") + string(STRIP "${ldflags}" ldflags) + string(COMPARE NOTEQUAL "${ANDROID}" "" is_android) + if(is_android) + set(ldflags "${ldflags} ${__libstl}") + endif() + hunter_status_debug(" LDFLAGS=${ldflags}") + set(${PARAM_OUT_LDFLAGS} ${ldflags} PARENT_SCOPE) + endif() +endfunction() + diff --git a/cmake/modules/hunter_get_lang_standard_flag.cmake b/cmake/modules/hunter_get_lang_standard_flag.cmake new file mode 100644 index 0000000000..3afad3970a --- /dev/null +++ b/cmake/modules/hunter_get_lang_standard_flag.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2017 Pawel Bylica +# All rights reserved. + +include(hunter_status_debug) + +function(hunter_get_lang_standard_flag LANG OUTPUT) + set(CXX_standards 17 14 11 98) + set(C_standards 11 99 90) + # Find the standard flag. + # This maps the logic in the CMake code: + # https://github.com/Kitware/CMake/blob/3bccdd89c88864839a0c8d4ea56bd069c90fa02b/Source/cmLocalGenerator.cxx#L1433-L1467 + + hunter_status_debug("CMAKE_${LANG}_STANDARD_DEFAULT: ${CMAKE_${LANG}_STANDARD_DEFAULT}") + hunter_status_debug("CMAKE_${LANG}_STANDARD: ${CMAKE_${LANG}_STANDARD}") + hunter_status_debug("CMAKE_${LANG}_EXTENSIONS: ${CMAKE_${LANG}_EXTENSIONS}") + hunter_status_debug("CMAKE_${LANG}_STANDARD_REQUIRED: ${CMAKE_${LANG}_STANDARD_REQUIRED}") + + set("${OUTPUT}" "" PARENT_SCOPE) # Reset output in case of quick return. + + string(COMPARE EQUAL "${CMAKE_${LANG}_STANDARD_DEFAULT}" "" no_default) + if(no_default) + # This compiler has no notion of language standard levels. + # https://github.com/Kitware/CMake/blob/3bccdd89c88864839a0c8d4ea56bd069c90fa02b/Source/cmLocalGenerator.cxx#L1427-L1432 + return() + endif() + + set(standard "${CMAKE_${LANG}_STANDARD}") + string(COMPARE EQUAL "${standard}" "" no_standard) + if(no_standard) + # The standard not defined by user. + # https://github.com/Kitware/CMake/blob/3bccdd89c88864839a0c8d4ea56bd069c90fa02b/Source/cmLocalGenerator.cxx#L1433-L1437 + return() + endif() + + # Decide on version with extensions or a clean one. + # By default extensions are assumed On. + # https://github.com/Kitware/CMake/blob/3bccdd89c88864839a0c8d4ea56bd069c90fa02b/Source/cmLocalGenerator.cxx#L1438-L1446 + set(ext "EXTENSION") + if(DEFINED CMAKE_${LANG}_EXTENSIONS AND NOT CMAKE_${LANG}_EXTENSIONS) + set(ext "STANDARD") + endif() + + set(standards "${${LANG}_standards}") + list(FIND standards "${standard}" begin) + if("${begin}" EQUAL "-1") + hunter_internal_error("${LANG} standard ${standard} not known") + return() + endif() + + set(flag "") + list(LENGTH standards end) + math(EXPR end "${end} - 1") + foreach(idx RANGE ${begin} ${end}) + list(GET standards ${idx} standard) + set(option_name "CMAKE_${LANG}${standard}_${ext}_COMPILE_OPTION") + set(flag "${${option_name}}") + hunter_status_debug("${option_name}: '${flag}'") + string(COMPARE NOTEQUAL "${flag}" "" has_flag) + if(has_flag OR CMAKE_${LANG}_STANDARD_REQUIRED) + # Break if flag found or standard is required and we don't want to + # continue checking older standards. + break() + endif() + endforeach() + hunter_status_debug("hunter_get_lang_standard_flag(${LANG}): '${flag}'") + set("${OUTPUT}" "${flag}" PARENT_SCOPE) +endfunction() diff --git a/cmake/modules/hunter_get_package_deps.cmake b/cmake/modules/hunter_get_package_deps.cmake index 096b516895..9fa2c5a407 100644 --- a/cmake/modules/hunter_get_package_deps.cmake +++ b/cmake/modules/hunter_get_package_deps.cmake @@ -36,11 +36,11 @@ function(hunter_get_package_deps) hunter_test_string_not_empty("${x_PACKAGE}") hunter_test_string_not_empty("${x_RESULT}") - hunter_test_string_not_empty("${HUNTER_TOOLCHAIN_ID_PATH}") + hunter_test_string_not_empty("${HUNTER_CONFIG_ID_PATH}") # Go to directory '/Build//__/Dependencies' # and find all `__dep` files. - set(dep_dir "${HUNTER_TOOLCHAIN_ID_PATH}/Build/${x_PACKAGE}") + set(dep_dir "${HUNTER_CONFIG_ID_PATH}/Build/${x_PACKAGE}") if(has_component) set(dep_dir "${dep_dir}/__${x_COMPONENT}") endif() diff --git a/cmake/modules/hunter_get_project_files_to_load.cmake b/cmake/modules/hunter_get_project_files_to_load.cmake new file mode 100644 index 0000000000..9dd1edf121 --- /dev/null +++ b/cmake/modules/hunter_get_project_files_to_load.cmake @@ -0,0 +1,97 @@ +# Copyright (c) 2017 Ruslan Baratov +# All rights reserved. + +include(CMakeParseArguments) # cmake_parse_arguments + +include(hunter_internal_error) +include(hunter_test_string_not_empty) + +function(hunter_get_project_files_to_load) + hunter_test_string_not_empty("${HUNTER_SELF}") + + set(optional "") + set(one PROJECT_NAME FILES) + set(multiple COMPONENTS) + + # Introduce: + # * x_PROJECT_NAME + # * x_FILES + # * x_COMPONENTS + cmake_parse_arguments(x "${optional}" "${one}" "${multiple}" "${ARGV}") + + string(COMPARE NOTEQUAL "${x_UNPARSED_ARGUMENTS}" "" has_unparsed) + if(has_unparsed) + hunter_internal_error("Unparsed arguments: ${x_UNPARSED_ARGUMENTS}") + endif() + + string(COMPARE EQUAL "${x_PROJECT_NAME}" "" is_empty) + if(is_empty) + hunter_internal_error("PROJECT_NAME is empty") + endif() + + get_property( + git_submodule_dir + GLOBAL + PROPERTY + "HUNTER_${x_PROJECT_NAME}_GIT_SUBMODULE_DIR" + ) + + if(git_submodule_dir) + set(result_list "") + list( + APPEND + result_list + "${git_submodule_dir}/${x_PROJECT_NAME}-version.cmake" + ) + + set(hunter_cmake "${HUNTER_SELF}/cmake/projects/${x_PROJECT_NAME}/hunter.cmake") + + if(EXISTS "${hunter_cmake}") + list(APPEND result_list "${hunter_cmake}") + else() + list( + APPEND + result_list + "${git_submodule_dir}/${x_PROJECT_NAME}-download.cmake" + ) + endif() + + set("${x_FILES}" "${result_list}" PARENT_SCOPE) + return() + endif() + + set( + project_dir + "${HUNTER_SELF}/cmake/projects/${x_PROJECT_NAME}" + ) + if(NOT EXISTS "${project_dir}") + hunter_internal_error("Project '${x_PROJECT_NAME}' not found") + endif() + if(NOT IS_DIRECTORY "${project_dir}") + hunter_internal_error("Project '${x_PROJECT_NAME}' not found") + endif() + + # Check components + foreach(x ${x_COMPONENTS}) + set(dir "${project_dir}/${x}") + if(NOT EXISTS "${dir}") + hunter_internal_error( + "Component '${x}' not found in project '${x_PROJECT_NAME}'" + ) + endif() + if(NOT IS_DIRECTORY "${dir}") + hunter_internal_error( + "Component '${x}' not found in project '${x_PROJECT_NAME}'" + ) + endif() + endforeach() + + set(result_list "${project_dir}/hunter.cmake") + + # Load components + foreach(x ${x_COMPONENTS}) + list(APPEND result_list "${project_dir}/${x}/hunter.cmake") + endforeach() + + set("${x_FILES}" "${result_list}" PARENT_SCOPE) +endfunction() diff --git a/cmake/modules/hunter_get_toolchain_binaries.cmake b/cmake/modules/hunter_get_toolchain_binaries.cmake new file mode 100644 index 0000000000..fade89b63f --- /dev/null +++ b/cmake/modules/hunter_get_toolchain_binaries.cmake @@ -0,0 +1,168 @@ +include(hunter_internal_error) +include(hunter_pick_archiver) +include(hunter_status_debug) +include(hunter_test_string_not_empty) + +function(hunter_get_toolchain_binaries) + set(optional_params) + set(one_value_params + OUT_AR + OUT_AS + OUT_LD + OUT_NM + OUT_OBJCOPY + OUT_OBJDUMP + OUT_RANLIB + OUT_STRIP + OUT_CPP + OUT_CC + OUT_CXX + ) + set(multi_value_params) + cmake_parse_arguments( + PARAM + "${optional_params}" + "${one_value_params}" + "${multi_value_params}" + ${ARGN} + ) + + if(PARAM_UNPARSED_ARGUMENTS) + hunter_internal_error( + "Invalid arguments passed to hunter_get_toolchain_binaries" + " ${PARAM_UNPARSED_ARGUMENTS}" + ) + endif() + + + string(COMPARE NOTEQUAL "${ANDROID}" "" is_android) + string(COMPARE NOTEQUAL "${RASPBERRY_PI}" "" is_raspberry_pi) + if(is_android) + hunter_test_string_not_empty("${CMAKE_CXX_ANDROID_TOOLCHAIN_MACHINE}") + hunter_test_string_not_empty("${CMAKE_C_ANDROID_TOOLCHAIN_PREFIX}") + # CMAKE_C_ANDROID_TOOLCHAIN_SUFFIX can be empty + + # Extra Android variables that can't be set in toolchain + # (some variables available only after toolchain processed). + set( + CMAKE_C_PREPROCESSOR + "${CMAKE_C_ANDROID_TOOLCHAIN_PREFIX}cpp${CMAKE_C_ANDROID_TOOLCHAIN_SUFFIX}" + ) + if(NOT EXISTS "${CMAKE_C_PREPROCESSOR}") + hunter_internal_error("File not found: ${CMAKE_C_PREPROCESSOR}") + endif() + endif() + + if(is_android OR is_raspberry_pi) + hunter_test_string_not_empty("${CMAKE_C_FLAGS}") + hunter_test_string_not_empty("${CMAKE_CXX_FLAGS}") + hunter_test_string_not_empty("${CMAKE_AR}") + hunter_test_string_not_empty("${CMAKE_C_PREPROCESSOR}") + hunter_test_string_not_empty("${CMAKE_C_COMPILER}") + hunter_test_string_not_empty("${CMAKE_CXX_COMPILER}") + hunter_test_string_not_empty("${CMAKE_LINKER}") + hunter_test_string_not_empty("${CMAKE_NM}") + hunter_test_string_not_empty("${CMAKE_OBJCOPY}") + hunter_test_string_not_empty("${CMAKE_OBJDUMP}") + hunter_test_string_not_empty("${CMAKE_RANLIB}") + hunter_test_string_not_empty("${CMAKE_STRIP}") + endif() + + # -> CMAKE_AR + # -> CMAKE_RANLIB + hunter_pick_archiver() + + string(COMPARE NOTEQUAL "${PARAM_OUT_AR}" "" has_out_ar) + string(COMPARE NOTEQUAL "${PARAM_OUT_AS}" "" has_out_as) + string(COMPARE NOTEQUAL "${PARAM_OUT_LD}" "" has_out_ld) + string(COMPARE NOTEQUAL "${PARAM_OUT_NM}" "" has_out_nm) + string(COMPARE NOTEQUAL "${PARAM_OUT_OBJCOPY}" "" has_out_objcopy) + string(COMPARE NOTEQUAL "${PARAM_OUT_OBJDUMP}" "" has_out_objdump) + string(COMPARE NOTEQUAL "${PARAM_OUT_RANLIB}" "" has_out_ranlib) + string(COMPARE NOTEQUAL "${PARAM_OUT_STRIP}" "" has_out_strip) + string(COMPARE NOTEQUAL "${PARAM_OUT_CPP}" "" has_out_cpp) + string(COMPARE NOTEQUAL "${PARAM_OUT_CC}" "" has_out_cc) + string(COMPARE NOTEQUAL "${PARAM_OUT_CXX}" "" has_out_cxx) + + # Sets the toolchain binaries + # AR=${CMAKE_AR} + # AS=${CMAKE_ASM_COMPILER} + # LD=${CMAKE_LINKER} + # NM=${CMAKE_NM} + # OBJCOPY=${CMAKE_OBJCOPY} + # OBJDUMP=${CMAKE_OBJDUMP} + # RANLIB=${CMAKE_RANLIB} + # STRIP=${CMAKE_STRIP} + # CPP=${CMAKE_C_PREPROCESSOR} + # CC=${CMAKE_C_COMPILER} + # CXX=${CMAKE_CXX_COMPILER} + # + hunter_status_debug("Toolchain Binaries:") + if(has_out_ar) + hunter_status_debug(" AR=${CMAKE_AR}") + if(CMAKE_AR) + set(${PARAM_OUT_AR} ${CMAKE_AR} PARENT_SCOPE) + endif() + endif() + if(has_out_as) + hunter_status_debug(" AS=${CMAKE_ASM_COMPILER}") + if(CMAKE_ASM_COMPILER) + set(${PARAM_OUT_AS} ${CMAKE_ASM_COMPILER} PARENT_SCOPE) + endif() + endif() + if(has_out_ld) + hunter_status_debug(" LD=${CMAKE_LINKER}") + if(CMAKE_LINKER) + set(${PARAM_OUT_LD} ${CMAKE_LINKER} PARENT_SCOPE) + endif() + endif() + if(has_out_nm) + hunter_status_debug(" NM=${CMAKE_NM}") + if(CMAKE_NM) + set(${PARAM_OUT_NM} ${CMAKE_NM} PARENT_SCOPE) + endif() + endif() + if(has_out_objcopy) + hunter_status_debug(" OBJCOPY=${CMAKE_OBJCOPY}") + if(CMAKE_OBJCOPY) + set(${PARAM_OUT_OBJCOPY} ${CMAKE_OBJCOPY} PARENT_SCOPE) + endif() + endif() + if(has_out_objdump) + hunter_status_debug(" OBJDUMP=${CMAKE_OBJDUMP}") + if(CMAKE_OBJDUMP) + set(${PARAM_OUT_OBJDUMP} ${CMAKE_OBJDUMP} PARENT_SCOPE) + endif() + endif() + if(has_out_ranlib) + hunter_status_debug(" RANLIB=${CMAKE_RANLIB}") + if(CMAKE_RANLIB) + set(${PARAM_OUT_RANLIB} ${CMAKE_RANLIB} PARENT_SCOPE) + endif() + endif() + if(has_out_strip) + hunter_status_debug(" STRIP=${CMAKE_STRIP}") + if(CMAKE_STRIP) + set(${PARAM_OUT_STRIP} ${CMAKE_STRIP} PARENT_SCOPE) + endif() + endif() + if(has_out_cpp) + hunter_status_debug(" CPP=${CMAKE_C_PREPROCESSOR}") + if(CMAKE_C_PREPROCESSOR) + set(${PARAM_OUT_CPP} ${CMAKE_C_PREPROCESSOR} PARENT_SCOPE) + endif() + endif() + if(has_out_cc) + hunter_status_debug(" CC=${CMAKE_C_COMPILER}") + if(CMAKE_C_COMPILER) + set(${PARAM_OUT_CC} ${CMAKE_C_COMPILER} PARENT_SCOPE) + endif() + endif() + if(has_out_cxx) + hunter_status_debug(" CXX=${CMAKE_CXX_COMPILER}") + if(CMAKE_CXX_COMPILER) + set(${PARAM_OUT_CXX} ${CMAKE_CXX_COMPILER} PARENT_SCOPE) + endif() + endif() +endfunction() + diff --git a/cmake/modules/hunter_load_from_cache.cmake b/cmake/modules/hunter_load_from_cache.cmake index c35cfca39a..eae1d4b932 100644 --- a/cmake/modules/hunter_load_from_cache.cmake +++ b/cmake/modules/hunter_load_from_cache.cmake @@ -203,10 +203,7 @@ function(hunter_load_from_cache) FROMSERVER "${from_server_file}" ) - if(NOT EXISTS "${archive_file}") - hunter_internal_error("archive file not found: ${archive_file}") - endif() - hunter_unpack_directory("${archive_file}" "${HUNTER_INSTALL_PREFIX}") + hunter_unpack_directory(${cache_sha1}) hunter_patch_unrelocatable_text_files( FROM "__HUNTER_PACKAGE_INSTALL_PREFIX__" diff --git a/cmake/modules/hunter_pack_directory.cmake b/cmake/modules/hunter_pack_directory.cmake index 258ffa69ea..05f06d182e 100644 --- a/cmake/modules/hunter_pack_directory.cmake +++ b/cmake/modules/hunter_pack_directory.cmake @@ -11,7 +11,7 @@ function(hunter_pack_directory dir_to_pack dest_dir result_sha1) set(temp "${dest_dir}/cache.tar.bz2") set(cmd "${CMAKE_COMMAND}" "-E" "tar") - if(HUNTER_STATUS_DEBUG) + if(HUNTER_STATUS_DEBUG AND NOT HUNTER_SUPPRESS_LIST_OF_FILES) list(APPEND cmd "cvjf") else() list(APPEND cmd "cjf") @@ -36,27 +36,24 @@ function(hunter_pack_directory dir_to_pack dest_dir result_sha1) list(APPEND cmd "${x}") endforeach() - if(HUNTER_STATUS_DEBUG) - set(logging_params "") - elseif(HUNTER_STATUS_PRINT) - set(logging_params "") - else() - set(logging_params "OUTPUT_QUIET") - endif() - hunter_print_cmd("${dir_to_pack}" "${cmd}") execute_process( COMMAND ${cmd} WORKING_DIRECTORY "${dir_to_pack}" RESULT_VARIABLE packing_result - ${logging_params} + OUTPUT_VARIABLE packing_output + ERROR_VARIABLE packing_error + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_STRIP_TRAILING_WHITESPACE ) if(packing_result EQUAL 0) hunter_status_debug("Packing successful: ${temp}") else() - hunter_internal_error("Packing failed") + hunter_internal_error( + "Packing failed (${packing_result}, ${packing_output}, ${packing_error})" + ) endif() file(SHA1 "${temp}" archive_sha1) diff --git a/cmake/modules/hunter_pack_git_submodule.cmake b/cmake/modules/hunter_pack_git_submodule.cmake new file mode 100644 index 0000000000..602b477f57 --- /dev/null +++ b/cmake/modules/hunter_pack_git_submodule.cmake @@ -0,0 +1,264 @@ +include(CMakeParseArguments) # cmake_parse_arguments + +include(hunter_internal_error) +include(hunter_status_debug) + +set(_HUNTER_TEMPLATE_SCHEME_DIR "${CMAKE_CURRENT_LIST_DIR}/../templates") + +function(hunter_pack_git_submodule) + set(PACKAGE_NAME "${_hunter_current_project}") + string(COMPARE EQUAL "${PACKAGE_NAME}" "" is_empty) + if(is_empty) + hunter_internal_error("_hunter_current_project is empty") + endif() + + set(optional "") + set(one GIT_SUBMODULE PROJECT_FILE VERSION SUBMODULE_SOURCE_SUBDIR) + set(multiple "") + + # Introduce: + # * x_GIT_SUBMODULE + # * x_PROJECT_FILE + # * x_VERSION + # * x_SUBMODULE_SOURCE_SUBDIR + cmake_parse_arguments(x "${optional}" "${one}" "${multiple}" "${ARGV}") + + string(COMPARE NOTEQUAL "${x_UNPARSED_ARGUMENTS}" "" has_unparsed) + if(has_unparsed) + hunter_internal_error("Unparsed arguments: ${x_UNPARSED_ARGUMENTS}") + endif() + + string(COMPARE EQUAL "${x_GIT_SUBMODULE}" "" is_empty) + if(is_empty) + hunter_internal_error("GIT_SUBMODULE is empty") + endif() + + find_package(Git REQUIRED) + hunter_status_debug("Using git executable: ${GIT_EXECUTABLE}") + + # For '--git-path': + # * https://git-scm.com/docs/git-rev-parse/2.5.0 + if(GIT_VERSION_STRING VERSION_LESS "2.5.0") + hunter_user_error("At least Git 2.5.0 required") + endif() + + set(cmd "${GIT_EXECUTABLE}" rev-parse --show-toplevel) + execute_process( + COMMAND ${cmd} + WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" + RESULT_VARIABLE result + OUTPUT_VARIABLE output + ERROR_VARIABLE error + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_STRIP_TRAILING_WHITESPACE + ) + + if(NOT result EQUAL 0) + hunter_internal_error( + "Command failed: ${cmd} (${result}, ${output}, ${error})" + ) + endif() + + set(top_git_directory "${output}") + + set(cmd "${GIT_EXECUTABLE}" submodule status "${x_GIT_SUBMODULE}") + execute_process( + COMMAND ${cmd} + WORKING_DIRECTORY "${top_git_directory}" + RESULT_VARIABLE result + OUTPUT_VARIABLE output + ERROR_VARIABLE error + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_STRIP_TRAILING_WHITESPACE + ) + + if(NOT result EQUAL 0) + string(REPLACE ";" " " cmd "${cmd}") + hunter_internal_error( + "Command failed: '${cmd}' (${result}, ${output}, ${error})" + "To reproduce error go to '${top_git_directory}' and" + "run command '${cmd}'" + ) + endif() + + set(submodule_file "${top_git_directory}/.gitmodules") + if(NOT EXISTS "${submodule_file}") + hunter_internal_error("File not found: '${submodule_file}'") + endif() + set_property( + DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${submodule_file}" + ) + + set(submodule_dir "${top_git_directory}/${x_GIT_SUBMODULE}") + if(NOT EXISTS "${submodule_dir}") + hunter_internal_error("Directory not exist: '${submodule_dir}'") + endif() + + set(cmd "${GIT_EXECUTABLE}" status --porcelain) + execute_process( + COMMAND ${cmd} + WORKING_DIRECTORY "${submodule_dir}" + RESULT_VARIABLE result + OUTPUT_VARIABLE output + ERROR_VARIABLE error + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_STRIP_TRAILING_WHITESPACE + ) + + if(NOT result EQUAL 0) + hunter_internal_error( + "Command failed: ${cmd} (${result}, ${output}, ${error})" + ) + endif() + + string(COMPARE EQUAL "${output}" "" is_empty) + if(NOT is_empty) + hunter_user_error( + "Git directory '${submodule_dir}' is dirty." + "Please commit or stash changes." + ) + endif() + + set(cmd "${GIT_EXECUTABLE}" rev-parse --git-path HEAD) + execute_process( + COMMAND ${cmd} + WORKING_DIRECTORY "${submodule_dir}" + RESULT_VARIABLE result + OUTPUT_VARIABLE output + ERROR_VARIABLE error + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_STRIP_TRAILING_WHITESPACE + ) + + if(NOT result EQUAL 0) + hunter_internal_error( + "Command failed: ${cmd} (${result}, ${output}, ${error})" + ) + endif() + + set(head_file "${output}") + if(NOT EXISTS "${head_file}") + hunter_internal_error("File not found: '${head_file}'") + endif() + set_property( + DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${head_file}" + ) + + set(cmd "${GIT_EXECUTABLE}" rev-parse --symbolic-full-name HEAD) + execute_process( + COMMAND ${cmd} + WORKING_DIRECTORY "${submodule_dir}" + RESULT_VARIABLE result + OUTPUT_VARIABLE output + ERROR_VARIABLE error + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_STRIP_TRAILING_WHITESPACE + ) + + if(NOT result EQUAL 0) + hunter_internal_error( + "Command failed: ${cmd} (${result}, ${output}, ${error})" + ) + endif() + + set(head_ref "${output}") + set(cmd "${GIT_EXECUTABLE}" rev-parse --git-path "${head_ref}") + execute_process( + COMMAND ${cmd} + WORKING_DIRECTORY "${submodule_dir}" + RESULT_VARIABLE result + OUTPUT_VARIABLE output + ERROR_VARIABLE error + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_STRIP_TRAILING_WHITESPACE + ) + + if(NOT result EQUAL 0) + hunter_internal_error( + "Command failed: ${cmd} (${result}, ${output}, ${error})" + ) + endif() + + set(ref_file "${output}") + if(NOT EXISTS "${ref_file}") + hunter_internal_error("File not fond: ${ref_file}") + endif() + + set_property( + DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${ref_file}" + ) + + set(archives_directory "${CMAKE_CURRENT_BINARY_DIR}/_3rdParty/Hunter/git-archives") + file(MAKE_DIRECTORY "${archives_directory}") + + set(archive "${archives_directory}/${PACKAGE_NAME}.tar") + hunter_status_debug("Creating archive '${archive}'") + + # check if whole submodule or just a subfolder is to be archived + string(COMPARE EQUAL "${x_SUBMODULE_SOURCE_SUBDIR}" "" is_empty) + if(is_empty) + hunter_status_debug("No SUBMODULE_SOURCE_SUBDIR specified, archive whole submodule") + set(source_flag) + else() + hunter_status_debug("SUBMODULE_SOURCE_SUBDIR specified, only archive subfolder: ${x_SUBMODULE_SOURCE_SUBDIR}") + set(source_flag "/${x_SUBMODULE_SOURCE_SUBDIR}") + endif() + + set(cmd "${GIT_EXECUTABLE}" archive HEAD -o "${archive}") + execute_process( + COMMAND ${cmd} + WORKING_DIRECTORY "${submodule_dir}${source_flag}" + RESULT_VARIABLE result + OUTPUT_VARIABLE output + ERROR_VARIABLE error + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_STRIP_TRAILING_WHITESPACE + ) + + if(NOT result EQUAL 0) + hunter_internal_error( + "Command failed: ${cmd} (${result}, ${output}, ${error})" + ) + endif() + + set(version_file "${archives_directory}/${PACKAGE_NAME}-version.cmake") + set(download_file "${archives_directory}/${PACKAGE_NAME}-download.cmake") + + file(SHA1 "${archive}" PACKAGE_SHA1) + set(PACKAGE_URL "file://${archive}") + + # Use: + # * PACKAGE_NAME + configure_file( + "${_HUNTER_TEMPLATE_SCHEME_DIR}/package-download.cmake.in" + "${download_file}" + @ONLY + ) + + # Use: + # * PACKAGE_NAME + # * PACKAGE_SHA1 + # * PACKAGE_URL + configure_file( + "${_HUNTER_TEMPLATE_SCHEME_DIR}/package-version.cmake.in" + "${version_file}" + @ONLY + ) + + set_property( + GLOBAL + PROPERTY + "HUNTER_${PACKAGE_NAME}_GIT_SUBMODULE_DIR" + "${archives_directory}" + ) + + set_property( + GLOBAL + APPEND + PROPERTY + HUNTER_SUBMODULE_PROJECTS + "${PACKAGE_NAME}" + ) + + set("${x_VERSION}" "${PACKAGE_SHA1}" PARENT_SCOPE) +endfunction() diff --git a/cmake/modules/hunter_parse_cmake_args_for_keyword.cmake b/cmake/modules/hunter_parse_cmake_args_for_keyword.cmake new file mode 100644 index 0000000000..f5f800d159 --- /dev/null +++ b/cmake/modules/hunter_parse_cmake_args_for_keyword.cmake @@ -0,0 +1,63 @@ +# Copyright (c) 2017, NeroBurner +# All rights reserved. + +include(CMakeParseArguments) # cmake_parse_arguments + +include(hunter_internal_error) +include(hunter_status_debug) + +function(hunter_parse_cmake_args_for_keyword) + set(optional "") + set(one KEYWORD OUTPUT) + set(multiple CMAKE_ARGS) + + # Introduce: + # * x_CMAKE_ARGS + # * x_KEYWORD + # * x_OUTPUT + cmake_parse_arguments(x "${optional}" "${one}" "${multiple}" "${ARGV}") + + string(COMPARE NOTEQUAL "${x_UNPARSED_ARGUMENTS}" "" has_unparsed) + if(has_unparsed) + hunter_internal_error("Unparsed arguments: ${x_UNPARSED_ARGUMENTS}") + endif() + + string(COMPARE EQUAL "${x_KEYWORD}" "" is_empty) + if(is_empty) + hunter_internal_error("KEYWORD is empty") + endif() + string(COMPARE EQUAL "${x_OUTPUT}" "" is_empty) + if(is_empty) + hunter_internal_error("OUTPUT is empty") + endif() + + # get KEYWORD from CMAKE_ARGS + set(output) + foreach(entry ${x_CMAKE_ARGS}) + string(FIND "${entry}" "=" update_var) + if(update_var EQUAL -1) + # nothing to to + else() + # Format = + # Note that we can have more than one '=' sign, e.g. A=-opt=value1 + string(REGEX REPLACE "=.*" "" var_name "${entry}") + + # 'string(REGEX REPLACE' will replace as much patterns as it found so + # it's not possible to replace only one '=' as we need. + string(LENGTH "${var_name}" var_name_len) + math(EXPR value_begin "${var_name_len} + 1") + string(SUBSTRING "${entry}" "${value_begin}" -1 var_value) + + # Check for submodule-source-dir keyword + string(COMPARE EQUAL "${var_name}" "${x_KEYWORD}" is_keyword) + if(is_keyword) + hunter_status_debug("Found ${var_name} = '${var_value}'") + set(output "${var_value}") + endif() + endif() + endforeach() + + # set OUTPUT variable + set("${x_OUTPUT}" "${output}" PARENT_SCOPE) +endfunction() + diff --git a/cmake/modules/hunter_patch_unrelocatable_text_files.cmake b/cmake/modules/hunter_patch_unrelocatable_text_files.cmake index 84e853487b..20f50dbde8 100644 --- a/cmake/modules/hunter_patch_unrelocatable_text_files.cmake +++ b/cmake/modules/hunter_patch_unrelocatable_text_files.cmake @@ -42,6 +42,11 @@ function(hunter_patch_unrelocatable_text_files) string(REPLACE "${x_FROM}" "${x_TO}" line "${line}") set(output_content "${output_content}\n${line}") endforeach() + + # if file is a link we should remove it first, otherwise we will + # update original file too + file(REMOVE "${text_full_path}") + file(WRITE "${text_full_path}" "${output_content}\n") endforeach() endfunction() diff --git a/cmake/modules/hunter_pick_archiver.cmake b/cmake/modules/hunter_pick_archiver.cmake new file mode 100644 index 0000000000..68dc6c2b45 --- /dev/null +++ b/cmake/modules/hunter_pick_archiver.cmake @@ -0,0 +1,36 @@ +# Copyright (c) 2017 Ruslan Baratov +# All rights reserved. + +# Set CMAKE_AR/CMAKE_RANLIB variables +function(hunter_pick_archiver) + if(NOT CMAKE_INTERPROCEDURAL_OPTIMIZATION) + return() + endif() + + string(COMPARE EQUAL "${CMAKE_CXX_COMPILER_ID}" "AppleClang" is_apple_clang) + string(COMPARE EQUAL "${CMAKE_CXX_COMPILER_ID}" "Clang" is_clang) + string(COMPARE EQUAL "${CMAKE_CXX_COMPILER_ID}" "GNU" is_gcc) + + if(is_gcc) + set(CMAKE_AR "${CMAKE_CXX_COMPILER_AR}" PARENT_SCOPE) + set(CMAKE_RANLIB "${CMAKE_CXX_COMPILER_RANLIB}" PARENT_SCOPE) + return() + endif() + + if(is_apple_clang) + # https://gitlab.kitware.com/cmake/cmake/blob/0e967e3b1dd8a705e304b4d94f1556249622d747/Modules/Compiler/Clang.cmake#L63-69 + return() + endif() + + if(NOT is_clang) + return() + endif() + + if(ANDROID) + # https://gitlab.kitware.com/cmake/cmake/blob/0e967e3b1dd8a705e304b4d94f1556249622d747/Modules/Compiler/Clang.cmake#L63-69 + return() + endif() + + set(CMAKE_AR "${CMAKE_CXX_COMPILER_AR}" PARENT_SCOPE) + set(CMAKE_RANLIB "${CMAKE_CXX_COMPILER_RANLIB}" PARENT_SCOPE) +endfunction() diff --git a/cmake/modules/hunter_pick_scheme.cmake b/cmake/modules/hunter_pick_scheme.cmake index 84ad65eeec..c0a0a03d1a 100644 --- a/cmake/modules/hunter_pick_scheme.cmake +++ b/cmake/modules/hunter_pick_scheme.cmake @@ -66,11 +66,19 @@ function(hunter_pick_scheme) is_unpack_install ) + string( + COMPARE + EQUAL + "${HUNTER_DOWNLOAD_SCHEME}" + "url_sha1_unpack_bin_install" + is_unpack_bin_install + ) + if(is_unpack) set(HUNTER_PACKAGE_SCHEME_UNPACK "1") elseif(is_download) set(HUNTER_PACKAGE_SCHEME_DOWNLOAD "1") - elseif(is_unpack_install) + elseif(is_unpack_install OR is_unpack_bin_install) set(HUNTER_PACKAGE_SCHEME_UNPACK_INSTALL "1") else() set(HUNTER_PACKAGE_SCHEME_INSTALL "1") diff --git a/cmake/modules/hunter_pkgconfig_export_target.cmake b/cmake/modules/hunter_pkgconfig_export_target.cmake new file mode 100644 index 0000000000..21200476c4 --- /dev/null +++ b/cmake/modules/hunter_pkgconfig_export_target.cmake @@ -0,0 +1,129 @@ +# ---------------------------------------------------------------------- +# Auto creation of CMake targets from pkg-config +# +# Copyright (C) 2017 Alexandre Pretyman. All rights reserved. +# +# Looks for a pkgconfig module of a given name and exports a cmake +# target under the namespace PkgConfig::. +# ---------------------------------------------------------------------- + +include(FindPkgConfig) + +include(hunter_internal_error) +include(hunter_status_debug) + +function(hunter_pkgconfig_export_target PKG_CONFIG_MODULE) + set(target_name "PkgConfig::${PKG_CONFIG_MODULE}") + if(TARGET "${target_name}") + return() + endif() + pkg_check_modules(${PKG_CONFIG_MODULE} ${PKG_CONFIG_MODULE}) + if(NOT ${PKG_CONFIG_MODULE}_FOUND) + hunter_internal_error( + "Could not find pkg-config module: ${PKG_CONFIG_MODULE}" + ) + endif() + add_library("${target_name}" INTERFACE IMPORTED GLOBAL) + + # --- INTERFACE_INCLUDE_DIRECTORIES begin --- + hunter_status_debug( + "PKG_CONFIG_MODULE ${PKG_CONFIG_MODULE} INCLUDE_DIRS: ${${PKG_CONFIG_MODULE}_INCLUDE_DIRS}" + ) + string(COMPARE NOTEQUAL + "${${PKG_CONFIG_MODULE}_INCLUDE_DIRS}" + "" + has_include_dirs + ) + if(has_include_dirs) + set_target_properties("${target_name}" + PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES + "${${PKG_CONFIG_MODULE}_INCLUDE_DIRS}" + ) + endif() + # --- INTERFACE_INCLUDE_DIRECTORIES end --- + + # --- INTERFACE_LINK_LIBRARIES begin --- + set(link_libs) + + hunter_status_debug( + "PKG_CONFIG_MODULE ${PKG_CONFIG_MODULE} LDFLAGS: ${${PKG_CONFIG_MODULE}_LDFLAGS}" + ) + string(COMPARE NOTEQUAL + "${${PKG_CONFIG_MODULE}_LDFLAGS}" + "" + has_ldflags + ) + if(has_ldflags) + list(APPEND link_libs ${${PKG_CONFIG_MODULE}_LDFLAGS}) + endif() + + hunter_status_debug( + "PKG_CONFIG_MODULE ${PKG_CONFIG_MODULE} LDFLAGS_OTHER: ${${PKG_CONFIG_MODULE}_LDFLAGS_OTHER}" + ) + string(COMPARE NOTEQUAL + "${${PKG_CONFIG_MODULE}_LDFLAGS_OTHER}" + "" + has_ldflags_other + ) + if(has_ldflags_other) + list(APPEND link_libs ${${PKG_CONFIG_MODULE}_LDFLAGS_OTHER}) + endif() + + # No need to treat the pkg-config module's _LIBRARY_DIRS and _LIBRARIES + # as they are already included in LD_FLAGS + string(COMPARE NOTEQUAL + "${link_libs}" + "" + has_link_libs + ) + if(has_link_libs) + set_target_properties("${target_name}" + PROPERTIES + INTERFACE_LINK_LIBRARIES + "${link_libs}" + ) + endif() + # --- INTERFACE_LINK_LIBRARIES begin --- + + # --- INTERFACE_COMPILE_OPTIONS begin --- + set(compile_opts) + + hunter_status_debug( + "PKG_CONFIG_MODULE ${PKG_CONFIG_MODULE} CFLAGS: ${${PKG_CONFIG_MODULE}_CFLAGS}" + ) + string(COMPARE NOTEQUAL + "${${PKG_CONFIG_MODULE}_CFLAGS}" + "" + has_cflags) + if(has_cflags) + list(APPEND compile_opts ${${PKG_CONFIG_MODULE}_CFLAGS}) + endif() + + hunter_status_debug( + "PKG_CONFIG_MODULE ${PKG_CONFIG_MODULE} CFLAGS_OTHER: ${${PKG_CONFIG_MODULE}_CFLAGS_OTHER}" + ) + string(COMPARE NOTEQUAL + "${${PKG_CONFIG_MODULE}_CFLAGS_OTHER}" + "" + has_cflags_other + ) + if(has_cflags_other) + list(APPEND compile_opts ${${PKG_CONFIG_MODULE}_CFLAGS_OTHER}) + endif() + + string(COMPARE NOTEQUAL + "${compile_opts}" + "" + has_compile_opts + ) + if(has_compile_opts) + set_target_properties("${target_name}" + PROPERTIES + INTERFACE_COMPILE_OPTIONS + "${compile_opts}" + ) + endif() + # --- INTERFACE_COMPILE_OPTIONS end --- +endfunction() + diff --git a/cmake/modules/hunter_register_dependency.cmake b/cmake/modules/hunter_register_dependency.cmake index d28584e7aa..978c3a0c2c 100644 --- a/cmake/modules/hunter_register_dependency.cmake +++ b/cmake/modules/hunter_register_dependency.cmake @@ -51,10 +51,10 @@ function(hunter_register_dependency) endif() hunter_test_string_not_empty("${hunter_PACKAGE_NAME}") - hunter_test_string_not_empty("${HUNTER_TOOLCHAIN_ID_PATH}") + hunter_test_string_not_empty("${HUNTER_CONFIG_ID_PATH}") set( dependencies_dir - "${HUNTER_TOOLCHAIN_ID_PATH}/Build/${hunter_PACKAGE_NAME}" + "${HUNTER_CONFIG_ID_PATH}/Build/${hunter_PACKAGE_NAME}" ) if(has_package_component) set( diff --git a/cmake/modules/hunter_save_to_cache.cmake b/cmake/modules/hunter_save_to_cache.cmake index 556418d765..fb6572bb87 100644 --- a/cmake/modules/hunter_save_to_cache.cmake +++ b/cmake/modules/hunter_save_to_cache.cmake @@ -98,13 +98,9 @@ function(hunter_save_to_cache) ) hunter_test_string_not_empty("${archive_sha1}") - set(archive_file "${cache_directory}/raw/${archive_sha1}.tar.bz2") - if(NOT EXISTS "${archive_file}") - hunter_internal_error("Archive not exists: ${archive_file}") - endif() ### Install to global directory from cache archive - hunter_unpack_directory("${archive_file}" "${HUNTER_INSTALL_PREFIX}") + hunter_unpack_directory(${archive_sha1}) hunter_patch_unrelocatable_text_files( FROM "__HUNTER_PACKAGE_INSTALL_PREFIX__" diff --git a/cmake/modules/hunter_setup_msvc.cmake b/cmake/modules/hunter_setup_msvc.cmake index 7987663b9a..cb11dac1a1 100644 --- a/cmake/modules/hunter_setup_msvc.cmake +++ b/cmake/modules/hunter_setup_msvc.cmake @@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.0) +include(hunter_fatal_error) include(hunter_internal_error) include(hunter_status_debug) @@ -41,7 +42,7 @@ macro(hunter_setup_msvc) string(COMPARE EQUAL "${MSVC_VERSION}" "1700" _vs_11_2012) string(COMPARE EQUAL "${MSVC_VERSION}" "1800" _vs_12_2013) string(COMPARE EQUAL "${MSVC_VERSION}" "1900" _vs_14_2015) - string(COMPARE EQUAL "${MSVC_VERSION}" "1910" _vs_15_2017) + string(REGEX MATCH "^191[01]$" _vs_15_2017 "${MSVC_VERSION}") if(_vs_8_2005) set(HUNTER_MSVC_VERSION "8") @@ -104,18 +105,48 @@ macro(hunter_setup_msvc) set(_hunter_vcvarsall_env "VS${_hunter_vcvarsall_env}COMNTOOLS") set(_hunter_vcvarsall_path "$ENV{${_hunter_vcvarsall_env}}") + hunter_status_debug( + "Environment '${_hunter_vcvarsall_env}': '${_hunter_vcvarsall_path}'" + ) + hunter_status_debug( + "CMAKE_VS_DEVENV_COMMAND: '${CMAKE_VS_DEVENV_COMMAND}'" + ) + string(COMPARE EQUAL "${_hunter_vcvarsall_path}" "" _is_empty) if(_is_empty) if(HUNTER_TESTING) # ignore error, see 'tests/hunter_setup_msvc/CMakeLists.txt' else() - hunter_internal_error( - "Environment variable ${_hunter_vcvarsall_env} is empty" + hunter_status_debug( + "Environment variable '${_hunter_vcvarsall_env}' is empty, analyzing CMAKE_VS_DEVENV_COMMAND" ) + string(COMPARE EQUAL "${CMAKE_VS_DEVENV_COMMAND}" "" is_empty) + if(is_empty) + hunter_fatal_error( + "Incorrect CMAKE_VS_DEVENV_COMMAND: is empty" + WIKI + error.vs.devenv + ) + endif() + if(NOT IS_ABSOLUTE "${CMAKE_VS_DEVENV_COMMAND}") + hunter_fatal_error( + "Incorrect CMAKE_VS_DEVENV_COMMAND: not absolute (${CMAKE_VS_DEVENV_COMMAND})" + WIKI + error.vs.devenv + ) + endif() + get_filename_component(_hunter_vcvarsall_path "${CMAKE_VS_DEVENV_COMMAND}" DIRECTORY) + set(_hunter_vcvarsall_path "${_hunter_vcvarsall_path}/../../VC/Auxiliary/Build") + endif() + else() + set(_hunter_vcvarsall_path "${_hunter_vcvarsall_path}/../../VC") + if(NOT HUNTER_MSVC_VERSION VERSION_LESS "15") + # Visual Studio 15 2017+ + # * https://github.com/ruslo/hunter/issues/836#issue-236352343 + set(_hunter_vcvarsall_path "${_hunter_vcvarsall_path}/Auxiliary/Build") endif() endif() - set(_hunter_vcvarsall_path "${_hunter_vcvarsall_path}/../../VC") get_filename_component( _hunter_vcvarsall_path "${_hunter_vcvarsall_path}" ABSOLUTE ) diff --git a/cmake/modules/hunter_unpack_directory.cmake b/cmake/modules/hunter_unpack_directory.cmake index c49af2fd87..8e8adf2de2 100644 --- a/cmake/modules/hunter_unpack_directory.cmake +++ b/cmake/modules/hunter_unpack_directory.cmake @@ -1,45 +1,155 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. include(hunter_internal_error) include(hunter_print_cmd) include(hunter_status_debug) +include(hunter_test_string_not_empty) -function(hunter_unpack_directory archive dest_dir) - file(MAKE_DIRECTORY "${dest_dir}") +function(hunter_unpack_directory cache_sha1) + hunter_test_string_not_empty("${HUNTER_SELF}") + hunter_test_string_not_empty("${HUNTER_CACHED_ROOT}") + hunter_test_string_not_empty("${HUNTER_INSTALL_PREFIX}") + hunter_test_string_not_empty("${cache_sha1}") - set(cmd "${CMAKE_COMMAND}" "-E" "tar") - if(HUNTER_STATUS_DEBUG) - list(APPEND cmd "xvf") - else() - list(APPEND cmd "xf") + set(cache_directory "${HUNTER_CACHED_ROOT}/_Base/Cache") + set(cellar_directory "${HUNTER_CACHED_ROOT}/_Base/Cellar") + + hunter_make_directory( + "${cellar_directory}/${cache_sha1}" + "${cache_sha1}" + cellar_directory + ) + + set(unpack_stamp "${cellar_directory}/unpack.DONE") + set(cellar_raw_directory "${cellar_directory}/raw") + file(MAKE_DIRECTORY "${cellar_raw_directory}") + + set(list_of_directories "${cellar_directory}/directories.list") + set(list_of_files "${cellar_directory}/files.list") + set(shell_link_script "${cellar_directory}/link-all.sh") + + set(archive_file "${cache_directory}/raw/${cache_sha1}.tar.bz2") + if(NOT EXISTS "${archive_file}") + hunter_internal_error("archive file not found: ${archive_file}") endif() - list(APPEND cmd "${archive}") - if(HUNTER_STATUS_DEBUG) - set(logging_params "") - elseif(HUNTER_STATUS_PRINT) - set(logging_params "") - else() - set(logging_params "OUTPUT_QUIET") + if(NOT EXISTS "${unpack_stamp}") + hunter_lock_directory("${cellar_directory}" "") + endif() + + # While waiting for lock other instance can do all the job + if(NOT EXISTS "${unpack_stamp}") + set(cmd "${CMAKE_COMMAND}" "-E" "tar") + if(HUNTER_STATUS_DEBUG AND NOT HUNTER_SUPPRESS_LIST_OF_FILES) + list(APPEND cmd "xvf") + else() + list(APPEND cmd "xf") + endif() + list(APPEND cmd "${archive_file}") + + if(HUNTER_STATUS_DEBUG) + set(logging_params "") + elseif(HUNTER_STATUS_PRINT) + set(logging_params "") + else() + set(logging_params "OUTPUT_QUIET") + endif() + + hunter_status_debug("Unpacking to cellar:") + hunter_status_debug(" ${archive_file}") + hunter_status_debug(" -> ${cellar_raw_directory}") + + hunter_print_cmd("${cellar_raw_directory}" "${cmd}") + + execute_process( + COMMAND ${cmd} + WORKING_DIRECTORY "${cellar_raw_directory}" + RESULT_VARIABLE unpacking_result + ${logging_params} + ) + + if(unpacking_result EQUAL 0) + hunter_status_debug("Unpacked successfully") + else() + hunter_internal_error("Unpack failed") + endif() + + hunter_status_debug("Creating list of files and directories") + # Note: LIST_DIRECTORIES available only since CMake 3.3 + file( + GLOB_RECURSE + files + RELATIVE "${cellar_raw_directory}" + "${cellar_raw_directory}/*" + ) + + set(directories "") + foreach(x ${files}) + get_filename_component(file_dir "${x}" DIRECTORY) + list(APPEND directories "${file_dir}") + endforeach() + list(REMOVE_DUPLICATES directories) + + # Create link script { + file( + WRITE + "${shell_link_script}" + "export \"HUNTER_CELLAR_RAW_DIRECTORY=${cellar_raw_directory}\"\n\n" + ) + foreach(x ${files}) + file( + APPEND + "${shell_link_script}" + "ln \\\n \"\${HUNTER_CELLAR_RAW_DIRECTORY}/${x}\" \\\n \"\$1/${x}\"\n\n" + ) + endforeach() + # } + + string(REPLACE ";" "\n" files "${files}") + string(REPLACE ";" "\n" directories "${directories}") + + file(WRITE "${list_of_files}" "${files}\n") + file(WRITE "${list_of_directories}" "${directories}\n") + + file(WRITE "${unpack_stamp}" "") endif() - hunter_status_debug("Unpacking:") - hunter_status_debug(" ${archive}") - hunter_status_debug(" -> ${dest_dir}") + hunter_status_debug("Creating directories") + file(STRINGS "${list_of_directories}" directories) + foreach(x ${directories}) + file(MAKE_DIRECTORY "${HUNTER_INSTALL_PREFIX}/${x}") + endforeach() - hunter_print_cmd("${dest_dir}" "${cmd}") + hunter_status_debug("Removing old files") + file(STRINGS "${list_of_files}" files) + foreach(x ${files}) + file(REMOVE "${HUNTER_INSTALL_PREFIX}/${x}") + endforeach() + hunter_status_debug("Linking files") + set( + cmd + "${CMAKE_COMMAND}" + "-DHUNTER_INSTALL_PREFIX=${HUNTER_INSTALL_PREFIX}" + "-DLIST_OF_FILES=${list_of_files}" + "-DSHELL_LINK_SCRIPT=${shell_link_script}" + "-DCELLAR_RAW_DIRECTORY=${cellar_raw_directory}" + "-DPYTHON_LINK_SCRIPT=${HUNTER_SELF}/scripts/link-all.py" + "-P" + "${HUNTER_SELF}/scripts/link-all.cmake" + ) + hunter_print_cmd("${cellar_directory}" "${cmd}") execute_process( COMMAND ${cmd} - WORKING_DIRECTORY "${dest_dir}" - RESULT_VARIABLE unpacking_result - ${logging_params} + WORKING_DIRECTORY "${cellar_directory}" + RESULT_VARIABLE result + OUTPUT_VARIABLE output + ERROR_VARIABLE error ) - - if(unpacking_result EQUAL 0) - hunter_status_debug("Unpacked successfully") + if(result EQUAL 0) + hunter_status_debug("Linking done: ${output}, ${error}") else() - hunter_internal_error("Unpack failed") + hunter_internal_error("Link script failed: ${result}, ${output}, ${error}") endif() endfunction() diff --git a/cmake/projects/ARM_NEON_2_x86_SSE/hunter.cmake b/cmake/projects/ARM_NEON_2_x86_SSE/hunter.cmake new file mode 100644 index 0000000000..caad82dc0c --- /dev/null +++ b/cmake/projects/ARM_NEON_2_x86_SSE/hunter.cmake @@ -0,0 +1,36 @@ +# Copyright (c) 2016-2017, Ruslan Baratov +# Copyright (c) 2017, David Hirvonen +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME + ARM_NEON_2_x86_SSE + VERSION + 1.0.0 + URL + "https://github.com/hunter-packages/ARM_NEON_2_x86_SSE/archive/v1.0.0.tar.gz" + SHA1 + 8067ea1b7aa9ec991db5989d7eda6ed7293d0fda +) + +hunter_add_version( + PACKAGE_NAME + ARM_NEON_2_x86_SSE + VERSION + 1.0.0-p0 + URL + "https://github.com/hunter-packages/ARM_NEON_2_x86_SSE/archive/v1.0.0-p0.tar.gz" + SHA1 + bf97b9ae78060b4dc9aa2afd3a2a1d577b405b2c +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(ARM_NEON_2_x86_SSE) +hunter_download(PACKAGE_NAME ARM_NEON_2_x86_SSE) diff --git a/cmake/projects/Android-ARM-EABI-v7a-System-Image/hunter.cmake b/cmake/projects/Android-ARM-EABI-v7a-System-Image/hunter.cmake new file mode 100755 index 0000000000..a5a1b38523 --- /dev/null +++ b/cmake/projects/Android-ARM-EABI-v7a-System-Image/hunter.cmake @@ -0,0 +1,35 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_download) +include(hunter_pick_scheme) + +# https://dl.google.com/android/repository/sys-img/android/sys-img.xml + +hunter_add_version( + PACKAGE_NAME + Android-ARM-EABI-v7a-System-Image + VERSION + "19_r05" + URL + "https://dl.google.com/android/repository/sys-img/android/armeabi-v7a-19_r05.zip" + SHA1 + d1a5fd4f2e1c013c3d3d9bfe7e9db908c3ed56fa +) + +hunter_add_version( + PACKAGE_NAME + Android-ARM-EABI-v7a-System-Image + VERSION + "21_r04" + URL + "https://dl.google.com/android/repository/sys-img/android/armeabi-v7a-21_r04.zip" + SHA1 + 8c606f81306564b65e41303d2603e4c42ded0d10 +) + +hunter_pick_scheme(DEFAULT url_sha1_unpack) +hunter_download(PACKAGE_NAME Android-ARM-EABI-v7a-System-Image) diff --git a/cmake/projects/Android-Google-Repository/hunter.cmake b/cmake/projects/Android-Google-Repository/hunter.cmake index 880fc412f8..382fafb096 100755 --- a/cmake/projects/Android-Google-Repository/hunter.cmake +++ b/cmake/projects/Android-Google-Repository/hunter.cmake @@ -9,6 +9,17 @@ include(hunter_pick_scheme) # https://dl.google.com/android/repository/addon.xml +hunter_add_version( + PACKAGE_NAME + Android-Google-Repository + VERSION + "47" + URL + "https://dl.google.com/android/repository/android_m2repository_r47.zip" + SHA1 + a0d22beacc106a6977321f2b07d692ce4979e96a +) + hunter_add_version( PACKAGE_NAME Android-Google-Repository diff --git a/cmake/projects/Android-SDK-Platform-tools/hunter.cmake b/cmake/projects/Android-SDK-Platform-tools/hunter.cmake index fa909f552c..eb646e41d9 100755 --- a/cmake/projects/Android-SDK-Platform-tools/hunter.cmake +++ b/cmake/projects/Android-SDK-Platform-tools/hunter.cmake @@ -7,7 +7,21 @@ include(hunter_add_version) include(hunter_download) include(hunter_pick_scheme) +# https://dl.google.com/android/repository/repository-10.xml +# https://dl.google.com/android/repository/repository-11.xml + if(CMAKE_HOST_APPLE) + hunter_add_version( + PACKAGE_NAME + Android-SDK-Platform-tools + VERSION + "r25.0.5" + URL + "http://dl-ssl.google.com/android/repository/platform-tools_r25.0.5-darwin.zip" + SHA1 + 9bbf65f80b05303a3576682d3350b087c4802283 + ) + hunter_add_version( PACKAGE_NAME Android-SDK-Platform-tools @@ -63,6 +77,17 @@ if(CMAKE_HOST_APPLE) 6675f9f583841972c5c5ef8d2c131e1209529fde ) elseif(CMAKE_HOST_UNIX) + hunter_add_version( + PACKAGE_NAME + Android-SDK-Platform-tools + VERSION + "r25.0.5" + URL + "http://dl-ssl.google.com/android/repository/platform-tools_r25.0.5-linux.zip" + SHA1 + 4c026e2445e8b898cb0fd5dedf710a666a78aaa7 + ) + hunter_add_version( PACKAGE_NAME Android-SDK-Platform-tools @@ -118,6 +143,17 @@ elseif(CMAKE_HOST_UNIX) 2502ade68af9f6288c4dd7726796599e8d9a4337 ) elseif(CMAKE_HOST_WIN32) + hunter_add_version( + PACKAGE_NAME + Android-SDK-Platform-tools + VERSION + "r25.0.5" + URL + "http://dl-ssl.google.com/android/repository/platform-tools_r25.0.5-windows.zip" + SHA1 + a59b3747414e3002e826f84470dc1a7ceeb1c6d4 + ) + hunter_add_version( PACKAGE_NAME Android-SDK-Platform-tools diff --git a/cmake/projects/Android-SDK-Tools/hunter.cmake b/cmake/projects/Android-SDK-Tools/hunter.cmake index 419d2ed522..213751b399 100755 --- a/cmake/projects/Android-SDK-Tools/hunter.cmake +++ b/cmake/projects/Android-SDK-Tools/hunter.cmake @@ -8,8 +8,20 @@ include(hunter_download) include(hunter_pick_scheme) # http://dl-ssl.google.com/android/repository/repository-10.xml +# http://dl-ssl.google.com/android/repository/repository-11.xml if(CMAKE_HOST_APPLE) + hunter_add_version( + PACKAGE_NAME + Android-SDK-Tools + VERSION + "25.2.5" + URL + "http://dl-ssl.google.com/android/repository/tools_r25.2.5-macosx.zip" + SHA1 + d2168d963ac5b616e3d3ddaf21511d084baf3659 + ) + hunter_add_version( PACKAGE_NAME Android-SDK-Tools @@ -65,6 +77,17 @@ if(CMAKE_HOST_APPLE) a567215d89b3ff80766e54f8f969b3487bce8d71 ) elseif(CMAKE_HOST_UNIX) + hunter_add_version( + PACKAGE_NAME + Android-SDK-Tools + VERSION + "25.2.5" + URL + "http://dl-ssl.google.com/android/repository/tools_r25.2.5-linux.zip" + SHA1 + 72df3aa1988c0a9003ccdfd7a13a7b8bd0f47fc1 + ) + hunter_add_version( PACKAGE_NAME Android-SDK-Tools @@ -120,6 +143,17 @@ elseif(CMAKE_HOST_UNIX) 398c38494d50d98dd9f3ae02899ba32be32c912d ) elseif(CMAKE_HOST_WIN32) + hunter_add_version( + PACKAGE_NAME + Android-SDK-Tools + VERSION + "25.2.5" + URL + "http://dl-ssl.google.com/android/repository/tools_r25.2.5-windows.zip" + SHA1 + a7f7ebeae1c8d8f62d3a8466e9c81baee7cc31ca + ) + hunter_add_version( PACKAGE_NAME Android-SDK-Tools diff --git a/cmake/projects/Android-SDK/hunter.cmake b/cmake/projects/Android-SDK/hunter.cmake index c663319697..a21a8fbf5c 100644 --- a/cmake/projects/Android-SDK/hunter.cmake +++ b/cmake/projects/Android-SDK/hunter.cmake @@ -9,6 +9,17 @@ include(hunter_configuration_types) include(hunter_download) include(hunter_pick_scheme) +hunter_add_version( + PACKAGE_NAME + Android-SDK + VERSION + "0.0.5" + URL + "https://github.com/hunter-packages/android-sdk/archive/v0.0.5.tar.gz" + SHA1 + fa27bf38136638b94942ef2219969191a9243356 +) + hunter_add_version( PACKAGE_NAME Android-SDK diff --git a/cmake/projects/Android-Support-Repository/hunter.cmake b/cmake/projects/Android-Support-Repository/hunter.cmake index c04d3a4bbc..d5e6513343 100755 --- a/cmake/projects/Android-Support-Repository/hunter.cmake +++ b/cmake/projects/Android-Support-Repository/hunter.cmake @@ -9,6 +9,17 @@ include(hunter_pick_scheme) # https://dl.google.com/android/repository/addon.xml +hunter_add_version( + PACKAGE_NAME + Android-Support-Repository + VERSION + "47" + URL + "http://dl-ssl.google.com/android/repository/android_m2repository_r47.zip" + SHA1 + a0d22beacc106a6977321f2b07d692ce4979e96a +) + hunter_add_version( PACKAGE_NAME Android-Support-Repository diff --git a/cmake/projects/BZip2/hunter.cmake b/cmake/projects/BZip2/hunter.cmake index 1b526d792e..38227cf451 100644 --- a/cmake/projects/BZip2/hunter.cmake +++ b/cmake/projects/BZip2/hunter.cmake @@ -9,11 +9,6 @@ include(hunter_download) include(hunter_pick_scheme) include(hunter_report_broken_package) -string(COMPARE EQUAL "${CMAKE_OSX_SYSROOT}" "iphoneos" _hunter_ios) -if(_hunter_ios) - hunter_report_broken_package("BZip2 is broken on iOS") -endif() - hunter_add_version( PACKAGE_NAME BZip2 @@ -25,6 +20,28 @@ hunter_add_version( 5eae50a9a0ded0ee0ea5201001b2f4f726dbf8ed ) +hunter_add_version( + PACKAGE_NAME + BZip2 + VERSION + "1.0.6-p2" + URL + "https://github.com/hunter-packages/bzip2/archive/v1.0.6-p2.tar.gz" + SHA1 + 76d5bdd269160a87948fec676c75c2bcc6888585 +) + +hunter_add_version( + PACKAGE_NAME + BZip2 + VERSION + "1.0.6-p3" + URL + "https://github.com/hunter-packages/bzip2/archive/v1.0.6-p3.tar.gz" + SHA1 + f0ebd4c19c2ff663c2f75406c1a476211bf3d3c1 +) + hunter_pick_scheme(DEFAULT url_sha1_cmake) hunter_cacheable(BZip2) hunter_download(PACKAGE_NAME BZip2) diff --git a/cmake/projects/Beast/hunter.cmake b/cmake/projects/Beast/hunter.cmake new file mode 100644 index 0000000000..f04bf8f699 --- /dev/null +++ b/cmake/projects/Beast/hunter.cmake @@ -0,0 +1,36 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_cmake_args) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME + Beast + VERSION + "1.0.0-b84-hunter-0" + URL + "https://github.com/hunter-packages/Beast/archive/v1.0.0-b84-hunter-0.tar.gz" + SHA1 + 4268caa6c044fc8180d36d918aa731ffa931380d +) + +hunter_add_version( + PACKAGE_NAME + Beast + VERSION + "1.0.0-b32-hunter-4" + URL + "https://github.com/hunter-packages/Beast/archive/v1.0.0-b32-hunter-4.tar.gz" + SHA1 + 469ff269b5c437255b8392a6bcee829c07d59ce7 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(Beast) +hunter_download(PACKAGE_NAME Beast) diff --git a/cmake/projects/Boost/atomic/hunter.cmake b/cmake/projects/Boost/atomic/hunter.cmake index ee1560ce18..de03a2f676 100644 --- a/cmake/projects/Boost/atomic/hunter.cmake +++ b/cmake/projects/Boost/atomic/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT atomic - PACKAGE_INTERNAL_DEPS_ID "9" + PACKAGE_INTERNAL_DEPS_ID "17" ) diff --git a/cmake/projects/Boost/chrono/hunter.cmake b/cmake/projects/Boost/chrono/hunter.cmake index d883bc0fe8..5e57637428 100644 --- a/cmake/projects/Boost/chrono/hunter.cmake +++ b/cmake/projects/Boost/chrono/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT chrono - PACKAGE_INTERNAL_DEPS_ID "9" + PACKAGE_INTERNAL_DEPS_ID "17" ) diff --git a/cmake/projects/Boost/context/hunter.cmake b/cmake/projects/Boost/context/hunter.cmake index 4907b0d833..c020c02e95 100644 --- a/cmake/projects/Boost/context/hunter.cmake +++ b/cmake/projects/Boost/context/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT context - PACKAGE_INTERNAL_DEPS_ID "9" + PACKAGE_INTERNAL_DEPS_ID "17" ) diff --git a/cmake/projects/Boost/coroutine/hunter.cmake b/cmake/projects/Boost/coroutine/hunter.cmake index 4787ef397a..c1bd3bedaa 100644 --- a/cmake/projects/Boost/coroutine/hunter.cmake +++ b/cmake/projects/Boost/coroutine/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT coroutine - PACKAGE_INTERNAL_DEPS_ID "9" + PACKAGE_INTERNAL_DEPS_ID "17" ) diff --git a/cmake/projects/Boost/date_time/hunter.cmake b/cmake/projects/Boost/date_time/hunter.cmake index 0686caa060..de8daead9b 100644 --- a/cmake/projects/Boost/date_time/hunter.cmake +++ b/cmake/projects/Boost/date_time/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT date_time - PACKAGE_INTERNAL_DEPS_ID "9" + PACKAGE_INTERNAL_DEPS_ID "17" ) diff --git a/cmake/projects/Boost/exception/hunter.cmake b/cmake/projects/Boost/exception/hunter.cmake index 300c43ef6a..497c94a3b5 100644 --- a/cmake/projects/Boost/exception/hunter.cmake +++ b/cmake/projects/Boost/exception/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT exception - PACKAGE_INTERNAL_DEPS_ID "9" + PACKAGE_INTERNAL_DEPS_ID "17" ) diff --git a/cmake/projects/Boost/filesystem/hunter.cmake b/cmake/projects/Boost/filesystem/hunter.cmake index c0adab2bb7..d62ffc2b4b 100644 --- a/cmake/projects/Boost/filesystem/hunter.cmake +++ b/cmake/projects/Boost/filesystem/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT filesystem - PACKAGE_INTERNAL_DEPS_ID "9" + PACKAGE_INTERNAL_DEPS_ID "17" ) diff --git a/cmake/projects/Boost/graph/hunter.cmake b/cmake/projects/Boost/graph/hunter.cmake index 0ee8de572b..c2d8d1be38 100644 --- a/cmake/projects/Boost/graph/hunter.cmake +++ b/cmake/projects/Boost/graph/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT graph - PACKAGE_INTERNAL_DEPS_ID "9" + PACKAGE_INTERNAL_DEPS_ID "17" ) diff --git a/cmake/projects/Boost/graph_parallel/hunter.cmake b/cmake/projects/Boost/graph_parallel/hunter.cmake index a9f6f9121d..54e8293dba 100644 --- a/cmake/projects/Boost/graph_parallel/hunter.cmake +++ b/cmake/projects/Boost/graph_parallel/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT graph_parallel - PACKAGE_INTERNAL_DEPS_ID "9" + PACKAGE_INTERNAL_DEPS_ID "17" ) diff --git a/cmake/projects/Boost/hunter.cmake b/cmake/projects/Boost/hunter.cmake index f5c50e50e0..fe282c1880 100644 --- a/cmake/projects/Boost/hunter.cmake +++ b/cmake/projects/Boost/hunter.cmake @@ -13,7 +13,31 @@ include(hunter_pick_scheme) set(Boost_NO_SYSTEM_PATHS ON) # use base url for official boost releases +set(_hunter_boost_base_url "https://dl.bintray.com/boostorg/release") + +hunter_add_version( + PACKAGE_NAME + Boost + VERSION + "1.65.0" + URL + "${_hunter_boost_base_url}/1.65.0/source/boost_1_65_0.tar.bz2" + SHA1 + f9260074ecfb31f3e65322fae9c15cc423c0ad59 +) + +# up until 1.63 sourcefourge was used set(_hunter_boost_base_url "https://downloads.sourceforge.net/project/boost/boost/") +hunter_add_version( + PACKAGE_NAME + Boost + VERSION + "1.64.0" + URL + "${_hunter_boost_base_url}/1.64.0/boost_1_64_0.tar.bz2" + SHA1 + 51421ef259a4530edea0fbfc448460fcc5c64edb +) hunter_add_version( PACKAGE_NAME @@ -271,4 +295,4 @@ hunter_add_version( hunter_pick_scheme(DEFAULT url_sha1_boost) hunter_cacheable(Boost) -hunter_download(PACKAGE_NAME Boost PACKAGE_INTERNAL_DEPS_ID "9") +hunter_download(PACKAGE_NAME Boost PACKAGE_INTERNAL_DEPS_ID "17") diff --git a/cmake/projects/Boost/hunter.cmake.in b/cmake/projects/Boost/hunter.cmake.in index ea1e7e1d7d..596630111d 100644 --- a/cmake/projects/Boost/hunter.cmake.in +++ b/cmake/projects/Boost/hunter.cmake.in @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT boost_component - PACKAGE_INTERNAL_DEPS_ID "9" + PACKAGE_INTERNAL_DEPS_ID "17" ) diff --git a/cmake/projects/Boost/iostreams/hunter.cmake b/cmake/projects/Boost/iostreams/hunter.cmake index 767ac0a9e2..38549ff56d 100644 --- a/cmake/projects/Boost/iostreams/hunter.cmake +++ b/cmake/projects/Boost/iostreams/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT iostreams - PACKAGE_INTERNAL_DEPS_ID "9" + PACKAGE_INTERNAL_DEPS_ID "17" ) diff --git a/cmake/projects/Boost/locale/hunter.cmake b/cmake/projects/Boost/locale/hunter.cmake index e95fb1e7f5..57921e0bfe 100644 --- a/cmake/projects/Boost/locale/hunter.cmake +++ b/cmake/projects/Boost/locale/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT locale - PACKAGE_INTERNAL_DEPS_ID "9" + PACKAGE_INTERNAL_DEPS_ID "17" ) diff --git a/cmake/projects/Boost/log/hunter.cmake b/cmake/projects/Boost/log/hunter.cmake index 4e70cdc02a..f5432ba683 100644 --- a/cmake/projects/Boost/log/hunter.cmake +++ b/cmake/projects/Boost/log/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT log - PACKAGE_INTERNAL_DEPS_ID "9" + PACKAGE_INTERNAL_DEPS_ID "17" ) diff --git a/cmake/projects/Boost/math/hunter.cmake b/cmake/projects/Boost/math/hunter.cmake index b3862adede..dec95b8229 100644 --- a/cmake/projects/Boost/math/hunter.cmake +++ b/cmake/projects/Boost/math/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT math - PACKAGE_INTERNAL_DEPS_ID "9" + PACKAGE_INTERNAL_DEPS_ID "17" ) diff --git a/cmake/projects/Boost/mpi/hunter.cmake b/cmake/projects/Boost/mpi/hunter.cmake index 3d0c3936fa..4c4c6e0d2f 100644 --- a/cmake/projects/Boost/mpi/hunter.cmake +++ b/cmake/projects/Boost/mpi/hunter.cmake @@ -26,5 +26,5 @@ hunter_download( Boost PACKAGE_COMPONENT mpi - PACKAGE_INTERNAL_DEPS_ID "9" + PACKAGE_INTERNAL_DEPS_ID "17" ) diff --git a/cmake/projects/Boost/program_options/hunter.cmake b/cmake/projects/Boost/program_options/hunter.cmake index d3c3be2715..f036ae7565 100644 --- a/cmake/projects/Boost/program_options/hunter.cmake +++ b/cmake/projects/Boost/program_options/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT program_options - PACKAGE_INTERNAL_DEPS_ID "9" + PACKAGE_INTERNAL_DEPS_ID "17" ) diff --git a/cmake/projects/Boost/python/hunter.cmake b/cmake/projects/Boost/python/hunter.cmake index b635fe8e10..06c786cdd6 100644 --- a/cmake/projects/Boost/python/hunter.cmake +++ b/cmake/projects/Boost/python/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT python - PACKAGE_INTERNAL_DEPS_ID "9" + PACKAGE_INTERNAL_DEPS_ID "17" ) diff --git a/cmake/projects/Boost/random/hunter.cmake b/cmake/projects/Boost/random/hunter.cmake index 3115770522..2f87231580 100644 --- a/cmake/projects/Boost/random/hunter.cmake +++ b/cmake/projects/Boost/random/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT random - PACKAGE_INTERNAL_DEPS_ID "9" + PACKAGE_INTERNAL_DEPS_ID "17" ) diff --git a/cmake/projects/Boost/regex/hunter.cmake b/cmake/projects/Boost/regex/hunter.cmake index fde68c12b7..2808a0e80f 100644 --- a/cmake/projects/Boost/regex/hunter.cmake +++ b/cmake/projects/Boost/regex/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT regex - PACKAGE_INTERNAL_DEPS_ID "9" + PACKAGE_INTERNAL_DEPS_ID "17" ) diff --git a/cmake/projects/Boost/schemes/url_sha1_boost.cmake.in b/cmake/projects/Boost/schemes/url_sha1_boost.cmake.in index 79dacbe1f9..fea6f61422 100644 --- a/cmake/projects/Boost/schemes/url_sha1_boost.cmake.in +++ b/cmake/projects/Boost/schemes/url_sha1_boost.cmake.in @@ -15,6 +15,7 @@ include(hunter_report_broken_package) include(hunter_status_debug) include(hunter_status_print) include(hunter_test_string_not_empty) +include(hunter_get_boost_libs) hunter_status_debug("Scheme: url_sha1_boost") @@ -35,48 +36,8 @@ if("@MSVC@") hunter_test_string_not_empty("@HUNTER_MSVC_VCVARSALL@") endif() -# Same logic in all url_sha1_boost* schemes (TODO: DRY) -macro(BOOST_COMPONENT name version) - list(APPEND BOOST_COMPONENT_NAMES ${name}) - set(BOOST_COMPONENT_${name}_VERSION ${version}) -endmacro() - -boost_component(atomic 1.53.0) -boost_component(chrono 1.47.0) -boost_component(container 1.56.0) -boost_component(context 1.51.0) -boost_component(coroutine 1.53.0) -boost_component(coroutine2 1.60.0) -boost_component(date_time 1.29.0) -boost_component(exception 1.36.0) -boost_component(fiber 1.62.0) -boost_component(filesystem 1.30.0) -boost_component(graph 1.18.0) -boost_component(graph_parallel 1.18.0) -boost_component(iostreams 1.33.0) -boost_component(locale 1.48.0) -boost_component(log 1.54.0) -boost_component(math 1.23.0) -boost_component(metaparse 1.61.0) -boost_component(mpi 1.35.0) -boost_component(program_options 1.32.0) -boost_component(python 1.19.0) -boost_component(random 1.15.0) -boost_component(regex 1.18.0) -boost_component(serialization 1.32.0) -boost_component(signals 1.29.0) -boost_component(system 1.35.0) -boost_component(test 1.21.0) -boost_component(thread 1.25.0) -boost_component(timer 1.9.0) -boost_component(type_erasure 1.60.0) -boost_component(wave 1.33.0) - -foreach(name IN LISTS BOOST_COMPONENT_NAMES) - if(NOT @HUNTER_Boost_VERSION@ VERSION_LESS BOOST_COMPONENT_${name}_VERSION) - list(APPEND boost_libs ${name}) - endif() -endforeach() +# get list of boost components for given version +hunter_get_boost_libs(VERSION "@HUNTER_Boost_VERSION@" LIBS boost_libs) # MinGW 1.55 is broken string(REGEX MATCH "1.55.0*" version_1_55 "@HUNTER_Boost_VERSION@") @@ -94,20 +55,24 @@ else() set(env_cmd "") endif() -if("@MSVC@" OR "@MINGW@") +if(CMAKE_HOST_WIN32) set(install_cmd "b2") set(bootstrap_cmd "bootstrap.bat") else() set(install_cmd "./b2") - if(APPLE) - # Clear Xcode environment - set( - bootstrap_cmd - . "@HUNTER_GLOBAL_SCRIPT_DIR@/clear-all.sh" && ./bootstrap.sh - ) - else() - set(bootstrap_cmd "./bootstrap.sh") - endif() + set(bootstrap_cmd "./bootstrap.sh") +endif() + +if("@MINGW@") + # Test scenario: MinGW installed in system, Visual Studio - not + list(APPEND bootstrap_cmd "gcc") +endif() +if(APPLE) + # Clear Xcode environment + set( + bootstrap_cmd + . "@HUNTER_GLOBAL_SCRIPT_DIR@/clear-all.sh" && ${bootstrap_cmd} + ) endif() if("@MSVC@") @@ -150,6 +115,7 @@ ExternalProject_Add( install ${boost_list} "--prefix=@HUNTER_PACKAGE_INSTALL_PREFIX@" + --ignore-site-config # Ignore Gentoo specific optimization "none" in site config that only the patched bjam of Gentoo can understand. COMMAND # Copy license files "@CMAKE_COMMAND@" "-C@HUNTER_ARGS_FILE@" # for 'HUNTER_INSTALL_LICENSE_FILES' diff --git a/cmake/projects/Boost/schemes/url_sha1_boost_ios_library.cmake.in b/cmake/projects/Boost/schemes/url_sha1_boost_ios_library.cmake.in index 6841bd337b..a01f7e56a8 100644 --- a/cmake/projects/Boost/schemes/url_sha1_boost_ios_library.cmake.in +++ b/cmake/projects/Boost/schemes/url_sha1_boost_ios_library.cmake.in @@ -11,11 +11,13 @@ include(ExternalProject) # ExternalProject_Add list(APPEND CMAKE_MODULE_PATH "@HUNTER_SELF@/cmake/modules") include(hunter_boost_component_b2_args) +include(hunter_dump_cmake_flags) include(hunter_install_boost_config) include(hunter_internal_error) include(hunter_status_debug) include(hunter_test_string_not_empty) include(hunter_unsetvar) +include(hunter_get_boost_libs) hunter_status_debug("Scheme: url_sha1_boost_ios_library") @@ -40,48 +42,8 @@ hunter_test_string_not_empty("@IPHONEOS_SDK_ROOT@") hunter_test_string_not_empty("@IPHONESIMULATOR_SDK_ROOT@") hunter_test_string_not_empty("@HUNTER_Boost_VERSION@") -# Same logic in all url_sha1_boost* schemes (TODO: DRY) -macro(BOOST_COMPONENT name version) - list(APPEND BOOST_COMPONENT_NAMES ${name}) - set(BOOST_COMPONENT_${name}_VERSION ${version}) -endmacro() - -boost_component(atomic 1.53.0) -boost_component(chrono 1.47.0) -boost_component(container 1.56.0) -boost_component(context 1.51.0) -boost_component(coroutine 1.53.0) -boost_component(coroutine2 1.60.0) -boost_component(date_time 1.29.0) -boost_component(exception 1.36.0) -boost_component(fiber 1.62.0) -boost_component(filesystem 1.30.0) -boost_component(graph 1.18.0) -boost_component(graph_parallel 1.18.0) -boost_component(iostreams 1.33.0) -boost_component(locale 1.48.0) -boost_component(log 1.54.0) -boost_component(math 1.23.0) -boost_component(metaparse 1.61.0) -boost_component(mpi 1.35.0) -boost_component(program_options 1.32.0) -boost_component(python 1.19.0) -boost_component(random 1.15.0) -boost_component(regex 1.18.0) -boost_component(serialization 1.32.0) -boost_component(signals 1.29.0) -boost_component(system 1.35.0) -boost_component(test 1.21.0) -boost_component(thread 1.25.0) -boost_component(timer 1.9.0) -boost_component(type_erasure 1.60.0) -boost_component(wave 1.33.0) - -foreach(name IN LISTS BOOST_COMPONENT_NAMES) - if(NOT @HUNTER_Boost_VERSION@ VERSION_LESS BOOST_COMPONENT_${name}_VERSION) - list(APPEND boost_libs ${name}) - endif() -endforeach() +# get list of boost components for given version +hunter_get_boost_libs(VERSION "@HUNTER_Boost_VERSION@" LIBS boost_libs) set(libfound NO) foreach(x ${boost_libs}) @@ -165,6 +127,9 @@ hunter_boost_component_b2_args( list(APPEND build_opts ${b2_component_opts}) +hunter_dump_cmake_flags() +# -> CMAKE_CXX_FLAGS + if(CMAKE_CXX_FLAGS) list(APPEND build_opts "cxxflags=${CMAKE_CXX_FLAGS}") endif() diff --git a/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in b/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in index 78e0867b45..bc9939eede 100644 --- a/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in +++ b/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in @@ -17,9 +17,11 @@ include(hunter_dump_cmake_flags) include(hunter_fatal_error) include(hunter_install_boost_config) include(hunter_internal_error) +include(hunter_pick_archiver) include(hunter_status_debug) include(hunter_status_print) include(hunter_test_string_not_empty) +include(hunter_get_boost_libs) hunter_status_debug("Scheme: url_sha1_boost_library") @@ -41,48 +43,8 @@ if("@MSVC@") hunter_test_string_not_empty("@HUNTER_MSVC_VCVARSALL@") endif() -# Same logic in all url_sha1_boost* schemes (TODO: DRY) -macro(BOOST_COMPONENT name version) - list(APPEND BOOST_COMPONENT_NAMES ${name}) - set(BOOST_COMPONENT_${name}_VERSION ${version}) -endmacro() - -boost_component(atomic 1.53.0) -boost_component(chrono 1.47.0) -boost_component(container 1.56.0) -boost_component(context 1.51.0) -boost_component(coroutine 1.53.0) -boost_component(coroutine2 1.60.0) -boost_component(date_time 1.29.0) -boost_component(exception 1.36.0) -boost_component(fiber 1.62.0) -boost_component(filesystem 1.30.0) -boost_component(graph 1.18.0) -boost_component(graph_parallel 1.18.0) -boost_component(iostreams 1.33.0) -boost_component(locale 1.48.0) -boost_component(log 1.54.0) -boost_component(math 1.23.0) -boost_component(metaparse 1.61.0) -boost_component(mpi 1.35.0) -boost_component(program_options 1.32.0) -boost_component(python 1.19.0) -boost_component(random 1.15.0) -boost_component(regex 1.18.0) -boost_component(serialization 1.32.0) -boost_component(signals 1.29.0) -boost_component(system 1.35.0) -boost_component(test 1.21.0) -boost_component(thread 1.25.0) -boost_component(timer 1.9.0) -boost_component(type_erasure 1.60.0) -boost_component(wave 1.33.0) - -foreach(name IN LISTS BOOST_COMPONENT_NAMES) - if(NOT @HUNTER_Boost_VERSION@ VERSION_LESS BOOST_COMPONENT_${name}_VERSION) - list(APPEND boost_libs ${name}) - endif() -endforeach() +# get list of boost components for given version +hunter_get_boost_libs(VERSION "@HUNTER_Boost_VERSION@" LIBS boost_libs) set(libfound NO) foreach(x ${boost_libs}) @@ -118,6 +80,9 @@ elseif(compiler_is_clang) elseif("@MSVC@") set(toolset_name "msvc") set(toolset_version "") +elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") + set(toolset_name "intel") + set(toolset_version "") else() hunter_fatal_error("TODO: set toolset for boost" WIKI "error.boost.toolset") endif() @@ -250,6 +215,10 @@ set( "--user-config=${boost_user_jam}" --with-@HUNTER_PACKAGE_COMPONENT@ ) +if("@MINGW@") + # cross compile from "linux" to "windows" using mingw + set(build_opts target-os=windows ${build_opts}) +endif() hunter_boost_component_b2_args( "@HUNTER_PACKAGE_COMPONENT@" @@ -285,6 +254,11 @@ if(use_cmake_archiver) # We need custom '' and '' for # Android LTO ('*-gcc-ar' instead of '*-ar') # WARNING: no spaces between '' and '${CMAKE_AR}'! + + # -> CMAKE_AR + # -> CMAKE_RANLIB + hunter_pick_archiver() + file( APPEND ${boost_user_jam} @@ -331,7 +305,7 @@ if(@HUNTER_STATUS_DEBUG@) set(verbose_output "-d+2 --debug-configuration") endif() -if("@MSVC@" OR "@MINGW@") +if(CMAKE_HOST_WIN32) set(bootstrap_cmd "bootstrap.bat") set(b2_cmd "b2") else() @@ -339,6 +313,9 @@ else() set(b2_cmd "./b2") endif() +if("@MINGW@") + list(APPEND bootstrap_cmd "gcc") +endif() if(HUNTER_STATUS_DEBUG) file(READ "${boost_user_jam}" USER_JAM_CONTENT) @@ -387,6 +364,7 @@ ExternalProject_Add( ${b2_cmd} ${verbose_output} ${build_opts} + --ignore-site-config # Ignore Gentoo specific optimization "none" in site config that only the patched bjam of Gentoo can understand. BUILD_IN_SOURCE 1 INSTALL_COMMAND @@ -395,6 +373,7 @@ ExternalProject_Add( ${build_opts} stage # install only libraries, headers installed in `url_sha1_boost` "--stagedir=@HUNTER_PACKAGE_INSTALL_PREFIX@" + --ignore-site-config # Ignore Gentoo specific optimization "none" in site config that only the patched bjam of Gentoo can understand. ${log_opts} ) diff --git a/cmake/projects/Boost/serialization/hunter.cmake b/cmake/projects/Boost/serialization/hunter.cmake index 58f90491c6..bb6d45db6d 100644 --- a/cmake/projects/Boost/serialization/hunter.cmake +++ b/cmake/projects/Boost/serialization/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT serialization - PACKAGE_INTERNAL_DEPS_ID "9" + PACKAGE_INTERNAL_DEPS_ID "17" ) diff --git a/cmake/projects/Boost/signals/hunter.cmake b/cmake/projects/Boost/signals/hunter.cmake index 8e0bf2696c..534a253f21 100644 --- a/cmake/projects/Boost/signals/hunter.cmake +++ b/cmake/projects/Boost/signals/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT signals - PACKAGE_INTERNAL_DEPS_ID "9" + PACKAGE_INTERNAL_DEPS_ID "17" ) diff --git a/cmake/projects/Boost/system/hunter.cmake b/cmake/projects/Boost/system/hunter.cmake index eb03ebac25..caf7bc0774 100644 --- a/cmake/projects/Boost/system/hunter.cmake +++ b/cmake/projects/Boost/system/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT system - PACKAGE_INTERNAL_DEPS_ID "9" + PACKAGE_INTERNAL_DEPS_ID "17" ) diff --git a/cmake/projects/Boost/test/hunter.cmake b/cmake/projects/Boost/test/hunter.cmake index 76034a60ae..25b1c4505c 100644 --- a/cmake/projects/Boost/test/hunter.cmake +++ b/cmake/projects/Boost/test/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT test - PACKAGE_INTERNAL_DEPS_ID "9" + PACKAGE_INTERNAL_DEPS_ID "17" ) diff --git a/cmake/projects/Boost/thread/hunter.cmake b/cmake/projects/Boost/thread/hunter.cmake index eef5743ca3..6671820baf 100644 --- a/cmake/projects/Boost/thread/hunter.cmake +++ b/cmake/projects/Boost/thread/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT thread - PACKAGE_INTERNAL_DEPS_ID "9" + PACKAGE_INTERNAL_DEPS_ID "17" ) diff --git a/cmake/projects/Boost/timer/hunter.cmake b/cmake/projects/Boost/timer/hunter.cmake index f1b08dd1ac..6b893c2665 100644 --- a/cmake/projects/Boost/timer/hunter.cmake +++ b/cmake/projects/Boost/timer/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT timer - PACKAGE_INTERNAL_DEPS_ID "9" + PACKAGE_INTERNAL_DEPS_ID "17" ) diff --git a/cmake/projects/Boost/wave/hunter.cmake b/cmake/projects/Boost/wave/hunter.cmake index 856401d108..54e80626f7 100644 --- a/cmake/projects/Boost/wave/hunter.cmake +++ b/cmake/projects/Boost/wave/hunter.cmake @@ -18,5 +18,5 @@ hunter_download( Boost PACKAGE_COMPONENT wave - PACKAGE_INTERNAL_DEPS_ID "9" + PACKAGE_INTERNAL_DEPS_ID "17" ) diff --git a/cmake/projects/CURL/hunter.cmake b/cmake/projects/CURL/hunter.cmake index aaea061a4f..54f55aae6b 100644 --- a/cmake/projects/CURL/hunter.cmake +++ b/cmake/projects/CURL/hunter.cmake @@ -1,20 +1,15 @@ # Copyright (c) 2015, Steve Brain +# Copyright (c) 2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! -# Load used modules - - - include(hunter_add_version) include(hunter_cacheable) include(hunter_cmake_args) include(hunter_download) include(hunter_pick_scheme) -# List of versions here... - hunter_add_version( PACKAGE_NAME CURL @@ -26,8 +21,29 @@ hunter_add_version( 1b17954403db625d5422faf8c7fd68b5dde093f9 ) +hunter_add_version( + PACKAGE_NAME + CURL + VERSION + "7.49.1-DEV-v5" + URL + "https://github.com/hunter-packages/curl/archive/hunter-7.49.1-v5.tar.gz" + SHA1 + 159d73e83f6cde54469c838234d32ed917ec9b80 +) -if (ANDROID OR IOS) +hunter_add_version( + PACKAGE_NAME + CURL + VERSION + "7.49.1-DEV-v8" + URL + "https://github.com/hunter-packages/curl/archive/hunter-7.49.1-v8.tar.gz" + SHA1 + 3ac2684e3274c17ca209731e121e9a0acc79e4a5 +) + +if (ANDROID OR IOS OR RASPBERRY_PI) set(_curl_cmake_args HAVE_GLIBC_STRERROR_R=1 HAVE_GLIBC_STRERROR_R__TRYRUN_OUTPUT="" @@ -49,9 +65,6 @@ hunter_cmake_args( ${_curl_cmake_args} ) - - -# Pick a download scheme hunter_pick_scheme(DEFAULT url_sha1_cmake) hunter_cacheable(CURL) hunter_download(PACKAGE_NAME CURL) diff --git a/cmake/projects/CapnProto/hunter.cmake b/cmake/projects/CapnProto/hunter.cmake new file mode 100644 index 0000000000..fe667eab36 --- /dev/null +++ b/cmake/projects/CapnProto/hunter.cmake @@ -0,0 +1,27 @@ +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_cmake_args) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME CapnProto + VERSION "0.6.1" + URL "https://capnproto.org/capnproto-c++-0.6.1.tar.gz" + SHA1 745dc4c60c02d0a664574a63ec85ef7a03c57676 +) + +hunter_add_version( + PACKAGE_NAME CapnProto + VERSION "0.6.0" + URL "https://capnproto.org/capnproto-c++-0.6.0.tar.gz" + SHA1 c601f0d9da8942fc19dffca79ac3f2279297047b +) + +hunter_cmake_args(CapnProto CMAKE_ARGS BUILD_TESTING=OFF) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(CapnProto) +hunter_download(PACKAGE_NAME CapnProto) diff --git a/cmake/projects/Catch/hunter.cmake b/cmake/projects/Catch/hunter.cmake index 3f27a68340..3640685df4 100644 --- a/cmake/projects/Catch/hunter.cmake +++ b/cmake/projects/Catch/hunter.cmake @@ -8,6 +8,17 @@ include(hunter_pick_scheme) include(hunter_cacheable) include(hunter_download) +hunter_add_version( + PACKAGE_NAME + Catch + VERSION + "1.8.2-p0" + URL + "https://github.com/hunter-packages/Catch/archive/v1.8.2-p0-hunter.tar.gz" + SHA1 + d8de13879e7be959d95a8e4a0daa2d5eb5fef807 +) + hunter_add_version( PACKAGE_NAME Catch diff --git a/cmake/projects/Clang/hunter.cmake b/cmake/projects/Clang/hunter.cmake index fd07fd2fe1..5f78e87363 100644 --- a/cmake/projects/Clang/hunter.cmake +++ b/cmake/projects/Clang/hunter.cmake @@ -7,6 +7,28 @@ include(hunter_add_version) include(hunter_download) include(hunter_pick_scheme) +hunter_add_version( + PACKAGE_NAME + Clang + VERSION + "4.0.1-p0" + URL + "https://github.com/hunter-packages/clang/archive/v4.0.1-p0.tar.gz" + SHA1 + cc2e74c852f57c946a4337812c73ce1bc97d639f +) + +hunter_add_version( + PACKAGE_NAME + Clang + VERSION + "3.6.2-p0" + URL + "https://github.com/hunter-packages/clang/archive/v3.6.2-p0.tar.gz" + SHA1 + a83fb5364829f3836cbf0104cb54500359d4ea8c +) + hunter_add_version( PACKAGE_NAME Clang diff --git a/cmake/projects/ClangToolsExtra/hunter.cmake b/cmake/projects/ClangToolsExtra/hunter.cmake index ff4544e3f2..353eeb9a6d 100644 --- a/cmake/projects/ClangToolsExtra/hunter.cmake +++ b/cmake/projects/ClangToolsExtra/hunter.cmake @@ -7,6 +7,17 @@ include(hunter_add_version) include(hunter_download) include(hunter_pick_scheme) +hunter_add_version( + PACKAGE_NAME + ClangToolsExtra + VERSION + "4.0.1" + URL + "http://llvm.org/releases/4.0.1/clang-tools-extra-4.0.1.src.tar.xz" + SHA1 + 414ccbadc4ba0658b34421a3855784af4e767796 +) + hunter_add_version( PACKAGE_NAME ClangToolsExtra diff --git a/cmake/projects/Eigen/hunter.cmake b/cmake/projects/Eigen/hunter.cmake index 13bb7f3c44..5cd5f2e86d 100644 --- a/cmake/projects/Eigen/hunter.cmake +++ b/cmake/projects/Eigen/hunter.cmake @@ -13,6 +13,39 @@ include(hunter_cacheable) hunter_cacheable(Eigen) # List of versions here... +hunter_add_version( + PACKAGE_NAME + Eigen + VERSION + "3.3.4-p0" + URL + "https://github.com/hunter-packages/eigen/archive/v3.3.4-p0.tar.gz" + SHA1 + 49dee30c5fedd8613a144f9bf6551fb46bb69e92 +) + +hunter_add_version( + PACKAGE_NAME + Eigen + VERSION + "3.3.3-p0" + URL + "https://github.com/hunter-packages/eigen/archive/v3.3.3-p0.tar.gz" + SHA1 + ed46aa311d2f6bc9dae06c3ac39cc53677e61400 +) + +hunter_add_version( + PACKAGE_NAME + Eigen + VERSION + "3.3.2-p0" + URL + "https://github.com/hunter-packages/eigen/archive/v3.3.2-p0.tar.gz" + SHA1 + b6bc33bb1acb0f853cc2b4e0c26d947bca510e1a +) + hunter_add_version( PACKAGE_NAME Eigen diff --git a/cmake/projects/IntSizeof/hunter.cmake b/cmake/projects/FakeIt/hunter.cmake similarity index 50% rename from cmake/projects/IntSizeof/hunter.cmake rename to cmake/projects/FakeIt/hunter.cmake index 82f66348c7..90a276f7ee 100644 --- a/cmake/projects/IntSizeof/hunter.cmake +++ b/cmake/projects/FakeIt/hunter.cmake @@ -1,22 +1,21 @@ -# Copyright (c) 2014, Ruslan Baratov -# All rights reserved. - # !!! DO NOT PLACE HEADER GUARDS HERE !!! include(hunter_add_version) -include(hunter_download) include(hunter_pick_scheme) +include(hunter_cacheable) +include(hunter_download) hunter_add_version( PACKAGE_NAME - IntSizeof + FakeIt VERSION - "1.0.0" + "2.0.3" URL - "https://github.com/ruslo/intsizeof/archive/v1.0.0.tar.gz" + "https://github.com/hunter-packages/FakeIt/archive/2.0.3-hunter.tar.gz" SHA1 - 9959e0e29c88fe414ba082fb28a722e411682bb3 + 9ac096c5d990bc8b8d8d8b0ac6b4902c21928a22 ) hunter_pick_scheme(DEFAULT url_sha1_cmake) -hunter_download(PACKAGE_NAME IntSizeof) +hunter_cacheable(FakeIt) +hunter_download(PACKAGE_NAME FakeIt) diff --git a/cmake/projects/GTest/hunter.cmake b/cmake/projects/GTest/hunter.cmake index 036bc36b78..ac8aff03c8 100644 --- a/cmake/projects/GTest/hunter.cmake +++ b/cmake/projects/GTest/hunter.cmake @@ -170,6 +170,30 @@ hunter_add_version( SHA1 ce12f38315d929704b054b0514ef6a63b28fedfd ) + +hunter_add_version( + PACKAGE_NAME + GTest + VERSION + 1.8.0-hunter-p6 + URL + "https://github.com/hunter-packages/googletest/archive/1.8.0-hunter-p6.tar.gz" + SHA1 + f57096bd01c6f8cbef043b312d4d1e82f29648b6 +) + + +hunter_add_version( + PACKAGE_NAME + GTest + VERSION + 1.8.0-hunter-p7 + URL + "https://github.com/hunter-packages/googletest/archive/1.8.0-hunter-p7.tar.gz" + SHA1 + 4fe083a96d7597f7dce6f453dca01e1d94a1e45b +) + if(HUNTER_GTest_VERSION VERSION_LESS 1.8.0) set(_gtest_license "LICENSE") else() diff --git a/cmake/projects/Jpeg/hunter.cmake b/cmake/projects/Jpeg/hunter.cmake index d94818fdae..5e69ccd5bd 100644 --- a/cmake/projects/Jpeg/hunter.cmake +++ b/cmake/projects/Jpeg/hunter.cmake @@ -8,6 +8,17 @@ include(hunter_cacheable) include(hunter_download) include(hunter_pick_scheme) +hunter_add_version( + PACKAGE_NAME + Jpeg + VERSION + "9b-p3" + URL + "https://github.com/hunter-packages/jpeg/archive/v9b-p3.tar.gz" + SHA1 + 41f208215d59be34868c1f23b1fd0ee3f9934b9b +) + hunter_add_version( PACKAGE_NAME Jpeg diff --git a/cmake/projects/LAPACK/hunter-msvc.cmake b/cmake/projects/LAPACK/hunter-msvc.cmake new file mode 100644 index 0000000000..066bd44e0e --- /dev/null +++ b/cmake/projects/LAPACK/hunter-msvc.cmake @@ -0,0 +1,36 @@ +# Copyright (c) 2017, NeroBurner +# All rights reserved. + +include(hunter_report_broken_package) + +#hunter_cacheable(LAPACK) # install is always cacheable + +# determine architecture +include(hunter_check_toolchain_definition) +hunter_check_toolchain_definition(NAME "_WIN64" DEFINED _WIN64_defined) + +if(_WIN64_defined) + hunter_add_version( + PACKAGE_NAME + LAPACK + VERSION + "3.7.1" + URL + https://github.com/hunter-packages/lapack/releases/download/v3.7.1-p0/lapack-prebuilt-3.7.1-msvc-amd64.zip + SHA1 + 4a6e51690e36747d51e4334358abac99ca22378c + ) +else() + hunter_report_broken_package("LAPACK on MSVC is only available on WIN64") +endif() + +# pass cmake arguments +hunter_cmake_args( + LAPACK + CMAKE_ARGS + HUNTER_INSTALL_LICENSE_FILES=LICENSE +) + +# Pick a download scheme +hunter_pick_scheme(DEFAULT url_sha1_unpack_install) + diff --git a/cmake/projects/LAPACK/hunter-source.cmake b/cmake/projects/LAPACK/hunter-source.cmake new file mode 100644 index 0000000000..7ccaf220e8 --- /dev/null +++ b/cmake/projects/LAPACK/hunter-source.cmake @@ -0,0 +1,27 @@ +# Copyright (c) 2017, NeroBurner +# All rights reserved. + +hunter_cacheable(LAPACK) + +# List of versions here... +hunter_add_version( + PACKAGE_NAME + LAPACK + VERSION + "3.7.1" + URL + https://github.com/hunter-packages/lapack/archive/v3.7.1-p0.tar.gz + SHA1 + 82616c0878fbe42f22ece5fadfb38e09456ba5b5 +) + +# pass cmake arguments +hunter_cmake_args( + LAPACK + CMAKE_ARGS + HUNTER_INSTALL_LICENSE_FILES=LICENSE +) + +# Pick a download scheme +hunter_pick_scheme(DEFAULT url_sha1_cmake) + diff --git a/cmake/projects/LAPACK/hunter.cmake b/cmake/projects/LAPACK/hunter.cmake new file mode 100644 index 0000000000..66476814e5 --- /dev/null +++ b/cmake/projects/LAPACK/hunter.cmake @@ -0,0 +1,23 @@ +# Copyright (c) 2017, NeroBurner +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +# Load used modules +include(hunter_add_version) +include(hunter_cmake_args) +include(hunter_download) +include(hunter_pick_scheme) +include(hunter_cacheable) + +if(NOT MSVC) + include("${CMAKE_CURRENT_LIST_DIR}/hunter-source.cmake") +else() + include("${CMAKE_CURRENT_LIST_DIR}/hunter-msvc.cmake") +endif() + +# Download package. +# Two versions of library will be build: +# * libexample_A.a +# * libexample_Ad.a +hunter_download(PACKAGE_NAME LAPACK) diff --git a/cmake/projects/LLVM/hunter.cmake b/cmake/projects/LLVM/hunter.cmake index a92b0f0ebc..9dbf7ad16a 100644 --- a/cmake/projects/LLVM/hunter.cmake +++ b/cmake/projects/LLVM/hunter.cmake @@ -1,18 +1,37 @@ -# Copyright (c) 2014, Ruslan Baratov +# Copyright (c) 2014-2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! include(hunter_add_version) +include(hunter_cacheable) include(hunter_cmake_args) include(hunter_configuration_types) include(hunter_download) include(hunter_pick_scheme) include(hunter_report_broken_package) -hunter_add_package(Clang) # CLANG_ROOT -hunter_add_package(ClangToolsExtra) # CLANGTOOLSEXTRA_ROOT -hunter_add_package(LLVMCompilerRT) # LLVMCOMPILERRT_ROOT +hunter_add_version( + PACKAGE_NAME + LLVM + VERSION + "4.0.1-p0" + URL + "https://github.com/hunter-packages/llvm/archive/v4.0.1-p0.tar.gz" + SHA1 + fd70af82551d3a693c4270d71e994b810f33f593 +) + +hunter_add_version( + PACKAGE_NAME + LLVM + VERSION + "3.6.2-p0" + URL + "https://github.com/hunter-packages/llvm/archive/v3.6.2-p0.tar.gz" + SHA1 + 81eed993cbbc7243597a4b16d2e371618156396b +) hunter_add_version( PACKAGE_NAME @@ -61,9 +80,6 @@ hunter_add_version( hunter_cmake_args( LLVM CMAKE_ARGS - "LLVM_EXTERNAL_CLANG_SOURCE_DIR=${CLANG_ROOT}" - "LLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR=${CLANGTOOLSEXTRA_ROOT}" - "LLVM_EXTERNAL_COMPILER_RT_SOURCE_DIR=${LLVMCOMPILERRT_ROOT}" LLVM_INCLUDE_EXAMPLES=OFF LLVM_INCLUDE_TESTS=OFF LLVM_INCLUDE_DOCS=OFF @@ -72,7 +88,7 @@ hunter_cmake_args( hunter_configuration_types(LLVM CONFIGURATION_TYPES Release) hunter_pick_scheme(DEFAULT url_sha1_cmake) -if(MSVC_IDE) +if(MSVC_IDE AND HUNTER_LLVM_VERSION VERSION_LESS 4.0.1) hunter_report_broken_package( "LLVM build broken on Visual Studio, see:" "http://llvm.1065342.n5.nabble.com/Install-Problem-of-Compiler-rt-with-Visual-Studio-Express-2013-for-Windows-Desktop-td66575.html" @@ -80,8 +96,5 @@ if(MSVC_IDE) ) endif() -hunter_download( - PACKAGE_NAME LLVM - # Explicit dependencies since LLVM is not hunterized - PACKAGE_DEPENDS_ON Clang ClangToolsExtra LLVMCompilerRT -) +hunter_cacheable(LLVM) +hunter_download(PACKAGE_NAME LLVM) diff --git a/cmake/projects/LLVMCompilerRT/hunter.cmake b/cmake/projects/LLVMCompilerRT/hunter.cmake index dd751ccf29..b98c003c68 100644 --- a/cmake/projects/LLVMCompilerRT/hunter.cmake +++ b/cmake/projects/LLVMCompilerRT/hunter.cmake @@ -7,6 +7,17 @@ include(hunter_add_version) include(hunter_download) include(hunter_pick_scheme) +hunter_add_version( + PACKAGE_NAME + LLVMCompilerRT + VERSION + "4.0.1-patched" + URL + "https://github.com/hunter-packages/LLVMCompilerRT/archive/v4.0.1-p0.tar.gz" + SHA1 + 561c29f1595c29f1d083567a7e669fec30cdfa44 +) + hunter_add_version( PACKAGE_NAME LLVMCompilerRT diff --git a/cmake/projects/Leptonica/hunter.cmake b/cmake/projects/Leptonica/hunter.cmake new file mode 100644 index 0000000000..0e2047d9a9 --- /dev/null +++ b/cmake/projects/Leptonica/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2017, Sacha Refshauge +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME + Leptonica + VERSION + "1.74.2-p4" + URL + "https://github.com/hunter-packages/leptonica/archive/v1.74.2-p4.tar.gz" + SHA1 + b317631496a683759565fc925e5125fddf85466a +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(Leptonica) +hunter_download(PACKAGE_NAME Leptonica) diff --git a/cmake/projects/MySQL-client/hunter.cmake b/cmake/projects/MySQL-client/hunter.cmake index 1ae26edf6e..b76b4e7aa7 100644 --- a/cmake/projects/MySQL-client/hunter.cmake +++ b/cmake/projects/MySQL-client/hunter.cmake @@ -19,10 +19,31 @@ hunter_add_version( SHA1 2444586365c2c58e7ca2397d4617e5fe19f9f246 ) -# CONFIGURATION_TYPES is set to Release, because Debug is bugged at the moment -# see https://github.com/ruslo/hunter/issues/303 -hunter_configuration_types(MySQL-client CONFIGURATION_TYPES Release) -hunter_cacheable(MySQL-client) + +hunter_add_version( + PACKAGE_NAME + MySQL-client + VERSION + "6.1.9" + URL + "https://github.com/hunter-packages/mysql-client/archive/v1.6.9.tar.gz" + SHA1 + 3268345d8e324d11380cd26475e1669bc5ff2fa0 +) + +hunter_add_version( + PACKAGE_NAME + MySQL-client + VERSION + "6.1.9-p0" + URL + "https://github.com/hunter-packages/mysql-client/archive/v1.6.9-p0.tar.gz" + SHA1 + 64c3fb0500e03fc0ee188dca1ec33e52c2f54e32 +) + +# https://github.com/ruslo/hunter/issues/705 +# hunter_cacheable(MySQL-client) + hunter_pick_scheme(DEFAULT url_sha1_cmake) hunter_download(PACKAGE_NAME MySQL-client) - diff --git a/cmake/projects/NASM/hunter.cmake b/cmake/projects/NASM/hunter.cmake new file mode 100644 index 0000000000..fca0f776fb --- /dev/null +++ b/cmake/projects/NASM/hunter.cmake @@ -0,0 +1,49 @@ +# Copyright (c) 2017, Zhuhao Wang +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_download) +include(hunter_pick_scheme) +include(hunter_configuration_types) + +if(MINGW) + # NASM only supports a subset of VS compilers on Windows. + hunter_add_version( + PACKAGE_NAME + NASM + VERSION + "2.12.02" + URL + "http://www.nasm.us/pub/nasm/releasebuilds/2.12.02/win32/nasm-2.12.02-win32.zip" + SHA1 + 07d7c742dcc1107d7a322db7a3a19065d7d1cbb4 + ) +else() + hunter_add_version( + PACKAGE_NAME + NASM + VERSION + "2.12.02" + URL + "http://www.nasm.us/pub/nasm/releasebuilds/2.12.02/nasm-2.12.02.tar.gz" + SHA1 + 6d23d4be63f3a73d7df3053e65168f7906dd99e7 + ) +endif() + +if(MINGW OR MSYS) + hunter_pick_scheme(DEFAULT url_sha1_unpack_bin_install) +elseif(CMAKE_HOST_WIN32) + hunter_pick_scheme(DEFAULT url_sha1_nasm_windows) + hunter_cacheable(NASM) +else() + hunter_configuration_types(NASM CONFIGURATION_TYPES Release) + hunter_pick_scheme(DEFAULT url_sha1_autotools) + hunter_cacheable(NASM) +endif() + +hunter_download(PACKAGE_NAME NASM) + diff --git a/cmake/projects/NASM/schemes/url_sha1_nasm_windows.cmake.in b/cmake/projects/NASM/schemes/url_sha1_nasm_windows.cmake.in new file mode 100644 index 0000000000..557aab0c9b --- /dev/null +++ b/cmake/projects/NASM/schemes/url_sha1_nasm_windows.cmake.in @@ -0,0 +1,65 @@ +# Copyright (c) 2017, Zhuhao Wang +# All rights reserved. + +cmake_minimum_required(VERSION 3.0) +project(Hunter) + +include(ExternalProject) # ExternalProject_Add + +# Scheme for download and install NASM library for Windows + +list(APPEND CMAKE_MODULE_PATH "@HUNTER_SELF@/cmake/modules") + +include(hunter_status_debug) +include(hunter_test_string_not_empty) + +hunter_status_debug("Scheme: url_sha1_nasm_windows") + +# Check preconditions +hunter_test_string_not_empty("@HUNTER_SELF@") +hunter_test_string_not_empty("@HUNTER_EP_NAME@") +hunter_test_string_not_empty("@HUNTER_PACKAGE_URL@") +hunter_test_string_not_empty("@HUNTER_PACKAGE_SHA1@") +hunter_test_string_not_empty("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_test_string_not_empty("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_test_string_not_empty("@HUNTER_PACKAGE_INSTALL_PREFIX@") +hunter_test_string_not_empty("@HUNTER_MSVC_ARCH@") +hunter_test_string_not_empty("@HUNTER_MSVC_VCVARSALL@") +hunter_test_string_not_empty("@HUNTER_PACKAGE_LICENSE_DIR@") + +ExternalProject_Add( + "@HUNTER_EP_NAME@" + URL + "@HUNTER_PACKAGE_URL@" + URL_HASH + SHA1=@HUNTER_PACKAGE_SHA1@ + DOWNLOAD_DIR + "@HUNTER_PACKAGE_DOWNLOAD_DIR@" + SOURCE_DIR + "@HUNTER_PACKAGE_SOURCE_DIR@" + INSTALL_DIR + "@HUNTER_PACKAGE_INSTALL_PREFIX@" + # not used, just avoid creating Install/ empty directory + CONFIGURE_COMMAND + "@HUNTER_MSVC_VCVARSALL@" "@HUNTER_MSVC_ARCH@" + BUILD_COMMAND + nmake /f Mkfiles/msvc.mak + BUILD_IN_SOURCE + 1 + INSTALL_COMMAND + "@CMAKE_COMMAND@" + "-E" "make_directory" "@HUNTER_PACKAGE_INSTALL_PREFIX@/bin" + COMMAND + "@CMAKE_COMMAND@" + "-E" "copy" "nasm.exe" "ndisasm.exe" "@HUNTER_PACKAGE_INSTALL_PREFIX@/bin" + COMMAND + "@CMAKE_COMMAND@" + "-E" "copy_directory" "rdoff" "@HUNTER_PACKAGE_INSTALL_PREFIX@/bin" + COMMAND # Copy license files + "@CMAKE_COMMAND@" + "-C@HUNTER_ARGS_FILE@" # for 'HUNTER_INSTALL_LICENSE_FILES' + "-Dsrcdir=@HUNTER_PACKAGE_SOURCE_DIR@" + "-Ddstdir=@HUNTER_PACKAGE_LICENSE_DIR@" + -P + "@HUNTER_SELF@/scripts/try-copy-license.cmake" +) diff --git a/cmake/projects/OpenBLAS/hunter.cmake b/cmake/projects/OpenBLAS/hunter.cmake index 02804e7e7c..2040116391 100644 --- a/cmake/projects/OpenBLAS/hunter.cmake +++ b/cmake/projects/OpenBLAS/hunter.cmake @@ -9,6 +9,17 @@ include(hunter_configuration_types) include(hunter_pick_scheme) include(hunter_download) +hunter_add_version( + PACKAGE_NAME + OpenBLAS + VERSION + 0.2.20-p0 + URL + "https://github.com/hunter-packages/OpenBLAS/archive/v0.2.20-p0.tar.gz" + SHA1 + 8f56263dda492f18972e55d51911a419d37eaba4 +) + hunter_add_version( PACKAGE_NAME OpenBLAS @@ -21,10 +32,15 @@ hunter_add_version( ) hunter_configuration_types(OpenBLAS CONFIGURATION_TYPES Release) -hunter_pick_scheme(DEFAULT OpenBLAS) +if (MSVC) + hunter_pick_scheme(DEFAULT url_sha1_cmake) +else() + hunter_pick_scheme(DEFAULT OpenBLAS) +endif() hunter_cacheable(OpenBLAS) hunter_download( PACKAGE_NAME OpenBLAS + PACKAGE_INTERNAL_DEPS_ID "1" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/cmake/openblas/OpenBLASConfig.cmake" ) diff --git a/cmake/projects/OpenBLAS/schemes/OpenBLAS.cmake.in b/cmake/projects/OpenBLAS/schemes/OpenBLAS.cmake.in index ba454e169d..f5306d0464 100644 --- a/cmake/projects/OpenBLAS/schemes/OpenBLAS.cmake.in +++ b/cmake/projects/OpenBLAS/schemes/OpenBLAS.cmake.in @@ -11,6 +11,7 @@ include("@HUNTER_SELF@/cmake/Hunter") include(hunter_status_debug) include(hunter_test_string_not_empty) include(hunter_user_error) +include(hunter_dump_cmake_flags) hunter_status_debug("Scheme: OpenBLAS") @@ -41,6 +42,7 @@ endif() string(TOUPPER "${cfg_types}" config_type) +hunter_dump_cmake_flags() set(cflags "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${config_type}}") if(NOT BUILD_SHARED_LIBS) @@ -49,6 +51,44 @@ else() set(lib_type "") endif() +set(compiler_arg "@CMAKE_C_COMPILER@") + + +if(CMAKE_CROSSCOMPILING) + # Tells OpenBLAS where to find host CC (HOSTCC=) + # and not to run tests (CROSS=1) + # and not to use fortran (NOFORTRAN=1) + # Feel free to implement cross fortran + + # What is HOSTCC? + set(HOSTCC gcc) + if($ENV{CC}) + set(HOSTCC $ENV{CC}) + elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") + set(HOSTCC "clang") + endif() + + set(cross_arg HOSTCC=${HOSTCC} CROSS=1 NOFORTRAN=1 ONLY_CBLAS=1) + + # We also need to manually set target when cross compiling + if(ANDROID) + if(CMAKE_ANDROID_ARCH_ABI STREQUAL "armeabi-v7a") + set(target_arg TARGET=ARMV7 BINARY=32 ARM_SOFTFP_ABI=1) + elseif(CMAKE_ANDROID_ARCH_ABI STREQUAL "arm64-v8a") + set(target_arg TARGET=CORTEXA57 BINARY=64) + elseif(CMAKE_ANDROID_ARCH_ABI STREQUAL "x86") + set(target_arg TARGET=CORE2 BINARY=32) + elseif(CMAKE_ANDROID_ARCH_ABI STREQUAL "x86_64") + set(target_arg TARGET=PENRYN BINARY=64) + endif() + elseif(IOS) + set(target_arg TARGET=generic) + endif() +else() + set(target_arg "") + set(cross_arg "") +endif() + ExternalProject_Add( "@HUNTER_EP_NAME@" URL @@ -65,11 +105,11 @@ ExternalProject_Add( CONFIGURE_COMMAND "" BUILD_COMMAND - make ${lib_type} "CC=@CMAKE_C_COMPILER@" "CFLAGS=${cflags}" + make ${lib_type} ${target_arg} ${cross_arg} "CC=${compiler_arg} ${cflags}" "AR=@CMAKE_AR@" BUILD_IN_SOURCE 1 INSTALL_COMMAND - make ${lib_type} "PREFIX=@HUNTER_PACKAGE_INSTALL_PREFIX@" install + make ${lib_type} ${target_arg} ${cross_arg} "CC=${compiler_arg} ${cflags}" "AR=@CMAKE_AR@" "PREFIX=@HUNTER_PACKAGE_INSTALL_PREFIX@" install COMMAND # Copy license files "@CMAKE_COMMAND@" "-C@HUNTER_ARGS_FILE@" # for 'HUNTER_INSTALL_LICENSE_FILES' diff --git a/cmake/projects/OpenCL/hunter.cmake b/cmake/projects/OpenCL/hunter.cmake index 36d45ac6fb..d6a0632fb1 100644 --- a/cmake/projects/OpenCL/hunter.cmake +++ b/cmake/projects/OpenCL/hunter.cmake @@ -3,10 +3,22 @@ # Load used modules include(hunter_add_version) include(hunter_cacheable) +include(hunter_cmake_args) include(hunter_download) include(hunter_pick_scheme) # List of versions here... +hunter_add_version( + PACKAGE_NAME + OpenCL + VERSION + "2.1-p3" + URL + "https://github.com/hunter-packages/OpenCL-ICD-Loader/archive/2.1-p3.tar.gz" + SHA1 + be6a6c575088103f1b87c5202dc0f69e49b3764f +) + hunter_add_version( PACKAGE_NAME OpenCL @@ -18,6 +30,13 @@ hunter_add_version( 1cb4fed5bc4d0e1583c07e02f43daccab12eb99a ) + +hunter_cmake_args( + OpenCL + CMAKE_ARGS + OPENCL_TESTS=OFF +) + # Pick a download scheme hunter_pick_scheme(DEFAULT url_sha1_cmake) hunter_cacheable(OpenCL) diff --git a/cmake/projects/OpenCV-Extra/hunter.cmake b/cmake/projects/OpenCV-Extra/hunter.cmake index d7b2a73bac..68f0c883bf 100644 --- a/cmake/projects/OpenCV-Extra/hunter.cmake +++ b/cmake/projects/OpenCV-Extra/hunter.cmake @@ -7,6 +7,29 @@ include(hunter_add_version) include(hunter_download) include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME + OpenCV-Extra + VERSION + "3.3.0" + URL + "https://github.com/opencv/opencv_contrib/archive/3.3.0.tar.gz" + SHA1 + d97d80f8887416f4d8353f10fc4812a21909f84a +) + +hunter_add_version( + PACKAGE_NAME + OpenCV-Extra + VERSION + "3.2.0" + URL + "https://github.com/Itseez/opencv_contrib/archive/3.2.0.tar.gz" + SHA1 + fa8ac06b8f6ad0a290106077f64b2a886055fd53 +) + hunter_add_version( PACKAGE_NAME OpenCV-Extra diff --git a/cmake/projects/OpenCV/hunter.cmake b/cmake/projects/OpenCV/hunter.cmake index 7a5ea03f1a..a1f2d1da86 100644 --- a/cmake/projects/OpenCV/hunter.cmake +++ b/cmake/projects/OpenCV/hunter.cmake @@ -13,6 +13,50 @@ include(hunter_pick_scheme) # List of versions here... +hunter_add_version( + PACKAGE_NAME + OpenCV + VERSION + "3.3.0-p2" + URL + "https://github.com/hunter-packages/opencv/archive/v3.3.0-p2.tar.gz" + SHA1 + 27be59f7978a4625401a1041af8d108a47ae745b +) + +hunter_add_version( + PACKAGE_NAME + OpenCV + VERSION + "3.3.0-p0" + URL + "https://github.com/hunter-packages/opencv/archive/v3.3.0-p0.tar.gz" + SHA1 + fc351142139be71b366458fa1572ab004c871774 +) + +hunter_add_version( + PACKAGE_NAME + OpenCV + VERSION + "3.2.0-p2" + URL + "https://github.com/hunter-packages/opencv/archive/v3.2.0-p2.tar.gz" + SHA1 + 99219206c4fb9b5b6f60e03112746461baf6c9ab +) + +hunter_add_version( + PACKAGE_NAME + OpenCV + VERSION + "3.2.0-p1" + URL + "https://github.com/hunter-packages/opencv/archive/v3.2.0-p1.tar.gz" + SHA1 + be088ced81f1b725e1bb76a45806ab044107fba3 +) + hunter_add_version( PACKAGE_NAME OpenCV @@ -85,7 +129,7 @@ hunter_add_version( VERSION "3.0.0-p11" URL - "https://github.com/hunter-packages/opencv/archive/v3.0.0-p11.tar.gz" + "https://github.com/hunter-packages/opencv/releases/download/v3.0.0-p11/v3.0.0-p11.tar.gz" SHA1 3fa05fadc5c2b5e02ada00ccb7752ede660699ab ) @@ -280,7 +324,7 @@ hunter_add_version( string(COMPARE EQUAL "${CMAKE_OSX_SYSROOT}" "iphoneos" _is_ios) if(_is_ios) - set(_ios_args ENABLE_NEON=ON) + set(_ios_args BUILD_WEBP=ON) else() set(_ios_args "") endif() @@ -314,6 +358,10 @@ hunter_cmake_args( BUILD_opencv_java=OFF BUILD_opencv_python2=OFF BUILD_opencv_python3=OFF + # There is not a CUDA package so need to stop OpenCV from searching for it, otherwise + # it might pick up the host version + WITH_CUDA=OFF + WITH_CUFFT=OFF ) # Pick a download scheme @@ -326,4 +374,7 @@ hunter_pick_scheme(DEFAULT url_sha1_cmake) # * libexample_Ad.a hunter_cacheable(OpenCV) -hunter_download(PACKAGE_NAME OpenCV) +hunter_download( + PACKAGE_NAME OpenCV + PACKAGE_INTERNAL_DEPS_ID "1" +) diff --git a/cmake/projects/OpenNMTTokenizer/hunter.cmake b/cmake/projects/OpenNMTTokenizer/hunter.cmake new file mode 100644 index 0000000000..a23420d3de --- /dev/null +++ b/cmake/projects/OpenNMTTokenizer/hunter.cmake @@ -0,0 +1,38 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_cmake_args) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME + OpenNMTTokenizer + VERSION + 0.2.0-p0 + URL + "https://github.com/hunter-packages/OpenNMT-Tokenizer/archive/v0.2.0-p0.tar.gz" + SHA1 + 8d6025d92014586c5ff5a831c13b9238e6c07da8 +) + +hunter_add_version( + PACKAGE_NAME + OpenNMTTokenizer + VERSION + 0.2.0-p1 + URL + "https://github.com/hunter-packages/OpenNMT-Tokenizer/archive/v0.2.0-p1.tar.gz" + SHA1 + 33c75c6d22a79a0410b28a518b57a5b257762f1f +) + +hunter_cmake_args(OpenNMTTokenizer CMAKE_ARGS LIB_ONLY=YES) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(OpenNMTTokenizer) +hunter_download(PACKAGE_NAME OpenNMTTokenizer) diff --git a/cmake/projects/OpenSSL/hunter.cmake b/cmake/projects/OpenSSL/hunter.cmake index 5e7c5c5764..8f4e726755 100755 --- a/cmake/projects/OpenSSL/hunter.cmake +++ b/cmake/projects/OpenSSL/hunter.cmake @@ -5,6 +5,8 @@ include(hunter_add_version) include(hunter_cacheable) +include(hunter_check_toolchain_definition) +include(hunter_cmake_args) include(hunter_download) include(hunter_pick_scheme) @@ -41,6 +43,50 @@ hunter_add_version( 783666315e96b8f55b28b5e1edcb7ed83e8bc79b ) +hunter_add_version( + PACKAGE_NAME + OpenSSL + VERSION + "1.1.0e" + URL + "https://github.com/openssl/openssl/archive/OpenSSL_1_1_0e.tar.gz" + SHA1 + 14eaed8edc7e48fe1f01924fa4561c1865c9c8ac +) + +hunter_add_version( + PACKAGE_NAME + OpenSSL + VERSION + "1.1.0f" + URL + "https://github.com/openssl/openssl/archive/OpenSSL_1_1_0f.tar.gz" + SHA1 + 8fd0ba4c9bb98a1d380689704b132fe20c000a19 +) + +hunter_add_version( + PACKAGE_NAME + OpenSSL + VERSION + "1.0.2l" + URL + "https://github.com/openssl/openssl/archive/OpenSSL_1_0_2l.tar.gz" + SHA1 + 5bea0957b371627e8ebbee5bef221519e94d547c +) + +hunter_add_version( + PACKAGE_NAME + OpenSSL + VERSION + "1.0.2k" + URL + "https://github.com/openssl/openssl/archive/OpenSSL_1_0_2k.tar.gz" + SHA1 + 462944eff7b045d950deaaa86798190cbdc5278a +) + hunter_add_version( PACKAGE_NAME OpenSSL @@ -250,7 +296,9 @@ hunter_add_version( 072cf2bc8e19c7c59a42e7e20977fe3037c9c9f3 ) -if(WIN32) +if(MINGW) + hunter_pick_scheme(DEFAULT url_sha1_openssl) +elseif(WIN32) if("${HUNTER_OpenSSL_VERSION}" VERSION_LESS "1.1") hunter_pick_scheme(DEFAULT url_sha1_openssl_windows) else() @@ -262,5 +310,12 @@ else() hunter_pick_scheme(DEFAULT url_sha1_openssl) endif() +if(MINGW) + hunter_check_toolchain_definition(NAME "__MINGW64__" DEFINED _hunter_mingw64) + if(_hunter_mingw64) + hunter_cmake_args(OpenSSL CMAKE_ARGS HUNTER_OPENSSL_MINGW64=TRUE) + endif() +endif() + hunter_cacheable(OpenSSL) -hunter_download(PACKAGE_NAME OpenSSL PACKAGE_INTERNAL_DEPS_ID 6) +hunter_download(PACKAGE_NAME OpenSSL PACKAGE_INTERNAL_DEPS_ID "14") diff --git a/cmake/projects/OpenSSL/schemes/url_sha1_openssl.cmake.in b/cmake/projects/OpenSSL/schemes/url_sha1_openssl.cmake.in index 8853c47e3b..7a121ca5e0 100644 --- a/cmake/projects/OpenSSL/schemes/url_sha1_openssl.cmake.in +++ b/cmake/projects/OpenSSL/schemes/url_sha1_openssl.cmake.in @@ -11,6 +11,7 @@ include(ExternalProject) # ExternalProject_Add list(APPEND CMAKE_MODULE_PATH "@HUNTER_SELF@/cmake/modules") include(hunter_dump_cmake_flags) +include(hunter_pick_archiver) include(hunter_status_debug) include(hunter_test_string_not_empty) include(hunter_user_error) @@ -31,6 +32,22 @@ hunter_test_string_not_empty("@HUNTER_GLOBAL_SCRIPT_DIR@") if(APPLE) set(configure_command "./Configure") set(configure_opts "darwin64-x86_64-cc") +elseif(ANDROID OR RASPBERRY_PI) + # -> CMAKE_AR + # -> CMAKE_RANLIB + hunter_pick_archiver() + + # Using the ./config script is currently broken with -no* CFLAGS on ALL versions + # * https://github.com/openssl/openssl/issues/3493 + # * https://github.com/openssl/openssl/blob/OpenSSL_1_1_0-stable/Configure#L560 + # * https://wiki.openssl.org/index.php/Compilation_and_Installation#Configure_.26_Config + set(configure_command AR=${CMAKE_AR} RANLIB=${CMAKE_RANLIB} "./Configure") +elseif(MINGW) + if(HUNTER_OPENSSL_MINGW64) + set(configure_command "./Configure" mingw64) + else() + set(configure_command "./Configure" mingw) + endif() else() set(configure_command "./config") endif() @@ -49,16 +66,36 @@ if(ANDROID) else() hunter_user_error("Could not find android architecture. Please set ANDROID_ARCH_NAME in your toolchain or use CMake 3.7+") endif() - set(configure_command - # Ignored. Prevents script from checking host uname - RELEASE=2.6.37 - SYSTEM=android - ARCH=${ANDROID_SSL_ARCH} - ${configure_command}) + + # Building OpenSSL with Android: + # * https://wiki.openssl.org/index.php/Android#Build_the_OpenSSL_Library + # Set environment variables similar to 'setenv-android.sh' script: + # * https://wiki.openssl.org/index.php/Android#Adjust_the_Cross-Compile_Script + + # Using documented method (./config script): + #set(configure_command + # Ignored. Prevents ./config from checking host uname + # RELEASE=2.6.37 + # SYSTEM=android + # ARCH=${CMAKE_ANDROID_ARCH} + # ${configure_command}) + + # Using android-* targets is currently broken for Clang on ALL versions + # * https://github.com/openssl/openssl/pull/2229 + # The ./config script only detects Android x86 and armv7 targets anyway. + # * https://github.com/openssl/openssl/issues/2490 + if (ANDROID_SSL_ARCH MATCHES "mips64|arm64|x86_64") + set(configure_opts "linux-generic64") + else() + set(configure_opts "linux-generic32") + endif() + list(APPEND configure_opts "-latomic") +elseif(RASPBERRY_PI) + set(configure_opts "linux-generic32") endif() # Pass C compiler through -set(configure_command +set(configure_command MACHINE=${CMAKE_SYSTEM_PROCESSOR} CC=${CMAKE_C_COMPILER} ${configure_command}) @@ -72,7 +109,13 @@ set( ) set(build_command . "@HUNTER_GLOBAL_SCRIPT_DIR@/clear-all.sh" && make) -set(configure_opts ${configure_opts} threads no-shared) +if (BUILD_SHARED_LIBS) + set(shared_flag shared) +else() + set(shared_flag no-shared) +endif() + +set(configure_opts ${configure_opts} threads ${shared_flag}) ExternalProject_Add( "@HUNTER_EP_NAME@" diff --git a/cmake/projects/OpenSSL/schemes/url_sha1_openssl_ios.cmake.in b/cmake/projects/OpenSSL/schemes/url_sha1_openssl_ios.cmake.in index 63bf11cda2..db88ce72c9 100644 --- a/cmake/projects/OpenSSL/schemes/url_sha1_openssl_ios.cmake.in +++ b/cmake/projects/OpenSSL/schemes/url_sha1_openssl_ios.cmake.in @@ -10,6 +10,7 @@ include(ExternalProject) # ExternalProject_Add list(APPEND CMAKE_MODULE_PATH "@HUNTER_SELF@/cmake/modules") +include(hunter_dump_cmake_flags) include(hunter_status_debug) include(hunter_test_string_not_empty) include(hunter_unsetvar) @@ -33,9 +34,17 @@ hunter_test_string_not_empty("@IOS_SDK_VERSION@") hunter_test_string_not_empty("@IPHONESIMULATOR_ROOT@") hunter_test_string_not_empty("@IPHONEOS_ROOT@") +hunter_dump_cmake_flags(SKIP_INCLUDES) +# -> CMAKE_CXX_FLAGS +# -> CMAKE_C_FLAGS + hunter_unsetvar(ssl_input_libraries) hunter_unsetvar(crypto_input_libraries) +set(configure_opts iphoneos-cross threads no-shared) +# Pass C flags through +set(configure_opts ${configure_opts} ${CMAKE_C_FLAGS}) + foreach(arch @IPHONEOS_ARCHS@ @IPHONESIMULATOR_ARCHS@) list( APPEND @@ -83,11 +92,9 @@ foreach(variant @IPHONEOS_ARCHS@ @IPHONESIMULATOR_ARCHS@) set(iphoneos_archs @IPHONEOS_ARCHS@) list(FIND iphoneos_archs ${variant} find_index) if(find_index EQUAL -1) - set(iphone_minversion "-miphoneos-version-min=@IOS_SDK_VERSION@") set(CROSS_TOP "@IPHONESIMULATOR_ROOT@") set(CROSS_SDK "iPhoneSimulator@IOS_SDK_VERSION@.sdk") else() - set(iphone_minversion "") set(CROSS_TOP "@IPHONEOS_ROOT@") set(CROSS_SDK "iPhoneOS@IOS_SDK_VERSION@.sdk") endif() @@ -116,12 +123,10 @@ foreach(variant @IPHONEOS_ARCHS@ @IPHONESIMULATOR_ARCHS@) # not used, just avoid creating Install/ empty directory CONFIGURE_COMMAND ./Configure - iphoneos-cross - threads - no-shared + "${configure_opts}" "${noasm}" + "no-async" "--prefix=@HUNTER_PACKAGE_INSTALL_PREFIX@" - "${iphone_minversion}" "-arch ${variant}" BUILD_COMMAND . "@HUNTER_GLOBAL_SCRIPT_DIR@/clear-all.sh" && diff --git a/cmake/projects/PocoCpp/hunter.cmake b/cmake/projects/PocoCpp/hunter.cmake index 136b69b6fb..e847256476 100644 --- a/cmake/projects/PocoCpp/hunter.cmake +++ b/cmake/projects/PocoCpp/hunter.cmake @@ -4,6 +4,17 @@ include(hunter_pick_scheme) include(hunter_cacheable) include(hunter_download) +hunter_add_version( + PACKAGE_NAME + PocoCpp + VERSION + 1.7.8-p0 + URL + "https://github.com/hunter-packages/poco/archive/v1.7.8-p0.zip" + SHA1 + 229dd0f6c3696c2ab0c7b4449b664a75c2211188 +) + hunter_add_version( PACKAGE_NAME PocoCpp diff --git a/cmake/projects/PostgreSQL/hunter.cmake b/cmake/projects/PostgreSQL/hunter.cmake index 0d0634d192..b0eabb15fc 100644 --- a/cmake/projects/PostgreSQL/hunter.cmake +++ b/cmake/projects/PostgreSQL/hunter.cmake @@ -8,6 +8,18 @@ include(hunter_cacheable) include(hunter_configuration_types) include(hunter_pick_scheme) include(hunter_download) +include(hunter_cmake_args) + +hunter_add_version( + PACKAGE_NAME + PostgreSQL + VERSION + "9.6.3" + URL + "https://github.com/hunter-packages/PostgreSQL/archive/PostgreSQL-9.6.3.tar.gz" + SHA1 + 103d31238ef688295960082619968bda4aa01163 +) hunter_add_version( PACKAGE_NAME @@ -31,7 +43,9 @@ endif() hunter_configuration_types(PostgreSQL CONFIGURATION_TYPES Release) hunter_pick_scheme(DEFAULT url_sha1_autotools) hunter_cacheable(PostgreSQL) -hunter_download(PACKAGE_NAME PostgreSQL +hunter_download( + PACKAGE_NAME PostgreSQL + PACKAGE_INTERNAL_DEPS_ID "1" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/libecpg.pc" "lib/pkgconfig/libecpg_compat.pc" @@ -39,4 +53,3 @@ hunter_download(PACKAGE_NAME PostgreSQL "lib/pkgconfig/libpq.pc" "lib/postgresql/pgxs/src/Makefile.global" ) - diff --git a/cmake/projects/Protobuf/hunter.cmake b/cmake/projects/Protobuf/hunter.cmake index 6ac16b4ca2..fbe0b76edf 100644 --- a/cmake/projects/Protobuf/hunter.cmake +++ b/cmake/projects/Protobuf/hunter.cmake @@ -14,7 +14,7 @@ hunter_add_version( URL "https://github.com/hunter-packages/protobuf/archive/v3.0.0-hunter-3.tar.gz" SHA1 - e3d5ab642e0295d16b86a4a55e06c3ee026ff249 + 242443553ca20ab279427330e175a3c33ecbf265 ) hunter_add_version( @@ -25,7 +25,7 @@ hunter_add_version( URL "https://github.com/hunter-packages/protobuf/archive/v3.0.0-hunter-2.tar.gz" SHA1 - 6fb368b171aa10f612d777f079d6896f37b85c55 + d1fa1592e05ab6ff3e4dbbcd9dfd9768a26ba94a ) hunter_add_version( @@ -36,7 +36,7 @@ hunter_add_version( URL "https://github.com/hunter-packages/protobuf/archive/v3.0.0-beta-2-hunter-1.tar.gz" SHA1 - 15752454ef0cf119b58136e2f4ffe97baeaf07cd + d43d0d6bbfd3b65539ca467e2bcb0f7eeeb6a9d9 ) hunter_add_version( @@ -47,7 +47,7 @@ hunter_add_version( URL "https://github.com/hunter-packages/protobuf/archive/v3.0.0-beta-2-hunter-2.tar.gz" SHA1 - dbae4995254f351918d0462b308b561dbab71b3f + f91766a391284b7ccd192fa36bc3f09449b3c202 ) if(ANDROID OR IOS) diff --git a/cmake/projects/Qt/generate.sh b/cmake/projects/Qt/generate.sh index 78e123257e..aca126c7a3 100755 --- a/cmake/projects/Qt/generate.sh +++ b/cmake/projects/Qt/generate.sh @@ -15,24 +15,40 @@ QT_LIBS=" qtandroidextras qtbase qtcanvas3d + qtcharts qtconnectivity + qtdatavis3d qtdeclarative qtdoc + qtdocgallery qtenginio + qtfeedback + qtgamepad qtgraphicaleffects qtimageformats qtlocation qtmacextras qtmultimedia + qtnetworkauth + qtpim + qtpurchasing + qtqa qtquick1 qtquickcontrols qtquickcontrols2 + qtremoteobjects + qtrepotools qtscript + qtscxml qtsensors + qtserialbus qtserialport + qtspeech qtsvg + qtsystems qttools qttranslations + qtvirtualkeyboard qtwayland qtwebchannel qtwebengine diff --git a/cmake/projects/Qt/hunter.cmake b/cmake/projects/Qt/hunter.cmake index 6c8bea5b82..3f1dedf47b 100644 --- a/cmake/projects/Qt/hunter.cmake +++ b/cmake/projects/Qt/hunter.cmake @@ -215,6 +215,17 @@ hunter_add_version( d902b7df94219d2ed2f5c868839c85ce9daa056a ) +hunter_add_version( + PACKAGE_NAME + Qt + VERSION + "5.9.1-p0" + URL + "https://github.com/hunter-packages/Qt/releases/download/v5.9.1-p0/hunter-5.9.1.7z" + SHA1 + b1bc254e688426316b55115adddd13e4a10115b2 +) + hunter_cacheable(Qt) if(NOT APPLE AND NOT WIN32) @@ -236,6 +247,21 @@ if(IOS) endif() endif() +if(CMAKE_VERSION VERSION_LESS 3.6) + # QtCMakeExtra modules (https://github.com/hunter-packages/QtCMakeExtra) installed + # near the Qt CMake modules and loaded by `file(GLOB)`: + # * https://github.com/qt/qtbase/blob/441ad9b938d453ccf5bff8867e7d3e6e432f9eba/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in#L352 + # + # Before CMake 3.6 file(GLOB) order is not predictable and QtCMakeExtra will not work + # because they are expected to load last. + # + # file(GLOB) sorted since CMake 3.6: + # * https://gitlab.kitware.com/cmake/cmake/commit/edcccde7d65944b3744c4567bd1d452211829702 + hunter_report_broken_package( + "CMake 3.6+ expected for Qt package (current version is ${CMAKE_VERSION}." + ) +endif() + include("${CMAKE_CURRENT_LIST_DIR}/qtbase/hunter.cmake") hunter_add_package(QtCMakeExtra) diff --git a/cmake/projects/Qt/hunter.cmake.in b/cmake/projects/Qt/hunter.cmake.in index f7e02d73ae..a70977740c 100644 --- a/cmake/projects/Qt/hunter.cmake.in +++ b/cmake/projects/Qt/hunter.cmake.in @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,12 +21,58 @@ if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) endif() ## -- end -## 5.6 only -- +## 5.6+ only -- string(COMPARE EQUAL "@qt_component@" "qtquickcontrol2" _is_qtquickcontrols2) string(COMPARE EQUAL "@qt_component@" "qtwebview" _is_qtwebview) if(_is_qtquickcontrols2 OR _is_qtwebview) - if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "@qt_component@" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "@qt_component@" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "@qt_component@" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "@qt_component@" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "@qt_component@" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "@qt_component@" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "@qt_component@" "qtpim" _is_qtpim) +string(COMPARE EQUAL "@qt_component@" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "@qt_component@" "qtqa" _is_qtqa) +string(COMPARE EQUAL "@qt_component@" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "@qt_component@" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "@qt_component@" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "@qt_component@" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "@qt_component@" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "@qt_component@" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "@qt_component@" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") return() endif() endif() diff --git a/cmake/projects/Qt/qt3d/hunter.cmake b/cmake/projects/Qt/qt3d/hunter.cmake index fa8d10cc66..66d4a31119 100644 --- a/cmake/projects/Qt/qt3d/hunter.cmake +++ b/cmake/projects/Qt/qt3d/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,12 +21,58 @@ if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) endif() ## -- end -## 5.6 only -- +## 5.6+ only -- string(COMPARE EQUAL "qt3d" "qtquickcontrol2" _is_qtquickcontrols2) string(COMPARE EQUAL "qt3d" "qtwebview" _is_qtwebview) if(_is_qtquickcontrols2 OR _is_qtwebview) - if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qt3d" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qt3d" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qt3d" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qt3d" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qt3d" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qt3d" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qt3d" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qt3d" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qt3d" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qt3d" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qt3d" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qt3d" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qt3d" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qt3d" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qt3d" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qt3d" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") return() endif() endif() diff --git a/cmake/projects/Qt/qtactiveqt/hunter.cmake b/cmake/projects/Qt/qtactiveqt/hunter.cmake index e63b2f7e92..6d6770bb8a 100644 --- a/cmake/projects/Qt/qtactiveqt/hunter.cmake +++ b/cmake/projects/Qt/qtactiveqt/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,12 +21,58 @@ if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) endif() ## -- end -## 5.6 only -- +## 5.6+ only -- string(COMPARE EQUAL "qtactiveqt" "qtquickcontrol2" _is_qtquickcontrols2) string(COMPARE EQUAL "qtactiveqt" "qtwebview" _is_qtwebview) if(_is_qtquickcontrols2 OR _is_qtwebview) - if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtactiveqt" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtactiveqt" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtactiveqt" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtactiveqt" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtactiveqt" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtactiveqt" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtactiveqt" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtactiveqt" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtactiveqt" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtactiveqt" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtactiveqt" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtactiveqt" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtactiveqt" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtactiveqt" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtactiveqt" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtactiveqt" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") return() endif() endif() diff --git a/cmake/projects/Qt/qtandroidextras/hunter.cmake b/cmake/projects/Qt/qtandroidextras/hunter.cmake index e744caaa2a..f1c0e7a91c 100644 --- a/cmake/projects/Qt/qtandroidextras/hunter.cmake +++ b/cmake/projects/Qt/qtandroidextras/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,12 +21,58 @@ if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) endif() ## -- end -## 5.6 only -- +## 5.6+ only -- string(COMPARE EQUAL "qtandroidextras" "qtquickcontrol2" _is_qtquickcontrols2) string(COMPARE EQUAL "qtandroidextras" "qtwebview" _is_qtwebview) if(_is_qtquickcontrols2 OR _is_qtwebview) - if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtandroidextras" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtandroidextras" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtandroidextras" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtandroidextras" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtandroidextras" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtandroidextras" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtandroidextras" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtandroidextras" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtandroidextras" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtandroidextras" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtandroidextras" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtandroidextras" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtandroidextras" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtandroidextras" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtandroidextras" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtandroidextras" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") return() endif() endif() diff --git a/cmake/projects/Qt/qtbase/hunter.cmake b/cmake/projects/Qt/qtbase/hunter.cmake index aa7f456466..bb0d328cac 100644 --- a/cmake/projects/Qt/qtbase/hunter.cmake +++ b/cmake/projects/Qt/qtbase/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,12 +21,58 @@ if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) endif() ## -- end -## 5.6 only -- +## 5.6+ only -- string(COMPARE EQUAL "qtbase" "qtquickcontrol2" _is_qtquickcontrols2) string(COMPARE EQUAL "qtbase" "qtwebview" _is_qtwebview) if(_is_qtquickcontrols2 OR _is_qtwebview) - if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtbase" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtbase" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtbase" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtbase" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtbase" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtbase" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtbase" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtbase" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtbase" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtbase" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtbase" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtbase" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtbase" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtbase" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtbase" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtbase" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") return() endif() endif() diff --git a/cmake/projects/Qt/qtcanvas3d/hunter.cmake b/cmake/projects/Qt/qtcanvas3d/hunter.cmake index a25101ff93..92644e7b38 100644 --- a/cmake/projects/Qt/qtcanvas3d/hunter.cmake +++ b/cmake/projects/Qt/qtcanvas3d/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,12 +21,58 @@ if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) endif() ## -- end -## 5.6 only -- +## 5.6+ only -- string(COMPARE EQUAL "qtcanvas3d" "qtquickcontrol2" _is_qtquickcontrols2) string(COMPARE EQUAL "qtcanvas3d" "qtwebview" _is_qtwebview) if(_is_qtquickcontrols2 OR _is_qtwebview) - if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtcanvas3d" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtcanvas3d" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtcanvas3d" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtcanvas3d" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtcanvas3d" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtcanvas3d" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtcanvas3d" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtcanvas3d" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtcanvas3d" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtcanvas3d" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtcanvas3d" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtcanvas3d" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtcanvas3d" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtcanvas3d" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtcanvas3d" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtcanvas3d" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") return() endif() endif() diff --git a/cmake/projects/Qt/qtcharts/hunter.cmake b/cmake/projects/Qt/qtcharts/hunter.cmake new file mode 100644 index 0000000000..5f0bb0a8e0 --- /dev/null +++ b/cmake/projects/Qt/qtcharts/hunter.cmake @@ -0,0 +1,138 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_package) +include(hunter_download) +include(hunter_generate_qt_info) +include(hunter_pick_scheme) +include(hunter_status_debug) + +## 5.5 only -- +string(COMPARE EQUAL "qtcharts" "qtquick1" _is_qtquick1) +string(COMPARE EQUAL "qtcharts" "qtwebkit" _is_qtwebkit) +string(COMPARE EQUAL "qtcharts" "qtwebkit-examples" _is_qtwebkit_examples) + +if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.5\\.") + return() + endif() +endif() +## -- end + +## 5.6+ only -- +string(COMPARE EQUAL "qtcharts" "qtquickcontrol2" _is_qtquickcontrols2) +string(COMPARE EQUAL "qtcharts" "qtwebview" _is_qtwebview) + +if(_is_qtquickcontrols2 OR _is_qtwebview) + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtcharts" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtcharts" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtcharts" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtcharts" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtcharts" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtcharts" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtcharts" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtcharts" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtcharts" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtcharts" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtcharts" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtcharts" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtcharts" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtcharts" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtcharts" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtcharts" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + return() + endif() +endif() +## -- end + +if(NOT _HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES) + # '_depends_on' will return **all** dependencies of the component so there is + # no need to traverse them recursively (optimization) + hunter_generate_qt_info( + "qtcharts" + _unused_toskip + _depends_on + _unused_nobuild + "${HUNTER_Qt_VERSION}" + "${ANDROID}" + "${WIN32}" + ) + + set(_HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES TRUE) + foreach(_x ${_depends_on}) + hunter_add_package(Qt COMPONENTS ${_x}) + endforeach() + set(_HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES FALSE) +endif() + +# We should call this function again since hunter_add_package is include-like +# instruction, i.e. will overwrite variable values (foreach's _x will survive) +hunter_generate_qt_info( + "qtcharts" + _unused_toskip + _unused_depends_on + _nobuild + "${HUNTER_Qt_VERSION}" + "${ANDROID}" + "${WIN32}" +) + +list(FIND _nobuild "qtcharts" _dont_build_it) +if(NOT _dont_build_it EQUAL -1) + hunter_status_debug( + "Qt component doesn't install anything and will be skipped: qtcharts" + ) + return() +endif() + +string(COMPARE EQUAL "qtcharts" "qtdeclarative" _is_qtdeclarative) +if(WIN32 AND _is_qtdeclarative) + find_program(_python_path NAME "python" PATHS ENV PATH) + if(NOT _python_path) + hunter_user_error( + "Python not found in PATH:\n $ENV{PATH}\n" + "Python required for building Qt component (qtdeclarative):\n" + " http://doc.qt.io/qt-5/windows-requirements.html" + ) + endif() +endif() + +hunter_pick_scheme(DEFAULT url_sha1_qt) +hunter_download( + PACKAGE_NAME Qt + PACKAGE_COMPONENT "qtcharts" + PACKAGE_INTERNAL_DEPS_ID "10" +) diff --git a/cmake/projects/Qt/qtconnectivity/hunter.cmake b/cmake/projects/Qt/qtconnectivity/hunter.cmake index ac12020bc3..a55ce1963d 100644 --- a/cmake/projects/Qt/qtconnectivity/hunter.cmake +++ b/cmake/projects/Qt/qtconnectivity/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,12 +21,58 @@ if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) endif() ## -- end -## 5.6 only -- +## 5.6+ only -- string(COMPARE EQUAL "qtconnectivity" "qtquickcontrol2" _is_qtquickcontrols2) string(COMPARE EQUAL "qtconnectivity" "qtwebview" _is_qtwebview) if(_is_qtquickcontrols2 OR _is_qtwebview) - if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtconnectivity" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtconnectivity" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtconnectivity" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtconnectivity" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtconnectivity" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtconnectivity" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtconnectivity" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtconnectivity" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtconnectivity" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtconnectivity" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtconnectivity" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtconnectivity" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtconnectivity" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtconnectivity" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtconnectivity" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtconnectivity" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") return() endif() endif() diff --git a/cmake/projects/Qt/qtdatavis3d/hunter.cmake b/cmake/projects/Qt/qtdatavis3d/hunter.cmake new file mode 100644 index 0000000000..2fe8d601e4 --- /dev/null +++ b/cmake/projects/Qt/qtdatavis3d/hunter.cmake @@ -0,0 +1,138 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_package) +include(hunter_download) +include(hunter_generate_qt_info) +include(hunter_pick_scheme) +include(hunter_status_debug) + +## 5.5 only -- +string(COMPARE EQUAL "qtdatavis3d" "qtquick1" _is_qtquick1) +string(COMPARE EQUAL "qtdatavis3d" "qtwebkit" _is_qtwebkit) +string(COMPARE EQUAL "qtdatavis3d" "qtwebkit-examples" _is_qtwebkit_examples) + +if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.5\\.") + return() + endif() +endif() +## -- end + +## 5.6+ only -- +string(COMPARE EQUAL "qtdatavis3d" "qtquickcontrol2" _is_qtquickcontrols2) +string(COMPARE EQUAL "qtdatavis3d" "qtwebview" _is_qtwebview) + +if(_is_qtquickcontrols2 OR _is_qtwebview) + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtdatavis3d" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtdatavis3d" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtdatavis3d" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtdatavis3d" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtdatavis3d" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtdatavis3d" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtdatavis3d" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtdatavis3d" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtdatavis3d" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtdatavis3d" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtdatavis3d" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtdatavis3d" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtdatavis3d" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtdatavis3d" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtdatavis3d" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtdatavis3d" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + return() + endif() +endif() +## -- end + +if(NOT _HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES) + # '_depends_on' will return **all** dependencies of the component so there is + # no need to traverse them recursively (optimization) + hunter_generate_qt_info( + "qtdatavis3d" + _unused_toskip + _depends_on + _unused_nobuild + "${HUNTER_Qt_VERSION}" + "${ANDROID}" + "${WIN32}" + ) + + set(_HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES TRUE) + foreach(_x ${_depends_on}) + hunter_add_package(Qt COMPONENTS ${_x}) + endforeach() + set(_HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES FALSE) +endif() + +# We should call this function again since hunter_add_package is include-like +# instruction, i.e. will overwrite variable values (foreach's _x will survive) +hunter_generate_qt_info( + "qtdatavis3d" + _unused_toskip + _unused_depends_on + _nobuild + "${HUNTER_Qt_VERSION}" + "${ANDROID}" + "${WIN32}" +) + +list(FIND _nobuild "qtdatavis3d" _dont_build_it) +if(NOT _dont_build_it EQUAL -1) + hunter_status_debug( + "Qt component doesn't install anything and will be skipped: qtdatavis3d" + ) + return() +endif() + +string(COMPARE EQUAL "qtdatavis3d" "qtdeclarative" _is_qtdeclarative) +if(WIN32 AND _is_qtdeclarative) + find_program(_python_path NAME "python" PATHS ENV PATH) + if(NOT _python_path) + hunter_user_error( + "Python not found in PATH:\n $ENV{PATH}\n" + "Python required for building Qt component (qtdeclarative):\n" + " http://doc.qt.io/qt-5/windows-requirements.html" + ) + endif() +endif() + +hunter_pick_scheme(DEFAULT url_sha1_qt) +hunter_download( + PACKAGE_NAME Qt + PACKAGE_COMPONENT "qtdatavis3d" + PACKAGE_INTERNAL_DEPS_ID "10" +) diff --git a/cmake/projects/Qt/qtdeclarative/hunter.cmake b/cmake/projects/Qt/qtdeclarative/hunter.cmake index 445a9c0d71..6a7b73fb14 100644 --- a/cmake/projects/Qt/qtdeclarative/hunter.cmake +++ b/cmake/projects/Qt/qtdeclarative/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,12 +21,58 @@ if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) endif() ## -- end -## 5.6 only -- +## 5.6+ only -- string(COMPARE EQUAL "qtdeclarative" "qtquickcontrol2" _is_qtquickcontrols2) string(COMPARE EQUAL "qtdeclarative" "qtwebview" _is_qtwebview) if(_is_qtquickcontrols2 OR _is_qtwebview) - if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtdeclarative" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtdeclarative" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtdeclarative" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtdeclarative" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtdeclarative" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtdeclarative" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtdeclarative" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtdeclarative" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtdeclarative" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtdeclarative" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtdeclarative" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtdeclarative" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtdeclarative" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtdeclarative" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtdeclarative" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtdeclarative" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") return() endif() endif() diff --git a/cmake/projects/Qt/qtdoc/hunter.cmake b/cmake/projects/Qt/qtdoc/hunter.cmake index cdb7664a65..38c3b2def7 100644 --- a/cmake/projects/Qt/qtdoc/hunter.cmake +++ b/cmake/projects/Qt/qtdoc/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,12 +21,58 @@ if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) endif() ## -- end -## 5.6 only -- +## 5.6+ only -- string(COMPARE EQUAL "qtdoc" "qtquickcontrol2" _is_qtquickcontrols2) string(COMPARE EQUAL "qtdoc" "qtwebview" _is_qtwebview) if(_is_qtquickcontrols2 OR _is_qtwebview) - if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtdoc" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtdoc" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtdoc" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtdoc" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtdoc" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtdoc" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtdoc" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtdoc" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtdoc" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtdoc" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtdoc" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtdoc" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtdoc" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtdoc" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtdoc" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtdoc" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") return() endif() endif() diff --git a/cmake/projects/Qt/qtdocgallery/hunter.cmake b/cmake/projects/Qt/qtdocgallery/hunter.cmake new file mode 100644 index 0000000000..429eb755e2 --- /dev/null +++ b/cmake/projects/Qt/qtdocgallery/hunter.cmake @@ -0,0 +1,138 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_package) +include(hunter_download) +include(hunter_generate_qt_info) +include(hunter_pick_scheme) +include(hunter_status_debug) + +## 5.5 only -- +string(COMPARE EQUAL "qtdocgallery" "qtquick1" _is_qtquick1) +string(COMPARE EQUAL "qtdocgallery" "qtwebkit" _is_qtwebkit) +string(COMPARE EQUAL "qtdocgallery" "qtwebkit-examples" _is_qtwebkit_examples) + +if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.5\\.") + return() + endif() +endif() +## -- end + +## 5.6+ only -- +string(COMPARE EQUAL "qtdocgallery" "qtquickcontrol2" _is_qtquickcontrols2) +string(COMPARE EQUAL "qtdocgallery" "qtwebview" _is_qtwebview) + +if(_is_qtquickcontrols2 OR _is_qtwebview) + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtdocgallery" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtdocgallery" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtdocgallery" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtdocgallery" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtdocgallery" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtdocgallery" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtdocgallery" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtdocgallery" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtdocgallery" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtdocgallery" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtdocgallery" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtdocgallery" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtdocgallery" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtdocgallery" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtdocgallery" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtdocgallery" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + return() + endif() +endif() +## -- end + +if(NOT _HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES) + # '_depends_on' will return **all** dependencies of the component so there is + # no need to traverse them recursively (optimization) + hunter_generate_qt_info( + "qtdocgallery" + _unused_toskip + _depends_on + _unused_nobuild + "${HUNTER_Qt_VERSION}" + "${ANDROID}" + "${WIN32}" + ) + + set(_HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES TRUE) + foreach(_x ${_depends_on}) + hunter_add_package(Qt COMPONENTS ${_x}) + endforeach() + set(_HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES FALSE) +endif() + +# We should call this function again since hunter_add_package is include-like +# instruction, i.e. will overwrite variable values (foreach's _x will survive) +hunter_generate_qt_info( + "qtdocgallery" + _unused_toskip + _unused_depends_on + _nobuild + "${HUNTER_Qt_VERSION}" + "${ANDROID}" + "${WIN32}" +) + +list(FIND _nobuild "qtdocgallery" _dont_build_it) +if(NOT _dont_build_it EQUAL -1) + hunter_status_debug( + "Qt component doesn't install anything and will be skipped: qtdocgallery" + ) + return() +endif() + +string(COMPARE EQUAL "qtdocgallery" "qtdeclarative" _is_qtdeclarative) +if(WIN32 AND _is_qtdeclarative) + find_program(_python_path NAME "python" PATHS ENV PATH) + if(NOT _python_path) + hunter_user_error( + "Python not found in PATH:\n $ENV{PATH}\n" + "Python required for building Qt component (qtdeclarative):\n" + " http://doc.qt.io/qt-5/windows-requirements.html" + ) + endif() +endif() + +hunter_pick_scheme(DEFAULT url_sha1_qt) +hunter_download( + PACKAGE_NAME Qt + PACKAGE_COMPONENT "qtdocgallery" + PACKAGE_INTERNAL_DEPS_ID "10" +) diff --git a/cmake/projects/Qt/qtenginio/hunter.cmake b/cmake/projects/Qt/qtenginio/hunter.cmake index 6c1c1e6b6c..b95dc91990 100644 --- a/cmake/projects/Qt/qtenginio/hunter.cmake +++ b/cmake/projects/Qt/qtenginio/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,12 +21,58 @@ if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) endif() ## -- end -## 5.6 only -- +## 5.6+ only -- string(COMPARE EQUAL "qtenginio" "qtquickcontrol2" _is_qtquickcontrols2) string(COMPARE EQUAL "qtenginio" "qtwebview" _is_qtwebview) if(_is_qtquickcontrols2 OR _is_qtwebview) - if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtenginio" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtenginio" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtenginio" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtenginio" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtenginio" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtenginio" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtenginio" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtenginio" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtenginio" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtenginio" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtenginio" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtenginio" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtenginio" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtenginio" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtenginio" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtenginio" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") return() endif() endif() diff --git a/cmake/projects/Qt/qtfeedback/hunter.cmake b/cmake/projects/Qt/qtfeedback/hunter.cmake new file mode 100644 index 0000000000..a3d845a1a2 --- /dev/null +++ b/cmake/projects/Qt/qtfeedback/hunter.cmake @@ -0,0 +1,138 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_package) +include(hunter_download) +include(hunter_generate_qt_info) +include(hunter_pick_scheme) +include(hunter_status_debug) + +## 5.5 only -- +string(COMPARE EQUAL "qtfeedback" "qtquick1" _is_qtquick1) +string(COMPARE EQUAL "qtfeedback" "qtwebkit" _is_qtwebkit) +string(COMPARE EQUAL "qtfeedback" "qtwebkit-examples" _is_qtwebkit_examples) + +if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.5\\.") + return() + endif() +endif() +## -- end + +## 5.6+ only -- +string(COMPARE EQUAL "qtfeedback" "qtquickcontrol2" _is_qtquickcontrols2) +string(COMPARE EQUAL "qtfeedback" "qtwebview" _is_qtwebview) + +if(_is_qtquickcontrols2 OR _is_qtwebview) + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtfeedback" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtfeedback" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtfeedback" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtfeedback" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtfeedback" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtfeedback" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtfeedback" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtfeedback" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtfeedback" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtfeedback" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtfeedback" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtfeedback" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtfeedback" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtfeedback" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtfeedback" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtfeedback" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + return() + endif() +endif() +## -- end + +if(NOT _HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES) + # '_depends_on' will return **all** dependencies of the component so there is + # no need to traverse them recursively (optimization) + hunter_generate_qt_info( + "qtfeedback" + _unused_toskip + _depends_on + _unused_nobuild + "${HUNTER_Qt_VERSION}" + "${ANDROID}" + "${WIN32}" + ) + + set(_HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES TRUE) + foreach(_x ${_depends_on}) + hunter_add_package(Qt COMPONENTS ${_x}) + endforeach() + set(_HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES FALSE) +endif() + +# We should call this function again since hunter_add_package is include-like +# instruction, i.e. will overwrite variable values (foreach's _x will survive) +hunter_generate_qt_info( + "qtfeedback" + _unused_toskip + _unused_depends_on + _nobuild + "${HUNTER_Qt_VERSION}" + "${ANDROID}" + "${WIN32}" +) + +list(FIND _nobuild "qtfeedback" _dont_build_it) +if(NOT _dont_build_it EQUAL -1) + hunter_status_debug( + "Qt component doesn't install anything and will be skipped: qtfeedback" + ) + return() +endif() + +string(COMPARE EQUAL "qtfeedback" "qtdeclarative" _is_qtdeclarative) +if(WIN32 AND _is_qtdeclarative) + find_program(_python_path NAME "python" PATHS ENV PATH) + if(NOT _python_path) + hunter_user_error( + "Python not found in PATH:\n $ENV{PATH}\n" + "Python required for building Qt component (qtdeclarative):\n" + " http://doc.qt.io/qt-5/windows-requirements.html" + ) + endif() +endif() + +hunter_pick_scheme(DEFAULT url_sha1_qt) +hunter_download( + PACKAGE_NAME Qt + PACKAGE_COMPONENT "qtfeedback" + PACKAGE_INTERNAL_DEPS_ID "10" +) diff --git a/cmake/projects/Qt/qtgamepad/hunter.cmake b/cmake/projects/Qt/qtgamepad/hunter.cmake new file mode 100644 index 0000000000..bdcc9784f5 --- /dev/null +++ b/cmake/projects/Qt/qtgamepad/hunter.cmake @@ -0,0 +1,138 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_package) +include(hunter_download) +include(hunter_generate_qt_info) +include(hunter_pick_scheme) +include(hunter_status_debug) + +## 5.5 only -- +string(COMPARE EQUAL "qtgamepad" "qtquick1" _is_qtquick1) +string(COMPARE EQUAL "qtgamepad" "qtwebkit" _is_qtwebkit) +string(COMPARE EQUAL "qtgamepad" "qtwebkit-examples" _is_qtwebkit_examples) + +if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.5\\.") + return() + endif() +endif() +## -- end + +## 5.6+ only -- +string(COMPARE EQUAL "qtgamepad" "qtquickcontrol2" _is_qtquickcontrols2) +string(COMPARE EQUAL "qtgamepad" "qtwebview" _is_qtwebview) + +if(_is_qtquickcontrols2 OR _is_qtwebview) + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtgamepad" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtgamepad" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtgamepad" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtgamepad" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtgamepad" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtgamepad" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtgamepad" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtgamepad" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtgamepad" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtgamepad" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtgamepad" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtgamepad" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtgamepad" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtgamepad" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtgamepad" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtgamepad" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + return() + endif() +endif() +## -- end + +if(NOT _HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES) + # '_depends_on' will return **all** dependencies of the component so there is + # no need to traverse them recursively (optimization) + hunter_generate_qt_info( + "qtgamepad" + _unused_toskip + _depends_on + _unused_nobuild + "${HUNTER_Qt_VERSION}" + "${ANDROID}" + "${WIN32}" + ) + + set(_HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES TRUE) + foreach(_x ${_depends_on}) + hunter_add_package(Qt COMPONENTS ${_x}) + endforeach() + set(_HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES FALSE) +endif() + +# We should call this function again since hunter_add_package is include-like +# instruction, i.e. will overwrite variable values (foreach's _x will survive) +hunter_generate_qt_info( + "qtgamepad" + _unused_toskip + _unused_depends_on + _nobuild + "${HUNTER_Qt_VERSION}" + "${ANDROID}" + "${WIN32}" +) + +list(FIND _nobuild "qtgamepad" _dont_build_it) +if(NOT _dont_build_it EQUAL -1) + hunter_status_debug( + "Qt component doesn't install anything and will be skipped: qtgamepad" + ) + return() +endif() + +string(COMPARE EQUAL "qtgamepad" "qtdeclarative" _is_qtdeclarative) +if(WIN32 AND _is_qtdeclarative) + find_program(_python_path NAME "python" PATHS ENV PATH) + if(NOT _python_path) + hunter_user_error( + "Python not found in PATH:\n $ENV{PATH}\n" + "Python required for building Qt component (qtdeclarative):\n" + " http://doc.qt.io/qt-5/windows-requirements.html" + ) + endif() +endif() + +hunter_pick_scheme(DEFAULT url_sha1_qt) +hunter_download( + PACKAGE_NAME Qt + PACKAGE_COMPONENT "qtgamepad" + PACKAGE_INTERNAL_DEPS_ID "10" +) diff --git a/cmake/projects/Qt/qtgraphicaleffects/hunter.cmake b/cmake/projects/Qt/qtgraphicaleffects/hunter.cmake index bffef6463d..2155ed6402 100644 --- a/cmake/projects/Qt/qtgraphicaleffects/hunter.cmake +++ b/cmake/projects/Qt/qtgraphicaleffects/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,12 +21,58 @@ if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) endif() ## -- end -## 5.6 only -- +## 5.6+ only -- string(COMPARE EQUAL "qtgraphicaleffects" "qtquickcontrol2" _is_qtquickcontrols2) string(COMPARE EQUAL "qtgraphicaleffects" "qtwebview" _is_qtwebview) if(_is_qtquickcontrols2 OR _is_qtwebview) - if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtgraphicaleffects" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtgraphicaleffects" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtgraphicaleffects" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtgraphicaleffects" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtgraphicaleffects" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtgraphicaleffects" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtgraphicaleffects" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtgraphicaleffects" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtgraphicaleffects" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtgraphicaleffects" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtgraphicaleffects" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtgraphicaleffects" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtgraphicaleffects" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtgraphicaleffects" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtgraphicaleffects" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtgraphicaleffects" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") return() endif() endif() diff --git a/cmake/projects/Qt/qtimageformats/hunter.cmake b/cmake/projects/Qt/qtimageformats/hunter.cmake index d89de88571..dc6c84f4e0 100644 --- a/cmake/projects/Qt/qtimageformats/hunter.cmake +++ b/cmake/projects/Qt/qtimageformats/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,12 +21,58 @@ if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) endif() ## -- end -## 5.6 only -- +## 5.6+ only -- string(COMPARE EQUAL "qtimageformats" "qtquickcontrol2" _is_qtquickcontrols2) string(COMPARE EQUAL "qtimageformats" "qtwebview" _is_qtwebview) if(_is_qtquickcontrols2 OR _is_qtwebview) - if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtimageformats" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtimageformats" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtimageformats" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtimageformats" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtimageformats" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtimageformats" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtimageformats" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtimageformats" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtimageformats" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtimageformats" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtimageformats" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtimageformats" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtimageformats" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtimageformats" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtimageformats" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtimageformats" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") return() endif() endif() diff --git a/cmake/projects/Qt/qtlocation/hunter.cmake b/cmake/projects/Qt/qtlocation/hunter.cmake index ab263a50ea..7d49d66e7a 100644 --- a/cmake/projects/Qt/qtlocation/hunter.cmake +++ b/cmake/projects/Qt/qtlocation/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,12 +21,58 @@ if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) endif() ## -- end -## 5.6 only -- +## 5.6+ only -- string(COMPARE EQUAL "qtlocation" "qtquickcontrol2" _is_qtquickcontrols2) string(COMPARE EQUAL "qtlocation" "qtwebview" _is_qtwebview) if(_is_qtquickcontrols2 OR _is_qtwebview) - if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtlocation" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtlocation" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtlocation" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtlocation" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtlocation" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtlocation" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtlocation" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtlocation" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtlocation" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtlocation" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtlocation" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtlocation" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtlocation" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtlocation" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtlocation" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtlocation" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") return() endif() endif() diff --git a/cmake/projects/Qt/qtmacextras/hunter.cmake b/cmake/projects/Qt/qtmacextras/hunter.cmake index 7d2918bec6..c388df61d7 100644 --- a/cmake/projects/Qt/qtmacextras/hunter.cmake +++ b/cmake/projects/Qt/qtmacextras/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,12 +21,58 @@ if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) endif() ## -- end -## 5.6 only -- +## 5.6+ only -- string(COMPARE EQUAL "qtmacextras" "qtquickcontrol2" _is_qtquickcontrols2) string(COMPARE EQUAL "qtmacextras" "qtwebview" _is_qtwebview) if(_is_qtquickcontrols2 OR _is_qtwebview) - if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtmacextras" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtmacextras" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtmacextras" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtmacextras" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtmacextras" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtmacextras" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtmacextras" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtmacextras" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtmacextras" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtmacextras" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtmacextras" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtmacextras" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtmacextras" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtmacextras" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtmacextras" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtmacextras" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") return() endif() endif() diff --git a/cmake/projects/Qt/qtmultimedia/hunter.cmake b/cmake/projects/Qt/qtmultimedia/hunter.cmake index bf109fa94a..8eaccb2f7f 100644 --- a/cmake/projects/Qt/qtmultimedia/hunter.cmake +++ b/cmake/projects/Qt/qtmultimedia/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,12 +21,58 @@ if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) endif() ## -- end -## 5.6 only -- +## 5.6+ only -- string(COMPARE EQUAL "qtmultimedia" "qtquickcontrol2" _is_qtquickcontrols2) string(COMPARE EQUAL "qtmultimedia" "qtwebview" _is_qtwebview) if(_is_qtquickcontrols2 OR _is_qtwebview) - if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtmultimedia" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtmultimedia" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtmultimedia" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtmultimedia" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtmultimedia" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtmultimedia" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtmultimedia" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtmultimedia" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtmultimedia" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtmultimedia" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtmultimedia" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtmultimedia" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtmultimedia" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtmultimedia" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtmultimedia" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtmultimedia" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") return() endif() endif() diff --git a/cmake/projects/Qt/qtnetworkauth/hunter.cmake b/cmake/projects/Qt/qtnetworkauth/hunter.cmake new file mode 100644 index 0000000000..c1da3e90a0 --- /dev/null +++ b/cmake/projects/Qt/qtnetworkauth/hunter.cmake @@ -0,0 +1,138 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_package) +include(hunter_download) +include(hunter_generate_qt_info) +include(hunter_pick_scheme) +include(hunter_status_debug) + +## 5.5 only -- +string(COMPARE EQUAL "qtnetworkauth" "qtquick1" _is_qtquick1) +string(COMPARE EQUAL "qtnetworkauth" "qtwebkit" _is_qtwebkit) +string(COMPARE EQUAL "qtnetworkauth" "qtwebkit-examples" _is_qtwebkit_examples) + +if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.5\\.") + return() + endif() +endif() +## -- end + +## 5.6+ only -- +string(COMPARE EQUAL "qtnetworkauth" "qtquickcontrol2" _is_qtquickcontrols2) +string(COMPARE EQUAL "qtnetworkauth" "qtwebview" _is_qtwebview) + +if(_is_qtquickcontrols2 OR _is_qtwebview) + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtnetworkauth" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtnetworkauth" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtnetworkauth" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtnetworkauth" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtnetworkauth" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtnetworkauth" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtnetworkauth" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtnetworkauth" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtnetworkauth" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtnetworkauth" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtnetworkauth" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtnetworkauth" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtnetworkauth" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtnetworkauth" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtnetworkauth" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtnetworkauth" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + return() + endif() +endif() +## -- end + +if(NOT _HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES) + # '_depends_on' will return **all** dependencies of the component so there is + # no need to traverse them recursively (optimization) + hunter_generate_qt_info( + "qtnetworkauth" + _unused_toskip + _depends_on + _unused_nobuild + "${HUNTER_Qt_VERSION}" + "${ANDROID}" + "${WIN32}" + ) + + set(_HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES TRUE) + foreach(_x ${_depends_on}) + hunter_add_package(Qt COMPONENTS ${_x}) + endforeach() + set(_HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES FALSE) +endif() + +# We should call this function again since hunter_add_package is include-like +# instruction, i.e. will overwrite variable values (foreach's _x will survive) +hunter_generate_qt_info( + "qtnetworkauth" + _unused_toskip + _unused_depends_on + _nobuild + "${HUNTER_Qt_VERSION}" + "${ANDROID}" + "${WIN32}" +) + +list(FIND _nobuild "qtnetworkauth" _dont_build_it) +if(NOT _dont_build_it EQUAL -1) + hunter_status_debug( + "Qt component doesn't install anything and will be skipped: qtnetworkauth" + ) + return() +endif() + +string(COMPARE EQUAL "qtnetworkauth" "qtdeclarative" _is_qtdeclarative) +if(WIN32 AND _is_qtdeclarative) + find_program(_python_path NAME "python" PATHS ENV PATH) + if(NOT _python_path) + hunter_user_error( + "Python not found in PATH:\n $ENV{PATH}\n" + "Python required for building Qt component (qtdeclarative):\n" + " http://doc.qt.io/qt-5/windows-requirements.html" + ) + endif() +endif() + +hunter_pick_scheme(DEFAULT url_sha1_qt) +hunter_download( + PACKAGE_NAME Qt + PACKAGE_COMPONENT "qtnetworkauth" + PACKAGE_INTERNAL_DEPS_ID "10" +) diff --git a/cmake/projects/Qt/qtpim/hunter.cmake b/cmake/projects/Qt/qtpim/hunter.cmake new file mode 100644 index 0000000000..c2858397c8 --- /dev/null +++ b/cmake/projects/Qt/qtpim/hunter.cmake @@ -0,0 +1,138 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_package) +include(hunter_download) +include(hunter_generate_qt_info) +include(hunter_pick_scheme) +include(hunter_status_debug) + +## 5.5 only -- +string(COMPARE EQUAL "qtpim" "qtquick1" _is_qtquick1) +string(COMPARE EQUAL "qtpim" "qtwebkit" _is_qtwebkit) +string(COMPARE EQUAL "qtpim" "qtwebkit-examples" _is_qtwebkit_examples) + +if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.5\\.") + return() + endif() +endif() +## -- end + +## 5.6+ only -- +string(COMPARE EQUAL "qtpim" "qtquickcontrol2" _is_qtquickcontrols2) +string(COMPARE EQUAL "qtpim" "qtwebview" _is_qtwebview) + +if(_is_qtquickcontrols2 OR _is_qtwebview) + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtpim" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtpim" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtpim" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtpim" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtpim" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtpim" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtpim" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtpim" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtpim" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtpim" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtpim" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtpim" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtpim" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtpim" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtpim" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtpim" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + return() + endif() +endif() +## -- end + +if(NOT _HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES) + # '_depends_on' will return **all** dependencies of the component so there is + # no need to traverse them recursively (optimization) + hunter_generate_qt_info( + "qtpim" + _unused_toskip + _depends_on + _unused_nobuild + "${HUNTER_Qt_VERSION}" + "${ANDROID}" + "${WIN32}" + ) + + set(_HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES TRUE) + foreach(_x ${_depends_on}) + hunter_add_package(Qt COMPONENTS ${_x}) + endforeach() + set(_HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES FALSE) +endif() + +# We should call this function again since hunter_add_package is include-like +# instruction, i.e. will overwrite variable values (foreach's _x will survive) +hunter_generate_qt_info( + "qtpim" + _unused_toskip + _unused_depends_on + _nobuild + "${HUNTER_Qt_VERSION}" + "${ANDROID}" + "${WIN32}" +) + +list(FIND _nobuild "qtpim" _dont_build_it) +if(NOT _dont_build_it EQUAL -1) + hunter_status_debug( + "Qt component doesn't install anything and will be skipped: qtpim" + ) + return() +endif() + +string(COMPARE EQUAL "qtpim" "qtdeclarative" _is_qtdeclarative) +if(WIN32 AND _is_qtdeclarative) + find_program(_python_path NAME "python" PATHS ENV PATH) + if(NOT _python_path) + hunter_user_error( + "Python not found in PATH:\n $ENV{PATH}\n" + "Python required for building Qt component (qtdeclarative):\n" + " http://doc.qt.io/qt-5/windows-requirements.html" + ) + endif() +endif() + +hunter_pick_scheme(DEFAULT url_sha1_qt) +hunter_download( + PACKAGE_NAME Qt + PACKAGE_COMPONENT "qtpim" + PACKAGE_INTERNAL_DEPS_ID "10" +) diff --git a/cmake/projects/Qt/qtpurchasing/hunter.cmake b/cmake/projects/Qt/qtpurchasing/hunter.cmake new file mode 100644 index 0000000000..e289d55370 --- /dev/null +++ b/cmake/projects/Qt/qtpurchasing/hunter.cmake @@ -0,0 +1,138 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_package) +include(hunter_download) +include(hunter_generate_qt_info) +include(hunter_pick_scheme) +include(hunter_status_debug) + +## 5.5 only -- +string(COMPARE EQUAL "qtpurchasing" "qtquick1" _is_qtquick1) +string(COMPARE EQUAL "qtpurchasing" "qtwebkit" _is_qtwebkit) +string(COMPARE EQUAL "qtpurchasing" "qtwebkit-examples" _is_qtwebkit_examples) + +if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.5\\.") + return() + endif() +endif() +## -- end + +## 5.6+ only -- +string(COMPARE EQUAL "qtpurchasing" "qtquickcontrol2" _is_qtquickcontrols2) +string(COMPARE EQUAL "qtpurchasing" "qtwebview" _is_qtwebview) + +if(_is_qtquickcontrols2 OR _is_qtwebview) + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtpurchasing" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtpurchasing" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtpurchasing" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtpurchasing" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtpurchasing" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtpurchasing" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtpurchasing" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtpurchasing" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtpurchasing" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtpurchasing" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtpurchasing" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtpurchasing" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtpurchasing" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtpurchasing" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtpurchasing" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtpurchasing" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + return() + endif() +endif() +## -- end + +if(NOT _HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES) + # '_depends_on' will return **all** dependencies of the component so there is + # no need to traverse them recursively (optimization) + hunter_generate_qt_info( + "qtpurchasing" + _unused_toskip + _depends_on + _unused_nobuild + "${HUNTER_Qt_VERSION}" + "${ANDROID}" + "${WIN32}" + ) + + set(_HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES TRUE) + foreach(_x ${_depends_on}) + hunter_add_package(Qt COMPONENTS ${_x}) + endforeach() + set(_HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES FALSE) +endif() + +# We should call this function again since hunter_add_package is include-like +# instruction, i.e. will overwrite variable values (foreach's _x will survive) +hunter_generate_qt_info( + "qtpurchasing" + _unused_toskip + _unused_depends_on + _nobuild + "${HUNTER_Qt_VERSION}" + "${ANDROID}" + "${WIN32}" +) + +list(FIND _nobuild "qtpurchasing" _dont_build_it) +if(NOT _dont_build_it EQUAL -1) + hunter_status_debug( + "Qt component doesn't install anything and will be skipped: qtpurchasing" + ) + return() +endif() + +string(COMPARE EQUAL "qtpurchasing" "qtdeclarative" _is_qtdeclarative) +if(WIN32 AND _is_qtdeclarative) + find_program(_python_path NAME "python" PATHS ENV PATH) + if(NOT _python_path) + hunter_user_error( + "Python not found in PATH:\n $ENV{PATH}\n" + "Python required for building Qt component (qtdeclarative):\n" + " http://doc.qt.io/qt-5/windows-requirements.html" + ) + endif() +endif() + +hunter_pick_scheme(DEFAULT url_sha1_qt) +hunter_download( + PACKAGE_NAME Qt + PACKAGE_COMPONENT "qtpurchasing" + PACKAGE_INTERNAL_DEPS_ID "10" +) diff --git a/cmake/projects/Qt/qtqa/hunter.cmake b/cmake/projects/Qt/qtqa/hunter.cmake new file mode 100644 index 0000000000..e40c07b118 --- /dev/null +++ b/cmake/projects/Qt/qtqa/hunter.cmake @@ -0,0 +1,138 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_package) +include(hunter_download) +include(hunter_generate_qt_info) +include(hunter_pick_scheme) +include(hunter_status_debug) + +## 5.5 only -- +string(COMPARE EQUAL "qtqa" "qtquick1" _is_qtquick1) +string(COMPARE EQUAL "qtqa" "qtwebkit" _is_qtwebkit) +string(COMPARE EQUAL "qtqa" "qtwebkit-examples" _is_qtwebkit_examples) + +if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.5\\.") + return() + endif() +endif() +## -- end + +## 5.6+ only -- +string(COMPARE EQUAL "qtqa" "qtquickcontrol2" _is_qtquickcontrols2) +string(COMPARE EQUAL "qtqa" "qtwebview" _is_qtwebview) + +if(_is_qtquickcontrols2 OR _is_qtwebview) + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtqa" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtqa" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtqa" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtqa" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtqa" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtqa" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtqa" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtqa" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtqa" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtqa" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtqa" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtqa" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtqa" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtqa" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtqa" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtqa" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + return() + endif() +endif() +## -- end + +if(NOT _HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES) + # '_depends_on' will return **all** dependencies of the component so there is + # no need to traverse them recursively (optimization) + hunter_generate_qt_info( + "qtqa" + _unused_toskip + _depends_on + _unused_nobuild + "${HUNTER_Qt_VERSION}" + "${ANDROID}" + "${WIN32}" + ) + + set(_HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES TRUE) + foreach(_x ${_depends_on}) + hunter_add_package(Qt COMPONENTS ${_x}) + endforeach() + set(_HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES FALSE) +endif() + +# We should call this function again since hunter_add_package is include-like +# instruction, i.e. will overwrite variable values (foreach's _x will survive) +hunter_generate_qt_info( + "qtqa" + _unused_toskip + _unused_depends_on + _nobuild + "${HUNTER_Qt_VERSION}" + "${ANDROID}" + "${WIN32}" +) + +list(FIND _nobuild "qtqa" _dont_build_it) +if(NOT _dont_build_it EQUAL -1) + hunter_status_debug( + "Qt component doesn't install anything and will be skipped: qtqa" + ) + return() +endif() + +string(COMPARE EQUAL "qtqa" "qtdeclarative" _is_qtdeclarative) +if(WIN32 AND _is_qtdeclarative) + find_program(_python_path NAME "python" PATHS ENV PATH) + if(NOT _python_path) + hunter_user_error( + "Python not found in PATH:\n $ENV{PATH}\n" + "Python required for building Qt component (qtdeclarative):\n" + " http://doc.qt.io/qt-5/windows-requirements.html" + ) + endif() +endif() + +hunter_pick_scheme(DEFAULT url_sha1_qt) +hunter_download( + PACKAGE_NAME Qt + PACKAGE_COMPONENT "qtqa" + PACKAGE_INTERNAL_DEPS_ID "10" +) diff --git a/cmake/projects/Qt/qtquick1/hunter.cmake b/cmake/projects/Qt/qtquick1/hunter.cmake index c13c290932..a0c2346edb 100644 --- a/cmake/projects/Qt/qtquick1/hunter.cmake +++ b/cmake/projects/Qt/qtquick1/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,12 +21,58 @@ if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) endif() ## -- end -## 5.6 only -- +## 5.6+ only -- string(COMPARE EQUAL "qtquick1" "qtquickcontrol2" _is_qtquickcontrols2) string(COMPARE EQUAL "qtquick1" "qtwebview" _is_qtwebview) if(_is_qtquickcontrols2 OR _is_qtwebview) - if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtquick1" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtquick1" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtquick1" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtquick1" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtquick1" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtquick1" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtquick1" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtquick1" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtquick1" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtquick1" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtquick1" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtquick1" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtquick1" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtquick1" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtquick1" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtquick1" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") return() endif() endif() diff --git a/cmake/projects/Qt/qtquickcontrols/hunter.cmake b/cmake/projects/Qt/qtquickcontrols/hunter.cmake index 8db9b3aebb..6446c25805 100644 --- a/cmake/projects/Qt/qtquickcontrols/hunter.cmake +++ b/cmake/projects/Qt/qtquickcontrols/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,12 +21,58 @@ if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) endif() ## -- end -## 5.6 only -- +## 5.6+ only -- string(COMPARE EQUAL "qtquickcontrols" "qtquickcontrol2" _is_qtquickcontrols2) string(COMPARE EQUAL "qtquickcontrols" "qtwebview" _is_qtwebview) if(_is_qtquickcontrols2 OR _is_qtwebview) - if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtquickcontrols" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtquickcontrols" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtquickcontrols" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtquickcontrols" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtquickcontrols" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtquickcontrols" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtquickcontrols" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtquickcontrols" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtquickcontrols" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtquickcontrols" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtquickcontrols" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtquickcontrols" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtquickcontrols" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtquickcontrols" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtquickcontrols" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtquickcontrols" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") return() endif() endif() diff --git a/cmake/projects/Qt/qtquickcontrols2/hunter.cmake b/cmake/projects/Qt/qtquickcontrols2/hunter.cmake index 165fddc983..bbefe35dc5 100644 --- a/cmake/projects/Qt/qtquickcontrols2/hunter.cmake +++ b/cmake/projects/Qt/qtquickcontrols2/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,12 +21,58 @@ if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) endif() ## -- end -## 5.6 only -- +## 5.6+ only -- string(COMPARE EQUAL "qtquickcontrols2" "qtquickcontrol2" _is_qtquickcontrols2) string(COMPARE EQUAL "qtquickcontrols2" "qtwebview" _is_qtwebview) if(_is_qtquickcontrols2 OR _is_qtwebview) - if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtquickcontrols2" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtquickcontrols2" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtquickcontrols2" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtquickcontrols2" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtquickcontrols2" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtquickcontrols2" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtquickcontrols2" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtquickcontrols2" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtquickcontrols2" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtquickcontrols2" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtquickcontrols2" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtquickcontrols2" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtquickcontrols2" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtquickcontrols2" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtquickcontrols2" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtquickcontrols2" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") return() endif() endif() diff --git a/cmake/projects/Qt/qtremoteobjects/hunter.cmake b/cmake/projects/Qt/qtremoteobjects/hunter.cmake new file mode 100644 index 0000000000..f5fd98402b --- /dev/null +++ b/cmake/projects/Qt/qtremoteobjects/hunter.cmake @@ -0,0 +1,138 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_package) +include(hunter_download) +include(hunter_generate_qt_info) +include(hunter_pick_scheme) +include(hunter_status_debug) + +## 5.5 only -- +string(COMPARE EQUAL "qtremoteobjects" "qtquick1" _is_qtquick1) +string(COMPARE EQUAL "qtremoteobjects" "qtwebkit" _is_qtwebkit) +string(COMPARE EQUAL "qtremoteobjects" "qtwebkit-examples" _is_qtwebkit_examples) + +if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.5\\.") + return() + endif() +endif() +## -- end + +## 5.6+ only -- +string(COMPARE EQUAL "qtremoteobjects" "qtquickcontrol2" _is_qtquickcontrols2) +string(COMPARE EQUAL "qtremoteobjects" "qtwebview" _is_qtwebview) + +if(_is_qtquickcontrols2 OR _is_qtwebview) + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtremoteobjects" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtremoteobjects" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtremoteobjects" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtremoteobjects" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtremoteobjects" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtremoteobjects" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtremoteobjects" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtremoteobjects" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtremoteobjects" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtremoteobjects" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtremoteobjects" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtremoteobjects" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtremoteobjects" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtremoteobjects" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtremoteobjects" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtremoteobjects" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + return() + endif() +endif() +## -- end + +if(NOT _HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES) + # '_depends_on' will return **all** dependencies of the component so there is + # no need to traverse them recursively (optimization) + hunter_generate_qt_info( + "qtremoteobjects" + _unused_toskip + _depends_on + _unused_nobuild + "${HUNTER_Qt_VERSION}" + "${ANDROID}" + "${WIN32}" + ) + + set(_HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES TRUE) + foreach(_x ${_depends_on}) + hunter_add_package(Qt COMPONENTS ${_x}) + endforeach() + set(_HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES FALSE) +endif() + +# We should call this function again since hunter_add_package is include-like +# instruction, i.e. will overwrite variable values (foreach's _x will survive) +hunter_generate_qt_info( + "qtremoteobjects" + _unused_toskip + _unused_depends_on + _nobuild + "${HUNTER_Qt_VERSION}" + "${ANDROID}" + "${WIN32}" +) + +list(FIND _nobuild "qtremoteobjects" _dont_build_it) +if(NOT _dont_build_it EQUAL -1) + hunter_status_debug( + "Qt component doesn't install anything and will be skipped: qtremoteobjects" + ) + return() +endif() + +string(COMPARE EQUAL "qtremoteobjects" "qtdeclarative" _is_qtdeclarative) +if(WIN32 AND _is_qtdeclarative) + find_program(_python_path NAME "python" PATHS ENV PATH) + if(NOT _python_path) + hunter_user_error( + "Python not found in PATH:\n $ENV{PATH}\n" + "Python required for building Qt component (qtdeclarative):\n" + " http://doc.qt.io/qt-5/windows-requirements.html" + ) + endif() +endif() + +hunter_pick_scheme(DEFAULT url_sha1_qt) +hunter_download( + PACKAGE_NAME Qt + PACKAGE_COMPONENT "qtremoteobjects" + PACKAGE_INTERNAL_DEPS_ID "10" +) diff --git a/cmake/projects/Qt/qtrepotools/hunter.cmake b/cmake/projects/Qt/qtrepotools/hunter.cmake new file mode 100644 index 0000000000..8ab1fc9bff --- /dev/null +++ b/cmake/projects/Qt/qtrepotools/hunter.cmake @@ -0,0 +1,138 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_package) +include(hunter_download) +include(hunter_generate_qt_info) +include(hunter_pick_scheme) +include(hunter_status_debug) + +## 5.5 only -- +string(COMPARE EQUAL "qtrepotools" "qtquick1" _is_qtquick1) +string(COMPARE EQUAL "qtrepotools" "qtwebkit" _is_qtwebkit) +string(COMPARE EQUAL "qtrepotools" "qtwebkit-examples" _is_qtwebkit_examples) + +if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.5\\.") + return() + endif() +endif() +## -- end + +## 5.6+ only -- +string(COMPARE EQUAL "qtrepotools" "qtquickcontrol2" _is_qtquickcontrols2) +string(COMPARE EQUAL "qtrepotools" "qtwebview" _is_qtwebview) + +if(_is_qtquickcontrols2 OR _is_qtwebview) + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtrepotools" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtrepotools" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtrepotools" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtrepotools" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtrepotools" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtrepotools" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtrepotools" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtrepotools" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtrepotools" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtrepotools" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtrepotools" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtrepotools" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtrepotools" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtrepotools" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtrepotools" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtrepotools" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + return() + endif() +endif() +## -- end + +if(NOT _HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES) + # '_depends_on' will return **all** dependencies of the component so there is + # no need to traverse them recursively (optimization) + hunter_generate_qt_info( + "qtrepotools" + _unused_toskip + _depends_on + _unused_nobuild + "${HUNTER_Qt_VERSION}" + "${ANDROID}" + "${WIN32}" + ) + + set(_HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES TRUE) + foreach(_x ${_depends_on}) + hunter_add_package(Qt COMPONENTS ${_x}) + endforeach() + set(_HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES FALSE) +endif() + +# We should call this function again since hunter_add_package is include-like +# instruction, i.e. will overwrite variable values (foreach's _x will survive) +hunter_generate_qt_info( + "qtrepotools" + _unused_toskip + _unused_depends_on + _nobuild + "${HUNTER_Qt_VERSION}" + "${ANDROID}" + "${WIN32}" +) + +list(FIND _nobuild "qtrepotools" _dont_build_it) +if(NOT _dont_build_it EQUAL -1) + hunter_status_debug( + "Qt component doesn't install anything and will be skipped: qtrepotools" + ) + return() +endif() + +string(COMPARE EQUAL "qtrepotools" "qtdeclarative" _is_qtdeclarative) +if(WIN32 AND _is_qtdeclarative) + find_program(_python_path NAME "python" PATHS ENV PATH) + if(NOT _python_path) + hunter_user_error( + "Python not found in PATH:\n $ENV{PATH}\n" + "Python required for building Qt component (qtdeclarative):\n" + " http://doc.qt.io/qt-5/windows-requirements.html" + ) + endif() +endif() + +hunter_pick_scheme(DEFAULT url_sha1_qt) +hunter_download( + PACKAGE_NAME Qt + PACKAGE_COMPONENT "qtrepotools" + PACKAGE_INTERNAL_DEPS_ID "10" +) diff --git a/cmake/projects/Qt/qtscript/hunter.cmake b/cmake/projects/Qt/qtscript/hunter.cmake index c31e885579..135d3eacdf 100644 --- a/cmake/projects/Qt/qtscript/hunter.cmake +++ b/cmake/projects/Qt/qtscript/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,12 +21,58 @@ if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) endif() ## -- end -## 5.6 only -- +## 5.6+ only -- string(COMPARE EQUAL "qtscript" "qtquickcontrol2" _is_qtquickcontrols2) string(COMPARE EQUAL "qtscript" "qtwebview" _is_qtwebview) if(_is_qtquickcontrols2 OR _is_qtwebview) - if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtscript" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtscript" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtscript" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtscript" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtscript" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtscript" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtscript" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtscript" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtscript" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtscript" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtscript" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtscript" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtscript" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtscript" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtscript" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtscript" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") return() endif() endif() diff --git a/cmake/projects/Qt/qtscxml/hunter.cmake b/cmake/projects/Qt/qtscxml/hunter.cmake new file mode 100644 index 0000000000..2554447d76 --- /dev/null +++ b/cmake/projects/Qt/qtscxml/hunter.cmake @@ -0,0 +1,138 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_package) +include(hunter_download) +include(hunter_generate_qt_info) +include(hunter_pick_scheme) +include(hunter_status_debug) + +## 5.5 only -- +string(COMPARE EQUAL "qtscxml" "qtquick1" _is_qtquick1) +string(COMPARE EQUAL "qtscxml" "qtwebkit" _is_qtwebkit) +string(COMPARE EQUAL "qtscxml" "qtwebkit-examples" _is_qtwebkit_examples) + +if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.5\\.") + return() + endif() +endif() +## -- end + +## 5.6+ only -- +string(COMPARE EQUAL "qtscxml" "qtquickcontrol2" _is_qtquickcontrols2) +string(COMPARE EQUAL "qtscxml" "qtwebview" _is_qtwebview) + +if(_is_qtquickcontrols2 OR _is_qtwebview) + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtscxml" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtscxml" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtscxml" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtscxml" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtscxml" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtscxml" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtscxml" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtscxml" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtscxml" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtscxml" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtscxml" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtscxml" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtscxml" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtscxml" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtscxml" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtscxml" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + return() + endif() +endif() +## -- end + +if(NOT _HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES) + # '_depends_on' will return **all** dependencies of the component so there is + # no need to traverse them recursively (optimization) + hunter_generate_qt_info( + "qtscxml" + _unused_toskip + _depends_on + _unused_nobuild + "${HUNTER_Qt_VERSION}" + "${ANDROID}" + "${WIN32}" + ) + + set(_HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES TRUE) + foreach(_x ${_depends_on}) + hunter_add_package(Qt COMPONENTS ${_x}) + endforeach() + set(_HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES FALSE) +endif() + +# We should call this function again since hunter_add_package is include-like +# instruction, i.e. will overwrite variable values (foreach's _x will survive) +hunter_generate_qt_info( + "qtscxml" + _unused_toskip + _unused_depends_on + _nobuild + "${HUNTER_Qt_VERSION}" + "${ANDROID}" + "${WIN32}" +) + +list(FIND _nobuild "qtscxml" _dont_build_it) +if(NOT _dont_build_it EQUAL -1) + hunter_status_debug( + "Qt component doesn't install anything and will be skipped: qtscxml" + ) + return() +endif() + +string(COMPARE EQUAL "qtscxml" "qtdeclarative" _is_qtdeclarative) +if(WIN32 AND _is_qtdeclarative) + find_program(_python_path NAME "python" PATHS ENV PATH) + if(NOT _python_path) + hunter_user_error( + "Python not found in PATH:\n $ENV{PATH}\n" + "Python required for building Qt component (qtdeclarative):\n" + " http://doc.qt.io/qt-5/windows-requirements.html" + ) + endif() +endif() + +hunter_pick_scheme(DEFAULT url_sha1_qt) +hunter_download( + PACKAGE_NAME Qt + PACKAGE_COMPONENT "qtscxml" + PACKAGE_INTERNAL_DEPS_ID "10" +) diff --git a/cmake/projects/Qt/qtsensors/hunter.cmake b/cmake/projects/Qt/qtsensors/hunter.cmake index a44e94d1ed..2cb2405de4 100644 --- a/cmake/projects/Qt/qtsensors/hunter.cmake +++ b/cmake/projects/Qt/qtsensors/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,12 +21,58 @@ if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) endif() ## -- end -## 5.6 only -- +## 5.6+ only -- string(COMPARE EQUAL "qtsensors" "qtquickcontrol2" _is_qtquickcontrols2) string(COMPARE EQUAL "qtsensors" "qtwebview" _is_qtwebview) if(_is_qtquickcontrols2 OR _is_qtwebview) - if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtsensors" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtsensors" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtsensors" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtsensors" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtsensors" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtsensors" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtsensors" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtsensors" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtsensors" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtsensors" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtsensors" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtsensors" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtsensors" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtsensors" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtsensors" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtsensors" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") return() endif() endif() diff --git a/cmake/projects/Qt/qtserialbus/hunter.cmake b/cmake/projects/Qt/qtserialbus/hunter.cmake new file mode 100644 index 0000000000..ddf26103eb --- /dev/null +++ b/cmake/projects/Qt/qtserialbus/hunter.cmake @@ -0,0 +1,138 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_package) +include(hunter_download) +include(hunter_generate_qt_info) +include(hunter_pick_scheme) +include(hunter_status_debug) + +## 5.5 only -- +string(COMPARE EQUAL "qtserialbus" "qtquick1" _is_qtquick1) +string(COMPARE EQUAL "qtserialbus" "qtwebkit" _is_qtwebkit) +string(COMPARE EQUAL "qtserialbus" "qtwebkit-examples" _is_qtwebkit_examples) + +if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.5\\.") + return() + endif() +endif() +## -- end + +## 5.6+ only -- +string(COMPARE EQUAL "qtserialbus" "qtquickcontrol2" _is_qtquickcontrols2) +string(COMPARE EQUAL "qtserialbus" "qtwebview" _is_qtwebview) + +if(_is_qtquickcontrols2 OR _is_qtwebview) + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtserialbus" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtserialbus" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtserialbus" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtserialbus" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtserialbus" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtserialbus" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtserialbus" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtserialbus" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtserialbus" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtserialbus" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtserialbus" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtserialbus" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtserialbus" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtserialbus" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtserialbus" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtserialbus" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + return() + endif() +endif() +## -- end + +if(NOT _HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES) + # '_depends_on' will return **all** dependencies of the component so there is + # no need to traverse them recursively (optimization) + hunter_generate_qt_info( + "qtserialbus" + _unused_toskip + _depends_on + _unused_nobuild + "${HUNTER_Qt_VERSION}" + "${ANDROID}" + "${WIN32}" + ) + + set(_HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES TRUE) + foreach(_x ${_depends_on}) + hunter_add_package(Qt COMPONENTS ${_x}) + endforeach() + set(_HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES FALSE) +endif() + +# We should call this function again since hunter_add_package is include-like +# instruction, i.e. will overwrite variable values (foreach's _x will survive) +hunter_generate_qt_info( + "qtserialbus" + _unused_toskip + _unused_depends_on + _nobuild + "${HUNTER_Qt_VERSION}" + "${ANDROID}" + "${WIN32}" +) + +list(FIND _nobuild "qtserialbus" _dont_build_it) +if(NOT _dont_build_it EQUAL -1) + hunter_status_debug( + "Qt component doesn't install anything and will be skipped: qtserialbus" + ) + return() +endif() + +string(COMPARE EQUAL "qtserialbus" "qtdeclarative" _is_qtdeclarative) +if(WIN32 AND _is_qtdeclarative) + find_program(_python_path NAME "python" PATHS ENV PATH) + if(NOT _python_path) + hunter_user_error( + "Python not found in PATH:\n $ENV{PATH}\n" + "Python required for building Qt component (qtdeclarative):\n" + " http://doc.qt.io/qt-5/windows-requirements.html" + ) + endif() +endif() + +hunter_pick_scheme(DEFAULT url_sha1_qt) +hunter_download( + PACKAGE_NAME Qt + PACKAGE_COMPONENT "qtserialbus" + PACKAGE_INTERNAL_DEPS_ID "10" +) diff --git a/cmake/projects/Qt/qtserialport/hunter.cmake b/cmake/projects/Qt/qtserialport/hunter.cmake index 703f461de3..6ee79d4f64 100644 --- a/cmake/projects/Qt/qtserialport/hunter.cmake +++ b/cmake/projects/Qt/qtserialport/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,12 +21,58 @@ if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) endif() ## -- end -## 5.6 only -- +## 5.6+ only -- string(COMPARE EQUAL "qtserialport" "qtquickcontrol2" _is_qtquickcontrols2) string(COMPARE EQUAL "qtserialport" "qtwebview" _is_qtwebview) if(_is_qtquickcontrols2 OR _is_qtwebview) - if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtserialport" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtserialport" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtserialport" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtserialport" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtserialport" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtserialport" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtserialport" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtserialport" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtserialport" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtserialport" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtserialport" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtserialport" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtserialport" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtserialport" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtserialport" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtserialport" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") return() endif() endif() diff --git a/cmake/projects/Qt/qtspeech/hunter.cmake b/cmake/projects/Qt/qtspeech/hunter.cmake new file mode 100644 index 0000000000..6cd623cc6a --- /dev/null +++ b/cmake/projects/Qt/qtspeech/hunter.cmake @@ -0,0 +1,138 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_package) +include(hunter_download) +include(hunter_generate_qt_info) +include(hunter_pick_scheme) +include(hunter_status_debug) + +## 5.5 only -- +string(COMPARE EQUAL "qtspeech" "qtquick1" _is_qtquick1) +string(COMPARE EQUAL "qtspeech" "qtwebkit" _is_qtwebkit) +string(COMPARE EQUAL "qtspeech" "qtwebkit-examples" _is_qtwebkit_examples) + +if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.5\\.") + return() + endif() +endif() +## -- end + +## 5.6+ only -- +string(COMPARE EQUAL "qtspeech" "qtquickcontrol2" _is_qtquickcontrols2) +string(COMPARE EQUAL "qtspeech" "qtwebview" _is_qtwebview) + +if(_is_qtquickcontrols2 OR _is_qtwebview) + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtspeech" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtspeech" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtspeech" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtspeech" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtspeech" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtspeech" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtspeech" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtspeech" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtspeech" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtspeech" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtspeech" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtspeech" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtspeech" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtspeech" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtspeech" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtspeech" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + return() + endif() +endif() +## -- end + +if(NOT _HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES) + # '_depends_on' will return **all** dependencies of the component so there is + # no need to traverse them recursively (optimization) + hunter_generate_qt_info( + "qtspeech" + _unused_toskip + _depends_on + _unused_nobuild + "${HUNTER_Qt_VERSION}" + "${ANDROID}" + "${WIN32}" + ) + + set(_HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES TRUE) + foreach(_x ${_depends_on}) + hunter_add_package(Qt COMPONENTS ${_x}) + endforeach() + set(_HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES FALSE) +endif() + +# We should call this function again since hunter_add_package is include-like +# instruction, i.e. will overwrite variable values (foreach's _x will survive) +hunter_generate_qt_info( + "qtspeech" + _unused_toskip + _unused_depends_on + _nobuild + "${HUNTER_Qt_VERSION}" + "${ANDROID}" + "${WIN32}" +) + +list(FIND _nobuild "qtspeech" _dont_build_it) +if(NOT _dont_build_it EQUAL -1) + hunter_status_debug( + "Qt component doesn't install anything and will be skipped: qtspeech" + ) + return() +endif() + +string(COMPARE EQUAL "qtspeech" "qtdeclarative" _is_qtdeclarative) +if(WIN32 AND _is_qtdeclarative) + find_program(_python_path NAME "python" PATHS ENV PATH) + if(NOT _python_path) + hunter_user_error( + "Python not found in PATH:\n $ENV{PATH}\n" + "Python required for building Qt component (qtdeclarative):\n" + " http://doc.qt.io/qt-5/windows-requirements.html" + ) + endif() +endif() + +hunter_pick_scheme(DEFAULT url_sha1_qt) +hunter_download( + PACKAGE_NAME Qt + PACKAGE_COMPONENT "qtspeech" + PACKAGE_INTERNAL_DEPS_ID "10" +) diff --git a/cmake/projects/Qt/qtsvg/hunter.cmake b/cmake/projects/Qt/qtsvg/hunter.cmake index 32e4e798c1..a204d699db 100644 --- a/cmake/projects/Qt/qtsvg/hunter.cmake +++ b/cmake/projects/Qt/qtsvg/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,12 +21,58 @@ if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) endif() ## -- end -## 5.6 only -- +## 5.6+ only -- string(COMPARE EQUAL "qtsvg" "qtquickcontrol2" _is_qtquickcontrols2) string(COMPARE EQUAL "qtsvg" "qtwebview" _is_qtwebview) if(_is_qtquickcontrols2 OR _is_qtwebview) - if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtsvg" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtsvg" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtsvg" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtsvg" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtsvg" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtsvg" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtsvg" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtsvg" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtsvg" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtsvg" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtsvg" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtsvg" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtsvg" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtsvg" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtsvg" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtsvg" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") return() endif() endif() diff --git a/cmake/projects/Qt/qtsystems/hunter.cmake b/cmake/projects/Qt/qtsystems/hunter.cmake new file mode 100644 index 0000000000..9e9a7fbfab --- /dev/null +++ b/cmake/projects/Qt/qtsystems/hunter.cmake @@ -0,0 +1,138 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_package) +include(hunter_download) +include(hunter_generate_qt_info) +include(hunter_pick_scheme) +include(hunter_status_debug) + +## 5.5 only -- +string(COMPARE EQUAL "qtsystems" "qtquick1" _is_qtquick1) +string(COMPARE EQUAL "qtsystems" "qtwebkit" _is_qtwebkit) +string(COMPARE EQUAL "qtsystems" "qtwebkit-examples" _is_qtwebkit_examples) + +if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.5\\.") + return() + endif() +endif() +## -- end + +## 5.6+ only -- +string(COMPARE EQUAL "qtsystems" "qtquickcontrol2" _is_qtquickcontrols2) +string(COMPARE EQUAL "qtsystems" "qtwebview" _is_qtwebview) + +if(_is_qtquickcontrols2 OR _is_qtwebview) + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtsystems" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtsystems" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtsystems" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtsystems" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtsystems" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtsystems" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtsystems" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtsystems" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtsystems" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtsystems" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtsystems" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtsystems" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtsystems" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtsystems" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtsystems" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtsystems" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + return() + endif() +endif() +## -- end + +if(NOT _HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES) + # '_depends_on' will return **all** dependencies of the component so there is + # no need to traverse them recursively (optimization) + hunter_generate_qt_info( + "qtsystems" + _unused_toskip + _depends_on + _unused_nobuild + "${HUNTER_Qt_VERSION}" + "${ANDROID}" + "${WIN32}" + ) + + set(_HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES TRUE) + foreach(_x ${_depends_on}) + hunter_add_package(Qt COMPONENTS ${_x}) + endforeach() + set(_HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES FALSE) +endif() + +# We should call this function again since hunter_add_package is include-like +# instruction, i.e. will overwrite variable values (foreach's _x will survive) +hunter_generate_qt_info( + "qtsystems" + _unused_toskip + _unused_depends_on + _nobuild + "${HUNTER_Qt_VERSION}" + "${ANDROID}" + "${WIN32}" +) + +list(FIND _nobuild "qtsystems" _dont_build_it) +if(NOT _dont_build_it EQUAL -1) + hunter_status_debug( + "Qt component doesn't install anything and will be skipped: qtsystems" + ) + return() +endif() + +string(COMPARE EQUAL "qtsystems" "qtdeclarative" _is_qtdeclarative) +if(WIN32 AND _is_qtdeclarative) + find_program(_python_path NAME "python" PATHS ENV PATH) + if(NOT _python_path) + hunter_user_error( + "Python not found in PATH:\n $ENV{PATH}\n" + "Python required for building Qt component (qtdeclarative):\n" + " http://doc.qt.io/qt-5/windows-requirements.html" + ) + endif() +endif() + +hunter_pick_scheme(DEFAULT url_sha1_qt) +hunter_download( + PACKAGE_NAME Qt + PACKAGE_COMPONENT "qtsystems" + PACKAGE_INTERNAL_DEPS_ID "10" +) diff --git a/cmake/projects/Qt/qttools/hunter.cmake b/cmake/projects/Qt/qttools/hunter.cmake index 041b91c86b..54dd87e6c4 100644 --- a/cmake/projects/Qt/qttools/hunter.cmake +++ b/cmake/projects/Qt/qttools/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,12 +21,58 @@ if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) endif() ## -- end -## 5.6 only -- +## 5.6+ only -- string(COMPARE EQUAL "qttools" "qtquickcontrol2" _is_qtquickcontrols2) string(COMPARE EQUAL "qttools" "qtwebview" _is_qtwebview) if(_is_qtquickcontrols2 OR _is_qtwebview) - if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qttools" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qttools" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qttools" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qttools" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qttools" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qttools" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qttools" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qttools" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qttools" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qttools" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qttools" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qttools" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qttools" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qttools" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qttools" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qttools" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") return() endif() endif() diff --git a/cmake/projects/Qt/qttranslations/hunter.cmake b/cmake/projects/Qt/qttranslations/hunter.cmake index 2e1cf01531..c77bf83ab6 100644 --- a/cmake/projects/Qt/qttranslations/hunter.cmake +++ b/cmake/projects/Qt/qttranslations/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,12 +21,58 @@ if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) endif() ## -- end -## 5.6 only -- +## 5.6+ only -- string(COMPARE EQUAL "qttranslations" "qtquickcontrol2" _is_qtquickcontrols2) string(COMPARE EQUAL "qttranslations" "qtwebview" _is_qtwebview) if(_is_qtquickcontrols2 OR _is_qtwebview) - if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qttranslations" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qttranslations" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qttranslations" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qttranslations" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qttranslations" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qttranslations" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qttranslations" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qttranslations" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qttranslations" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qttranslations" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qttranslations" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qttranslations" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qttranslations" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qttranslations" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qttranslations" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qttranslations" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") return() endif() endif() diff --git a/cmake/projects/Qt/qtvirtualkeyboard/hunter.cmake b/cmake/projects/Qt/qtvirtualkeyboard/hunter.cmake new file mode 100644 index 0000000000..8048f8a572 --- /dev/null +++ b/cmake/projects/Qt/qtvirtualkeyboard/hunter.cmake @@ -0,0 +1,138 @@ +# Copyright (c) 2015-2017, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_package) +include(hunter_download) +include(hunter_generate_qt_info) +include(hunter_pick_scheme) +include(hunter_status_debug) + +## 5.5 only -- +string(COMPARE EQUAL "qtvirtualkeyboard" "qtquick1" _is_qtquick1) +string(COMPARE EQUAL "qtvirtualkeyboard" "qtwebkit" _is_qtwebkit) +string(COMPARE EQUAL "qtvirtualkeyboard" "qtwebkit-examples" _is_qtwebkit_examples) + +if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.5\\.") + return() + endif() +endif() +## -- end + +## 5.6+ only -- +string(COMPARE EQUAL "qtvirtualkeyboard" "qtquickcontrol2" _is_qtquickcontrols2) +string(COMPARE EQUAL "qtvirtualkeyboard" "qtwebview" _is_qtwebview) + +if(_is_qtquickcontrols2 OR _is_qtwebview) + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtvirtualkeyboard" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtvirtualkeyboard" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtvirtualkeyboard" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtvirtualkeyboard" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtvirtualkeyboard" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtvirtualkeyboard" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtvirtualkeyboard" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtvirtualkeyboard" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtvirtualkeyboard" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtvirtualkeyboard" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtvirtualkeyboard" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtvirtualkeyboard" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtvirtualkeyboard" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtvirtualkeyboard" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtvirtualkeyboard" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtvirtualkeyboard" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + return() + endif() +endif() +## -- end + +if(NOT _HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES) + # '_depends_on' will return **all** dependencies of the component so there is + # no need to traverse them recursively (optimization) + hunter_generate_qt_info( + "qtvirtualkeyboard" + _unused_toskip + _depends_on + _unused_nobuild + "${HUNTER_Qt_VERSION}" + "${ANDROID}" + "${WIN32}" + ) + + set(_HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES TRUE) + foreach(_x ${_depends_on}) + hunter_add_package(Qt COMPONENTS ${_x}) + endforeach() + set(_HUNTER_INTERNAL_LOADING_QT_DEPENDENCIES FALSE) +endif() + +# We should call this function again since hunter_add_package is include-like +# instruction, i.e. will overwrite variable values (foreach's _x will survive) +hunter_generate_qt_info( + "qtvirtualkeyboard" + _unused_toskip + _unused_depends_on + _nobuild + "${HUNTER_Qt_VERSION}" + "${ANDROID}" + "${WIN32}" +) + +list(FIND _nobuild "qtvirtualkeyboard" _dont_build_it) +if(NOT _dont_build_it EQUAL -1) + hunter_status_debug( + "Qt component doesn't install anything and will be skipped: qtvirtualkeyboard" + ) + return() +endif() + +string(COMPARE EQUAL "qtvirtualkeyboard" "qtdeclarative" _is_qtdeclarative) +if(WIN32 AND _is_qtdeclarative) + find_program(_python_path NAME "python" PATHS ENV PATH) + if(NOT _python_path) + hunter_user_error( + "Python not found in PATH:\n $ENV{PATH}\n" + "Python required for building Qt component (qtdeclarative):\n" + " http://doc.qt.io/qt-5/windows-requirements.html" + ) + endif() +endif() + +hunter_pick_scheme(DEFAULT url_sha1_qt) +hunter_download( + PACKAGE_NAME Qt + PACKAGE_COMPONENT "qtvirtualkeyboard" + PACKAGE_INTERNAL_DEPS_ID "10" +) diff --git a/cmake/projects/Qt/qtwayland/hunter.cmake b/cmake/projects/Qt/qtwayland/hunter.cmake index 5c884426e9..48d1251c9f 100644 --- a/cmake/projects/Qt/qtwayland/hunter.cmake +++ b/cmake/projects/Qt/qtwayland/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,12 +21,58 @@ if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) endif() ## -- end -## 5.6 only -- +## 5.6+ only -- string(COMPARE EQUAL "qtwayland" "qtquickcontrol2" _is_qtquickcontrols2) string(COMPARE EQUAL "qtwayland" "qtwebview" _is_qtwebview) if(_is_qtquickcontrols2 OR _is_qtwebview) - if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtwayland" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtwayland" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtwayland" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtwayland" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtwayland" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtwayland" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtwayland" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtwayland" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtwayland" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtwayland" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtwayland" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtwayland" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtwayland" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtwayland" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtwayland" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtwayland" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") return() endif() endif() diff --git a/cmake/projects/Qt/qtwebchannel/hunter.cmake b/cmake/projects/Qt/qtwebchannel/hunter.cmake index c6b6e8fc53..dbb4861839 100644 --- a/cmake/projects/Qt/qtwebchannel/hunter.cmake +++ b/cmake/projects/Qt/qtwebchannel/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,12 +21,58 @@ if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) endif() ## -- end -## 5.6 only -- +## 5.6+ only -- string(COMPARE EQUAL "qtwebchannel" "qtquickcontrol2" _is_qtquickcontrols2) string(COMPARE EQUAL "qtwebchannel" "qtwebview" _is_qtwebview) if(_is_qtquickcontrols2 OR _is_qtwebview) - if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtwebchannel" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtwebchannel" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtwebchannel" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtwebchannel" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtwebchannel" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtwebchannel" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtwebchannel" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtwebchannel" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtwebchannel" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtwebchannel" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtwebchannel" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtwebchannel" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtwebchannel" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtwebchannel" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtwebchannel" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtwebchannel" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") return() endif() endif() diff --git a/cmake/projects/Qt/qtwebengine/hunter.cmake b/cmake/projects/Qt/qtwebengine/hunter.cmake index 97bf6d6c9b..bcc02d895f 100644 --- a/cmake/projects/Qt/qtwebengine/hunter.cmake +++ b/cmake/projects/Qt/qtwebengine/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,12 +21,58 @@ if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) endif() ## -- end -## 5.6 only -- +## 5.6+ only -- string(COMPARE EQUAL "qtwebengine" "qtquickcontrol2" _is_qtquickcontrols2) string(COMPARE EQUAL "qtwebengine" "qtwebview" _is_qtwebview) if(_is_qtquickcontrols2 OR _is_qtwebview) - if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtwebengine" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtwebengine" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtwebengine" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtwebengine" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtwebengine" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtwebengine" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtwebengine" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtwebengine" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtwebengine" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtwebengine" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtwebengine" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtwebengine" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtwebengine" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtwebengine" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtwebengine" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtwebengine" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") return() endif() endif() diff --git a/cmake/projects/Qt/qtwebkit-examples/hunter.cmake b/cmake/projects/Qt/qtwebkit-examples/hunter.cmake index 06db0bdc73..6d225f0090 100644 --- a/cmake/projects/Qt/qtwebkit-examples/hunter.cmake +++ b/cmake/projects/Qt/qtwebkit-examples/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,12 +21,58 @@ if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) endif() ## -- end -## 5.6 only -- +## 5.6+ only -- string(COMPARE EQUAL "qtwebkit-examples" "qtquickcontrol2" _is_qtquickcontrols2) string(COMPARE EQUAL "qtwebkit-examples" "qtwebview" _is_qtwebview) if(_is_qtquickcontrols2 OR _is_qtwebview) - if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtwebkit-examples" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtwebkit-examples" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtwebkit-examples" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtwebkit-examples" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtwebkit-examples" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtwebkit-examples" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtwebkit-examples" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtwebkit-examples" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtwebkit-examples" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtwebkit-examples" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtwebkit-examples" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtwebkit-examples" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtwebkit-examples" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtwebkit-examples" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtwebkit-examples" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtwebkit-examples" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") return() endif() endif() diff --git a/cmake/projects/Qt/qtwebkit/hunter.cmake b/cmake/projects/Qt/qtwebkit/hunter.cmake index 0cce0e761a..383ca68e3d 100644 --- a/cmake/projects/Qt/qtwebkit/hunter.cmake +++ b/cmake/projects/Qt/qtwebkit/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,12 +21,58 @@ if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) endif() ## -- end -## 5.6 only -- +## 5.6+ only -- string(COMPARE EQUAL "qtwebkit" "qtquickcontrol2" _is_qtquickcontrols2) string(COMPARE EQUAL "qtwebkit" "qtwebview" _is_qtwebview) if(_is_qtquickcontrols2 OR _is_qtwebview) - if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtwebkit" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtwebkit" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtwebkit" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtwebkit" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtwebkit" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtwebkit" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtwebkit" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtwebkit" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtwebkit" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtwebkit" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtwebkit" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtwebkit" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtwebkit" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtwebkit" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtwebkit" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtwebkit" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") return() endif() endif() diff --git a/cmake/projects/Qt/qtwebsockets/hunter.cmake b/cmake/projects/Qt/qtwebsockets/hunter.cmake index 10abfa1b3c..a7f85f89f6 100644 --- a/cmake/projects/Qt/qtwebsockets/hunter.cmake +++ b/cmake/projects/Qt/qtwebsockets/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,12 +21,58 @@ if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) endif() ## -- end -## 5.6 only -- +## 5.6+ only -- string(COMPARE EQUAL "qtwebsockets" "qtquickcontrol2" _is_qtquickcontrols2) string(COMPARE EQUAL "qtwebsockets" "qtwebview" _is_qtwebview) if(_is_qtquickcontrols2 OR _is_qtwebview) - if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtwebsockets" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtwebsockets" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtwebsockets" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtwebsockets" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtwebsockets" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtwebsockets" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtwebsockets" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtwebsockets" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtwebsockets" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtwebsockets" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtwebsockets" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtwebsockets" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtwebsockets" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtwebsockets" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtwebsockets" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtwebsockets" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") return() endif() endif() diff --git a/cmake/projects/Qt/qtwebview/hunter.cmake b/cmake/projects/Qt/qtwebview/hunter.cmake index 12bf4d1a44..c0fda093ce 100644 --- a/cmake/projects/Qt/qtwebview/hunter.cmake +++ b/cmake/projects/Qt/qtwebview/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,12 +21,58 @@ if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) endif() ## -- end -## 5.6 only -- +## 5.6+ only -- string(COMPARE EQUAL "qtwebview" "qtquickcontrol2" _is_qtquickcontrols2) string(COMPARE EQUAL "qtwebview" "qtwebview" _is_qtwebview) if(_is_qtquickcontrols2 OR _is_qtwebview) - if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtwebview" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtwebview" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtwebview" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtwebview" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtwebview" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtwebview" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtwebview" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtwebview" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtwebview" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtwebview" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtwebview" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtwebview" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtwebview" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtwebview" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtwebview" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtwebview" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") return() endif() endif() diff --git a/cmake/projects/Qt/qtwinextras/hunter.cmake b/cmake/projects/Qt/qtwinextras/hunter.cmake index 5c476c1a7e..79876bc91a 100644 --- a/cmake/projects/Qt/qtwinextras/hunter.cmake +++ b/cmake/projects/Qt/qtwinextras/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,12 +21,58 @@ if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) endif() ## -- end -## 5.6 only -- +## 5.6+ only -- string(COMPARE EQUAL "qtwinextras" "qtquickcontrol2" _is_qtquickcontrols2) string(COMPARE EQUAL "qtwinextras" "qtwebview" _is_qtwebview) if(_is_qtquickcontrols2 OR _is_qtwebview) - if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtwinextras" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtwinextras" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtwinextras" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtwinextras" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtwinextras" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtwinextras" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtwinextras" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtwinextras" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtwinextras" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtwinextras" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtwinextras" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtwinextras" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtwinextras" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtwinextras" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtwinextras" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtwinextras" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") return() endif() endif() diff --git a/cmake/projects/Qt/qtx11extras/hunter.cmake b/cmake/projects/Qt/qtx11extras/hunter.cmake index 4bf9bca095..39effa55ba 100644 --- a/cmake/projects/Qt/qtx11extras/hunter.cmake +++ b/cmake/projects/Qt/qtx11extras/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,12 +21,58 @@ if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) endif() ## -- end -## 5.6 only -- +## 5.6+ only -- string(COMPARE EQUAL "qtx11extras" "qtquickcontrol2" _is_qtquickcontrols2) string(COMPARE EQUAL "qtx11extras" "qtwebview" _is_qtwebview) if(_is_qtquickcontrols2 OR _is_qtwebview) - if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtx11extras" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtx11extras" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtx11extras" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtx11extras" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtx11extras" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtx11extras" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtx11extras" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtx11extras" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtx11extras" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtx11extras" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtx11extras" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtx11extras" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtx11extras" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtx11extras" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtx11extras" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtx11extras" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") return() endif() endif() diff --git a/cmake/projects/Qt/qtxmlpatterns/hunter.cmake b/cmake/projects/Qt/qtxmlpatterns/hunter.cmake index 6ba6f995d8..09e62f4b81 100644 --- a/cmake/projects/Qt/qtxmlpatterns/hunter.cmake +++ b/cmake/projects/Qt/qtxmlpatterns/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,12 +21,58 @@ if(_is_qtquick1 OR _is_qtwebkit OR _is_qtwebkit_examples) endif() ## -- end -## 5.6 only -- +## 5.6+ only -- string(COMPARE EQUAL "qtxmlpatterns" "qtquickcontrol2" _is_qtquickcontrols2) string(COMPARE EQUAL "qtxmlpatterns" "qtwebview" _is_qtwebview) if(_is_qtquickcontrols2 OR _is_qtwebview) - if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + if(HUNTER_Qt_VERSION MATCHES "^5\\.6\\.") + # Qt 5.6.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.6.* + else() + return() + endif() +endif() +## -- end + +## 5.9 only -- +string(COMPARE EQUAL "qtxmlpatterns" "qtcharts" _is_qtcharts) +string(COMPARE EQUAL "qtxmlpatterns" "qtdatavis3d" _is_qtdatavis3d) +string(COMPARE EQUAL "qtxmlpatterns" "qtdocgallery" _is_qtdocgallery) +string(COMPARE EQUAL "qtxmlpatterns" "qtfeedback" _is_qtfeedback) +string(COMPARE EQUAL "qtxmlpatterns" "qtgamepad" _is_qtgamepad) +string(COMPARE EQUAL "qtxmlpatterns" "qtnetworkauth" _is_qtnetworkauth) +string(COMPARE EQUAL "qtxmlpatterns" "qtpim" _is_qtpim) +string(COMPARE EQUAL "qtxmlpatterns" "qtpurchasing" _is_qtpurchasing) +string(COMPARE EQUAL "qtxmlpatterns" "qtqa" _is_qtqa) +string(COMPARE EQUAL "qtxmlpatterns" "qtremoteobjects" _is_qtremoteobjects) +string(COMPARE EQUAL "qtxmlpatterns" "qtrepotools" _is_qtrepotools) +string(COMPARE EQUAL "qtxmlpatterns" "qtscxml" _is_qtscxml) +string(COMPARE EQUAL "qtxmlpatterns" "qtserialbus" _is_qtserialbus) +string(COMPARE EQUAL "qtxmlpatterns" "qtspeech" _is_qtspeech) +string(COMPARE EQUAL "qtxmlpatterns" "qtsystems" _is_qtsystems) +string(COMPARE EQUAL "qtxmlpatterns" "qtvirtualkeyboard" _is_qtvirtualkeyboard) + +if( + _is_qtcharts OR + _is_qtdatavis3d OR + _is_qtdocgallery OR + _is_qtfeedback OR + _is_qtgamepad OR + _is_qtnetworkauth OR + _is_qtpim OR + _is_qtpurchasing OR + _is_qtqa OR + _is_qtremoteobjects OR + _is_qtrepotools OR + _is_qtscxml OR + _is_qtserialbus OR + _is_qtspeech OR + _is_qtsystems OR + _is_qtvirtualkeyboard +) + if(NOT HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") return() endif() endif() diff --git a/cmake/projects/Qt/schemes/url_sha1_qt.cmake.in b/cmake/projects/Qt/schemes/url_sha1_qt.cmake.in index 45208f7455..729609db3b 100644 --- a/cmake/projects/Qt/schemes/url_sha1_qt.cmake.in +++ b/cmake/projects/Qt/schemes/url_sha1_qt.cmake.in @@ -24,7 +24,7 @@ hunter_test_string_not_empty("@HUNTER_PACKAGE_COMPONENT@") hunter_test_string_not_empty("@HUNTER_PACKAGE_DOWNLOAD_DIR@") hunter_test_string_not_empty("@HUNTER_PACKAGE_BUILD_DIR@") hunter_test_string_not_empty("@HUNTER_PACKAGE_CONFIGURATION_TYPES@") -hunter_test_string_not_empty("@HUNTER_TOOLCHAIN_ID_PATH@") +hunter_test_string_not_empty("@HUNTER_CONFIG_ID_PATH@") hunter_test_string_not_empty("@HUNTER_INSTALL_PREFIX@") hunter_test_string_not_empty("@HUNTER_PACKAGE_INSTALL_PREFIX@") hunter_test_string_not_empty("@HUNTER_PACKAGE_LICENSE_DIR@") @@ -185,6 +185,9 @@ elseif(_is_linux) ) elseif("@MSVC@") list(APPEND configure_opts -platform "win32-msvc@HUNTER_MSVC_YEAR@") + if(QT_OPENGL_DESKTOP) + list(APPEND configure_opts -opengl "desktop") + endif() elseif("@MINGW@") list(APPEND configure_opts -platform "win32-g++") list(APPEND configure_opts -opengl "desktop") @@ -236,7 +239,9 @@ list(APPEND configure_opts "-no-fontconfig") list(APPEND configure_opts "-no-gif") if(NOT WIN32) list(APPEND configure_opts "-no-glib") - list(APPEND configure_opts "-no-gtkstyle") + if(HUNTER_Qt_VERSION VERSION_LESS 5.9) + list(APPEND configure_opts "-no-gtkstyle") + endif() list(APPEND configure_opts "-no-xinput2") endif() list(APPEND configure_opts "-no-icu") @@ -316,7 +321,7 @@ endif() # lose some extra HDD space. Example: Qt base + 2 components + sources ~ 4.4G set( qt_source_dir - "@HUNTER_TOOLCHAIN_ID_PATH@/QtBuild/@HUNTER_PACKAGE_INTERNAL_DEPS_ID@" + "@HUNTER_CONFIG_ID_PATH@/QtBuild/@HUNTER_PACKAGE_INTERNAL_DEPS_ID@" ) # We are building only one component "qt_component". To skip all other diff --git a/cmake/projects/QtCMakeExtra/hunter.cmake b/cmake/projects/QtCMakeExtra/hunter.cmake index 87335457bb..5af507c813 100644 --- a/cmake/projects/QtCMakeExtra/hunter.cmake +++ b/cmake/projects/QtCMakeExtra/hunter.cmake @@ -261,6 +261,50 @@ hunter_add_version( a5dadedaa53f2c44e3207fd5c7edc8211cae3f83 ) +hunter_add_version( + PACKAGE_NAME + QtCMakeExtra + VERSION + "1.0.23" + URL + "https://github.com/hunter-packages/QtCMakeExtra/archive/v1.0.23.tar.gz" + SHA1 + a05102ed3f68cb79da70751c9e89e54daa64c0be +) + +hunter_add_version( + PACKAGE_NAME + QtCMakeExtra + VERSION + "1.0.24" + URL + "https://github.com/hunter-packages/QtCMakeExtra/archive/v1.0.24.tar.gz" + SHA1 + d2aced482704a11ff5c5029750b2fb6f9671f622 +) + +hunter_add_version( + PACKAGE_NAME + QtCMakeExtra + VERSION + "1.0.25" + URL + "https://github.com/hunter-packages/QtCMakeExtra/archive/v1.0.25.tar.gz" + SHA1 + 23182e08840d09cb521c362aaa7e695b7c7e3d5b +) + +hunter_add_version( + PACKAGE_NAME + QtCMakeExtra + VERSION + "1.0.27" + URL + "https://github.com/hunter-packages/QtCMakeExtra/archive/v1.0.27.tar.gz" + SHA1 + 57f9015d9bba46c7720ac103efcd86b17ad12952 +) + hunter_pick_scheme(DEFAULT url_sha1_cmake) hunter_cacheable(QtCMakeExtra) hunter_download(PACKAGE_NAME QtCMakeExtra) diff --git a/cmake/projects/SDL2/hunter.cmake b/cmake/projects/SDL2/hunter.cmake index 3ff2351559..db0df8d508 100644 --- a/cmake/projects/SDL2/hunter.cmake +++ b/cmake/projects/SDL2/hunter.cmake @@ -6,6 +6,28 @@ include(hunter_download) include(hunter_pick_scheme) include(hunter_cacheable) +hunter_add_version( + PACKAGE_NAME + SDL2 + VERSION + "2.0.4-p4" + URL + "https://github.com/hunter-packages/SDL2/archive/2.0.4-p4.tar.gz" + SHA1 + 589fcb46963b28e9d968646af54add6f4b19890c +) + +hunter_add_version( + PACKAGE_NAME + SDL2 + VERSION + "2.0.4-p3" + URL + "https://github.com/hunter-packages/SDL2/archive/2.0.4-p3.tar.gz" + SHA1 + 811f7577fb71fd84a391ef8c4878325effb56a8c +) + hunter_add_version( PACKAGE_NAME SDL2 diff --git a/cmake/projects/SDL_image/hunter.cmake b/cmake/projects/SDL_image/hunter.cmake new file mode 100644 index 0000000000..b6d93d1658 --- /dev/null +++ b/cmake/projects/SDL_image/hunter.cmake @@ -0,0 +1,22 @@ +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +# Load used modules +include(hunter_add_version) +include(hunter_download) +include(hunter_pick_scheme) +include(hunter_cacheable) + +hunter_add_version( + PACKAGE_NAME + SDL_image + VERSION + "2.0.1-p1" + URL + "https://github.com/hunter-packages/SDL_image_cmake/archive/2.0.1-p1.tar.gz" + SHA1 + 8f644d026256f48f0e2ba5411422eaf2a91c0463 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(SDL_image) +hunter_download(PACKAGE_NAME SDL_image) diff --git a/cmake/projects/SDL_mixer/hunter.cmake b/cmake/projects/SDL_mixer/hunter.cmake new file mode 100644 index 0000000000..2c0c258ddc --- /dev/null +++ b/cmake/projects/SDL_mixer/hunter.cmake @@ -0,0 +1,22 @@ +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +# Load used modules +include(hunter_add_version) +include(hunter_download) +include(hunter_pick_scheme) +include(hunter_cacheable) + +hunter_add_version( + PACKAGE_NAME + SDL_mixer + VERSION + "2.0.1-p1" + URL + "https://github.com/hunter-packages/SDL_mixer/archive/v2.0.1-p1.tar.gz" + SHA1 + b4e97fb430309d5218185afa702f16f0129678be +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(SDL_mixer) +hunter_download(PACKAGE_NAME SDL_mixer) diff --git a/cmake/projects/Snappy/hunter.cmake b/cmake/projects/Snappy/hunter.cmake new file mode 100644 index 0000000000..2a16e5a471 --- /dev/null +++ b/cmake/projects/Snappy/hunter.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2017, Pawel Bylica +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_cmake_args) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME + Snappy + VERSION + 1.1.6-p0 + URL + "https://github.com/google/snappy/archive/77c12adc192ac6620a0f0d340c99149ec56a97a3.tar.gz" + SHA1 + 5f26e7130061e41faa0b7d500a132d8c08a92a48 +) + +hunter_cmake_args( + Snappy + CMAKE_ARGS + SNAPPY_BUILD_TESTS=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(Snappy) +hunter_download(PACKAGE_NAME Snappy) diff --git a/cmake/projects/SuiteSparse/hunter.cmake b/cmake/projects/SuiteSparse/hunter.cmake new file mode 100644 index 0000000000..1487728e53 --- /dev/null +++ b/cmake/projects/SuiteSparse/hunter.cmake @@ -0,0 +1,54 @@ +# Copyright (c) 2017, NeroBurner +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +# Load used modules +include(hunter_add_version) +include(hunter_cmake_args) +include(hunter_download) +include(hunter_pick_scheme) +include(hunter_cacheable) + +hunter_cacheable(SuiteSparse) + +# List of versions here... +## suitesparse-metis-for-windows version is 1.3.1 +## suitesparse library version is 4.5.1 +hunter_add_version( + PACKAGE_NAME + SuiteSparse + VERSION + "4.5.1-p1" + URL + "https://github.com/hunter-packages/suitesparse-metis-for-windows/archive/v1.3.1-p1.tar.gz" + SHA1 + b5c678a7dbb88ff60e454c9f93c30b618d8451ac +) +hunter_add_version( + PACKAGE_NAME + SuiteSparse + VERSION + "4.5.1-p0" + URL + "https://github.com/hunter-packages/suitesparse-metis-for-windows/archive/v1.3.1-p0.tar.gz" + SHA1 + 1350eab5d1a8d488e7b28d217fa751906d4767da +) + + +hunter_cmake_args( + SuiteSparse + CMAKE_ARGS + BUILD_METIS=NO + HUNTER_INSTALL_LICENSE_FILES=LICENSE.md +) + +# Pick a download scheme +hunter_pick_scheme(DEFAULT url_sha1_cmake) + +# Download package. +# Two versions of library will be build: +# * libexample_A.a +# * libexample_Ad.a +hunter_download(PACKAGE_NAME SuiteSparse) diff --git a/cmake/projects/Tesseract/hunter.cmake b/cmake/projects/Tesseract/hunter.cmake new file mode 100644 index 0000000000..294a6ecd0a --- /dev/null +++ b/cmake/projects/Tesseract/hunter.cmake @@ -0,0 +1,34 @@ +# Copyright (c) 2015, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_cmake_args) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME + Tesseract + VERSION + "3.05.01-hunter-3" + URL + "https://github.com/hunter-packages/tesseract/archive/v3.05.01-hunter-3.tar.gz" + SHA1 + 0ccf9537a17634448618b21d3fd26537a26b94ae +) + +if(ANDROID OR MINGW) + hunter_cmake_args( + Tesseract + CMAKE_ARGS + Tesseract_USE_OPENCL=OFF +) +endif() + + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(Tesseract) +hunter_download(PACKAGE_NAME Tesseract) diff --git a/cmake/projects/WDC/hunter.cmake b/cmake/projects/WDC/hunter.cmake new file mode 100644 index 0000000000..74f7295e19 --- /dev/null +++ b/cmake/projects/WDC/hunter.cmake @@ -0,0 +1,60 @@ +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_cmake_args) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME WDC + VERSION "1.1.1" + URL "https://github.com/CloudPolis/webdav-client-cpp/archive/v1.1.1.tar.gz" + SHA1 ae111eee686c2f7d9091164ba270a6be11f8d4a8 +) + +hunter_add_version( + PACKAGE_NAME WDC + VERSION "1.1.0" + URL "https://github.com/CloudPolis/webdav-client-cpp/archive/v1.1.0.tar.gz" + SHA1 cc0923530fd1ce13fe927592bad3999db4f22d5e +) + +hunter_add_version( + PACKAGE_NAME WDC + VERSION "1.0.9" + URL "https://github.com/CloudPolis/webdav-client-cpp/archive/v1.0.9.tar.gz" + SHA1 a4035ce5ac73581384c71105a4716839e1f54b5f +) + +hunter_add_version( + PACKAGE_NAME WDC + VERSION "1.0.8" + URL "https://github.com/CloudPolis/webdav-client-cpp/archive/v1.0.8.tar.gz" + SHA1 10db2c64fd9165011c9caaea572e07bf97c817cd +) + +hunter_add_version( + PACKAGE_NAME WDC + VERSION "1.0.7" + URL "https://github.com/CloudPolis/webdav-client-cpp/archive/v1.0.7.tar.gz" + SHA1 58dd5181bf11f842f6eb8c7206d89070f2d52190 +) + +hunter_add_version( + PACKAGE_NAME WDC + VERSION "1.0.6" + URL "https://github.com/CloudPolis/webdav-client-cpp/archive/v1.0.6.tar.gz" + SHA1 db0358658f689cc9118d96acf1d6de6eeb4d9041 +) + +hunter_add_version( + PACKAGE_NAME WDC + VERSION "1.0.5" + URL "https://github.com/CloudPolis/webdav-client-cpp/archive/v1.0.5.tar.gz" + SHA1 5f0d0cce727d079f3acc822737fc5e9f93aabed2 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(WDC) +hunter_download(PACKAGE_NAME WDC) diff --git a/cmake/projects/ZeroMQ/hunter.cmake b/cmake/projects/ZeroMQ/hunter.cmake index 39001d56ca..fa0ac4bd38 100644 --- a/cmake/projects/ZeroMQ/hunter.cmake +++ b/cmake/projects/ZeroMQ/hunter.cmake @@ -28,6 +28,17 @@ hunter_add_version( be57db45f4f998c04d1804132b1302f923405fa4 ) +hunter_add_version( + PACKAGE_NAME + ZeroMQ + VERSION + "4.2.3-p1" + URL + "https://github.com/hunter-packages/libzmq/releases/download/v4.2.3-hunter-1/libzmq-4.2.3-hunter-1.tar.gz" + SHA1 + 14ce51a8940f9f23d821a3363c128a51bfafa257 +) + hunter_cmake_args(ZeroMQ CMAKE_ARGS ZMQ_BUILD_TESTS=OFF) hunter_pick_scheme(DEFAULT url_sha1_cmake) hunter_cacheable(ZeroMQ) diff --git a/cmake/projects/aes/hunter.cmake b/cmake/projects/aes/hunter.cmake new file mode 100644 index 0000000000..2d0cf381d7 --- /dev/null +++ b/cmake/projects/aes/hunter.cmake @@ -0,0 +1,35 @@ +# Copyright (c) 2016-2017, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME + aes + VERSION + 0.0.1-p0 + URL + "https://github.com/hunter-packages/aes/archive/v0.0.1-p0.tar.gz" + SHA1 + 49ae29df3b0e0619c1db7e7696795c956386f71b +) + +hunter_add_version( + PACKAGE_NAME + aes + VERSION + 0.0.1-p1 + URL + "https://github.com/hunter-packages/aes/archive/v0.0.1-p1.tar.gz" + SHA1 + 5ec961526679246b34332afd1d83c015c377bd79 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(aes) +hunter_download(PACKAGE_NAME aes) diff --git a/cmake/projects/aglet/hunter.cmake b/cmake/projects/aglet/hunter.cmake new file mode 100644 index 0000000000..e9ca5afe41 --- /dev/null +++ b/cmake/projects/aglet/hunter.cmake @@ -0,0 +1,47 @@ +# Copyright (c) 2016-2017, Ruslan Baratov +# Copyright (c) 2017, David Hirvonen +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME + aglet + VERSION + 1.0 + URL + "https://github.com/elucideye/aglet/archive/v1.0.tar.gz" + SHA1 + fbc018f8d7fdb757b23daa972ac6f83aea87c30c +) + +hunter_add_version( + PACKAGE_NAME + aglet + VERSION + 1.1.0 + URL + "https://github.com/elucideye/aglet/archive/v1.1.0.tar.gz" + SHA1 + 1857a8d99c0224688d7131a09f295f48723209aa +) + +hunter_add_version( + PACKAGE_NAME + aglet + VERSION + 1.2.0 + URL + "https://github.com/elucideye/aglet/archive/v1.2.0.tar.gz" + SHA1 + 65d910c63e0c030a20ca4da9473753ce284c49de +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(aglet) +hunter_download(PACKAGE_NAME aglet) diff --git a/cmake/projects/bison/hunter.cmake b/cmake/projects/bison/hunter.cmake new file mode 100644 index 0000000000..9fb74c4d68 --- /dev/null +++ b/cmake/projects/bison/hunter.cmake @@ -0,0 +1,23 @@ +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_configuration_types) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME + bison + VERSION + "3.0.4" + URL + "https://ftp.gnu.org/gnu/bison/bison-3.0.4.tar.gz" + SHA1 + ec1f2706a7cfedda06d29dc394b03e092a1e1b74 +) + +hunter_configuration_types(bison CONFIGURATION_TYPES Release) +hunter_pick_scheme(DEFAULT url_sha1_autotools) +# bison is not cacheable at this time because it hard codes paths to m4sugar +# directories in C source code. +hunter_download(PACKAGE_NAME bison) diff --git a/cmake/projects/boost-pba/hunter.cmake b/cmake/projects/boost-pba/hunter.cmake new file mode 100644 index 0000000000..e41e9dbccb --- /dev/null +++ b/cmake/projects/boost-pba/hunter.cmake @@ -0,0 +1,37 @@ +# Copyright (c) 2017, David Hirvonen +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +# Load used modules +include(hunter_add_package) +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME + boost-pba + VERSION + "1.0.0" + URL + "https://github.com/hunter-packages/boost-pba/archive/v1.0.0.tar.gz" + SHA1 + 65b28b923cf0330860b36d568bf4a98503fb0455 +) + +hunter_add_version( + PACKAGE_NAME + boost-pba + VERSION + "1.0.0-p0" + URL + "https://github.com/hunter-packages/boost-pba/archive/v1.0.0-p0.tar.gz" + SHA1 + c4dd316edbb6839c5be2a5e1a9decd3bdfd848d0 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(boost-pba) +hunter_download(PACKAGE_NAME boost-pba) diff --git a/cmake/projects/cereal/hunter.cmake b/cmake/projects/cereal/hunter.cmake index 3085a9bcfa..85c5670eda 100644 --- a/cmake/projects/cereal/hunter.cmake +++ b/cmake/projects/cereal/hunter.cmake @@ -12,6 +12,17 @@ include(hunter_cacheable) hunter_cacheable(cereal) +hunter_add_version( + PACKAGE_NAME + cereal + VERSION + "1.2.2-p0" + URL + "https://github.com/hunter-packages/cereal/archive/v1.2.2-p0.tar.gz" + SHA1 + 7325d29644654c16f066a8c887665c2cf78226c2 + ) + hunter_add_version( PACKAGE_NAME cereal diff --git a/cmake/projects/ceres-solver/hunter.cmake b/cmake/projects/ceres-solver/hunter.cmake new file mode 100644 index 0000000000..6a8651f42b --- /dev/null +++ b/cmake/projects/ceres-solver/hunter.cmake @@ -0,0 +1,67 @@ +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +# Load used modules +include(hunter_add_version) +include(hunter_cmake_args) +include(hunter_download) +include(hunter_pick_scheme) +include(hunter_cacheable) + +# starting with 1.12.0-p2 ceres-solver is cacheable +hunter_cacheable(ceres-solver) + +# use base url for hunter fork +set(_hunter_ceres_base_url_fork "https://github.com/hunter-packages/ceres-solver/archive") + + +# List of versions +hunter_add_version( + PACKAGE_NAME + ceres-solver + VERSION + "1.12.0-p2" + URL + "${_hunter_ceres_base_url_fork}/v1.12.0-p2.tar.gz" + SHA1 + 04724b04aaa17fdd1feaa7d21e8a37723f78d9fc +) + +hunter_add_version( + PACKAGE_NAME + ceres-solver + VERSION + "1.12.0-p1" + URL + "${_hunter_ceres_base_url_fork}/v1.12.0-p1.tar.gz" + SHA1 + d8676dcfe72c19d77aa099a894b94515761e8e94 +) + +hunter_add_version( + PACKAGE_NAME + ceres-solver + VERSION + "1.12.0-p0" + URL + "${_hunter_ceres_base_url_fork}/v1.12.0-p0.tar.gz" + SHA1 + c8a24d83bf4b26b99fd8fc3bed28a267e6247c85 +) +hunter_cmake_args(ceres-solver CMAKE_ARGS + # explicitly remove dependency on gflags (only needed for tests) + GFLAGS=OFF + # explicitly disable suitesparse support + LAPACK=OFF + SUITESPARSE=OFF + # don't build tests + BUILD_TESTING=OFF + # also don't build examples: when suitesparse is enabled the examples need Fortran libraries + BUILD_EXAMPLES=OFF +) + +# Pick a download scheme +hunter_pick_scheme(DEFAULT url_sha1_cmake) # use scheme for cmake projects + +# Download package. +hunter_download(PACKAGE_NAME ceres-solver) + diff --git a/cmake/projects/cpp_redis/hunter.cmake b/cmake/projects/cpp_redis/hunter.cmake new file mode 100644 index 0000000000..86d65b21a5 --- /dev/null +++ b/cmake/projects/cpp_redis/hunter.cmake @@ -0,0 +1,31 @@ +# cmake/projects/cpp_redis/hunter.cmake + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +# Load used modules +include(hunter_add_version) +include(hunter_download) +include(hunter_pick_scheme) +include(hunter_cacheable) + +# List of versions here... +hunter_add_version( + PACKAGE_NAME + cpp_redis + VERSION + "3.5.0-h1" + URL + "https://github.com/hunter-packages/cpp_redis/archive/3.5.0-h1.tar.gz" + SHA1 + b88a7f6c303122f4f62f0c37cce8625a592b51d1 +) + +# Pick a download scheme +hunter_pick_scheme(DEFAULT url_sha1_cmake) # use scheme for cmake projects + +# Download package. +# Two versions of library will be build by default: +# * libcpp_redis.a +# * libcpp_redisd.a +hunter_cacheable(cpp_redis) +hunter_download(PACKAGE_NAME cpp_redis) diff --git a/cmake/projects/cryptopp/hunter.cmake b/cmake/projects/cryptopp/hunter.cmake new file mode 100644 index 0000000000..a1283171d6 --- /dev/null +++ b/cmake/projects/cryptopp/hunter.cmake @@ -0,0 +1,42 @@ +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +# Load used modules +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_cmake_args) +include(hunter_download) +include(hunter_pick_scheme) + +# List of versions here... +hunter_add_version( + PACKAGE_NAME + cryptopp + VERSION + "5.6.5" + URL + "https://github.com/weidai11/cryptopp/archive/CRYPTOPP_5_6_5.tar.gz" + SHA1 + 3aa4f2fcfee05ed304c6614325c90eba0dc75f16 +) + +hunter_add_version( + PACKAGE_NAME + cryptopp + VERSION + "5.6.4" + URL + "https://github.com/weidai11/cryptopp/archive/CRYPTOPP_5_6_4.tar.gz" + SHA1 + 066e01e704bbdc0f4f785f344c05c8259078a020 +) + +hunter_cmake_args( + cryptopp + CMAKE_ARGS + BUILD_SHARED=OFF + BUILD_TESTING=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) # use scheme for cmake projects +hunter_cacheable(cryptopp) +hunter_download(PACKAGE_NAME cryptopp) diff --git a/cmake/projects/czmq/hunter.cmake b/cmake/projects/czmq/hunter.cmake new file mode 100644 index 0000000000..81bfcbc4b5 --- /dev/null +++ b/cmake/projects/czmq/hunter.cmake @@ -0,0 +1,65 @@ +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME + czmq + VERSION + "4.0.2-p1" + URL + "https://github.com/hunter-packages/czmq/archive/v4.0.2-p1.tar.gz" + SHA1 + 6f0a60bdcccd8cadd8de14eb9562cda4e6b0e0b3 +) + +hunter_add_version( + PACKAGE_NAME + czmq + VERSION + "4.0.1-p2" + URL + "https://github.com/hunter-packages/czmq/archive/v4.0.1-p2.tar.gz" + SHA1 + aa52f864ac9f963634bfa46e48e2372b968cb8ef +) + +hunter_add_version( + PACKAGE_NAME + czmq + VERSION + "4.0.0-p2" + URL + "https://github.com/hunter-packages/czmq/archive/v4.0.0-p2.tar.gz" + SHA1 + 5644fc0cb17a57431d1fda541cf76cd0a70ab536 +) + +hunter_add_version( + PACKAGE_NAME + czmq + VERSION + "3.0.2-p1" + URL + "https://github.com/hunter-packages/czmq/archive/v3.0.2-p1.tar.gz" + SHA1 + 1824ab64761a09eb9047660afab2eccca4809fa8 +) + +hunter_add_version( + PACKAGE_NAME + czmq + VERSION + "3.0.1-p1" + URL + "https://github.com/hunter-packages/czmq/archive/v3.0.1-p1.tar.gz" + SHA1 + a0f85e5a746b9b31204e16f952760bc3f054a433 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(czmq) +hunter_download(PACKAGE_NAME czmq) diff --git a/cmake/projects/damageproto/hunter.cmake b/cmake/projects/damageproto/hunter.cmake index 9d37cb17d5..cc8a01d0c2 100644 --- a/cmake/projects/damageproto/hunter.cmake +++ b/cmake/projects/damageproto/hunter.cmake @@ -26,6 +26,6 @@ hunter_pick_scheme(DEFAULT url_sha1_autotools) hunter_cacheable(damageproto) hunter_download( PACKAGE_NAME damageproto - PACKAGE_INTERNAL_DEPS_ID "1" + PACKAGE_INTERNAL_DEPS_ID "2" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/damageproto.pc" ) diff --git a/cmake/projects/dlib/hunter.cmake b/cmake/projects/dlib/hunter.cmake index 70a28d488c..518cdc9d0b 100644 --- a/cmake/projects/dlib/hunter.cmake +++ b/cmake/projects/dlib/hunter.cmake @@ -9,6 +9,50 @@ include(hunter_cmake_args) include(hunter_download) include(hunter_pick_scheme) +hunter_add_version( + PACKAGE_NAME + dlib + VERSION + "19.6-p0" + URL + "https://github.com/hunter-packages/dlib/archive/v19.6-p0.tar.gz" + SHA1 + e48b67dc6cf02ec8fdf936f2fddf78b8146f5469 +) + +hunter_add_version( + PACKAGE_NAME + dlib + VERSION + "19.4-p3" + URL + "https://github.com/hunter-packages/dlib/archive/v19.4-p3.tar.gz" + SHA1 + 8c56def3b12b1d70935947c1f0611290d221f496 +) + +hunter_add_version( + PACKAGE_NAME + dlib + VERSION + "19.4-p2" + URL + "https://github.com/hunter-packages/dlib/archive/v19.4-p2.tar.gz" + SHA1 + 119231fe068799efd0922594dc580a18ebdb3a15 +) + +hunter_add_version( + PACKAGE_NAME + dlib + VERSION + "19.4-p1" + URL + "https://github.com/hunter-packages/dlib/archive/v19.4-p1.tar.gz" + SHA1 + 4e6c8adfa97092bf45bfd83c3036d1e4a6052c84 +) + hunter_add_version( PACKAGE_NAME dlib diff --git a/cmake/projects/doctest/hunter.cmake b/cmake/projects/doctest/hunter.cmake new file mode 100644 index 0000000000..0e1c70e81b --- /dev/null +++ b/cmake/projects/doctest/hunter.cmake @@ -0,0 +1,45 @@ +# cmake/projects/Example/hunter.cmake + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +# Load used modules +include(hunter_add_version) +include(hunter_cmake_args) +include(hunter_download) +include(hunter_pick_scheme) +include(hunter_cacheable) + +# List of versions here... +hunter_add_version( + PACKAGE_NAME + doctest + VERSION + "1.1.4-hunter-1" + URL + "https://github.com/piribes/doctest/archive/1.1.4-hunter-1.tar.gz" + SHA1 + 684580f4cf1f40ca7750bea90facc4564a807c2a +) + +hunter_add_version( + PACKAGE_NAME + doctest + VERSION + "1.2.0" + URL + "https://github.com/onqtam/doctest/archive/1.2.0.tar.gz" + SHA1 + 53f87a422c7cc842d9b3e06d5a7eb7e35307e6ac +) + +hunter_cmake_args(doctest CMAKE_ARGS + DOCTEST_SKIP_EXAMPLES=ON + DOCTEST_SKIP_COVERAGE=ON + DOCTEST_WITH_TESTS=OFF +) + +# Pick a download scheme +hunter_pick_scheme(DEFAULT url_sha1_cmake) # use scheme for cmake projects + +hunter_cacheable(doctest) +hunter_download(PACKAGE_NAME doctest) diff --git a/cmake/projects/double-conversion/hunter.cmake b/cmake/projects/double-conversion/hunter.cmake new file mode 100644 index 0000000000..753f1b0171 --- /dev/null +++ b/cmake/projects/double-conversion/hunter.cmake @@ -0,0 +1,22 @@ +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +# Load used modules +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME + double-conversion + VERSION + "3.0.0" + URL + "https://github.com/hunter-packages/double-conversion/archive/v3.0.0-p0.tar.gz" + SHA1 + 8cef7eff66b8488f996fb091f036eb6dc82f92d5 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(double-conversion) +hunter_download(PACKAGE_NAME double-conversion) diff --git a/cmake/projects/dri2proto/hunter.cmake b/cmake/projects/dri2proto/hunter.cmake index b28f7dec10..1db083706c 100644 --- a/cmake/projects/dri2proto/hunter.cmake +++ b/cmake/projects/dri2proto/hunter.cmake @@ -26,6 +26,6 @@ hunter_pick_scheme(DEFAULT url_sha1_autotools) hunter_cacheable(dri2proto) hunter_download( PACKAGE_NAME dri2proto - PACKAGE_INTERNAL_DEPS_ID "1" + PACKAGE_INTERNAL_DEPS_ID "2" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/dri2proto.pc" ) diff --git a/cmake/projects/dri3proto/hunter.cmake b/cmake/projects/dri3proto/hunter.cmake index ce9cc81588..fa58c75cf5 100644 --- a/cmake/projects/dri3proto/hunter.cmake +++ b/cmake/projects/dri3proto/hunter.cmake @@ -26,6 +26,6 @@ hunter_pick_scheme(DEFAULT url_sha1_autotools) hunter_cacheable(dri3proto) hunter_download( PACKAGE_NAME dri3proto - PACKAGE_INTERNAL_DEPS_ID "1" + PACKAGE_INTERNAL_DEPS_ID "2" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/dri3proto.pc" ) diff --git a/cmake/projects/drishti_assets/hunter.cmake b/cmake/projects/drishti_assets/hunter.cmake new file mode 100644 index 0000000000..9898ea7ddb --- /dev/null +++ b/cmake/projects/drishti_assets/hunter.cmake @@ -0,0 +1,47 @@ +# Copyright (c) 2017, Ruslan Baratov +# Copyright (c) 2017, David Hirvonen +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME + drishti_assets + VERSION + 1.6 + URL + "https://github.com/elucideye/drishti-assets/archive/v1.6.tar.gz" + SHA1 + 7787ba57e30146c979780c79ae62e8299cfe3cfd +) + +hunter_add_version( + PACKAGE_NAME + drishti_assets + VERSION + 1.7 + URL + "https://github.com/elucideye/drishti-assets/archive/v1.7.tar.gz" + SHA1 + 1c35ca176e4b30111eed44fd607d8a5ac0c71585 +) + +hunter_add_version( + PACKAGE_NAME + drishti_assets + VERSION + 1.8 + URL + "https://github.com/elucideye/drishti-assets/archive/v1.8.tar.gz" + SHA1 + 1667a5209e83902a46251632dab25cf114d75c96 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(drishti_assets) +hunter_download(PACKAGE_NAME drishti_assets) diff --git a/cmake/projects/drishti_faces/hunter.cmake b/cmake/projects/drishti_faces/hunter.cmake new file mode 100644 index 0000000000..a17f47f7e3 --- /dev/null +++ b/cmake/projects/drishti_faces/hunter.cmake @@ -0,0 +1,35 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME + drishti_faces + VERSION + 1.1 + URL + "https://github.com/elucideye/drishti-faces/archive/v1.1.tar.gz" + SHA1 + 2518ff034bd4c2967cbab4fc7a69d30cf0de057a +) + +hunter_add_version( + PACKAGE_NAME + drishti_faces + VERSION + 1.2 + URL + "https://github.com/elucideye/drishti-faces/archive/v1.2.tar.gz" + SHA1 + 61cf9e459856a06d2da83f84f43f1a0e43955d7a +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(drishti_faces) +hunter_download(PACKAGE_NAME drishti_faces) diff --git a/cmake/projects/drm/hunter.cmake b/cmake/projects/drm/hunter.cmake index f5b00ac0ca..6458a430dd 100644 --- a/cmake/projects/drm/hunter.cmake +++ b/cmake/projects/drm/hunter.cmake @@ -37,7 +37,7 @@ hunter_cmake_args( hunter_cacheable(drm) hunter_download( PACKAGE_NAME drm - PACKAGE_INTERNAL_DEPS_ID "2" + PACKAGE_INTERNAL_DEPS_ID "3" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/libdrm.la" "lib/libdrm_amdgpu.la" diff --git a/cmake/projects/eigen3-nnls/hunter.cmake b/cmake/projects/eigen3-nnls/hunter.cmake new file mode 100644 index 0000000000..013364a0b6 --- /dev/null +++ b/cmake/projects/eigen3-nnls/hunter.cmake @@ -0,0 +1,26 @@ +# Copyright (c) 2016-2017, Ruslan Baratov +# Copyright (c) 2017, David Hirvonen +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_cmake_args) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME + eigen3-nnls + VERSION + 1.0.0 + URL + "https://github.com/hunter-packages/eigen3-nnls/archive/v1.0.0.tar.gz" + SHA1 + 0bc34af72ace36e14dc8387e292e338ee30f620d + ) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(eigen3-nnls) +hunter_download(PACKAGE_NAME eigen3-nnls) diff --git a/cmake/projects/enet/hunter.cmake b/cmake/projects/enet/hunter.cmake new file mode 100644 index 0000000000..962d789d85 --- /dev/null +++ b/cmake/projects/enet/hunter.cmake @@ -0,0 +1,27 @@ +# cmake/projects/Example/hunter.cmake + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +# Load used modules +include(hunter_add_version) +include(hunter_download) +include(hunter_pick_scheme) +include(hunter_cacheable) + +# List of versions here... +hunter_add_version( + PACKAGE_NAME + enet + VERSION + "1.3.13-p1" + URL + "https://github.com/hunter-packages/enet/archive/v1.3.13-p1.tar.gz" + SHA1 + 40f97cc8d5e41f36fab05c9170836fb55d64191e +) + +# Pick a download scheme +hunter_pick_scheme(DEFAULT url_sha1_cmake) # use scheme for cmake projects + +hunter_cacheable(enet) +hunter_download(PACKAGE_NAME enet) diff --git a/cmake/projects/eos/hunter.cmake b/cmake/projects/eos/hunter.cmake index 8ff1c6573d..2a64b058ab 100644 --- a/cmake/projects/eos/hunter.cmake +++ b/cmake/projects/eos/hunter.cmake @@ -14,11 +14,11 @@ hunter_add_version( PACKAGE_NAME eos VERSION - 0.6.1-p0 + 0.12.1 URL - "https://github.com/hunter-packages/eos/archive/v0.6.1-p0.tar.gz" + "https://github.com/hunter-packages/eos/archive/v0.12.1.tar.gz" SHA1 - 3ce7b579fb2795a0c464b2dea12ca9345cf86e91 + cbc8143c270fe4ade45be47adae83f34db280659 ) hunter_add_version( @@ -32,6 +32,17 @@ hunter_add_version( 663e02aa35275f9dc447e8d4004e091f107eb686 ) +hunter_add_version( + PACKAGE_NAME + eos + VERSION + 0.6.1-p0 + URL + "https://github.com/hunter-packages/eos/archive/v0.6.1-p0.tar.gz" + SHA1 + 3ce7b579fb2795a0c464b2dea12ca9345cf86e91 +) + hunter_cmake_args( eos CMAKE_ARGS diff --git a/cmake/projects/fixesproto/hunter.cmake b/cmake/projects/fixesproto/hunter.cmake index 48481d8a13..0afd66cb61 100644 --- a/cmake/projects/fixesproto/hunter.cmake +++ b/cmake/projects/fixesproto/hunter.cmake @@ -5,6 +5,7 @@ include(hunter_add_version) include(hunter_cacheable) +include(hunter_cmake_args) include(hunter_configuration_types) include(hunter_download) include(hunter_pick_scheme) @@ -23,9 +24,14 @@ hunter_add_version( hunter_configuration_types(fixesproto CONFIGURATION_TYPES Release) hunter_pick_scheme(DEFAULT url_sha1_autotools) +hunter_cmake_args( + fixesproto + CMAKE_ARGS + PKGCONFIG_EXPORT_TARGETS=fixesproto +) hunter_cacheable(fixesproto) hunter_download( PACKAGE_NAME fixesproto - PACKAGE_INTERNAL_DEPS_ID "1" + PACKAGE_INTERNAL_DEPS_ID "2" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/fixesproto.pc" ) diff --git a/cmake/projects/flex/hunter.cmake b/cmake/projects/flex/hunter.cmake new file mode 100644 index 0000000000..b90bf80a98 --- /dev/null +++ b/cmake/projects/flex/hunter.cmake @@ -0,0 +1,23 @@ +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_configuration_types) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME + flex + VERSION + "2.6.4" + URL + "https://github.com/westes/flex/files/981163/flex-2.6.4.tar.gz" + SHA1 + fafece095a0d9890ebd618adb1f242d8908076e1 +) + +hunter_configuration_types(flex CONFIGURATION_TYPES Release) +hunter_pick_scheme(DEFAULT url_sha1_autotools) +hunter_cacheable(flex) +hunter_download(PACKAGE_NAME flex) diff --git a/cmake/projects/fmt/hunter.cmake b/cmake/projects/fmt/hunter.cmake index 322f008ef0..75e875a210 100644 --- a/cmake/projects/fmt/hunter.cmake +++ b/cmake/projects/fmt/hunter.cmake @@ -8,6 +8,17 @@ include(hunter_download) include(hunter_pick_scheme) # List of versions here... +hunter_add_version( + PACKAGE_NAME + fmt + VERSION + "4.0.0" + URL + "https://github.com/fmtlib/fmt/archive/4.0.0.tar.gz" + SHA1 + d52942b4a31fb94dbb2cca36c90e34209033408f +) + hunter_add_version( PACKAGE_NAME fmt diff --git a/cmake/projects/foo/hunter.cmake b/cmake/projects/foo/hunter.cmake new file mode 100644 index 0000000000..6e600519b5 --- /dev/null +++ b/cmake/projects/foo/hunter.cmake @@ -0,0 +1,46 @@ +# Copyright (c) 2016-2017, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME + foo + VERSION + 1.0.0 + URL + "https://github.com/hunter-packages/foo/archive/v1.0.0.tar.gz" + SHA1 + 1111111111111111111111111111111111111111 +) + +hunter_add_version( + PACKAGE_NAME + foo + VERSION + 2.0.0 + URL + "https://github.com/hunter-packages/foo/archive/v2.0.0.tar.gz" + SHA1 + 2222222222222222222222222222222222222222 +) + +hunter_add_version( + PACKAGE_NAME + foo + VERSION + 3.0.0 + URL + "https://github.com/hunter-packages/foo/archive/v3.0.0.tar.gz" + SHA1 + 3333333333333333333333333333333333333333 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(foo) +hunter_download(PACKAGE_NAME foo) diff --git a/cmake/projects/gauze/hunter.cmake b/cmake/projects/gauze/hunter.cmake new file mode 100644 index 0000000000..55838e6801 --- /dev/null +++ b/cmake/projects/gauze/hunter.cmake @@ -0,0 +1,37 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_cmake_args) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME + gauze + VERSION + 0.1.0 + URL + "https://github.com/hunter-packages/gauze/archive/v0.1.0.tar.gz" + SHA1 + 6944f77d5eb61c067acebf06231a29b90963b7c0 +) + +hunter_add_version( + PACKAGE_NAME + gauze + VERSION + 0.1.1 + URL + "https://github.com/hunter-packages/gauze/archive/v0.1.1.tar.gz" + SHA1 + 4993b09855e51047ea51136a05fcd6d0216f2716 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(gauze) +hunter_cmake_args(gauze CMAKE_ARGS GAUZE_BUILD_TESTS=OFF) +hunter_download(PACKAGE_NAME gauze) diff --git a/cmake/projects/geos/hunter.cmake b/cmake/projects/geos/hunter.cmake index 5401a5b8e4..1a6d1387df 100644 --- a/cmake/projects/geos/hunter.cmake +++ b/cmake/projects/geos/hunter.cmake @@ -21,4 +21,7 @@ hunter_add_version( hunter_configuration_types(geos CONFIGURATION_TYPES Release) hunter_pick_scheme(DEFAULT url_sha1_autotools) -hunter_download(PACKAGE_NAME geos) +hunter_download( + PACKAGE_NAME geos + PACKAGE_INTERNAL_DEPS_ID "1" +) diff --git a/cmake/projects/gflags/hunter.cmake b/cmake/projects/gflags/hunter.cmake index 8dca5879bc..5a05628dab 100644 --- a/cmake/projects/gflags/hunter.cmake +++ b/cmake/projects/gflags/hunter.cmake @@ -30,6 +30,17 @@ hunter_add_version( 113255cba87b6af61663014f446e2d69d0d2bc3a ) +hunter_add_version( + PACKAGE_NAME + gflags + VERSION + 2.2.1 + URL + "https://github.com/gflags/gflags/archive/v2.2.1.tar.gz" + SHA1 + b1c82261c8b9c87fb2fb5de6bdf70121ad1cca58 +) + hunter_pick_scheme(DEFAULT url_sha1_cmake) hunter_cacheable(gflags) hunter_download(PACKAGE_NAME gflags) diff --git a/cmake/projects/glfw/hunter.cmake b/cmake/projects/glfw/hunter.cmake index 992a5455c7..e0fc0bc04f 100644 --- a/cmake/projects/glfw/hunter.cmake +++ b/cmake/projects/glfw/hunter.cmake @@ -1,4 +1,5 @@ -# Copyright (c) 2016, Alexandre Pretyman +# Copyright (c) 2016-2017, Alexandre Pretyman +# Copyright (c) 2017, David Hirvonen # All rights reserved. if(EMSCRIPTEN) @@ -6,9 +7,10 @@ if(EMSCRIPTEN) endif() include(hunter_add_version) -include(hunter_pick_scheme) include(hunter_cacheable) +include(hunter_cmake_args) include(hunter_download) +include(hunter_pick_scheme) hunter_add_version( PACKAGE_NAME @@ -19,8 +21,72 @@ hunter_add_version( "https://github.com/hunter-packages/glfw/archive/3.2-p0.tar.gz" SHA1 90f91bab3020db15a0fc07c27c53095fa2dbf1b3 + ) + +hunter_add_version( + PACKAGE_NAME + glfw + VERSION + "3.3.0-p0" + URL + "https://github.com/hunter-packages/glfw/archive/3.3.0-p0.tar.gz" + SHA1 + 3621fc665397f07c57d1c77ac4d85d4634f18d3a + ) + +hunter_add_version( + PACKAGE_NAME + glfw + VERSION + "3.3.0-p1" + URL + "https://github.com/hunter-packages/glfw/archive/3.3.0-p1.tar.gz" + SHA1 + 3b42c415f6f6f197768857d12ba44f77e9f1fc50 ) +hunter_add_version( + PACKAGE_NAME + glfw + VERSION + "3.3.0-p2" + URL + "https://github.com/hunter-packages/glfw/archive/3.3.0-p2.tar.gz" + SHA1 + 980c5b788849da9e8429e8f57a10569620b2fa07 +) + +hunter_add_version( + PACKAGE_NAME + glfw + VERSION + "3.3.0-p3" + URL + "https://github.com/hunter-packages/glfw/archive/3.3.0-p3.tar.gz" + SHA1 + 76b9d007591ac1464c443066f4e9db1a0b973efc +) + +hunter_add_version( + PACKAGE_NAME + glfw + VERSION + "3.3.0-p4" + URL + "https://github.com/hunter-packages/glfw/archive/3.3.0-p4.tar.gz" + SHA1 + 455c97ea01a1b78ae39a72d00d86eb1c455e0dca +) + +hunter_cmake_args( + glfw + CMAKE_ARGS + GLFW_BUILD_EXAMPLES=OFF + GLFW_BUILD_TESTS=OFF + GLFW_BUILD_DOCS=OFF + GLFW_INSTALL=ON + ) + hunter_pick_scheme(DEFAULT url_sha1_cmake) hunter_cacheable(glfw) hunter_download( @@ -34,4 +100,3 @@ hunter_download( "lib/pkgconfig/glfw3.pc" ) - diff --git a/cmake/projects/glm/hunter.cmake b/cmake/projects/glm/hunter.cmake index bd0f7ecacd..bb15930c7e 100644 --- a/cmake/projects/glm/hunter.cmake +++ b/cmake/projects/glm/hunter.cmake @@ -6,6 +6,17 @@ include(hunter_pick_scheme) include(hunter_cacheable) include(hunter_download) +hunter_add_version( + PACKAGE_NAME + glm + VERSION + "0.9.8.5" + URL + "https://github.com/hunter-packages/glm/archive/0.9.8.5.tar.gz" + SHA1 + 04ff6d037916f85219e53731e08eb8660d14a38d + ) + hunter_add_version( PACKAGE_NAME glm diff --git a/cmake/projects/glog/hunter.cmake b/cmake/projects/glog/hunter.cmake index 0272995cec..a689edf69d 100644 --- a/cmake/projects/glog/hunter.cmake +++ b/cmake/projects/glog/hunter.cmake @@ -9,6 +9,28 @@ include(hunter_cacheable) include(hunter_download) include(hunter_pick_scheme) +hunter_add_version( + PACKAGE_NAME + glog + VERSION + "0.3.5-p1" + URL + "https://github.com/hunter-packages/glog/archive/v0.3.5-p1.tar.gz" + SHA1 + 64a9da4feec196071fa7f9cd2963e9f193213a67 +) + +hunter_add_version( + PACKAGE_NAME + glog + VERSION + "0.3.5-p0" + URL + "https://github.com/hunter-packages/glog/archive/v0.3.5-p0.tar.gz" + SHA1 + 7b1137b2fb26115f1325534a7c3ffdd6014ccbf8 +) + hunter_add_version( PACKAGE_NAME glog diff --git a/cmake/projects/glproto/hunter.cmake b/cmake/projects/glproto/hunter.cmake index 219de93b07..860dacbc55 100644 --- a/cmake/projects/glproto/hunter.cmake +++ b/cmake/projects/glproto/hunter.cmake @@ -26,6 +26,6 @@ hunter_pick_scheme(DEFAULT url_sha1_autotools) hunter_cacheable(glproto) hunter_download( PACKAGE_NAME glproto - PACKAGE_INTERNAL_DEPS_ID "1" + PACKAGE_INTERNAL_DEPS_ID "2" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/glproto.pc" ) diff --git a/cmake/projects/ice/hunter.cmake b/cmake/projects/ice/hunter.cmake index 455b59a1fd..d5bce7c8eb 100644 --- a/cmake/projects/ice/hunter.cmake +++ b/cmake/projects/ice/hunter.cmake @@ -36,7 +36,7 @@ hunter_cmake_args( hunter_cacheable(ice) hunter_download( PACKAGE_NAME ice - PACKAGE_INTERNAL_DEPS_ID "2" + PACKAGE_INTERNAL_DEPS_ID "3" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/libICE.la" "lib/pkgconfig/ice.pc" diff --git a/cmake/projects/imshow/hunter.cmake b/cmake/projects/imshow/hunter.cmake new file mode 100644 index 0000000000..3997f1b966 --- /dev/null +++ b/cmake/projects/imshow/hunter.cmake @@ -0,0 +1,37 @@ +# Copyright (c) 2017, David Hirvonen +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +# Load used modules +include(hunter_add_package) +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME + imshow + VERSION + "1.0.0" + URL + "https://github.com/hunter-packages/imshow/archive/v1.0.0.tar.gz" + SHA1 + 3b01b2cdd59d8a90da0df45888e96175da009ef5 +) + +hunter_add_version( + PACKAGE_NAME + imshow + VERSION + "1.0.0-p0" + URL + "https://github.com/hunter-packages/imshow/archive/v1.0.0-p0.tar.gz" + SHA1 + 196be66bb2bf62747e638b87444b88824ca51a18 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(imshow) +hunter_download(PACKAGE_NAME imshow) diff --git a/cmake/projects/inputproto/hunter.cmake b/cmake/projects/inputproto/hunter.cmake index e650fde24d..b1d6aa1c33 100644 --- a/cmake/projects/inputproto/hunter.cmake +++ b/cmake/projects/inputproto/hunter.cmake @@ -5,6 +5,7 @@ include(hunter_add_version) include(hunter_cacheable) +include(hunter_cmake_args) include(hunter_configuration_types) include(hunter_download) include(hunter_pick_scheme) @@ -24,8 +25,13 @@ hunter_add_version( hunter_configuration_types(inputproto CONFIGURATION_TYPES Release) hunter_pick_scheme(DEFAULT url_sha1_autotools) hunter_cacheable(inputproto) +hunter_cmake_args( + inputproto + CMAKE_ARGS + PKGCONFIG_EXPORT_TARGETS=inputproto +) hunter_download( PACKAGE_NAME inputproto - PACKAGE_INTERNAL_DEPS_ID "1" + PACKAGE_INTERNAL_DEPS_ID "2" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/inputproto.pc" ) diff --git a/cmake/projects/intltool/hunter.cmake b/cmake/projects/intltool/hunter.cmake index ddc47b4649..653f0c06a7 100644 --- a/cmake/projects/intltool/hunter.cmake +++ b/cmake/projects/intltool/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Damien Buhl +# Copyright (c) 2015, Damien Buhl # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,4 +21,7 @@ hunter_add_version( hunter_configuration_types(intltool CONFIGURATION_TYPES Release) hunter_pick_scheme(DEFAULT url_sha1_autotools) -hunter_download(PACKAGE_NAME intltool) +hunter_download( + PACKAGE_NAME intltool + PACKAGE_INTERNAL_DEPS_ID "1" +) diff --git a/cmake/projects/intsizeof/hunter.cmake b/cmake/projects/intsizeof/hunter.cmake new file mode 100644 index 0000000000..cad30ef7d9 --- /dev/null +++ b/cmake/projects/intsizeof/hunter.cmake @@ -0,0 +1,46 @@ +# Copyright (c) 2014-2017, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME + intsizeof + VERSION + "1.0.0" + URL + "https://github.com/ruslo/intsizeof/archive/v1.0.0.tar.gz" + SHA1 + 9959e0e29c88fe414ba082fb28a722e411682bb3 +) + +hunter_add_version( + PACKAGE_NAME + intsizeof + VERSION + "2.0.0" + URL + "https://github.com/ruslo/intsizeof/archive/v2.0.0.tar.gz" + SHA1 + 35b954c7180bce95f491951a87a49098bb074595 +) + +hunter_add_version( + PACKAGE_NAME + intsizeof + VERSION + "2.0.1" + URL + "https://github.com/ruslo/intsizeof/archive/v2.0.1.tar.gz" + SHA1 + e897f9c32cbd87130ac6b0e88106d06a8b0ada42 +) + +hunter_cacheable(intsizeof) +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_download(PACKAGE_NAME intsizeof) diff --git a/cmake/projects/jsoncpp/hunter.cmake b/cmake/projects/jsoncpp/hunter.cmake index 9925df1ecc..2d41addba9 100644 --- a/cmake/projects/jsoncpp/hunter.cmake +++ b/cmake/projects/jsoncpp/hunter.cmake @@ -4,20 +4,22 @@ # Load used modules include(hunter_add_version) +include(hunter_cacheable) include(hunter_download) include(hunter_pick_scheme) include(hunter_cmake_args) -# List of versions here... +# List of versions: + hunter_add_version( PACKAGE_NAME jsoncpp VERSION - "0.7.0" + "1.8.0" URL - "https://github.com/open-source-parsers/jsoncpp/archive/0.7.0.tar.gz" + "https://github.com/open-source-parsers/jsoncpp/archive/1.8.0.tar.gz" SHA1 - 4fcb0e3275a1391856fc6ae21e36dce866b19393 + 40f7f34551012f68e822664a0b179e7e6cac5a97 ) hunter_add_version( @@ -31,7 +33,16 @@ hunter_add_version( 7bbb47e25b3aa7c4c8b579ca46b32d55f32cb46e ) -# Probably more versions for real packages... +hunter_add_version( + PACKAGE_NAME + jsoncpp + VERSION + "0.7.0" + URL + "https://github.com/open-source-parsers/jsoncpp/archive/0.7.0.tar.gz" + SHA1 + 4fcb0e3275a1391856fc6ae21e36dce866b19393 +) # Pick a download scheme hunter_pick_scheme(DEFAULT url_sha1_cmake) # use scheme for cmake projects @@ -44,4 +55,5 @@ hunter_cmake_args( JSONCPP_WITH_CMAKE_PACKAGE=ON ) +hunter_cacheable(jsoncpp) hunter_download(PACKAGE_NAME jsoncpp) diff --git a/cmake/projects/kbproto/hunter.cmake b/cmake/projects/kbproto/hunter.cmake index 1fbc9b15dc..97ffae46cb 100644 --- a/cmake/projects/kbproto/hunter.cmake +++ b/cmake/projects/kbproto/hunter.cmake @@ -5,6 +5,7 @@ include(hunter_add_version) include(hunter_cacheable) +include(hunter_cmake_args) include(hunter_configuration_types) include(hunter_download) include(hunter_pick_scheme) @@ -23,9 +24,14 @@ hunter_add_version( hunter_configuration_types(kbproto CONFIGURATION_TYPES Release) hunter_pick_scheme(DEFAULT url_sha1_autotools) +hunter_cmake_args( + kbproto + CMAKE_ARGS + PKGCONFIG_EXPORT_TARGETS=kbproto +) hunter_cacheable(kbproto) hunter_download( PACKAGE_NAME kbproto - PACKAGE_INTERNAL_DEPS_ID "1" + PACKAGE_INTERNAL_DEPS_ID "2" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/kbproto.pc" ) diff --git a/cmake/projects/libdaemon/hunter.cmake b/cmake/projects/libdaemon/hunter.cmake index 699b81a7db..db15caf2bf 100644 --- a/cmake/projects/libdaemon/hunter.cmake +++ b/cmake/projects/libdaemon/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Damien Buhl +# Copyright (c) 2015, Damien Buhl # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -21,4 +21,7 @@ hunter_add_version( hunter_configuration_types(libdaemon CONFIGURATION_TYPES Release) hunter_pick_scheme(DEFAULT url_sha1_autotools) -hunter_download(PACKAGE_NAME libdaemon) +hunter_download( + PACKAGE_NAME libdaemon + PACKAGE_INTERNAL_DEPS_ID "1" +) diff --git a/cmake/projects/libjson-rpc-cpp/hunter.cmake b/cmake/projects/libjson-rpc-cpp/hunter.cmake new file mode 100644 index 0000000000..12c19f7aaa --- /dev/null +++ b/cmake/projects/libjson-rpc-cpp/hunter.cmake @@ -0,0 +1,61 @@ +# cmake/projects/libjson-rpc-cpp/hunter.cmake + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_download) +include(hunter_pick_scheme) +include(hunter_cmake_args) + +# List of versions: + +hunter_add_version( + PACKAGE_NAME + libjson-rpc-cpp + VERSION + "0.7.0-p0" + URL + "https://github.com/hunter-packages/libjson-rpc-cpp/archive/v0.7.0-p0.tar.gz" + SHA1 + ddd5f12dfde6f7072d271071bd2c7b0a487de97f +) + +hunter_add_version( + PACKAGE_NAME + libjson-rpc-cpp + VERSION + "0.7.0-p3" + URL + "https://github.com/hunter-packages/libjson-rpc-cpp/archive/v0.7.0-p3.tar.gz" + SHA1 + f2c7e2fd73c1ad3662d275c2b2e515b2ddf02a72 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) + +set(_hunter_unix_cmake_args "") +if(UNIX) + # UNIX options. Disable all as they don't compile on macOS. + set( + _hunter_unix_cmake_args + UNIX_DOMAIN_SOCKET_SERVER=OFF + UNIX_DOMAIN_SOCKET_CLIENT=OFF + FILE_DESCRIPTOR_SERVER=OFF + FILE_DESCRIPTOR_CLIENT=OFF + ) +endif() + +hunter_cmake_args( + libjson-rpc-cpp + CMAKE_ARGS + BUILD_STATIC_LIBS=ON + WITH_COVERAGE=OFF + COMPILE_STUBGEN=OFF + COMPILE_EXAMPLES=OFF + COMPILE_TESTS=OFF + HTTP_CLIENT=ON + HTTP_SERVER=OFF # Requires microhttpd library. + ${_hunter_unix_cmake_args} +) + +hunter_cacheable(libjson-rpc-cpp) +hunter_download(PACKAGE_NAME libjson-rpc-cpp) diff --git a/cmake/projects/libuv/hunter.cmake b/cmake/projects/libuv/hunter.cmake new file mode 100644 index 0000000000..6d32322ee0 --- /dev/null +++ b/cmake/projects/libuv/hunter.cmake @@ -0,0 +1,61 @@ +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_download) +include(hunter_pick_scheme) +include(hunter_report_broken_package) + +hunter_add_version( + PACKAGE_NAME + libuv + VERSION + 2.0.0 + URL + https://github.com/hunter-packages/libuv/archive/v2.0.0-hunter-release.tar.gz + SHA1 + 60dee8435f4c4136a2ecb6814a2f302641ef1093 + ) + +hunter_add_version( + PACKAGE_NAME + libuv + VERSION + 2.0.0-p0 + URL + "https://github.com/hunter-packages/libuv/archive/v2.0.0-p0.tar.gz" + SHA1 + 65a011219de5ad16e2de2df4b07b945a9e67035d + ) + +hunter_add_version( + PACKAGE_NAME + libuv + VERSION + 1.14.0-p0 + URL + "https://github.com/hunter-packages/libuv/archive/v1.14.0-p0.tar.gz" + SHA1 + b570a0b45a631b1955e7c58a3f35dcbf19c522d6 +) + +hunter_add_version( + PACKAGE_NAME + libuv + VERSION + 1.14.0-p1 + URL + "https://github.com/hunter-packages/libuv/archive/v1.14.0-p1.tar.gz" + SHA1 + 4b334b174f4abf4a7f41656e1cfe3c60ad9382ca +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) + +if(ANDROID AND (CMAKE_SYSTEM_VERSION VERSION_LESS 21)) + # https://stackoverflow.com/a/32638557/2288008 + hunter_report_broken_package("API 21+ required for 'pthread_atfork'") +endif() + +hunter_cacheable(libuv) +hunter_download(PACKAGE_NAME libuv) diff --git a/cmake/projects/libxml2/hunter.cmake b/cmake/projects/libxml2/hunter.cmake index 0b9fb1c3c2..c6594f850a 100644 --- a/cmake/projects/libxml2/hunter.cmake +++ b/cmake/projects/libxml2/hunter.cmake @@ -31,8 +31,9 @@ hunter_cmake_args( hunter_configuration_types(libxml2 CONFIGURATION_TYPES Release) hunter_pick_scheme(DEFAULT url_sha1_autotools) hunter_cacheable(libxml2) -hunter_download(PACKAGE_NAME libxml2 - PACKAGE_UNRELOCATABLE_TEXT_FILES - lib/pkgconfig/libxml-2.0.pc +hunter_download( + PACKAGE_NAME libxml2 + PACKAGE_INTERNAL_DEPS_ID "1" + PACKAGE_UNRELOCATABLE_TEXT_FILES + "lib/pkgconfig/libxml-2.0.pc" ) - diff --git a/cmake/projects/lzma/hunter.cmake b/cmake/projects/lzma/hunter.cmake new file mode 100644 index 0000000000..4e94d5ede0 --- /dev/null +++ b/cmake/projects/lzma/hunter.cmake @@ -0,0 +1,57 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME + lzma + VERSION + 5.2.3-p0 + URL + "https://github.com/hunter-packages/lzma/archive/v5.2.3-p0.tar.gz" + SHA1 + 98de5eb2f3bf361a836ee78509f311db1c54494b +) + +hunter_add_version( + PACKAGE_NAME + lzma + VERSION + 5.2.3-p1 + URL + "https://github.com/hunter-packages/lzma/archive/v5.2.3-p1.tar.gz" + SHA1 + 391ace8ca1ae84d3b4fb9750943749bc6b589e87 +) + +hunter_add_version( + PACKAGE_NAME + lzma + VERSION + 5.2.3-p2 + URL + "https://github.com/hunter-packages/lzma/archive/v5.2.3-p2.tar.gz" + SHA1 + 758b108c2acb060ff4ddd9118d71809b3dd60427 +) + +hunter_add_version( + PACKAGE_NAME + lzma + VERSION + 5.2.3-p4 + URL + "https://github.com/hunter-packages/lzma/archive/v5.2.3-p4.tar.gz" + SHA1 + 09d7d8c8c8f1f488b3ccb739760c2092aae62441 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(lzma) +hunter_download(PACKAGE_NAME lzma) diff --git a/cmake/projects/mtplz/hunter.cmake b/cmake/projects/mtplz/hunter.cmake new file mode 100644 index 0000000000..b12f077845 --- /dev/null +++ b/cmake/projects/mtplz/hunter.cmake @@ -0,0 +1,44 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_cmake_args) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME + mtplz + VERSION + 0.1-p1 + URL + "https://github.com/hunter-packages/mtplz/archive/v0.1-p1.tar.gz" + SHA1 + 3323b6a97afefa0cc008785caa37b43681c9589e +) + +hunter_add_version( + PACKAGE_NAME + mtplz + VERSION + 0.1-p3 + URL + "https://github.com/hunter-packages/mtplz/archive/v0.1-p3.tar.gz" + SHA1 + 22a29dbe58a86e4e91e1abeb1ab4c67cf3ceca79 +) + +hunter_cmake_args( + mtplz + CMAKE_ARGS + BUILD_TESTING=OFF + MTPLZ_BUILD_EXE=OFF + MTPLZ_BUILD_KENLM_INTERPOLATE=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(mtplz) +hunter_download(PACKAGE_NAME mtplz) diff --git a/cmake/projects/nanoflann/hunter.cmake b/cmake/projects/nanoflann/hunter.cmake new file mode 100644 index 0000000000..47a4d38b3a --- /dev/null +++ b/cmake/projects/nanoflann/hunter.cmake @@ -0,0 +1,33 @@ +# Copyright (c) 2016-2017, Ruslan Baratov +# Copyright (c) 2017, David Hirvonen +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_cmake_args) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME + nanoflann + VERSION + 1.2.3-p0 + URL + "https://github.com/hunter-packages/nanoflann/archive/v1.2.3-p0.tar.gz" + SHA1 + 72a42a31056aab380eac09b9f00dab18e91235b8 + ) + +hunter_cmake_args( + nanoflann + CMAKE_ARGS + NANOFLANN_BUILD_EXAMPLES=OFF + NANOFLANN_BUILD_TESTS=OFF + ) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(nanoflann) +hunter_download(PACKAGE_NAME nanoflann) diff --git a/cmake/projects/nlohmann-json/hunter.cmake b/cmake/projects/nlohmann-json/hunter.cmake deleted file mode 100644 index 301cc74a88..0000000000 --- a/cmake/projects/nlohmann-json/hunter.cmake +++ /dev/null @@ -1,27 +0,0 @@ -# !!! DO NOT PLACE HEADER GUARDS HERE !!! - -include(hunter_add_version) -include(hunter_cacheable) -include(hunter_cmake_args) -include(hunter_download) -include(hunter_pick_scheme) - -hunter_add_version( - PACKAGE_NAME nlohmann-json - VERSION "1.0.0-rc1-hunter-2" - URL "https://github.com/hunter-packages/json/archive/v1.0.0-rc1-hunter-2.tar.gz" - SHA1 2db824ca17678c8918575bbab982e6ae93283433 -) - -hunter_add_version( - PACKAGE_NAME nlohmann-json - VERSION "1.0.0-rc1-hunter-3" - URL "https://github.com/hunter-packages/json/archive/v1.0.0-rc1-hunter-3.tar.gz" - SHA1 4f0300ebb08b28ac6bca0f947ffd6afde64386ef -) - -hunter_cmake_args(nlohmann-json CMAKE_ARGS JSON_BUILD_TESTS=OFF) - -hunter_pick_scheme(DEFAULT url_sha1_cmake) -hunter_cacheable(nlohmann-json) -hunter_download(PACKAGE_NAME nlohmann-json) diff --git a/cmake/projects/nlohmann_json/hunter.cmake b/cmake/projects/nlohmann_json/hunter.cmake new file mode 100644 index 0000000000..2d67fc7c85 --- /dev/null +++ b/cmake/projects/nlohmann_json/hunter.cmake @@ -0,0 +1,27 @@ +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_cmake_args) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME nlohmann_json + VERSION "2.1.1-p0" + URL "https://github.com/hunter-packages/json/archive/v2.1.1-p0.tar.gz" + SHA1 baf11b83387a7c4b2b6eb1e280f69084185813c0 +) + +hunter_add_version( + PACKAGE_NAME nlohmann_json + VERSION "2.1.1-p1" + URL "https://github.com/hunter-packages/json/archive/v2.1.1-p1.tar.gz" + SHA1 28ec11ef2596d38a11a2f4b3dfd63c3255c76f57 +) + +hunter_cmake_args(nlohmann_json CMAKE_ARGS JSON_BuildTests=OFF) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(nlohmann_json) +hunter_download(PACKAGE_NAME nlohmann_json) diff --git a/cmake/projects/odb-boost/hunter.cmake b/cmake/projects/odb-boost/hunter.cmake index 64cf49bd1c..4f6ad8d9f6 100644 --- a/cmake/projects/odb-boost/hunter.cmake +++ b/cmake/projects/odb-boost/hunter.cmake @@ -27,5 +27,5 @@ hunter_download(PACKAGE_NAME odb-boost PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/libodb-boost.la" "lib/pkgconfig/libodb-boost.pc" - PACKAGE_INTERNAL_DEPS_ID "1" + PACKAGE_INTERNAL_DEPS_ID "6" ) diff --git a/cmake/projects/odb/hunter.cmake b/cmake/projects/odb/hunter.cmake index e9985490c6..e6ab737648 100644 --- a/cmake/projects/odb/hunter.cmake +++ b/cmake/projects/odb/hunter.cmake @@ -23,7 +23,9 @@ hunter_add_version( hunter_configuration_types(odb CONFIGURATION_TYPES Release) hunter_pick_scheme(DEFAULT url_sha1_autotools) hunter_cacheable(odb) -hunter_download(PACKAGE_NAME odb +hunter_download( + PACKAGE_NAME odb + PACKAGE_INTERNAL_DEPS_ID "1" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/libodb.la" "lib/pkgconfig/libodb.pc" diff --git a/cmake/projects/ogles_gpgpu/hunter.cmake b/cmake/projects/ogles_gpgpu/hunter.cmake index 447c63a732..93b2441e0c 100644 --- a/cmake/projects/ogles_gpgpu/hunter.cmake +++ b/cmake/projects/ogles_gpgpu/hunter.cmake @@ -9,6 +9,17 @@ include(hunter_cmake_args) include(hunter_download) include(hunter_pick_scheme) +hunter_add_version( + PACKAGE_NAME + ogles_gpgpu + VERSION + 0.1.6-p3 + URL + "https://github.com/hunter-packages/ogles_gpgpu/archive/v0.1.6-p3.tar.gz" + SHA1 + 3ddef5cd88ae26776e86e5d0d0cf637d06a88d1f +) + hunter_add_version( PACKAGE_NAME ogles_gpgpu @@ -86,6 +97,28 @@ hunter_add_version( 3b9b76a5af9e8eb206cfaa4503b954ec87cb5c7c ) +hunter_add_version( + PACKAGE_NAME + ogles_gpgpu + VERSION + 0.2.1 + URL + "https://github.com/hunter-packages/ogles_gpgpu/archive/v0.2.1.tar.gz" + SHA1 + 373a66b1149b1b563f65195c6767ba4ee7a0b9ed +) + +hunter_add_version( + PACKAGE_NAME + ogles_gpgpu + VERSION + 0.2.4 + URL + "https://github.com/hunter-packages/ogles_gpgpu/archive/v0.2.4.tar.gz" + SHA1 + ce38c35533fbb8f8efc30eb74d300598ee2132aa +) + hunter_cmake_args(ogles_gpgpu CMAKE_ARGS OGLES_GPGPU_INSTALL=ON) hunter_pick_scheme(DEFAULT url_sha1_cmake) hunter_cacheable(ogles_gpgpu) diff --git a/cmake/projects/onmt/hunter.cmake b/cmake/projects/onmt/hunter.cmake new file mode 100644 index 0000000000..d32e4122eb --- /dev/null +++ b/cmake/projects/onmt/hunter.cmake @@ -0,0 +1,38 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_cmake_args) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME + onmt + VERSION + 0.4.1-p0 + URL + "https://github.com/hunter-packages/onmt/archive/v0.4.1-p0.tar.gz" + SHA1 + a691a53a695135cd38d85042bafacf734b3e6a5a +) + +hunter_add_version( + PACKAGE_NAME + onmt + VERSION + 0.4.1-p2 + URL + "https://github.com/hunter-packages/onmt/archive/v0.4.1-p2.tar.gz" + SHA1 + a0b6cf26304e8049d7e8d68b0c80fc757fc0504a +) + +hunter_cmake_args(onmt CMAKE_ARGS LIB_ONLY=YES WITH_OPENMP=OFF) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(onmt) +hunter_download(PACKAGE_NAME onmt) diff --git a/cmake/projects/pciaccess/hunter.cmake b/cmake/projects/pciaccess/hunter.cmake index e821a62f7d..1a5cf4181c 100644 --- a/cmake/projects/pciaccess/hunter.cmake +++ b/cmake/projects/pciaccess/hunter.cmake @@ -26,7 +26,7 @@ hunter_pick_scheme(DEFAULT url_sha1_autotools) hunter_cacheable(pciaccess) hunter_download( PACKAGE_NAME pciaccess - PACKAGE_INTERNAL_DEPS_ID "2" + PACKAGE_INTERNAL_DEPS_ID "3" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/libpciaccess.la" "lib/pkgconfig/pciaccess.pc" diff --git a/cmake/projects/presentproto/hunter.cmake b/cmake/projects/presentproto/hunter.cmake index 133f76aa1d..a2db52561e 100644 --- a/cmake/projects/presentproto/hunter.cmake +++ b/cmake/projects/presentproto/hunter.cmake @@ -26,6 +26,6 @@ hunter_pick_scheme(DEFAULT url_sha1_autotools) hunter_cacheable(presentproto) hunter_download( PACKAGE_NAME presentproto - PACKAGE_INTERNAL_DEPS_ID "1" + PACKAGE_INTERNAL_DEPS_ID "2" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/presentproto.pc" ) diff --git a/cmake/projects/pthread-stubs/hunter.cmake b/cmake/projects/pthread-stubs/hunter.cmake index a7a714f134..7958d64631 100644 --- a/cmake/projects/pthread-stubs/hunter.cmake +++ b/cmake/projects/pthread-stubs/hunter.cmake @@ -5,6 +5,7 @@ include(hunter_add_version) include(hunter_cacheable) +include(hunter_cmake_args) include(hunter_configuration_types) include(hunter_download) include(hunter_pick_scheme) @@ -24,8 +25,13 @@ hunter_add_version( hunter_configuration_types(pthread-stubs CONFIGURATION_TYPES Release) hunter_pick_scheme(DEFAULT url_sha1_autotools) hunter_cacheable(pthread-stubs) +hunter_cmake_args( + pthread-stubs + CMAKE_ARGS + PKGCONFIG_EXPORT_TARGETS=pthread-stubs +) hunter_download( PACKAGE_NAME pthread-stubs - PACKAGE_INTERNAL_DEPS_ID "1" + PACKAGE_INTERNAL_DEPS_ID "2" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/pthread-stubs.pc" ) diff --git a/cmake/projects/pugixml/hunter.cmake b/cmake/projects/pugixml/hunter.cmake new file mode 100644 index 0000000000..913d04a49b --- /dev/null +++ b/cmake/projects/pugixml/hunter.cmake @@ -0,0 +1,18 @@ +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_cmake_args) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME pugixml + VERSION "1.8.1" + URL "https://github.com/rusdevops/pugixml/archive/v1.8.1-hunter.tar.gz" + SHA1 005b1c8830e6f81f559d0b72f9f7ff320895847f +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(pugixml) +hunter_download(PACKAGE_NAME pugixml) diff --git a/cmake/projects/randrproto/hunter.cmake b/cmake/projects/randrproto/hunter.cmake index 2bde8c87e0..69428203ec 100644 --- a/cmake/projects/randrproto/hunter.cmake +++ b/cmake/projects/randrproto/hunter.cmake @@ -31,10 +31,12 @@ hunter_cmake_args( randrproto CMAKE_ARGS # do not use double quotes on CMAKE_ARGS DEPENDS_ON_PACKAGES=${randrproto_dependencies} + PKGCONFIG_EXPORT_TARGETS=randrproto ) hunter_cacheable(randrproto) hunter_download( PACKAGE_NAME randrproto + PACKAGE_INTERNAL_DEPS_ID "1" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/randrproto.pc" ) diff --git a/cmake/projects/renderproto/hunter.cmake b/cmake/projects/renderproto/hunter.cmake index 72391c0293..12b0f5b57f 100644 --- a/cmake/projects/renderproto/hunter.cmake +++ b/cmake/projects/renderproto/hunter.cmake @@ -5,6 +5,7 @@ include(hunter_add_version) include(hunter_cacheable) +include(hunter_cmake_args) include(hunter_configuration_types) include(hunter_download) include(hunter_pick_scheme) @@ -23,9 +24,14 @@ hunter_add_version( hunter_configuration_types(renderproto CONFIGURATION_TYPES Release) hunter_pick_scheme(DEFAULT url_sha1_autotools) +hunter_cmake_args( + renderproto + CMAKE_ARGS + PKGCONFIG_EXPORT_TARGETS=renderproto +) hunter_cacheable(renderproto) hunter_download( PACKAGE_NAME renderproto - PACKAGE_INTERNAL_DEPS_ID "1" + PACKAGE_INTERNAL_DEPS_ID "2" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/renderproto.pc" ) diff --git a/cmake/projects/sm/hunter.cmake b/cmake/projects/sm/hunter.cmake index 3f051b0637..6aa95cf4c7 100644 --- a/cmake/projects/sm/hunter.cmake +++ b/cmake/projects/sm/hunter.cmake @@ -37,7 +37,7 @@ hunter_cmake_args( hunter_cacheable(sm) hunter_download( PACKAGE_NAME sm - PACKAGE_INTERNAL_DEPS_ID "2" + PACKAGE_INTERNAL_DEPS_ID "3" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/libSM.la" "lib/pkgconfig/sm.pc" diff --git a/cmake/projects/sparsehash/hunter.cmake b/cmake/projects/sparsehash/hunter.cmake index bd7a4fce6b..729f55a483 100644 --- a/cmake/projects/sparsehash/hunter.cmake +++ b/cmake/projects/sparsehash/hunter.cmake @@ -10,6 +10,7 @@ include(hunter_add_version) include(hunter_download) include(hunter_pick_scheme) +include(hunter_report_broken_package) # Version list hunter_add_version( @@ -26,5 +27,9 @@ hunter_add_version( # Default CMake scheme hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_report_broken_package( + "'sparsehash' package is destructive (https://github.com/ruslo/hunter/issues/695)" +) + # This is header-only, so only headers are needed hunter_download(PACKAGE_NAME sparsehash) diff --git a/cmake/projects/spdlog/hunter.cmake b/cmake/projects/spdlog/hunter.cmake index 7b99f64196..cdd59d9f20 100644 --- a/cmake/projects/spdlog/hunter.cmake +++ b/cmake/projects/spdlog/hunter.cmake @@ -19,6 +19,39 @@ hunter_add_version( 4d9967d165fc7ea2d561210bec2f50e60547daa6 ) +hunter_add_version( + PACKAGE_NAME + spdlog + VERSION + "0.13.0-p0" + URL + "https://github.com/hunter-packages/spdlog/archive/v0.13.0-p0.tar.gz" + SHA1 + b34b92075423d9da196daefe796316393a0fd593 +) + +hunter_add_version( + PACKAGE_NAME + spdlog + VERSION + "0.13.0-p1" + URL + "https://github.com/hunter-packages/spdlog/archive/v0.13.0-p1.tar.gz" + SHA1 + edf9ba15852b181e16e1fe323878d8281941b376 +) + +hunter_add_version( + PACKAGE_NAME + spdlog + VERSION + "0.12.0-p0" + URL + "https://github.com/hunter-packages/spdlog/archive/v0.12.0-p0.tar.gz" + SHA1 + b10bf7b537198a5f2224c3e022db38da9b2f3d53 +) + hunter_add_version( PACKAGE_NAME spdlog diff --git a/cmake/projects/sse2neon/hunter.cmake b/cmake/projects/sse2neon/hunter.cmake new file mode 100644 index 0000000000..1c872fab32 --- /dev/null +++ b/cmake/projects/sse2neon/hunter.cmake @@ -0,0 +1,25 @@ +# Copyright (c) 2016-2017, Ruslan Baratov +# Copyright (c) 2017, David Hirvonen +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME + sse2neon + VERSION + 1.0.0-p0 + URL + "https://github.com/hunter-packages/sse2neon/archive/v1.0.0-p0.tar.gz" + SHA1 + 1a3104782526ea6aba9e5429dc64414e91b4cf1c +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(sse2neon) +hunter_download(PACKAGE_NAME sse2neon) diff --git a/cmake/projects/stormlib/hunter.cmake b/cmake/projects/stormlib/hunter.cmake new file mode 100644 index 0000000000..cb96b07942 --- /dev/null +++ b/cmake/projects/stormlib/hunter.cmake @@ -0,0 +1,27 @@ +# cmake/projects/Example/hunter.cmake + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +# Load used modules +include(hunter_add_version) +include(hunter_download) +include(hunter_pick_scheme) +include(hunter_cacheable) + +# List of versions here... +hunter_add_version( + PACKAGE_NAME + stormlib + VERSION + "9.21-p1" + URL + "https://github.com/hunter-packages/StormLib/archive/v9.21-p1.tar.gz" + SHA1 + db5b811ef5171b163e9abc4d41f1323fb43882a2 +) + +# Pick a download scheme +hunter_pick_scheme(DEFAULT url_sha1_cmake) # use scheme for cmake projects + +hunter_cacheable(stormlib) +hunter_download(PACKAGE_NAME stormlib) diff --git a/cmake/projects/tacopie/hunter.cmake b/cmake/projects/tacopie/hunter.cmake new file mode 100644 index 0000000000..af3c56ef93 --- /dev/null +++ b/cmake/projects/tacopie/hunter.cmake @@ -0,0 +1,31 @@ +# cmake/projects/tacopie/hunter.cmake + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +# Load used modules +include(hunter_add_version) +include(hunter_download) +include(hunter_pick_scheme) +include(hunter_cacheable) + +# List of versions here... +hunter_add_version( + PACKAGE_NAME + tacopie + VERSION + "2.4.0-h1" + URL + "https://github.com/hunter-packages/tacopie/archive/2.4.0-h1.tar.gz" + SHA1 + 5b326dd4e4792e63d9261682205f32944719bed0 +) + +# Pick a download scheme +hunter_pick_scheme(DEFAULT url_sha1_cmake) # use scheme for cmake projects + +# Download package. +# Two versions of library will be build by default: +# * libtacopie.a +# * libtacopied.a +hunter_cacheable(tacopie) +hunter_download(PACKAGE_NAME tacopie) diff --git a/cmake/projects/thread-pool-cpp/hunter.cmake b/cmake/projects/thread-pool-cpp/hunter.cmake index 4866336022..b80d0d66ce 100644 --- a/cmake/projects/thread-pool-cpp/hunter.cmake +++ b/cmake/projects/thread-pool-cpp/hunter.cmake @@ -8,6 +8,17 @@ include(hunter_cacheable) include(hunter_download) include(hunter_pick_scheme) +hunter_add_version( + PACKAGE_NAME + thread-pool-cpp + VERSION + 1.1.0 + URL + "https://github.com/hunter-packages/thread-pool-cpp/archive/v1.1.0.tar.gz" + SHA1 + 52c345cb9f0f3e43d0c4760462784b0180f5efe8 +) + hunter_add_version( PACKAGE_NAME thread-pool-cpp diff --git a/cmake/projects/tomcrypt/hunter.cmake b/cmake/projects/tomcrypt/hunter.cmake new file mode 100644 index 0000000000..d2d87000a6 --- /dev/null +++ b/cmake/projects/tomcrypt/hunter.cmake @@ -0,0 +1,49 @@ +# cmake/projects/Example/hunter.cmake + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +# Load used modules +include(hunter_add_version) +include(hunter_download) +include(hunter_pick_scheme) +include(hunter_cacheable) + +# List of versions here... +hunter_add_version( + PACKAGE_NAME + tomcrypt + VERSION + "1.17-p1" + URL + "https://github.com/hunter-packages/libtomcrypt/archive/1.17-p1.tar.gz" + SHA1 + 3c9c61ee441b77517525528f5c191fa19801fd30 +) + +hunter_add_version( + PACKAGE_NAME + tomcrypt + VERSION + "1.17-p2" + URL + "https://github.com/hunter-packages/libtomcrypt/archive/1.17-p2.tar.gz" + SHA1 + 90a3796bddd319fe12529d4b58e2ab23c15b7f1b +) + +hunter_add_version( + PACKAGE_NAME + tomcrypt + VERSION + "1.17-p3" + URL + "https://github.com/hunter-packages/libtomcrypt/archive/1.17-p3.tar.gz" + SHA1 + 69b882eff5bf69a5a4e0e9169cc9b9c0ea5b9d71 +) + +# Pick a download scheme +hunter_pick_scheme(DEFAULT url_sha1_cmake) # use scheme for cmake projects + +hunter_cacheable(tomcrypt) +hunter_download(PACKAGE_NAME tomcrypt) diff --git a/cmake/projects/x11/hunter.cmake b/cmake/projects/x11/hunter.cmake index 446c2c6057..74db2902fb 100644 --- a/cmake/projects/x11/hunter.cmake +++ b/cmake/projects/x11/hunter.cmake @@ -36,11 +36,12 @@ hunter_cmake_args( x11 CMAKE_ARGS # do not use double quotes on CMAKE_ARGS DEPENDS_ON_PACKAGES=${x11_dependencies} + PKGCONFIG_EXPORT_TARGETS=x11-xcb;x11 ) hunter_cacheable(x11) hunter_download( PACKAGE_NAME x11 - PACKAGE_INTERNAL_DEPS_ID "2" + PACKAGE_INTERNAL_DEPS_ID "4" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/libX11-xcb.la" "lib/libX11.la" diff --git a/cmake/projects/x264/hunter.cmake b/cmake/projects/x264/hunter.cmake new file mode 100644 index 0000000000..75ed647d8c --- /dev/null +++ b/cmake/projects/x264/hunter.cmake @@ -0,0 +1,30 @@ +# Copyright (c) 2017 Alexandre Pretyman +# All rights reserved. + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_cmake_args) +include(hunter_configuration_types) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME + x264 + VERSION + "snapshot-20170420-2245" + URL + "ftp://ftp.videolan.org/pub/x264/snapshots/x264-snapshot-20170420-2245.tar.bz2" + SHA1 + 679b8c4f39f375090bf64e5c80c83303e4ddc37c +) + +hunter_configuration_types(x264 CONFIGURATION_TYPES Release) +hunter_pick_scheme(DEFAULT url_sha1_x264) +hunter_cmake_args(x264 CMAKE_ARGS PKGCONFIG_EXPORT_TARGETS=x264) +hunter_cacheable(x264) +hunter_download( + PACKAGE_NAME x264 + PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/x264.pc" +) + diff --git a/cmake/projects/x264/schemes/url_sha1_x264.cmake.in b/cmake/projects/x264/schemes/url_sha1_x264.cmake.in new file mode 100644 index 0000000000..bb66c92723 --- /dev/null +++ b/cmake/projects/x264/schemes/url_sha1_x264.cmake.in @@ -0,0 +1,342 @@ +# Copyright (c) 2017 Alexandre Pretyman +# All rights reserved. + +cmake_minimum_required(VERSION 3.0) +project(Hunter) + +include(ExternalProject) # ExternalProject_Add + +# Scheme for building x264 libraries only (no programs) + +list(APPEND CMAKE_MODULE_PATH "@HUNTER_SELF@/cmake/modules") + +include(hunter_fatal_error) +include(hunter_get_build_flags) +include(hunter_get_toolchain_binaries) +include(hunter_report_broken_package) +include(hunter_status_debug) +include(hunter_status_print) +include(hunter_test_string_not_empty) + +hunter_status_debug("Scheme: url_sha1_x264") + +# Check preconditions +hunter_test_string_not_empty("@HUNTER_SELF@") +hunter_test_string_not_empty("@HUNTER_EP_NAME@") +hunter_test_string_not_empty("@HUNTER_PACKAGE_URL@") +hunter_test_string_not_empty("@HUNTER_PACKAGE_SHA1@") +hunter_test_string_not_empty("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_test_string_not_empty("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_test_string_not_empty("@HUNTER_PACKAGE_INSTALL_PREFIX@") +hunter_test_string_not_empty("@HUNTER_PACKAGE_CONFIGURATION_TYPES@") +hunter_test_string_not_empty("@HUNTER_INSTALL_PREFIX@") +hunter_test_string_not_empty("@HUNTER_GLOBAL_SCRIPT_DIR@") + +if("@MSVC@") + hunter_user_error("x264 building under MSVC needs to be implemented") +endif() + +# Ideally the running of commands below should be changed in the future to, +# instead of using the shell variables, control the environment through CMake's +# ENV{var} and run the commands through execute_process(...) + +set(default_path "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin") +set(shell_env_path "PATH=@HUNTER_PACKAGE_INSTALL_PREFIX@/bin:${default_path}") + +set(d1 "${root_id}/lib/pkgconfig") +set(d2 "${root_id}/share/pkgconfig") +set(shell_pkg_config_libdir "PKG_CONFIG_LIBDIR=${d1}:${d2}") + +set(clear_vars_shell_script "@HUNTER_GLOBAL_SCRIPT_DIR@/clear-all.sh") + + +hunter_get_toolchain_binaries( + OUT_AR + ar + OUT_AS + as + OUT_LD + ld + OUT_NM + nm + OUT_OBJCOPY + objcopy + OUT_OBJDUMP + objdump + OUT_RANLIB + ranlib + OUT_STRIP + strip + OUT_CPP + cpp + OUT_CC + cc + OUT_CXX + cxx +) + +set(toolchain_binaries) +if(ar) + list(APPEND toolchain_binaries "AR=${ar}") +endif() +if(as) + list(APPEND toolchain_binaries "AS=${as}") +endif() +if(ld) + list(APPEND toolchain_binaries "LD=${ld}") +endif() +if(nm) + list(APPEND toolchain_binaries "NM=${nm}") +endif() +if(objcopy) + list(APPEND toolchain_binaries "OBJCOPY=${objcopy}") +endif() +if(objdump) + list(APPEND toolchain_binaries "OBJDUMP=${objdump}") +endif() +if(ranlib) + list(APPEND toolchain_binaries "RANLIB=${ranlib}") +endif() +if(strip) + list(APPEND toolchain_binaries "STRIP=${strip}") +endif() +if(cpp) + list(APPEND toolchain_binaries "CPP=${cpp}") +endif() +if(cc) + list(APPEND toolchain_binaries "CC=${cc}") +endif() +if(cxx) + list(APPEND toolchain_binaries "CXX=${cxx}") +endif() + +set(shell_env + . + ${clear_vars_shell_script} + && + ${shell_env_path} + ${shell_pkg_config_libdir} +) + +if(toolchain_binaries) + list(APPEND shell_env ${toolchain_binaries}) +endif() + +hunter_get_build_flags( + INSTALL_DIR + "@HUNTER_INSTALL_PREFIX@" + PACKAGE_CONFIGURATION_TYPES + "@HUNTER_PACKAGE_CONFIGURATION_TYPES@" + OUT_CPPFLAGS + cppflags + OUT_CFLAGS + cflags + OUT_LDFLAGS + ldflags +) + +set(x264_configure_command "./configure") + +if(CMAKE_CROSSCOMPILING) + set(configure_host) + string(COMPARE NOTEQUAL "${ANDROID}" "" is_android) + string(COMPARE NOTEQUAL "${IPHONEOS_ARCHS}${IPHONESIMULATOR_ARCHS}" "" is_ios) + string(COMPARE NOTEQUAL "${CROSS_COMPILE_TOOLCHAIN_PREFIX}" "" is_cross_compile) + if(is_android) + set(configure_host --host=${CMAKE_CXX_ANDROID_TOOLCHAIN_MACHINE}) + elseif(is_ios) + # for iOS the host setting is done below + elseif(is_cross_compile) + set(configure_host --host=${CROSS_COMPILE_TOOLCHAIN_PREFIX}) + endif() + + string(COMPARE NOTEQUAL "${configure_host}" "" has_configure_host) + if(has_configure_host) + list(APPEND x264_configure_command ${configure_host}) + endif() +endif() + + +list(APPEND x264_configure_command "--disable-cli") # build only libs + +if(NOT CMAKE_ASM_COMPILER OR DISABLE_ASM) + list(APPEND x264_configure_command "--disable-asm") +endif() + +set(cflags "${cppflags} ${cflags}") +string(STRIP "${cflags}" cflags) + +# Hunter builds static libraries by default +if(BUILD_SHARED_LIBS) + list(APPEND x264_configure_command --enable-shared --disable-static) +else() + list(APPEND x264_configure_command --disable-shared --enable-static) +endif() + + +set(x264_make_command "make") +if("@HUNTER_JOBS_OPTION@") + list(APPEND x264_make_command "-j" "@HUNTER_JOBS_OPTION@") +endif() + +#configure_command set below +set(build_command ${shell_env} ${x264_make_command}) +set(install_command ${shell_env} make install) + +string(COMPARE NOTEQUAL "${IPHONEOS_ARCHS}${IPHONESIMULATOR_ARCHS}" "" is_ios) +if(is_ios) + hunter_status_debug("x264 iOS IPHONEOS_ARCHS: ${IPHONEOS_ARCHS} IPHONESIMULATOR_ARCHS: ${IPHONESIMULATOR_ARCHS}") + if(BUILD_SHARED_LIBS) + hunter_fatal_error("x264: building iOS libraries as shared is not supported") + endif() + set(ios_architectures) + list(APPEND ios_architectures ${IPHONEOS_ARCHS} ${IPHONESIMULATOR_ARCHS}) +endif() + +if(NOT is_ios) + # The code below should be changed to set these flags as ENV{CFLAGS} and + # ENV{LDFLAGS} instead of --extra-* parameters below + # When the are spaces in ${cflags} and ${ldflags}, CMake puts the value + # inside double quotes, and the shell interprets it as a command instead of + # env var, returning error of CFLAGS=... command not found + list(APPEND x264_configure_command "--extra-cflags=${cflags}") + list(APPEND x264_configure_command "--extra-ldflags=${ldflags}") + list(APPEND x264_configure_command "--prefix=@HUNTER_PACKAGE_INSTALL_PREFIX@") + + set(configure_command ${shell_env} ${x264_configure_command}) + ExternalProject_Add( + "@HUNTER_EP_NAME@" + URL + @HUNTER_PACKAGE_URL@ + URL_HASH + SHA1=@HUNTER_PACKAGE_SHA1@ + DOWNLOAD_DIR + "@HUNTER_PACKAGE_DOWNLOAD_DIR@" + SOURCE_DIR + "@HUNTER_PACKAGE_SOURCE_DIR@" + INSTALL_DIR + "@HUNTER_PACKAGE_INSTALL_PREFIX@" + # not used, just avoid creating Install/ empty directory + CONFIGURE_COMMAND + ${configure_command} + BUILD_COMMAND + ${build_command} + BUILD_IN_SOURCE + 1 + INSTALL_COMMAND + ${install_command} + ) +else() + set(ios_universal_target "@HUNTER_EP_NAME@-universal") + set(merge_lipo_script "autotools-merge-lipo.cmake") + ExternalProject_Add(${ios_universal_target} + DOWNLOAD_COMMAND + "" + SOURCE_DIR + "@HUNTER_PACKAGE_SOURCE_DIR@/universal" + INSTALL_DIR + "@HUNTER_PACKAGE_INSTALL_PREFIX@" + # not used, just avoid creating Install/ empty directory + CONFIGURE_COMMAND + "" + BUILD_COMMAND + "" + BUILD_IN_SOURCE + 1 + INSTALL_COMMAND + ${CMAKE_COMMAND} + -P + "@HUNTER_PACKAGE_SOURCE_DIR@/universal/${merge_lipo_script}" + ) + set(ios_built_arch_roots) + set(multi_arch_install_root "@HUNTER_PACKAGE_BUILD_DIR@/multi-arch") + foreach(ios_architecture ${ios_architectures}) + hunter_status_debug("Autotools: building for iOS architecture ${ios_architecture}") + #clear the conf options + set(is_simulator FALSE) + if(${ios_architecture} STREQUAL "armv7" + OR ${ios_architecture} STREQUAL "armv7s") + set(configure_host "arm-apple-darwin") + elseif(${ios_architecture} STREQUAL "arm64") + set(configure_host "aarch64-apple-darwin") + elseif(${ios_architecture} STREQUAL "i386") + set(configure_host "i386-apple-darwin") + set(is_simulator TRUE) + elseif(${ios_architecture} STREQUAL "x86_64") + set(configure_host "x86_64-apple-darwin") + set(is_simulator TRUE) + else() + hunter_fatal_error("iOS architecture: ${ios_architecture} not supported") + endif() + + set(arch_flags) + # Extra space at the end of the arch_flags is needed below when appending + # to configure_opts, please do not remove! + if(is_simulator) + set(arch_flags "-arch ${ios_architecture} -isysroot ${IPHONESIMULATOR_SDK_ROOT} -miphoneos-version-min=${IOS_SDK_VERSION} ") + else() + set(arch_flags "-arch ${ios_architecture} -isysroot ${IPHONEOS_SDK_ROOT} -miphoneos-version-min=${IOS_SDK_VERSION} ") + endif() + + # architecture specific source dir + set(arch_source_dir + "@HUNTER_PACKAGE_SOURCE_DIR@/multi-arch-build/${ios_architecture}" + ) + set(arch_target + "${target_name}-${ios_architecture}" + ) + set(arch_install_dir + "${multi_arch_install_root}/${ios_architecture}" + ) + + set(configure_command + ${shell_env} + ${x264_configure_command} + "--host=${configure_host}" + "--extra-cflags=${arch_flags}${cflags}" + "--extra-ldflags=${arch_flags}${ldflags}" + "--prefix=${arch_install_dir}" + ) + ExternalProject_Add(${arch_target} + URL + @HUNTER_PACKAGE_URL@ + URL_HASH + SHA1=@HUNTER_PACKAGE_SHA1@ + DOWNLOAD_DIR + "@HUNTER_PACKAGE_DOWNLOAD_DIR@" + SOURCE_DIR + ${arch_source_dir} + INSTALL_DIR + ${arch_install_dir} + # not used, just avoid creating Install/ empty directory + CONFIGURE_COMMAND + ${configure_command} + BUILD_COMMAND + ${build_command} + BUILD_IN_SOURCE + 1 + INSTALL_COMMAND + ${install_command} + ) + + list(APPEND ios_built_arch_roots ${arch_install_dir}) + add_dependencies( + "${ios_universal_target}" + "${arch_target}" + ) + endforeach() + + set(HUNTER_PACKAGE_INSTALL_PREFIX "@HUNTER_PACKAGE_INSTALL_PREFIX@") + configure_file( + "@HUNTER_GLOBAL_SCRIPT_DIR@/${merge_lipo_script}.in" + "@HUNTER_PACKAGE_SOURCE_DIR@/universal/${merge_lipo_script}" + @ONLY + ) +endif() + +foreach(PKG_CONFIG_MODULE ${PKGCONFIG_EXPORT_TARGETS}) + configure_file( + "@HUNTER_GLOBAL_SCRIPT_DIR@/pkgconfig-export-targets.cmake.in" + "@HUNTER_PACKAGE_INSTALL_PREFIX@/lib/cmake/${PKG_CONFIG_MODULE}/${PKG_CONFIG_MODULE}Config.cmake" + ) +endforeach() diff --git a/cmake/projects/xau/hunter.cmake b/cmake/projects/xau/hunter.cmake index 98e18f570b..155a886421 100644 --- a/cmake/projects/xau/hunter.cmake +++ b/cmake/projects/xau/hunter.cmake @@ -32,10 +32,11 @@ hunter_cmake_args( xau CMAKE_ARGS # do not use double quotes on CMAKE_ARGS DEPENDS_ON_PACKAGES=${xau_dependencies} + PKGCONFIG_EXPORT_TARGETS=xau ) hunter_cacheable(xau) hunter_download( PACKAGE_NAME xau - PACKAGE_INTERNAL_DEPS_ID "2" + PACKAGE_INTERNAL_DEPS_ID "4" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/libXau.la;lib/pkgconfig/xau.pc" ) diff --git a/cmake/projects/xcb-proto/hunter.cmake b/cmake/projects/xcb-proto/hunter.cmake index 0c0ee8cabe..b62b450a45 100644 --- a/cmake/projects/xcb-proto/hunter.cmake +++ b/cmake/projects/xcb-proto/hunter.cmake @@ -5,6 +5,7 @@ include(hunter_add_version) include(hunter_cacheable) +include(hunter_cmake_args) include(hunter_configuration_types) include(hunter_download) include(hunter_pick_scheme) @@ -35,9 +36,14 @@ hunter_add_version( hunter_configuration_types(xcb-proto CONFIGURATION_TYPES Release) hunter_pick_scheme(DEFAULT url_sha1_autotools) +hunter_cmake_args( + xcb-proto + CMAKE_ARGS + PKGCONFIG_EXPORT_TARGETS=xcb-proto +) hunter_cacheable(xcb-proto) hunter_download( PACKAGE_NAME xcb-proto - PACKAGE_INTERNAL_DEPS_ID "1" + PACKAGE_INTERNAL_DEPS_ID "2" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/xcb-proto.pc" ) diff --git a/cmake/projects/xcb/hunter.cmake b/cmake/projects/xcb/hunter.cmake index f139840b55..4850f50efd 100644 --- a/cmake/projects/xcb/hunter.cmake +++ b/cmake/projects/xcb/hunter.cmake @@ -46,6 +46,6 @@ hunter_pick_scheme(DEFAULT xcb) hunter_cacheable(xcb) hunter_download( PACKAGE_NAME xcb - PACKAGE_INTERNAL_DEPS_ID "2" + PACKAGE_INTERNAL_DEPS_ID "3" PACKAGE_UNRELOCATABLE_TEXT_FILES "${_xcb_text_files}" ) diff --git a/cmake/projects/xcb/schemes/xcb.cmake.in b/cmake/projects/xcb/schemes/xcb.cmake.in index 654dc62e01..389b558f67 100644 --- a/cmake/projects/xcb/schemes/xcb.cmake.in +++ b/cmake/projects/xcb/schemes/xcb.cmake.in @@ -17,9 +17,16 @@ if("@MSVC@") hunter_fatal_error("Autotools scheme not supported with Visual Studio") endif() -hunter_add_package(xcb-proto) -hunter_add_package(pthread-stubs) -hunter_add_package(xau) +set( + DEPENDS_ON_PACKAGES + xcb-proto + pthread-stubs + xau +) + +foreach(x ${DEPENDS_ON_PACKAGES}) + hunter_add_package("${x}") +endforeach() # Check preconditions hunter_test_string_not_empty("@HUNTER_SELF@") @@ -31,6 +38,7 @@ hunter_test_string_not_empty("@HUNTER_PACKAGE_SOURCE_DIR@") hunter_test_string_not_empty("@HUNTER_PACKAGE_BUILD_DIR@") hunter_test_string_not_empty("@HUNTER_PACKAGE_INSTALL_PREFIX@") hunter_test_string_not_empty("@HUNTER_INSTALL_PREFIX@") +hunter_test_string_not_empty("@HUNTER_GLOBAL_SCRIPT_DIR@") hunter_autotools_project( "@HUNTER_EP_NAME@" @@ -58,3 +66,14 @@ hunter_autotools_project( --without-doxygen --disable-devel-docs ) + +set(PKG_CONFIG_MODULE xcb) + +# Use: +# * PKG_CONFIG_MODULE +# * DEPENDS_ON_PACKAGES +configure_file( + "@HUNTER_GLOBAL_SCRIPT_DIR@/pkgconfig-export-targets.cmake.in" + "@HUNTER_PACKAGE_INSTALL_PREFIX@/lib/cmake/${PKG_CONFIG_MODULE}/${PKG_CONFIG_MODULE}Config.cmake" + @ONLY +) diff --git a/cmake/projects/xcursor/hunter.cmake b/cmake/projects/xcursor/hunter.cmake index fa732e76b5..9ad45084f2 100644 --- a/cmake/projects/xcursor/hunter.cmake +++ b/cmake/projects/xcursor/hunter.cmake @@ -35,10 +35,12 @@ hunter_cmake_args( xcursor CMAKE_ARGS # do not use double quotes on CMAKE_ARGS DEPENDS_ON_PACKAGES=${xcursor_dependencies} + PKGCONFIG_EXPORT_TARGETS=xcursor ) hunter_cacheable(xcursor) hunter_download( PACKAGE_NAME xcursor + PACKAGE_INTERNAL_DEPS_ID "1" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/libXcursor.la" "lib/pkgconfig/xcursor.pc" diff --git a/cmake/projects/xdamage/hunter.cmake b/cmake/projects/xdamage/hunter.cmake index 1d9c5c3817..1b1f931ddf 100644 --- a/cmake/projects/xdamage/hunter.cmake +++ b/cmake/projects/xdamage/hunter.cmake @@ -39,7 +39,7 @@ hunter_cmake_args( ) hunter_download( PACKAGE_NAME xdamage - PACKAGE_INTERNAL_DEPS_ID "2" + PACKAGE_INTERNAL_DEPS_ID "3" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/xdamage.pc" "lib/libXdamage.la" diff --git a/cmake/projects/xext/hunter.cmake b/cmake/projects/xext/hunter.cmake index be14f8bd2d..3564f61213 100644 --- a/cmake/projects/xext/hunter.cmake +++ b/cmake/projects/xext/hunter.cmake @@ -33,11 +33,12 @@ hunter_cmake_args( xext CMAKE_ARGS # do not use double quotes on CMAKE_ARGS DEPENDS_ON_PACKAGES=${xext_dependencies} + PKGCONFIG_EXPORT_TARGETS=xext ) hunter_cacheable(xext) hunter_download( PACKAGE_NAME xext - PACKAGE_INTERNAL_DEPS_ID "2" + PACKAGE_INTERNAL_DEPS_ID "3" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/libXext.la" "lib/pkgconfig/xext.pc" diff --git a/cmake/projects/xextproto/hunter.cmake b/cmake/projects/xextproto/hunter.cmake index a08e50e059..c56d7ff5f2 100644 --- a/cmake/projects/xextproto/hunter.cmake +++ b/cmake/projects/xextproto/hunter.cmake @@ -5,6 +5,7 @@ include(hunter_add_version) include(hunter_cacheable) +include(hunter_cmake_args) include(hunter_configuration_types) include(hunter_download) include(hunter_pick_scheme) @@ -23,9 +24,14 @@ hunter_add_version( hunter_configuration_types(xextproto CONFIGURATION_TYPES Release) hunter_pick_scheme(DEFAULT url_sha1_autotools) +hunter_cmake_args( + xextproto + CMAKE_ARGS + PKGCONFIG_EXPORT_TARGETS=xextproto +) hunter_cacheable(xextproto) hunter_download( PACKAGE_NAME xextproto - PACKAGE_INTERNAL_DEPS_ID "1" + PACKAGE_INTERNAL_DEPS_ID "2" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/xextproto.pc" ) diff --git a/cmake/projects/xf86vidmodeproto/hunter.cmake b/cmake/projects/xf86vidmodeproto/hunter.cmake index a854a1f5ad..9986447fa1 100644 --- a/cmake/projects/xf86vidmodeproto/hunter.cmake +++ b/cmake/projects/xf86vidmodeproto/hunter.cmake @@ -35,6 +35,7 @@ hunter_cmake_args( hunter_cacheable(xf86vidmodeproto) hunter_download( PACKAGE_NAME xf86vidmodeproto + PACKAGE_INTERNAL_DEPS_ID "1" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/xf86vidmodeproto.pc" ) diff --git a/cmake/projects/xfixes/hunter.cmake b/cmake/projects/xfixes/hunter.cmake index c3aafb1628..06eacb9433 100644 --- a/cmake/projects/xfixes/hunter.cmake +++ b/cmake/projects/xfixes/hunter.cmake @@ -34,12 +34,13 @@ hunter_cmake_args( xfixes CMAKE_ARGS # do not use double quotes on CMAKE_ARGS DEPENDS_ON_PACKAGES=${xfixes_dependencies} + PKGCONFIG_EXPORT_TARGETS=xfixes ) hunter_cacheable(xfixes) hunter_download( PACKAGE_NAME xfixes - PACKAGE_INTERNAL_DEPS_ID "2" + PACKAGE_INTERNAL_DEPS_ID "3" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/libXfixes.la" "lib/pkgconfig/xfixes.pc" diff --git a/cmake/projects/xgboost/hunter.cmake b/cmake/projects/xgboost/hunter.cmake index fd520ba648..44624759fa 100644 --- a/cmake/projects/xgboost/hunter.cmake +++ b/cmake/projects/xgboost/hunter.cmake @@ -8,6 +8,17 @@ include(hunter_cacheable) include(hunter_download) include(hunter_pick_scheme) +hunter_add_version( + PACKAGE_NAME + xgboost + VERSION + 0.40-p9 + URL + "https://github.com/hunter-packages/xgboost/archive/v0.40-p9.tar.gz" + SHA1 + 040000efe20018fcfcd2acc318cf36eb5dcb1b1d +) + hunter_add_version( PACKAGE_NAME xgboost diff --git a/cmake/projects/xi/hunter.cmake b/cmake/projects/xi/hunter.cmake new file mode 100644 index 0000000000..8d8cc887f2 --- /dev/null +++ b/cmake/projects/xi/hunter.cmake @@ -0,0 +1,51 @@ +# Copyright (c) 2016, Alexandre Pretyman +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_cmake_args) +include(hunter_configuration_types) +include(hunter_download) +include(hunter_pick_scheme) + +# http://www.x.org/releases/X11R7.7/src/lib +hunter_add_version( + PACKAGE_NAME + xi + VERSION + "1.6.1" + URL + "https://www.x.org/releases/X11R7.7/src/lib/libXi-1.6.1.tar.bz2" + SHA1 + 4b53b41fdaa3acc86606c696c68d5eed11454612 +) + +hunter_configuration_types(xi CONFIGURATION_TYPES Release) +hunter_pick_scheme(DEFAULT url_sha1_autotools) + +set( + _dependencies + xproto + x11 + xextproto + xext + inputproto +) + +hunter_cmake_args( + xi + CMAKE_ARGS + DEPENDS_ON_PACKAGES=${_dependencies} + PKGCONFIG_EXPORT_TARGETS=xi +) + +hunter_cacheable(xi) +hunter_download( + PACKAGE_NAME xi + PACKAGE_UNRELOCATABLE_TEXT_FILES + "lib/libXi.la" + "lib/pkgconfig/xi.pc" +) diff --git a/cmake/projects/xinerama/hunter.cmake b/cmake/projects/xinerama/hunter.cmake index 5b37a675ca..400e54c330 100644 --- a/cmake/projects/xinerama/hunter.cmake +++ b/cmake/projects/xinerama/hunter.cmake @@ -34,10 +34,12 @@ hunter_cmake_args( xinerama CMAKE_ARGS # do not use double quotes on CMAKE_ARGS DEPENDS_ON_PACKAGES=${xinerama_dependencies} + PKGCONFIG_EXPORT_TARGETS=xinerama ) hunter_cacheable(xinerama) hunter_download( PACKAGE_NAME xinerama + PACKAGE_INTERNAL_DEPS_ID "1" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/libXinerama.la" "lib/pkgconfig/xinerama.pc" diff --git a/cmake/projects/xineramaproto/hunter.cmake b/cmake/projects/xineramaproto/hunter.cmake index 8e7e5a7b08..47beb81605 100644 --- a/cmake/projects/xineramaproto/hunter.cmake +++ b/cmake/projects/xineramaproto/hunter.cmake @@ -31,10 +31,12 @@ hunter_cmake_args( xineramaproto CMAKE_ARGS # do not use double quotes on CMAKE_ARGS DEPENDS_ON_PACKAGES=${xineramaproto_dependencies} + PKGCONFIG_EXPORT_TARGETS=xineramaproto ) hunter_cacheable(xineramaproto) hunter_download( PACKAGE_NAME xineramaproto + PACKAGE_INTERNAL_DEPS_ID "1" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/xineramaproto.pc" ) diff --git a/cmake/projects/xorg-macros/hunter.cmake b/cmake/projects/xorg-macros/hunter.cmake index 03aa2732d1..1701be38e2 100644 --- a/cmake/projects/xorg-macros/hunter.cmake +++ b/cmake/projects/xorg-macros/hunter.cmake @@ -5,6 +5,7 @@ include(hunter_add_version) include(hunter_cacheable) +include(hunter_cmake_args) include(hunter_configuration_types) include(hunter_download) include(hunter_pick_scheme) @@ -24,8 +25,13 @@ hunter_add_version( hunter_configuration_types(xorg-macros CONFIGURATION_TYPES Release) hunter_pick_scheme(DEFAULT url_sha1_autotools) hunter_cacheable(xorg-macros) +hunter_cmake_args( + xorg-macros + CMAKE_ARGS + PKGCONFIG_EXPORT_TARGETS=xorg-macros +) hunter_download( PACKAGE_NAME xorg-macros - PACKAGE_INTERNAL_DEPS_ID "1" + PACKAGE_INTERNAL_DEPS_ID "2" PACKAGE_UNRELOCATABLE_TEXT_FILES "share/pkgconfig/xorg-macros.pc" ) diff --git a/cmake/projects/xproto/hunter.cmake b/cmake/projects/xproto/hunter.cmake index 4410f19a50..7dcd28b09a 100644 --- a/cmake/projects/xproto/hunter.cmake +++ b/cmake/projects/xproto/hunter.cmake @@ -28,10 +28,11 @@ hunter_cmake_args( xproto CMAKE_ARGS DEPENDS_ON_PACKAGES=xorg-macros + PKGCONFIG_EXPORT_TARGETS=xproto ) hunter_cacheable(xproto) hunter_download( PACKAGE_NAME xproto - PACKAGE_INTERNAL_DEPS_ID "2" + PACKAGE_INTERNAL_DEPS_ID "3" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/xproto.pc" ) diff --git a/cmake/projects/xrandr/hunter.cmake b/cmake/projects/xrandr/hunter.cmake index 0721bc5670..f32d27a1fb 100644 --- a/cmake/projects/xrandr/hunter.cmake +++ b/cmake/projects/xrandr/hunter.cmake @@ -36,11 +36,12 @@ hunter_cmake_args( xrandr CMAKE_ARGS # do not use double quotes on CMAKE_ARGS DEPENDS_ON_PACKAGES=${xrandr_dependencies} + PKGCONFIG_EXPORT_TARGETS=xrandr ) hunter_cacheable(xrandr) hunter_download( PACKAGE_NAME xrandr - PACKAGE_INTERNAL_DEPS_ID "1" + PACKAGE_INTERNAL_DEPS_ID "2" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/xrandr.pc" "lib/libXrandr.la" diff --git a/cmake/projects/xrender/hunter.cmake b/cmake/projects/xrender/hunter.cmake index e483f14ad0..a4780bc30f 100644 --- a/cmake/projects/xrender/hunter.cmake +++ b/cmake/projects/xrender/hunter.cmake @@ -32,11 +32,12 @@ hunter_cmake_args( xrender CMAKE_ARGS # do not use double quotes on CMAKE_ARGS DEPENDS_ON_PACKAGES=${xrender_dependencies} + PKGCONFIG_EXPORT_TARGETS=xrender ) hunter_cacheable(xrender) hunter_download( PACKAGE_NAME xrender - PACKAGE_INTERNAL_DEPS_ID "2" + PACKAGE_INTERNAL_DEPS_ID "3" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/libXrender.la" "lib/pkgconfig/xrender.pc" diff --git a/cmake/projects/xshmfence/hunter.cmake b/cmake/projects/xshmfence/hunter.cmake index b2e2704493..b887e942b0 100644 --- a/cmake/projects/xshmfence/hunter.cmake +++ b/cmake/projects/xshmfence/hunter.cmake @@ -35,7 +35,7 @@ hunter_cmake_args( hunter_cacheable(xshmfence) hunter_download( PACKAGE_NAME xshmfence - PACKAGE_INTERNAL_DEPS_ID "2" + PACKAGE_INTERNAL_DEPS_ID "3" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/libxshmfence.la" "lib/pkgconfig/xshmfence.pc" diff --git a/cmake/projects/xtrans/hunter.cmake b/cmake/projects/xtrans/hunter.cmake index 5020103ace..0bcf7c4001 100644 --- a/cmake/projects/xtrans/hunter.cmake +++ b/cmake/projects/xtrans/hunter.cmake @@ -5,6 +5,7 @@ include(hunter_add_version) include(hunter_cacheable) +include(hunter_cmake_args) include(hunter_configuration_types) include(hunter_download) include(hunter_pick_scheme) @@ -24,8 +25,13 @@ hunter_add_version( hunter_configuration_types(xtrans CONFIGURATION_TYPES Release) hunter_pick_scheme(DEFAULT url_sha1_autotools) hunter_cacheable(xtrans) +hunter_cmake_args( + xtrans + CMAKE_ARGS + PKGCONFIG_EXPORT_TARGETS=xtrans +) hunter_download( PACKAGE_NAME xtrans - PACKAGE_INTERNAL_DEPS_ID "1" + PACKAGE_INTERNAL_DEPS_ID "2" PACKAGE_UNRELOCATABLE_TEXT_FILES "share/pkgconfig/xtrans.pc" ) diff --git a/cmake/projects/xxf86vm/hunter.cmake b/cmake/projects/xxf86vm/hunter.cmake index 2e8b8b06d5..54df9fb1ad 100644 --- a/cmake/projects/xxf86vm/hunter.cmake +++ b/cmake/projects/xxf86vm/hunter.cmake @@ -40,6 +40,7 @@ hunter_cmake_args( hunter_cacheable(xxf86vm) hunter_download( PACKAGE_NAME xxf86vm + PACKAGE_INTERNAL_DEPS_ID "1" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/libXxf86vm.la" "lib/pkgconfig/xxf86vm.pc" diff --git a/cmake/projects/yaml-cpp/hunter.cmake b/cmake/projects/yaml-cpp/hunter.cmake index 1d03655f8c..7fefb2c9e8 100644 --- a/cmake/projects/yaml-cpp/hunter.cmake +++ b/cmake/projects/yaml-cpp/hunter.cmake @@ -12,7 +12,7 @@ hunter_add_version( VERSION "0.5.3" URL - "https://github.com/hunter-packages/yaml-cpp/archive/release-0.5.3-hunter-p2.tar.gz" + "https://github.com/hunter-packages/yaml-cpp/releases/download/release-0.5.3-hunter-p2/release-0.5.3-hunter-p2.tar.gz" SHA1 ee1fe3713409de48b203f6b631c1284190d95671 ) diff --git a/cmake/schemes/url_sha1_autotools.cmake.in b/cmake/schemes/url_sha1_autotools.cmake.in index 0792715b03..cc53317d7f 100644 --- a/cmake/schemes/url_sha1_autotools.cmake.in +++ b/cmake/schemes/url_sha1_autotools.cmake.in @@ -58,3 +58,13 @@ hunter_autotools_project("@HUNTER_EP_NAME@" BOOTSTRAP "${BOOTSTRAP}" ) + +foreach(PKG_CONFIG_MODULE ${PKGCONFIG_EXPORT_TARGETS}) + # Use: + # * DEPENDS_ON_PACKAGES + configure_file( + "@HUNTER_GLOBAL_SCRIPT_DIR@/pkgconfig-export-targets.cmake.in" + "@HUNTER_PACKAGE_INSTALL_PREFIX@/lib/cmake/${PKG_CONFIG_MODULE}/${PKG_CONFIG_MODULE}Config.cmake" + @ONLY + ) +endforeach() diff --git a/cmake/schemes/url_sha1_cmake.cmake.in b/cmake/schemes/url_sha1_cmake.cmake.in index 7ca6c42876..ea2f112fd0 100644 --- a/cmake/schemes/url_sha1_cmake.cmake.in +++ b/cmake/schemes/url_sha1_cmake.cmake.in @@ -73,7 +73,7 @@ else() set(log_build 0) endif() -if("@HUNTER_PACKAGE_LOG_INSTALL@") +if("@HUNTER_PACKAGE_LOG_INSTALL@" OR "@HUNTER_SUPPRESS_LIST_OF_FILES@") set(log_install 1) else() set(log_install 0) @@ -97,6 +97,8 @@ else() set(make_args "") endif() +string(COMPARE EQUAL "${CMAKE_CFG_INTDIR}" "." is_single) + foreach(configuration @HUNTER_PACKAGE_CONFIGURATION_TYPES@) # All configurations use the same URL which will be downloaded only once # i.e. overhead only for unpacking archive + no files from the previous @@ -111,6 +113,12 @@ foreach(configuration @HUNTER_PACKAGE_CONFIGURATION_TYPES@) endif() set(current_project "@HUNTER_EP_NAME@-${configuration}") + + if(is_single) + set(build_type_opts "-DCMAKE_BUILD_TYPE=${configuration}") + else() + set(build_type_opts "-DCMAKE_CONFIGURATION_TYPES=${configuration}") + endif() ExternalProject_Add( "${current_project}" @@ -126,16 +134,20 @@ foreach(configuration @HUNTER_PACKAGE_CONFIGURATION_TYPES@) INSTALL_DIR "@HUNTER_PACKAGE_INSTALL_PREFIX@" # not used, just avoid creating Install/ empty directory - BUILD_COMMAND "" - # this command is empty because all necessary targets will - # be built on install stage + BUILD_COMMAND + # Separate build and install stage so we can suppress install log + # which may consist of a long list of files + "@CMAKE_COMMAND@" + --build . + --config ${configuration} + -- + ${jobs_option} CMAKE_ARGS "-G@CMAKE_GENERATOR@" "-C@HUNTER_CACHE_FILE@" "-C@HUNTER_ARGS_FILE@" "-D${postfix_name}=${${postfix_name}}" - "-DCMAKE_BUILD_TYPE=${configuration}" - "-DCMAKE_CONFIGURATION_TYPES=${configuration}" + "${build_type_opts}" "-DCMAKE_INSTALL_PREFIX=@HUNTER_PACKAGE_INSTALL_PREFIX@" "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" "${make_args}" @@ -145,8 +157,6 @@ foreach(configuration @HUNTER_PACKAGE_CONFIGURATION_TYPES@) --build . --target install --config ${configuration} - -- - ${jobs_option} COMMAND # Copy license files "@CMAKE_COMMAND@" "-C@HUNTER_ARGS_FILE@" # for 'HUNTER_INSTALL_LICENSE_FILES' diff --git a/cmake/schemes/url_sha1_unpack_bin_install.cmake.in b/cmake/schemes/url_sha1_unpack_bin_install.cmake.in new file mode 100644 index 0000000000..ef4bce9819 --- /dev/null +++ b/cmake/schemes/url_sha1_unpack_bin_install.cmake.in @@ -0,0 +1,47 @@ +# Copyright (c) 2017, Zhuhao Wang +# All rights reserved. + +cmake_minimum_required(VERSION 3.0) +project(Hunter) + +include(ExternalProject) # ExternalProject_Add + +list(APPEND CMAKE_MODULE_PATH "@HUNTER_SELF@/cmake/modules") + +include(hunter_status_debug) +include(hunter_test_string_not_empty) + +hunter_status_debug("Scheme: url_sha1_unpack_bin_install") + +# Check preconditions +hunter_test_string_not_empty("@HUNTER_SELF@") +hunter_test_string_not_empty("@HUNTER_EP_NAME@") +hunter_test_string_not_empty("@HUNTER_PACKAGE_URL@") +hunter_test_string_not_empty("@HUNTER_PACKAGE_SHA1@") +hunter_test_string_not_empty("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_test_string_not_empty("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_test_string_not_empty("@HUNTER_PACKAGE_INSTALL_PREFIX@") + +ExternalProject_Add( + "@HUNTER_EP_NAME@" + URL + "@HUNTER_PACKAGE_URL@" + URL_HASH + SHA1=@HUNTER_PACKAGE_SHA1@ + DOWNLOAD_DIR + "@HUNTER_PACKAGE_DOWNLOAD_DIR@" + SOURCE_DIR + "@HUNTER_PACKAGE_SOURCE_DIR@" + INSTALL_DIR + "@HUNTER_PACKAGE_INSTALL_PREFIX@" + # not used, just avoid creating Install/ empty directory + CONFIGURE_COMMAND + "" + BUILD_COMMAND + "" + INSTALL_COMMAND + "@CMAKE_COMMAND@" + "-Dfrom=@HUNTER_PACKAGE_SOURCE_DIR@" + "-Dto=@HUNTER_PACKAGE_INSTALL_PREFIX@/bin" + -P "@HUNTER_SELF@/scripts/copy-files.cmake" +) diff --git a/cmake/templates/package-download.cmake.in b/cmake/templates/package-download.cmake.in new file mode 100644 index 0000000000..077605fe27 --- /dev/null +++ b/cmake/templates/package-download.cmake.in @@ -0,0 +1,7 @@ +include(hunter_cacheable) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable("@PACKAGE_NAME@") +hunter_download(PACKAGE_NAME "@PACKAGE_NAME@") diff --git a/cmake/templates/package-version.cmake.in b/cmake/templates/package-version.cmake.in new file mode 100644 index 0000000000..579b44a2f7 --- /dev/null +++ b/cmake/templates/package-version.cmake.in @@ -0,0 +1,12 @@ +include(hunter_add_version) + +hunter_add_version( + PACKAGE_NAME + "@PACKAGE_NAME@" + VERSION + "@PACKAGE_SHA1@" + URL + "@PACKAGE_URL@" + SHA1 + "@PACKAGE_SHA1@" +) diff --git a/docs/conf.py b/docs/conf.py index 279995dee8..c2142e2846 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -55,7 +55,7 @@ # General information about the project. project = 'Hunter' -copyright = '2013-2016, Ruslan Baratov' +copyright = '2013-2017, Ruslan Baratov' author = 'Ruslan Baratov' # The version info for the project you're documenting, acts as replacement for @@ -63,9 +63,9 @@ # built documents. # # The short X.Y version. -version = '0.14' +version = '0.19' # The full version, including alpha/beta/rc tags. -release = '0.14' +release = '0.19' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -82,7 +82,7 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. -exclude_patterns = ['_build', '_venv', 'rtfd-css'] +exclude_patterns = ['_build', '_venv', 'rtfd-css', 'packages/pkg/foo.rst'] # The reST default role (used for this markup: `text`) to use for all # documents. diff --git a/docs/contacts.rst b/docs/contacts.rst index a0fa3fae19..031c2375b6 100644 --- a/docs/contacts.rst +++ b/docs/contacts.rst @@ -7,23 +7,19 @@ Contacts Public ====== -Feel free to open new `issue`_ if you want to ask any questions. - -Public chat room: `gitter`_ +* Feel free to open new `issue`_ if you want to ask any question +* Public chat room on |gitter_public| Private ======= -You can write me to ``ruslan_baratov@yahoo.com`` or contact me using `Tox`_: - -* ``7EBD836B7690C3742E6F3632742BEB00283529E06D76E06F7065544A5F9C6F37D948FB0F754B`` -* ``4EED21EA40B0351D8BFC85A69499A3F7CFEDA6844DA39FF1783A4D9827423F075D7194707C43`` +* Write me to ruslan_baratov@yahoo.com +* Private chat room on |gitter_private| .. _issue: https://github.com/ruslo/hunter/issues/new -.. _Tox: https://tox.chat -.. _gitter: https://gitter.im/ruslo/hunter?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge +.. |gitter_public| image:: https://badges.gitter.im/ruslo/hunter.svg + :target: https://gitter.im/ruslo/hunter -.. Stopped working for some reason: https://travis-ci.org/ruslo/hunter/jobs/185557845 -.. .. |gitter| image:: https://badges.gitter.im/ruslo/hunter.svg -.. :target: https://gitter.im/ruslo/hunter?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge +.. |gitter_private| image:: https://badges.gitter.im/ruslo/hunter.svg + :target: https://gitter.im/ruslo diff --git a/docs/contributing.rst b/docs/contributing.rst index f9e3e1011c..98386a18b6 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -1,7 +1,103 @@ .. Copyright (c) 2016, Ruslan Baratov .. All rights reserved. +.. _contributing: + Contributing ------------ -* `Contribution `_ +There are many ways to contribute to Hunter: + +- Documentation +- There is a newer version of an existing package? `Notify us `__ or send a pull request with an updated version. +- Missing a package in Hunter? :ref:`Add a new package ` +- `Resolve Issues `__ + + - Can you provide an answer to an open question? + - Can you reproduce the error? + - Is the issue still relevant? Maybe the issue can be closed. + +When contributing please follow the style guides: + +- `Git `__ +- `CMake `__ + +.. note:: + + The minimum version of CMake for using Hunter is ``3.0``. + Please check that you're not using commands from newer versions + (`see documentation for 3.0 `__). + +.. note:: + + Before adding or updating a package in Hunter, the package is tested. + Tests are done to check if the source can be downloaded, built and linked. + Head over to our + `repository for per package CI testing contribution `__ + to see more. + +Reporting bugs +~~~~~~~~~~~~~~ + +Hunter is CMake-based package manager so it's assumed that CMake is installed +and working correctly. Before reporting bugs please check: + +* Appropriate version of CMake is installed. + See :doc:`CMake version for Hunter `. + +* Verify CMake, build tools and C/C++ compilers you're planning to use. + Try to build simple CMake project (check + `this document `__ + in case you have troubles): + + .. code-block:: cmake + + # CMakeLists.txt + + cmake_minimum_required(VERSION 3.0) + project(foo) + + add_executable(foo foo.cpp) + + .. code-block:: cpp + + // foo.cpp + + #include + + int main() { + std::cout << "Hello world!" << std::endl; + } + +* Most sources downloaded by HTTPS protocol so CMake should be build with + CURL with enabled OpenSSL. Without HTTPS support you will see this error: + + .. code-block:: none + + error: downloading + 'https://...' failed + + status_code: 1 + status_string: "Unsupported protocol" + log: Protocol "https" not supported or disabled in libcurl + + Closing connection -1 + + .. note:: + + * `Example of building CMake with CURL + OpenSSL `__ + +If everything seems OK: + +* Run build again with :ref:`HUNTER_STATUS_DEBUG=ON ` +* Take a look at **first** error reported by Hunter. If Hunter reports chain + of errors the last error you see is **not relevant**! +* Update to `latest Hunter URL/SHA1 `__ + and check that issue you have hit is not already fixed/reported +* Open an `issue `__ and provide + next info: + + * CMake version you're using ``cmake --version``. CMake build from source? + * OS (Linux, OSX, Windows) + * Command line you're using on generate step (e.g. ``cmake -H. -B_builds "-GVisual Studio 14 2015"``) + * Add log until **first error** reported by Hunter diff --git a/docs/creating-new.rst b/docs/creating-new.rst index 2f3e58bd75..ad3aa68282 100644 --- a/docs/creating-new.rst +++ b/docs/creating-new.rst @@ -6,14 +6,9 @@ Creating new package .. _creating new: -This is a guide for adding new package to Hunter. We start with the simple -one (CMake based, no dependencies), then cover "hunterization" (CMake based, -depends on other packages). Final is a most complex one (non-CMake packages, -creating custom build scheme). - .. toctree:: :maxdepth: 1 - /creating-new/cmake - /creating-new/cmake-dependencies - /creating-new/custom + /creating-new/create + /creating-new/update + /creating-new/patch diff --git a/docs/creating-new/cmake-dependencies.rst b/docs/creating-new/cmake-dependencies.rst deleted file mode 100644 index fff337ab56..0000000000 --- a/docs/creating-new/cmake-dependencies.rst +++ /dev/null @@ -1,112 +0,0 @@ -.. Copyright (c) 2016, Ruslan Baratov -.. All rights reserved. - -CMake (with dependencies) -------------------------- - -If your project uses external packages (i.e. has command ``find_package(Foo)``) -you need to patch it first so these packages can be found in the Hunter root -directory instead of the standard one: - -.. code-block:: cmake - :emphasize-lines: 1 - - hunter_add_package(Foo) - find_package(Foo) - -.. _dependencies conflict: - -Conflict -======== - -Without the ``hunter_add_package(Foo)`` call one package will be found in the -standard location and another one in the Hunter root directory. The found -packages may may conflict with each other. - -Consider the next example: Project ``Roo`` is not aware about Hunter custom -locations. It's just using regular ``find_package``: - -.. code-block:: cmake - - # Roo/CMakeLists.txt - - find_package(ZLIB) - -Project ``Bar`` depends on ``ZLIB`` and ``Roo``. Both packages are downloaded by -``hunter_add_package`` commands: - -.. code-block:: cmake - :emphasize-lines: 3, 6 - - # Bar/CMakeLists.txt - - hunter_add_package(Roo) - find_package(Roo) - - hunter_add_package(ZLIB) - find_package(ZLIB) - -.. image:: /images/package-conflict.png - :align: center - -Fix -=== - -To fix this issue you need to patch project ``Roo`` so it will use ``ZLIB`` from Hunter. -In terms of CMake code it means adding ``HunterGate`` and ``hunter_add_package`` -(see :doc:`First Step `): - -.. code-block:: cmake - :emphasize-lines: 4-5 - - # Roo/CMakeLists.txt - - include("cmake/HunterGate.cmake") - HunterGate(...) - hunter_add_package(ZLIB) - find_package(ZLIB) - -.. image:: /images/package-conflict-resolved.png - :align: center - -Note that now the main project ``Bar`` and the hunter dependency ``Roo`` contain -a ``HunterGate`` command. The URL and SHA1 of the ``HunterGate`` command my not match. -In this case the URL and SHA1 of the main project ``Bar`` are used for both -``HunterGate`` commands. The user doesn't need to manage them manually. -The same is true for sub-projects added by ``add_subdirectory`` calls. - -Maintenance -=========== - -In practice patching requires to have a fork of a project. In general it -doesn't matter where the fork is located. But it matters that there is a central place for the -patched packages: - -* https://github.com/hunter-packages - -If you want to create new fork let me know about it in a corresponding issue -with `"new package" label`_, I will create a new team and add you so you can -push changes. Create a new branch ``hunter`` for patching. Please -keep other branches in a **clean state** so we can always do -``git merge --ff-only`` from upstream. -Please do push commits **only related to hunterization**. Do not push general -fixes and improvements, do push them **upstream** instead. Perfect hunterization -should contain only: - -* Adding ``HunterGate`` module (`example `__) -* Including it with some URL/SHA1 (`example `__) -* Adding ``hunter_add_package`` commands (`example `__) - -Note that I'm not willing and can't maintain all packages in practice. Therefore -I do add all developers to the team if they ask to. If you want to be -a maintainer, keep eye on changes, pull requests, be responsible for review and -releases - let me know. - -Also note that Hunter is designed to have **zero maintenance** for such tasks, since -you can add ``HUNTER_ENABLED=OFF`` option at the top of the project to skip all -package management stuff (see :doc:`/overview/compatibility`). It means you -can push branch ``hunter`` to upstream without affecting functionality of -the project. As a summary it may sounds strange, but the final goal of this -organization is to have no forks of packages at all. - -.. _"new package" label: https://github.com/ruslo/hunter/issues?q=is%3Aopen+is%3Aissue+label%3A%22new+package%22 diff --git a/docs/creating-new/cmake.rst b/docs/creating-new/cmake.rst deleted file mode 100644 index ece72dcfac..0000000000 --- a/docs/creating-new/cmake.rst +++ /dev/null @@ -1,382 +0,0 @@ -.. Copyright (c) 2016, Ruslan Baratov -.. All rights reserved. - -CMake (no dependencies) ------------------------ - -If package is CMake project without third party dependencies which installed -using ``cmake --build --target install`` then integration is pretty easy. -Here is a step-by-step tutorial for a tiny package -`example-A `__. - -Test it manually -================ - -Install/verify project using Wget, OpenSSL and CMake: - -.. code-block:: bash - :emphasize-lines: 1,3,7 - - > wget https://github.com/forexample/example-A/archive/v1.0.1.tar.gz - > openssl sha1 v1.0.1.tar.gz - SHA1(v1.0.1.tar.gz)= 48179067d11828dc347f98fc148654f88766529d - > tar xf v1.0.1.tar.gz - > cd example-A-1.0.1/ - > cmake -H. -B_builds -DCMAKE_INSTALL_PREFIX=`pwd`/_install - > cmake --build _builds/ --target install - > ls _install/* - _install/libexample_A.a - - _install/example_A: - foo.hpp - -Test it using ExternalProject_Add -================================= - -.. code-block:: bash - :emphasize-lines: 6-12 - - > cat CMakeLists.txt - cmake_minimum_required(VERSION 2.8) - - include(ExternalProject) # ExternalProject_Add - - ExternalProject_Add( - Example - URL https://github.com/forexample/example-A/archive/v1.0.1.tar.gz - URL_HASH SHA1=48179067d11828dc347f98fc148654f88766529d - CMAKE_ARGS - "-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_LIST_DIR}/_install" - ) - > cmake -H. -B_builds - > cmake --build _builds/ - > ls _install/* - _install/libexample_A.a - - _install/example_A: - foo.hpp - -Add new package -=============== - -First, new ``hunter.cmake`` file need to be add to ``projects`` directory - -.. code-block:: bash - - > git clone https://github.com/ruslo/hunter - > export HUNTER_ROOT="`pwd`/hunter" - > cd ${HUNTER_ROOT} - > mkdir cmake/projects/Example - -Content of ``hunter.cmake``: - -.. code-block:: cmake - - # cmake/projects/Example/hunter.cmake - - # !!! DO NOT PLACE HEADER GUARDS HERE !!! - - # Load used modules - include(hunter_add_version) - include(hunter_download) - include(hunter_pick_scheme) - - # List of versions here... - hunter_add_version( - PACKAGE_NAME - Example - VERSION - "1.0.1" - URL - "https://github.com/forexample/example-A/archive/v1.0.1.tar.gz" - SHA1 - 48179067d11828dc347f98fc148654f88766529d - ) - - hunter_add_version( - PACKAGE_NAME - Example - VERSION - "1.0.0" - URL - "https://github.com/forexample/example-A/archive/v1.0.0.tar.gz" - SHA1 - d9b25aeadde5a5b1b60ba2dd39ed1a7a4846589a - ) - - # Probably more versions for real packages... - - # Pick a download scheme - hunter_pick_scheme(DEFAULT url_sha1_cmake) # use scheme for cmake projects - - # Download package. - # Two versions of library will be build by default: - # * libexample_A.a - # * libexample_Ad.a - hunter_download(PACKAGE_NAME Example) - -Second, specify version in default config: - -.. code-block:: bash - :emphasize-lines: 2 - - > grep Example cmake/config/default.cmake - hunter_config(Example VERSION 1.0.1) - -Note -==== - -Package configuration can also be performed at a project level, -e.g. customization can be performed within -``${CMAKE_CURRENT_LIST_DIR}/cmake/Hunter/config.cmake``. -See `customizing external packages `__ -for more detailed information. - -Using -===== - -That's all! Now package can be used (see next section for testing): - -.. code-block:: cmake - :emphasize-lines: 9-10, 15 - - # CMakeLists.txt - cmake_minimum_required(VERSION 3.0) - - include("cmake/HunterGate.cmake") - - # If Hunter is cloned this line will not - # be used if fact. See 'testing' section for me info - HunterGate( - URL "https://url/to/your/hunter-archive.tar.gz" - SHA1 "put-archive-sha1-here" - ) - - project(TestExampleDownload) - - hunter_add_package(Example) - -Library can be found by ``EXAMPLE_ROOT`` CMake variable: - -.. code-block:: cmake - - find_library( - example_release - example_A - ${EXAMPLE_ROOT} - ) - - find_library( - example_debug - example_A${CMAKE_DEBUG_POSTFIX} - ${EXAMPLE_ROOT} - ) - - message("Release: ${example_release}") - message("Debug: ${example_debug}") - -``EXAMPLE_ROOT`` variable assembled by moving package name to upper case and -adding ``_ROOT``. For the packages containing ``-`` char the "snake case" -variant also available. E.g. for package ``foo-bar-boo`` both -``FOO-BAR-BOO_ROOT`` and ``FOO_BAR_BOO_ROOT`` can be used. - -Note that for real packages there will be more code like searching for -``EXAMPLE_INCLUDE_DIR`` or setting ``EXAMPLE_COMPILE_DEFINITIONS``. - -Important! -~~~~~~~~~~ - -Note that CMake modern-style packages can automatically produce and install -CMake configs for ``find_package`` commands. This helps to avoid manually -writing/supporting and distributing endless list of ``Find.cmake`` -modules. Also, what is very important for Hunter, it's the one of the painless -ways to support relocation. I.e. only config-mode packages (native or emulated) -with imported targets can be cached and downloaded as prebuilt binary archive -from build servers. Plus only imported targets works nicely with non standard -build types like MinSizeRel or RelWithDebInfo. It is highly recommended to have -such feature. Read -`this overview `__ -if you want to have code: - -.. code-block:: cmake - - find_package(Example CONFIG REQUIRED) - -Instead of bunch of ``find_library`` in snipped from previous paragraph. - -If your package is already relocatable use command -:doc:`hunter_cacheable ` -to allow caching. - -Test -==== - -Let's test it (see `how to do it nicely `__): - -.. code-block:: bash - - > cmake -H. -B_builds - -- [hunter] HUNTER_ROOT: /.../Hunter - -- [hunter] [ Hunter-ID: 7912489 | Config-ID: f1ec619 | Toolchain-ID: f8714ae ] - ... - -- [hunter] EXAMPLE_ROOT: /.../Hunter/_Base/7912489/f1ec619/f8714ae/Install (ver.: 1.0.1) - -- [hunter] Building Example - ... - -- downloading... - ... - src='https://github.com/forexample/example-A/archive/v1.0.1.tar.gz' - -- [download 100% complete] - Install the project... - -- Install configuration: "Release" - ... - -- Install configuration: "Debug" - ... - Release: /.../Hunter/_Base/7912489/f1ec619/f8714ae/Install/libexample_A.a - Debug: /.../Hunter/_Base/7912489/f1ec619/f8714ae/Install/libexample_Ad.a - -Extra -===== - -Package defaults -~~~~~~~~~~~~~~~~ - -CMake options -+++++++++++++ - -Note that it doesn't make sense to include in build such stuff like examples, -tests or documentation. Please check that your package has CMake option to -disable it and apply extra variables to all versions (if options is not -disabled by default) using ``hunter_cmake_args`` function: - -.. code-block:: cmake - :emphasize-lines: 3, 6-8 - - # bottom of cmake/projects/Foo/hunter.cmake - - hunter_cmake_args( - Foo - CMAKE_ARGS - FOO_BUILD_EXAMPLES=OFF - FOO_BUILD_TESTS=OFF - FOO_BUILD_DOCUMENTATION=OFF - ) - - hunter_pick_scheme(DEFAULT url_sha1_cmake) - hunter_download(PACKAGE_NAME Foo) - -Options set by ``hunter_cmake_args`` have lower precedence than options set -by ``hunter_config(... CMAKE_ARGS ...)`` (see -`order `__). - -Build types -+++++++++++ - -Default build type(s) can be set by ``hunter_configuration_types``: - -.. code-block:: cmake - - hunter_configuration_types(Foo CONFIGURATION_TYPES Release) - hunter_download(PACKAGE_NAME Foo) - -User can overwrite this default by using -`custom `__ -``hunter_config`` parameters. - -Default behavior -~~~~~~~~~~~~~~~~ - -Please check that your package respect (i.e. doesn't rewrite) such CMake variables like: - -* `CMAKE_INSTALL_PREFIX `__ (**critical**) -* `CMAKE_{C,CXX}_FLAGS + variations `__ (**critical**) -* `CMAKE_{C,CXX}_COMPILER + friends `__ (**critical**) -* `CMAKE_BUILD_TYPE `__ (not critical, but recommended) -* `CMAKE_CONFIGURATION_TYPES `__ (not critical, but recommended) -* `BUILD_SHARED_LIBS `__ (not critical, but may result some errors) - -Environment -~~~~~~~~~~~ - -Configuration of the package should be predictable. - -For example it should not depend on the fact that some package already installed -or not: - -.. code-block:: cmake - :emphasize-lines: 2 - - find_package(OpenSSL) - if(OPENSSL_FOUND) - target_compile_definitions(... PUBLIC FOO_WITH_OPENSSL=1) - endif() - -If package is optional then control behavior explicitly: - -.. code-block:: cmake - :emphasize-lines: 1, 5 - - option(FOO_WITH_OPENSSL "Build with OpenSSL" ON) - - if(FOO_WITH_OPENSSL) - find_package(OpenSSL REQUIRED) # fatal error if not found! - target_compile_definitions(... PUBLIC FOO_WITH_OPENSSL=1) - endif() - -Same with the programs: - -.. code-block:: cmake - :emphasize-lines: 2 - - find_program(PYTHON_EXE python) # Use 'find_package(PythonInterp)' in real code - if(PYTHON_EXE) - # generate some extra code - endif() - -Use this code instead: - -.. code-block:: cmake - :emphasize-lines: 1, 4, 6 - - option(FOO_WITH_PYTHON "Build with Python" ON) - - if(FOO_WITH_PYTHON) - find_program(PYTHON_EXE python) - if(NOT PYTHON_EXE) - message(FATAL_ERROR "Python not found") - endif() - endif() - -Environment variable example: - -.. code-block:: cmake - :emphasize-lines: 1 - - if(EXISTS "$ENV{FOO_EXTRA_CODE}") - # add some code - endif() - -Solution: - -.. code-block:: cmake - :emphasize-lines: 1, 4 - - option(FOO_WITH_EXTRA_CODE "Use extra code" ON) - - if(FOO_WITH_EXTRA_CODE) - if(NOT EXISTS "$ENV{FOO_EXTRA_CODE}") - message(FATAL_ERROR "...") - endif() - endif() - -Note that this is kind of a natural limitation because otherwise Hunter have -to save the whole outside environment like default paths, environment -variables, etc. This is not doable on practice. - -Exception is the variables related to compiler/toolchain like compiler version, -compiler id, platforms, generators, architectures: ``WIN32``, ``IOS``, -``ANDROID``, etc. Number of such traits is limited and forms -:doc:`toolchain-id `. - -.. admonition:: CGold - - * `Depending on environment variable `__ diff --git a/docs/creating-new/create.rst b/docs/creating-new/create.rst new file mode 100644 index 0000000000..b946279a85 --- /dev/null +++ b/docs/creating-new/create.rst @@ -0,0 +1,18 @@ +.. Copyright (c) 2017, Ruslan Baratov +.. All rights reserved. + +Create package +-------------- + +This is a guide for adding new package to Hunter. We start with the simple +one (CMake based, no dependencies), then cover "hunterization" (CMake based, +depends on other packages). Final is a most complex one (non-CMake packages, +creating custom build scheme). + +.. toctree:: + :maxdepth: 1 + + /creating-new/create/cmake + /creating-new/create/cmake-dependencies + /creating-new/create/autotools + /creating-new/create/custom diff --git a/docs/creating-new/create/autotools.rst b/docs/creating-new/create/autotools.rst new file mode 100644 index 0000000000..c0d310a601 --- /dev/null +++ b/docs/creating-new/create/autotools.rst @@ -0,0 +1,106 @@ +.. spelling:: + + Autotools + autotools + foo + + +Autotools +========= + +Very often, you will come across a package that uses autotools as its build +system and does not support CMake builds. Although Hunter prefers CMake builds +when possible, it does support autotools projects when no CMake build is +available. Here is how to do it. + +.. code-block:: cmake + + # !!! DO NOT PLACE HEADER GUARDS HERE !!! + + include(hunter_add_version) + include(hunter_configuration_types) + include(hunter_pick_scheme) + include(hunter_download) + include(hunter_cacheable) + include(hunter_cmake_args) + + hunter_add_version( + PACKAGE_NAME + foo + VERSION + "1.2.3" + URL + "https://example.com/foo-1.2.3.tar.gz" + SHA1 + da39a3ee5e6b4b0d3255bfef95601890afd80709 + ) + + # More versions... + + # Optional platform customization. + if (ANDROID OR IOS) + hunter_cmake_args( + foo + CMAKE_ARGS + EXTRA_FLAGS=--enable-x + ) + endif() + + hunter_configuration_types(foo CONFIGURATION_TYPES Release) + hunter_pick_scheme(DEFAULT url_sha1_autotools) + hunter_cacheable(foo) + hunter_download(PACKAGE_NAME foo) + +Note that the build may not be cacheable if autotools generation expands +absolute paths. Try using ``hunter_cacheable`` and see if it works. + +Many autotools projects generate pkg-config files. These can be used +to generate a CMake config. For example, consider using the following in your +package's ``hunter.cmake`` file: + +.. code-block:: cmake + + hunter_cmake_args( + foo + CMAKE_ARGS + PKGCONFIG_EXPORT_TARGETS=foo + ) + +In the above example, package ``foo`` generates a file ``foo.pc`` in the +autotools build. Hunter then uses ``foo.pc`` to generate a CMake config file +``fooConfig.cmake``. Now, our dependent project ``Bar`` has a much simpler +``CMakeLists.txt``: + +.. code-block:: cmake + + hunter_add_package(foo) + find_package(foo CONFIG REQUIRED) + add_executable(bar ${BAR_SOURCES}) + target_link_libraries(bar PUBLIC PkgConfig::foo) + +When following this pkg-config practice and attempting to keep ``foo`` +cacheable, you must add this piece of code to your package's ``hunter.cmake``: + +.. code-block:: cmake + + hunter_download(PACKAGE_NAME foo + PACKAGE_INTERNAL_DEPS_ID "1" # Increment for each new pull request + PACKAGE_UNRELOCATABLE_TEXT_FILES + lib/pkgconfig/foo.pc) + +The pkg-config files will probably need to be patched so that they do not point +to the directory they are initially installed into. +``PACKAGE_UNRELOCATABLE_TEXT_FILES`` identifies these files for Hunter to patch. + +If the autotools build does not produce a pkg-config output file, you must +add ``Findfoo.cmake`` place it in the ``cmake/find`` directory so Hunter can +find the package. This script should also provide import targets for dependent +builds, such that linking against ``foo::foo`` pulls in the foo includes and +libraries. In this case, dependent projects will use code similar to the following: + +.. code-block:: cmake + + hunter_add_package(foo) + find_package(foo REQUIRED) + add_executable(bar ${BAR_SOURCES}) + target_link_libraries(bar PUBLIC foo::foo) diff --git a/docs/creating-new/create/ci/.travis-NEW.yml b/docs/creating-new/create/ci/.travis-NEW.yml new file mode 100644 index 0000000000..4c8bef5873 --- /dev/null +++ b/docs/creating-new/create/ci/.travis-NEW.yml @@ -0,0 +1,107 @@ +# OSX/Linux (https://github.com/travis-ci-tester/toolchain-table) + +# Workaround for https://github.com/travis-ci/travis-ci/issues/8363 +language: + - minimal + +# Container-based infrastructure (Linux) +# * https://docs.travis-ci.com/user/migrating-from-legacy/#How-can-I-use-container-based-infrastructure%3F +sudo: + - false + +# Install packages differs for container-based infrastructure +# * https://docs.travis-ci.com/user/migrating-from-legacy/#How-do-I-install-APT-sources-and-packages%3F +addons: + apt: + packages: + - python3-pip + +dist: + - trusty + +env: + global: + - secure: "RXl1cmKQUgB/Lr6CFW82nYDFSyF5tYjG5N3+ZpZZWDbmVvm8Wj634GR1B5JVcLzoWLearGYtqOA2mQcK+vcp04/KMQC7mEEtUWix74wXz9djzUZMYuMz0VvImpqyE8KF8ZVgbQL5XFP1u+nRahLT9qtNX7VFTqgSB2PJ/kDEQQPV+H4lv/tVBv9ptMC4q9Nwev8qFzEPLqQgp6mqb05BBsgrExEbzVrX5kywb23TGcxMe3c6IHf63vCmr8aHAJFVsHHGkV2QhOoJKeMNa1xPJXGE+yf1rAACglTru7IXOlsZ4bym2qLtQRHz+2jHn1i+qQf0V5M+4H/OBkqOpU9AJ/ylF/WK2eBZedxC+4WPvuO/iDnrtNxikzS5avdFS7IMUJrIm9fP0B8efLovEiJaKwo5k1Yj0uw07b1PoyRE5x+ozRzSLzvWXgOIXbZjOM9BzYFfoNJ+dpjilELuxGn85HljeniK89H/d5gtEUPvSMQC/+RuMo420qaGGhy/lR4ivPTZwCqT7VPQ6+2HLz/wAF5S2jFLGjSZIbb/NMmrV6+puIEEicx0mj2eSpgt7cn9UguevnwtT5UoN2G+dZrI6RfUp0CSH8UHdcJtoSCmYVxO5LsRPXyCEFFF54EsfhqjWegYcxLmHqQQUKlJ8lX9dXMRftW7bIldb98PQGud6Fg=" + +matrix: + include: + # Linux { + - os: linux + env: PROJECT_DIR=examples/hunter_box_1 TOOLCHAIN=default + - os: linux + env: PROJECT_DIR=examples/hunter_box_1 TOOLCHAIN=clang-libstdcxx + - os: linux + env: PROJECT_DIR=examples/hunter_box_1 TOOLCHAIN=gcc + - os: linux + env: PROJECT_DIR=examples/hunter_box_1 TOOLCHAIN=android-ndk-r10e-api-19-armeabi-v7a-neon + - os: linux + env: PROJECT_DIR=examples/hunter_box_1 TOOLCHAIN=android-ndk-r15c-api-21-armeabi-v7a-neon-clang-libcxx + - os: linux + env: PROJECT_DIR=examples/hunter_box_1 TOOLCHAIN=analyze + - os: linux + env: PROJECT_DIR=examples/hunter_box_1 TOOLCHAIN=sanitize-address + - os: linux + env: PROJECT_DIR=examples/hunter_box_1 TOOLCHAIN=sanitize-leak + + # FIXME: https://github.com/ruslo/hunter/issues/718#issuecomment-290610583 + # - os: linux + # env: PROJECT_DIR=examples/hunter_box_1 TOOLCHAIN=sanitize-thread + + # } + + # OSX { + - os: osx + env: PROJECT_DIR=examples/hunter_box_1 TOOLCHAIN=libcxx + - os: osx + env: PROJECT_DIR=examples/hunter_box_1 TOOLCHAIN=osx-10-11 + + # FIXME: iOS is not supported by this package + # * https://travis-ci.org/hunterbox/hunter/jobs/276514722 + # - os: osx + # env: PROJECT_DIR=examples/hunter_box_1 TOOLCHAIN=ios-nocodesign-9-3 + + # } + +install: + # Info about OS + - uname -a + + # Disable autoupdate + # * https://github.com/Homebrew/brew/blob/7d31a70373edae4d8e78d91a4cbc05324bebc3ba/Library/Homebrew/manpages/brew.1.md.erb#L202 + - export HOMEBREW_NO_AUTO_UPDATE=1 + + # Install Python 3 + - if [[ "`uname`" == "Darwin" ]]; then travis_retry brew install python3; fi + + # Install Python package 'requests' + # 'easy_install3' is not installed by 'brew install python3' on OS X 10.9 Maverick + - if [[ "`uname`" == "Darwin" ]]; then pip3 install requests; fi + - if [[ "`uname`" == "Linux" ]]; then travis_retry pip3 install --user requests; fi + + # Install latest Polly toolchains and scripts + - wget https://github.com/ruslo/polly/archive/master.zip + - unzip master.zip + - POLLY_ROOT="`pwd`/polly-master" + - export PATH="${POLLY_ROOT}/bin:${PATH}" + + # Install dependencies (CMake, Android NDK) + - install-ci-dependencies.py + + # Tune locations + - export PATH="`pwd`/_ci/cmake/bin:${PATH}" + + # Installed if toolchain is Android (otherwise directory doesn't exist) + - export ANDROID_NDK_r10e="`pwd`/_ci/android-ndk-r10e" + - export ANDROID_NDK_r11c="`pwd`/_ci/android-ndk-r11c" + - export ANDROID_NDK_r15c="`pwd`/_ci/android-ndk-r15c" + +script: + - python3 ./jenkins.py + +# https://docs.travis-ci.com/user/customizing-the-build/#Whitelisting-or-blacklisting-branches +# Exclude branch 'pkg.template'. Nothing to build there. +branches: + except: + - pkg.template + - /^pr\..*/ + - /^v[0-9]+\.[0-9]+\.[0-9]+$/ diff --git a/docs/creating-new/create/ci/.travis-OLD.yml b/docs/creating-new/create/ci/.travis-OLD.yml new file mode 100644 index 0000000000..b63a034e53 --- /dev/null +++ b/docs/creating-new/create/ci/.travis-OLD.yml @@ -0,0 +1,103 @@ +# OSX/Linux (https://github.com/travis-ci-tester/toolchain-table) + +# Workaround for https://github.com/travis-ci/travis-ci/issues/8363 +language: + - minimal + +# Container-based infrastructure (Linux) +# * https://docs.travis-ci.com/user/migrating-from-legacy/#How-can-I-use-container-based-infrastructure%3F +sudo: + - false + +# Install packages differs for container-based infrastructure +# * https://docs.travis-ci.com/user/migrating-from-legacy/#How-do-I-install-APT-sources-and-packages%3F +addons: + apt: + packages: + - python3-pip + +dist: + - trusty + +env: + global: + - secure: "RXl1cmKQUgB/Lr6CFW82nYDFSyF5tYjG5N3+ZpZZWDbmVvm8Wj634GR1B5JVcLzoWLearGYtqOA2mQcK+vcp04/KMQC7mEEtUWix74wXz9djzUZMYuMz0VvImpqyE8KF8ZVgbQL5XFP1u+nRahLT9qtNX7VFTqgSB2PJ/kDEQQPV+H4lv/tVBv9ptMC4q9Nwev8qFzEPLqQgp6mqb05BBsgrExEbzVrX5kywb23TGcxMe3c6IHf63vCmr8aHAJFVsHHGkV2QhOoJKeMNa1xPJXGE+yf1rAACglTru7IXOlsZ4bym2qLtQRHz+2jHn1i+qQf0V5M+4H/OBkqOpU9AJ/ylF/WK2eBZedxC+4WPvuO/iDnrtNxikzS5avdFS7IMUJrIm9fP0B8efLovEiJaKwo5k1Yj0uw07b1PoyRE5x+ozRzSLzvWXgOIXbZjOM9BzYFfoNJ+dpjilELuxGn85HljeniK89H/d5gtEUPvSMQC/+RuMo420qaGGhy/lR4ivPTZwCqT7VPQ6+2HLz/wAF5S2jFLGjSZIbb/NMmrV6+puIEEicx0mj2eSpgt7cn9UguevnwtT5UoN2G+dZrI6RfUp0CSH8UHdcJtoSCmYVxO5LsRPXyCEFFF54EsfhqjWegYcxLmHqQQUKlJ8lX9dXMRftW7bIldb98PQGud6Fg=" + +matrix: + include: + # Linux { + - os: linux + env: PROJECT_DIR=examples/hunter_box_1 TOOLCHAIN=default + - os: linux + env: PROJECT_DIR=examples/hunter_box_1 TOOLCHAIN=clang-libstdcxx + - os: linux + env: PROJECT_DIR=examples/hunter_box_1 TOOLCHAIN=gcc + - os: linux + env: PROJECT_DIR=examples/hunter_box_1 TOOLCHAIN=android-ndk-r10e-api-19-armeabi-v7a-neon + - os: linux + env: PROJECT_DIR=examples/hunter_box_1 TOOLCHAIN=android-ndk-r15c-api-21-armeabi-v7a-neon-clang-libcxx + - os: linux + env: PROJECT_DIR=examples/hunter_box_1 TOOLCHAIN=analyze + - os: linux + env: PROJECT_DIR=examples/hunter_box_1 TOOLCHAIN=sanitize-address + - os: linux + env: PROJECT_DIR=examples/hunter_box_1 TOOLCHAIN=sanitize-leak + + # FIXME: https://github.com/ruslo/hunter/issues/718#issuecomment-290610583 + # - os: linux + # env: PROJECT_DIR=examples/hunter_box_1 TOOLCHAIN=sanitize-thread + + # } + + # OSX { + - os: osx + env: PROJECT_DIR=examples/hunter_box_1 TOOLCHAIN=libcxx + - os: osx + env: PROJECT_DIR=examples/hunter_box_1 TOOLCHAIN=osx-10-11 + - os: osx + env: PROJECT_DIR=examples/hunter_box_1 TOOLCHAIN=ios-nocodesign-9-3 + # } + +install: + # Info about OS + - uname -a + + # Disable autoupdate + # * https://github.com/Homebrew/brew/blob/7d31a70373edae4d8e78d91a4cbc05324bebc3ba/Library/Homebrew/manpages/brew.1.md.erb#L202 + - export HOMEBREW_NO_AUTO_UPDATE=1 + + # Install Python 3 + - if [[ "`uname`" == "Darwin" ]]; then travis_retry brew install python3; fi + + # Install Python package 'requests' + # 'easy_install3' is not installed by 'brew install python3' on OS X 10.9 Maverick + - if [[ "`uname`" == "Darwin" ]]; then pip3 install requests; fi + - if [[ "`uname`" == "Linux" ]]; then travis_retry pip3 install --user requests; fi + + # Install latest Polly toolchains and scripts + - wget https://github.com/ruslo/polly/archive/master.zip + - unzip master.zip + - POLLY_ROOT="`pwd`/polly-master" + - export PATH="${POLLY_ROOT}/bin:${PATH}" + + # Install dependencies (CMake, Android NDK) + - install-ci-dependencies.py + + # Tune locations + - export PATH="`pwd`/_ci/cmake/bin:${PATH}" + + # Installed if toolchain is Android (otherwise directory doesn't exist) + - export ANDROID_NDK_r10e="`pwd`/_ci/android-ndk-r10e" + - export ANDROID_NDK_r11c="`pwd`/_ci/android-ndk-r11c" + - export ANDROID_NDK_r15c="`pwd`/_ci/android-ndk-r15c" + +script: + - python3 ./jenkins.py + +# https://docs.travis-ci.com/user/customizing-the-build/#Whitelisting-or-blacklisting-branches +# Exclude branch 'pkg.template'. Nothing to build there. +branches: + except: + - pkg.template + - /^pr\..*/ + - /^v[0-9]+\.[0-9]+\.[0-9]+$/ diff --git a/docs/creating-new/create/cmake-dependencies.rst b/docs/creating-new/create/cmake-dependencies.rst new file mode 100644 index 0000000000..c92e784fd5 --- /dev/null +++ b/docs/creating-new/create/cmake-dependencies.rst @@ -0,0 +1,82 @@ +.. Copyright (c) 2016, Ruslan Baratov +.. All rights reserved. + +.. _cmake-with-deps: + +CMake (with dependencies) +------------------------- + +If your project uses external packages (i.e. has command ``find_package(Foo)``) +you need to patch it first so these packages can be found in the Hunter root +directory instead of the standard one: + +.. code-block:: cmake + :emphasize-lines: 1 + + hunter_add_package(Foo) + find_package(Foo) + +.. note:: + + * :doc:`Patching sources (hunter-packages) ` + +.. _dependencies conflict: + +Conflict +======== + +Without the ``hunter_add_package(Foo)`` call one package will be found in the +standard location and another one in the Hunter root directory. The found +packages may may conflict with each other. + +Consider the next example: Project ``Roo`` is not aware about Hunter custom +locations. It's just using regular ``find_package``: + +.. code-block:: cmake + + # Roo/CMakeLists.txt + + find_package(ZLIB) + +Project ``Bar`` depends on ``ZLIB`` and ``Roo``. Both packages are downloaded by +``hunter_add_package`` commands: + +.. code-block:: cmake + :emphasize-lines: 3, 6 + + # Bar/CMakeLists.txt + + hunter_add_package(Roo) + find_package(Roo) + + hunter_add_package(ZLIB) + find_package(ZLIB) + +.. image:: /images/package-conflict.png + :align: center + +Fix +=== + +To fix this issue you need to patch project ``Roo`` so it will use ``ZLIB`` from Hunter. +In terms of CMake code it means adding ``HunterGate`` and ``hunter_add_package`` +(see :doc:`First Step `): + +.. code-block:: cmake + :emphasize-lines: 4-5 + + # Roo/CMakeLists.txt + + include("cmake/HunterGate.cmake") + HunterGate(...) + hunter_add_package(ZLIB) + find_package(ZLIB CONFIG REQUIRED) + +.. image:: /images/package-conflict-resolved.png + :align: center + +Note that now the main project ``Bar`` and the hunter dependency ``Roo`` contain +a ``HunterGate`` command. The URL and SHA1 of the ``HunterGate`` command my not match. +In this case the URL and SHA1 of the main project ``Bar`` are used for both +``HunterGate`` commands. The user does not need to manage them manually. +The same is true for sub-projects added by ``add_subdirectory`` calls. diff --git a/docs/creating-new/create/cmake.rst b/docs/creating-new/create/cmake.rst new file mode 100644 index 0000000000..715030ad20 --- /dev/null +++ b/docs/creating-new/create/cmake.rst @@ -0,0 +1,728 @@ +.. Copyright (c) 2016, Ruslan Baratov +.. All rights reserved. + +.. _cmake-simple: + +CMake (no dependencies) +----------------------- + +CMake project without third party dependencies can be used **as is** in Hunter. +However you need to check that CMake code is correctly written and use best +CMake practices. + +Default behavior +================ + +Please check that your package respect (i.e. does not rewrite) such CMake +variables like: + +* `CMAKE_INSTALL_PREFIX `__ (**critical**) +* `CMAKE_{C,CXX}_FLAGS + variations `__ (**critical**) +* `CMAKE_{C,CXX}_COMPILER + friends `__ (**critical**) +* `CMAKE_BUILD_TYPE `__ (not critical, but recommended) +* `CMAKE_CONFIGURATION_TYPES `__ (not critical, but recommended) +* `BUILD_SHARED_LIBS `__ (not critical, but may result some errors) + +Environment +=========== + +Configuration of the package should be predictable. + +For example it should not depend on the fact that some package already installed +or not: + +.. code-block:: cmake + :emphasize-lines: 2 + + find_package(OpenSSL) + if(OPENSSL_FOUND) + target_compile_definitions(... PUBLIC FOO_WITH_OPENSSL=1) + endif() + +If package is optional then control behavior explicitly: + +.. code-block:: cmake + :emphasize-lines: 1, 5 + + option(FOO_WITH_OPENSSL "Build with OpenSSL" ON) + + if(FOO_WITH_OPENSSL) + find_package(OpenSSL REQUIRED) # fatal error if not found! + target_compile_definitions(... PUBLIC FOO_WITH_OPENSSL=1) + endif() + +Same with the programs: + +.. code-block:: cmake + :emphasize-lines: 2 + + find_program(PYTHON_EXE python) # Use 'find_package(PythonInterp)' in real code + if(PYTHON_EXE) + # generate some extra code + endif() + +Use this code instead: + +.. code-block:: cmake + :emphasize-lines: 1, 4, 6 + + option(FOO_WITH_PYTHON "Build with Python" ON) + + if(FOO_WITH_PYTHON) + find_program(PYTHON_EXE python) + if(NOT PYTHON_EXE) + message(FATAL_ERROR "Python not found") + endif() + endif() + +Environment variable example: + +.. code-block:: cmake + :emphasize-lines: 1 + + if(EXISTS "$ENV{FOO_EXTRA_CODE}") + # add some code + endif() + +Solution: + +.. code-block:: cmake + :emphasize-lines: 1, 4 + + option(FOO_WITH_EXTRA_CODE "Use extra code" ON) + + if(FOO_WITH_EXTRA_CODE) + if(NOT EXISTS "$ENV{FOO_EXTRA_CODE}") + message(FATAL_ERROR "...") + endif() + endif() + +Note that this is kind of a natural limitation because otherwise Hunter have +to save the whole outside environment like default paths, environment +variables, etc. This is not doable on practice. + +Exception is the variables related to compiler/toolchain like compiler version, +compiler id, platforms, generators, architectures: ``WIN32``, ``IOS``, +``ANDROID``, etc. Number of such traits is limited and forms +:doc:`toolchain-id `. + +.. admonition:: CGold + + * `Depending on environment variable `__ + +Install XXXConfig.cmake +======================= + +The easiest way to integrate installed libraries into other project is to use +`find_package `__ +command. Project should generate and install ``*Config.cmake`` files instead +of using ``Find*.cmake`` modules. It's the one of the painless ways to support +relocation - imported targets can be cached and downloaded as prebuilt binary +archive from build servers. Plus only imported targets works nicely with non +standard build types like ``MinSizeRel`` or ``RelWithDebInfo``. + +To check this feature you can try to install files to local directory. +If result of installation looks like this: + +.. code-block:: none + :emphasize-lines: 4-5 + + Install the project... + /.../cmake -P cmake_install.cmake + -- Install configuration: "Release" + -- Installing: /.../lib/libhunter_box_1.a + -- Installing: /.../include/hunter_box_1.hpp + +It means that this feature is missing and you need to +:doc:`patch CMake code ` to introduce it. +Details can be found +`here `__. + +Installation after fix: + +.. code-block:: none + :emphasize-lines: 6-9 + + Install the project... + /.../cmake -P cmake_install.cmake + -- Install configuration: "Release" + -- Installing: /.../lib/libhunter_box_1.a + -- Installing: /.../include/hunter_box_1.hpp + -- Installing: /.../lib/cmake/hunter_box_1/hunter_box_1Config.cmake + -- Installing: /.../lib/cmake/hunter_box_1/hunter_box_1ConfigVersion.cmake + -- Installing: /.../lib/cmake/hunter_box_1/hunter_box_1Targets.cmake + -- Installing: /.../lib/cmake/hunter_box_1/hunter_box_1Targets-release.cmake + +.. admonition:: CGold + + * `Rejected: FindXXX.cmake `__ + * `Install layout `__ + +.. admonition:: CMake documentation + + * `find_package `__ + * `cmake-packages `__ + +Add package to Hunter +===================== + +Next let's assume user ``hunterbox`` is trying to add ``hunter_box_1`` project +to Hunter. + +.. admonition:: Examples on GitHub + + * `Example: hunterbox/hunter_box_1 `__ + +Recommended name for the package is lowercase separated with underscore. + +C++: + +.. code-block:: cpp + + #include + + int main() { + hunter_box_1::foo(); + } + +.. code-block:: cpp + + // file hunter_box_1.hpp + + namespace hunter_box_1 { + } // namespace hunter_box_1 + +CMake with Hunter: + +.. code-block:: cmake + + hunter_add_package(hunter_box_1) + find_package(hunter_box_1 CONFIG REQUIRED) + target_link_libraries(... hunter_box_1::hunter_box_1) + +In Hunter sources: + +* ``cmake/projects/hunter_box_1/hunter.cmake`` file with versions +* ``examples/hunter_box_1`` directory with example for testing +* ``docs/packages/pkg/hunter_box_1.rst`` documentation for package + +Git branches (will be covered in details later): + +* ``pkg.hunter_box_1`` branch for testing +* ``upload.hunter_box_1`` branch for uploading +* ``pr.hunter_box_1`` work-in-progress branch for adding/updating package + +Fork Hunter +=========== + +Hunter hosted on GitHub service where common way to add code is to fork +project and create pull request. + +Fork `ruslo/hunter `__, clone +`your fork `__ and initialize all +submodules: + +.. code-block:: none + + > git clone https://github.com/hunterbox/hunter + > cd hunter + [hunter]> git submodule update --init --recursive . + +Create branch to work on new package: + +.. code-block:: none + + [hunter]> git checkout -b pr.hunter_box_1 + +Add versions +============ + +Add one or several versions of ``hunter_box_1`` package to corresponding +``hunter.cmake`` file. + +Copy template and substitute all strings ``foo`` to ``hunter_box_1``: + +.. code-block:: none + + [hunter]> cp -r cmake/projects/foo cmake/projects/hunter_box_1 + [hunter]> sed -i 's,foo,hunter_box_1,g' cmake/projects/hunter_box_1/hunter.cmake + +Download release archive and calculate ``SHA1``: + +.. code-block:: none + + > wget https://github.com/hunterbox/hunter_box_1/archive/v1.0.0.tar.gz + > openssl sha1 v1.0.0.tar.gz + SHA1(v1.0.0.tar.gz)= c724e0f8a4ebc95cf7ba628b89b998b3b3c2697d + +Add this information to ``cmake/projects/hunter_box_1/hunter.cmake`` file: + +.. code-block:: cmake + :emphasize-lines: 10, 12, 14, 16 + + # !!! DO NOT PLACE HEADER GUARDS HERE !!! + + include(hunter_add_version) + include(hunter_cacheable) + include(hunter_download) + include(hunter_pick_scheme) + + hunter_add_version( + PACKAGE_NAME + hunter_box_1 + VERSION + 1.0.0 + URL + "https://github.com/hunterbox/hunter_box_1/archive/v1.0.0.tar.gz" + SHA1 + c724e0f8a4ebc95cf7ba628b89b998b3b3c2697d + ) + + hunter_pick_scheme(DEFAULT url_sha1_cmake) + hunter_cacheable(hunter_box_1) + hunter_download(PACKAGE_NAME hunter_box_1) + +CMake options +============= + +Note that it does not make sense to include in build such stuff like examples, +tests or documentation. Please check that your package has CMake option to +disable it and apply extra variables to all versions (if options is not +disabled by default) using ``hunter_cmake_args`` function: + +.. code-block:: cmake + :emphasize-lines: 3, 6-8 + + # bottom of cmake/projects/Foo/hunter.cmake + + hunter_cmake_args( + Foo + CMAKE_ARGS + FOO_BUILD_EXAMPLES=OFF + FOO_BUILD_TESTS=OFF + FOO_BUILD_DOCUMENTATION=OFF + ) + + hunter_pick_scheme(DEFAULT url_sha1_cmake) + hunter_download(PACKAGE_NAME Foo) + +Options set by ``hunter_cmake_args`` have lower precedence than options set +by ``hunter_config(... CMAKE_ARGS ...)`` (see +`order `__). + +Build types +=========== + +.. warning:: + + Usually there is no need to set build type explicitly. If package does not + work with default ``Debug`` + ``Release`` it means something wrong with + package itself. + +Default build type(s) can be set by ``hunter_configuration_types``: + +.. code-block:: cmake + + hunter_configuration_types(Foo CONFIGURATION_TYPES Release) + hunter_download(PACKAGE_NAME Foo) + +User can overwrite this default by using +`custom `__ +``hunter_config`` parameters. + +Set default version +=================== + +Add ``hunter_config`` directive with default version to +``cmake/configs/default.cmake``: + +.. code-block:: cmake + + hunter_config(hunter_box_1 VERSION 1.0.0) + +Create example +============== + +Simple example will be used to test integration of package. Copy template +example and substitute all strings ``foo`` with ``hunter_box_1``: + +.. code-block:: none + + [hunter]> cp -r examples/foo examples/hunter_box_1 + [hunter]> sed -i 's,foo,hunter_box_1,g' examples/hunter_box_1/* + +Tweak all files in ``examples/hunter_box_1`` directory to fit headers and +name of imported targets. + +Add documentation +================= + +Each package should have +:doc:`page with information and usage example `. + +To create such page copy template file and substitute all strings ``foo`` with +project name ``hunter_box_1`` string: + +.. code-block:: none + + [hunter]> cp docs/packages/pkg/foo.rst docs/packages/pkg/hunter_box_1.rst + [hunter]> sed -i 's,foo,hunter_box_1,g' docs/packages/pkg/hunter_box_1.rst + +Open file ``docs/packages/pkg/hunter_box_1.rst`` and tweak all entries. + +Substitute ``unsorted`` with some tag in directive +``.. index:: unsorted ; foo``. This tag will be used on +:ref:`this page `. + +.. note:: + + Since you don't know a priory pull request number leave it as ``N`` for now. + You can update it later. + +To check documentation building locally you can run: + +.. code-block:: none + + [hunter]> cd docs + [hunter/docs]> source ./jenkins.sh + (_venv) [hunter/docs]> ./make.sh + +Commit +====== + +Now save all changes by doing commit: + +.. code-block:: none + + [hunter]> git branch + master + * pr.hunter_box_1 + + [hunter]> git add cmake/configs/default.cmake + [hunter]> git add cmake/projects/hunter_box_1/ + [hunter]> git add docs/packages/pkg/hunter_box_1.rst + [hunter]> git add examples/hunter_box_1/ + + [hunter]> git commit -m "Add 'hunter_box_1' package" + +Testing locally +=============== + +This step is optional since we will run tests on CI server. However it's the +fastest way to check that everything is ready and working correctly. + +Script ``jenkins.py`` will package temporary Hunter archive based on current +state and build example. This script use +`Polly `__ toolchains. + +Check you have Python 3 installed, clone Polly and add ``bin`` folder to +``PATH`` environment variable: + +.. code-block:: none + + > which python3 + /usr/bin/python3 + + > git clone https://github.com/ruslo/polly + > cd polly + [polly]> export PATH="`pwd`/bin:$PATH" + +Go back to Hunter repository and run test: + +.. code-block:: none + + > cd hunter + [hunter]> which polly.py + /.../bin/polly.py + [hunter]> TOOLCHAIN=gcc PROJECT_DIR=examples/hunter_box_1 ./jenkins.py + +CI testing +========== + +Now let's run tests on continuous integration servers with various toolchains +and platforms. Hunter use `AppVeyor `__ to test +Windows (Visual Studio, NMake, Ninja, MinGW, MSYS) and +`Travis `__ to test +Linux (GCC, Clang, Android, Clang Analyzer, Sanitize Address, Sanitize Leak) +and OSX (Clang + Makefile, Xcode, iOS). + +Register your Hunter fork: + +* `AppVeyor: Getting started `__ +* `Travis: Getting started `__ + +Branch master +============= + +To understand what should be done next you need to understand the structure +of branches. + +* Name: ``master`` +* Repository: https://github.com/ruslo/hunter +* Testing: Documentation on Linux + +In branch ``master`` there is only ``.travis.yml`` file which will only check +documentation building: + +* https://github.com/ruslo/hunter/blob/ea9de264d6c1b05484bdc16a9967c3cb8cca9048/.travis.yml#L57-L59 + +When you open pull request to ``ruslo/hunter`` this test will run automatically. + +Branch pkg.template +=================== + +* Name: ``pkg.template`` +* Repository: https://github.com/ingenue/hunter +* Testing: *Nothing* + +In branch ``pkg.template`` of ``ingenue/hunter`` repository there are +**template** ``.travis.yml`` and ``appveyor.yml`` files: + +* https://github.com/ingenue/hunter/blob/pkg.template/.travis.yml +* https://github.com/ingenue/hunter/blob/pkg.template/appveyor.yml + +All changes from ``master`` will go to ``pkg.template``. The only difference +between ``master`` and ``pkg.template`` is ``.travis.yml``/``appveyor.yml`` +files. + +Branch pkg. +================= + +Branch for testing package ````. + +* Name: ``pkg.`` +* Repository: https://github.com/ingenue/hunter +* Testing: Package ```` on Windows/Linux/OSX hosts + +Real testing happens in ``pkg.`` branch of ``ingenue/hunter`` repository. +E.g. branch ``pkg.gtest``: + +* https://github.com/ingenue/hunter/tree/pkg.gtest +* AppVeyor https://ci.appveyor.com/project/ingenue/hunter/build/1.0.2352 +* Travis https://travis-ci.org/ingenue/hunter/builds/274507515 + +All changes from ``pkg.template`` will go to ``pkg.`` branch on updates. +The only difference between ``pkg.template`` and ``pkg.`` is +``travis.yml``/``appveyor.yml`` files. + +Branch upload. +==================== + +Branch for uploads. + +* Name: ``upload.`` +* Repository: https://github.com/ingenue/hunter +* Testing: Upload archives with binaries to server + +After successful tests on ``pkg.`` branch ``upload.`` will do +uploads. E.g. branch ``upload.gtest``: + +* https://github.com/ingenue/hunter/tree/upload.gtest +* https://ci.appveyor.com/project/ingenue/hunter/build/1.0.2287 +* https://travis-ci.org/ingenue/hunter/builds/270324624 + +All changes from ``pkg.`` will go to ``upload.`` branch on updates. +The only difference between ``upload.`` and ``pkg.`` is +build command: ``jenkins.py`` vs. ``jenkins.py --upload``. + +Branches structure +================== + +Here is an image for branches structure: + +.. image:: /creating-new/images/branches.png + :align: center + :alt: Branches + +Fetch CI configs +================ + +Since we are adding new package we have to create new CI configs for it. +Fetch ``pkg.template`` branch and substitute all ``foo`` strings with +``hunter_box_1``: + +.. code-block:: none + + [hunter]> git remote add ci https://github.com/ingenue/hunter + [hunter]> git fetch ci + [hunter]> git checkout pkg.template + [hunter]> git checkout -b pr.pkg.hunter_box_1 + + [hunter]> sed -i 's,foo,hunter_box_1,g' .travis.yml + [hunter]> sed -i 's,foo,hunter_box_1,g' appveyor.yml + + [hunter]> git add .travis.yml appveyor.yml + [hunter]> git commit -m "Test 'hunter_box_1' package" + +Run remote tests +================ + +Current state is: + +* ``pr.hunter_box_1`` contains new package +* ``pr.pkg.hunter_box_1`` contains configs for testing + +.. code-block:: none + + [hunter]> git branch -vv + master + pkg.template + pr.hunter_box_1 9f60453 Add 'hunter_box_1' package + * pr.pkg.hunter_box_1 4a7626d Test 'hunter_box_1' package + +To run tests we need to merge both changes into ``test.hunter_box_1`` +and push ``test.hunter_box_1`` branch to remote: + +.. code-block:: none + + [hunter]> git checkout pr.hunter_box_1 + [hunter]> git checkout -b test.hunter_box_1 + [hunter]> git merge pr.pkg.hunter_box_1 + [hunter]> git push -u origin test.hunter_box_1 + +Example: + +* https://travis-ci.org/hunterbox/hunter/builds/276514711 + +.. image:: /creating-new/images/pull-request.png + :align: center + :alt: Pull request + +Excluding tests +=============== + +If all tests passed you can skip this section. + +If some toolchains are working and some toolchains failed it means project +has platform-specific problems. Note that you don't have to have all +toolchains working and there is **no need to fix all issues you see**. +If at least *something* is working then you can exclude broken +toolchain and you or somebody else can apply fixes later. + +**Do not remove** toolchains from ``.travis.yml``/``appveyor.yml`` configs. +Comment it out instead to simplify enabling it back. Do not change the order +of toolchains since it will affect ``git merge``. Leave the link to broken job: + +.. literalinclude:: ci/.travis-NEW.yml + :diff: ci/.travis-OLD.yml + +If no working toolchains left for ``.travis.yml`` or ``appveyor.yml`` then +comment out everything and add ``TOOLCHAIN=dummy`` test. + +Go to branch ``pr.pkg.hunter_box_1`` with CI configs and commit this change +there: + +.. code-block:: none + + [hunter]> git checkout pr.pkg.hunter_box_1 + [hunter]> git add .travis.yml + [hunter]> git commit -m 'Exclude broken' + +Go to testing branch ``test.hunter_box_1``, merge updated CI configs and run +new CI tests by pushing commits to remote: + +.. code-block:: none + + [hunter]> git checkout test.hunter_box_1 + [hunter]> git merge pr.pkg.hunter_box_1 + [hunter]> git push + +Pull requests (tests) +===================== + +First push ``pr.pkg.hunter_box_1`` with CI configs: + +.. code-block:: none + + [hunter]> git checkout pr.pkg.hunter_box_1 + [hunter]> git push -u origin pr.pkg.hunter_box_1 + +Open pull request to ``ingenue/hunter`` repository, to ``pkg.template`` +branch: + +.. image:: /creating-new/images/pr-with-tests.png + :align: center + :alt: Pull request with tests + +I will create ``pkg.hunter_box_1`` and change branch before merging: + +.. image:: /creating-new/images/pr-change-branch.png + :align: center + :alt: Change branch + +Pull requests +============= + +After CI configs merged you can open pull request with package itself: + +.. code-block:: none + + [hunter]> git checkout pr.hunter_box_1 + [hunter]> git push -u origin pr.hunter_box_1 + +.. image:: /creating-new/images/pr-with-package.png + :align: center + :alt: PR with package + +At this moment you know the pull request number: + +.. image:: /creating-new/images/pr-number.png + :align: center + :alt: Pull request number + +Add it to documentation: + +.. code-block:: none + + [hunter]> git checkout pr.hunter_box_1 + [hunter]> vim docs/packages/pkg/hunter_box_1.rst + [hunter]> git add docs/packages/pkg/hunter_box_1.rst + [hunter]> git commit -m 'Pull request number' + [hunter]> git push + +Pull request will be approved and tests run on CI, documentation will be +tested automatically: + +.. image:: /creating-new/images/package-testing.png + :align: center + :alt: Package testing + +Branch ``pkg.hunter_box_1.pr-N`` will be created from ``pkg.hunter_box_1`` +to test package: + +.. image:: /creating-new/images/pull-request-testing.png + :align: center + :alt: Change branch + +Upload +====== + +After tests passed pull request will be merged and upload run. When upload +finished new release will be created: + +.. image:: /creating-new/images/upload.png + :align: center + :alt: Upload + +You can use new ``URL``/``SHA1``: + +.. image:: /creating-new/images/release.png + :align: center + :alt: Upload + +Clean +===== + +At this moment all branches can be removed: + +.. code-block:: none + + [hunter]> git checkout master + + [hunter]> git push origin :pr.hunter_box_1 + [hunter]> git push origin :pr.pkg.hunter_box_1 + [hunter]> git push origin :test.hunter_box_1 + + [hunter]> git branch -D :pr.hunter_box_1 + [hunter]> git branch -D :pr.pkg.hunter_box_1 + [hunter]> git branch -D :test.hunter_box_1 diff --git a/docs/creating-new/create/custom.rst b/docs/creating-new/create/custom.rst new file mode 100644 index 0000000000..82204b0905 --- /dev/null +++ b/docs/creating-new/create/custom.rst @@ -0,0 +1,189 @@ +.. Copyright (c) 2016, Ruslan Baratov +.. All rights reserved. + +Non-CMake: custom scheme +------------------------ + +Non-CMake projects can be added too. But sometimes it's not a trivial task +(for example there are a 3 custom schemes for `OpenSSL `_. In general it's better to +apply a patch to an existing CMake build and use :ref:`cmake-simple` add +instruction. Anyway here is a guide how to add a project with custom build: + +Test it manually +================ + +.. code-block:: bash + + > wget https://github.com/phonegap/ios-sim/archive/1.8.2.tar.gz + > openssl sha1 1.8.2.tar.gz + SHA1(1.8.2.tar.gz)= 4328b3c8e6b455631d52b7ce5968170c9769eb1e + > tar xf 1.8.2.tar.gz + > cd ios-sim-1.8.2/ + > xcodebuild -target ios-sim -configuration Release + > ls build/Release/ios-sim + build/Release/ios-sim + +Test it using ``ExternalProject_Add`` +===================================== + +.. code-block:: bash + + > cat CMakeLists.txt + cmake_minimum_required(VERSION 3.0) + + include(ExternalProject) # ExternalProject_Add + + ExternalProject_Add( + ios_sim + URL + "https://github.com/phonegap/ios-sim/archive/1.8.2.tar.gz" + URL_HASH + SHA1=4328b3c8e6b455631d52b7ce5968170c9769eb1e + CONFIGURE_COMMAND + "" + BUILD_COMMAND + xcodebuild -target ios-sim -configuration Release + BUILD_IN_SOURCE + 1 + INSTALL_COMMAND + "${CMAKE_COMMAND}" -E make_directory "${CMAKE_INSTALL_PREFIX}" + COMMAND + "${CMAKE_COMMAND}" -E copy build/Release/ios-sim "${CMAKE_INSTALL_PREFIX}" + ) + > cmake -H. -B_builds -DCMAKE_INSTALL_PREFIX=`pwd`/_install + > cmake --build _builds/ + > ls _install/ + ios-sim + +Add new package +=============== + +First, custom build scheme need to be added to ``cmake/schemes`` directory: + +.. code-block:: bash + + > cd ${HUNTER_ROOT} + > cat cmake/schemes/url_sha1_ios_sim.cmake.in + # This is configuration file, variable @SOME_VARIABLE_NAME@ will be substituted during configure_file command + cmake_minimum_required(VERSION 3.0) + + # If such variables like `CMAKE_CXX_FLAGS` or `CMAKE_CXX_COMPILER` not used by scheme + # setting `LANGUAGES` to `NONE` will speed-up build a little bit. If you have any problems/glitches + # use regular `project(Hunter)` command + project(Hunter LANGUAGES NONE) + + include(ExternalProject) # ExternalProject_Add + + # some Hunter modules will be used + list(APPEND CMAKE_MODULE_PATH "@HUNTER_SELF@/cmake/modules") + + include(hunter_status_debug) + include(hunter_test_string_not_empty) + + # print this message if HUNTER_STATUS_DEBUG option is ON + hunter_status_debug("Scheme: url_sha1_ios_sim") + + # Check variables is not empty + hunter_test_string_not_empty("@HUNTER_SELF@") + hunter_test_string_not_empty("@HUNTER_EP_NAME@") + hunter_test_string_not_empty("@HUNTER_PACKAGE_URL@") + hunter_test_string_not_empty("@HUNTER_PACKAGE_SHA1@") + hunter_test_string_not_empty("@HUNTER_PACKAGE_DOWNLOAD_DIR@") + hunter_test_string_not_empty("@HUNTER_PACKAGE_SOURCE_DIR@") + hunter_test_string_not_empty("@HUNTER_INSTALL_PREFIX@") + + ExternalProject_Add( + @HUNTER_EP_NAME@ # Name of the external project. Actually not used set for beautify logging messages + URL + @HUNTER_PACKAGE_URL@ # URL of the package to download + URL_HASH + SHA1=@HUNTER_PACKAGE_SHA1@ # SHA1 hash + DOWNLOAD_DIR + "@HUNTER_PACKAGE_DOWNLOAD_DIR@" # Archive destination location + SOURCE_DIR + "@HUNTER_PACKAGE_SOURCE_DIR@" # Unpack directory + INSTALL_DIR + "@HUNTER_INSTALL_PREFIX@" # not used actually (see install command) + CONFIGURE_COMMAND + "" + BUILD_COMMAND + xcodebuild -target ios-sim -configuration Release + BUILD_IN_SOURCE + 1 + INSTALL_COMMAND + "@CMAKE_COMMAND@" -E copy build/Release/ios-sim "@HUNTER_INSTALL_PREFIX@" + ) + +Next steps are similar to :ref:`cmake-simple`. + +.. code-block:: bash + + > cat cmake/projects/ios_sim/hunter.cmake + + # !!! DO NOT PLACE HEADER GUARDS HERE !!! + + include(hunter_add_version) + include(hunter_download) + include(hunter_pick_scheme) + + hunter_add_version( + PACKAGE_NAME + ios_sim + VERSION + "1.8.2" + URL + "https://github.com/phonegap/ios-sim/archive/1.8.2.tar.gz" + SHA1 + 4328b3c8e6b455631d52b7ce5968170c9769eb1e + ) + + hunter_pick_scheme(DEFAULT url_sha1_ios_sim) # Use new custom scheme + hunter_download(PACKAGE_NAME ios_sim) + +.. code-block:: bash + + > grep ios_sim cmake/config/default.cmake + hunter_config(ios_sim VERSION 1.8.2) + +Using +===== + +Now package ready to be used: + +.. code-block:: bash + + > cat CMakeLists.txt + cmake_minimum_required(VERSION 2.8) + + include("cmake/HunterGate.cmake") + + HunterGate( + URL "https://url/to/your/hunter-archive.tar.gz" + SHA1 "put-archive-sha1-here" + ) + + hunter_add_package(ios_sim) + + find_program(IOS_SIM_EXECUTABLE ios-sim ${IOS_SIM_ROOT}) + message("ios_sim: ${IOS_SIM_EXECUTABLE}") + > cmake -H. -B_builds + -- [hunter] HUNTER_ROOT: /.../Hunter + -- [hunter] [ Hunter-ID: 7912489 | Config-ID: 9ec2ff8 | Toolchain-ID: c018e63 ] + -- [hunter] IOS_SIM_ROOT: /.../Hunter/_Base/7912489/9ec2ff8/c018e63/Install (ver.: 1.8.2) + ... + -- downloading... + src='https://github.com/phonegap/ios-sim/archive/1.8.2.tar.gz' + -- [download 100% complete] + ios_sim: /.../Hunter/_Base/7912489/9ec2ff8/c018e63/Install/ios-sim + +Default behavior +================ + +Note that such CMake variables like: + +* `CMAKE_{C,CXX}_FLAGS `_ +* `CMAKE_{C,CXX}_COMPILER `_ +* `CMAKE_CONFIGURATION_TYPES `_ +* `BUILD_SHARED_LIBS `_ + +must be checked manually for each custom build scheme (see :ref:`cmake-simple`). diff --git a/docs/creating-new/custom.rst b/docs/creating-new/custom.rst deleted file mode 100644 index 323a697b14..0000000000 --- a/docs/creating-new/custom.rst +++ /dev/null @@ -1,9 +0,0 @@ -.. Copyright (c) 2016, Ruslan Baratov -.. All rights reserved. - -Non-CMake: custom scheme ------------------------- - -* How to add a new `custom-build project`_ - -.. _custom-build project: https://github.com/ruslo/hunter/wiki/usr.adding.new.package.custom.scheme diff --git a/docs/creating-new/default-NEW.cmake b/docs/creating-new/default-NEW.cmake new file mode 100644 index 0000000000..f4d095e506 --- /dev/null +++ b/docs/creating-new/default-NEW.cmake @@ -0,0 +1,312 @@ +# Copyright (c) 2013-2017, Ruslan Baratov +# All rights reserved. + +# Do not place header guards here + +# Unset: +# * ${PACKAGE_NAME}_ROOT (CMake variable) +# * ${PACKAGE_NAME}_ROOT (CMake cache variable) +# * ${PACKAGE_NAME}_ROOT (environment variable) + +# Set CMake variables: +# * HUNTER_${PACKAGE_NAME}_VERSION +# * HUNTER_${PACKAGE_NAME}_CMAKE_ARGS (optionally) + +# Usage: +# hunter_config(Foo VERSION 1.0.0) +# hunter_config(Boo VERSION 1.2.3z CMAKE_ARGS BOO_WITH_A=ON) + +# Wiki: +# * https://github.com/ruslo/hunter/wiki/dev.modules#hunter_config + +include(hunter_config) +include(hunter_user_error) + +# NOTE: no names with spaces! + +hunter_config(AllTheFlopsThreads VERSION 0.1-p0) +hunter_config(Android-Apk VERSION 1.1.13) +hunter_config(Android-Build-Tools VERSION 22.0.1) +hunter_config(Android-Google-Repository VERSION 47) +hunter_config(Android-Modules VERSION 1.0.0) +hunter_config(Android-SDK VERSION 0.0.5) +hunter_config(Android-SDK-Platform-tools VERSION r25.0.5) +hunter_config(Android-SDK-Tools VERSION 25.2.5) +hunter_config(Android-Support-Repository VERSION 47) +hunter_config(ARM_NEON_2_x86_SSE VERSION 1.0.0-p0) +hunter_config(ArrayFire VERSION 3.3.1-p0) +hunter_config(Assimp VERSION 3.2-p1) +hunter_config(Async++ VERSION 0.0.3-hunter) +hunter_config(Avahi VERSION 0.6.31) +hunter_config(Beast VERSION 1.0.0-b84-hunter-0) +hunter_config(BZip2 VERSION 1.0.6-p3) +if(MSVC OR MINGW) + # FIXME: https://ci.appveyor.com/project/ingenue/hunter/build/1.0.2229 + hunter_config(Boost VERSION 1.64.0) +else() + hunter_config(Boost VERSION 1.65.0) +endif() +hunter_config(BoostCompute VERSION 0.5-p0) +hunter_config(BoostProcess VERSION 0.5) +hunter_config(CapnProto VERSION 0.6.1) +hunter_config(CLAPACK VERSION 3.2.1) +hunter_config(CURL VERSION 7.49.1-DEV-v8) +hunter_config(Clang VERSION 4.0.1-p0) +hunter_config(ClangToolsExtra VERSION 4.0.1) # Clang +hunter_config(Comet VERSION 4.0.2) +hunter_config(CppNetlib VERSION 0.10.1-hunter-3) +hunter_config(CppNetlibUri VERSION 1.0.4-hunter) +hunter_config(CsvParserCPlusPlus VERSION 1.0.1) +hunter_config(Eigen VERSION 3.3.4-p0) +hunter_config(enet VERSION 1.3.13-p1) +hunter_config(Expat VERSION 2.1.1) +if(MSVC) + hunter_config(getopt VERSION 1.0.0-p0) +endif() +hunter_config(GPUImage VERSION 0.1.6-p6) +hunter_config(GSL VERSION 2.1.0-p2) +hunter_config(Igloo VERSION 1.1.1-hunter) +hunter_config(intsizeof VERSION 2.0.1) +hunter_config(Jpeg VERSION 9b-p3) +hunter_config(JsonSpirit VERSION 0.0.4-hunter) +if(MSVC_VERSION LESS 1600) + # for VS10 - version without support C++11 + hunter_config(jsoncpp VERSION 0.7.0) +else() + hunter_config(jsoncpp VERSION 1.8.0) +endif() +hunter_config(LAPACK VERSION 3.7.1) +hunter_config(LLVM VERSION 4.0.1-p0) # Clang +hunter_config(LLVMCompilerRT VERSION 4.0.1-patched) # Clang +hunter_config(Leathers VERSION 0.1.6) +hunter_config(Leptonica VERSION 1.74.2-p4) +hunter_config(Libcxx VERSION 3.6.2) # Clang +hunter_config(Libcxxabi VERSION 3.6.2) # Clang +hunter_config(librtmp VERSION 2.4.0-p0) +hunter_config(Libssh2 VERSION 1.7.0) +hunter_config(Lua VERSION 5.3.2) +hunter_config(MySQL-client VERSION 6.1.9-p0) +hunter_config(NASM VERSION 2.12.02) +hunter_config(OpenBLAS VERSION 0.2.20-p0) +hunter_config(OpenCL VERSION 2.1-p3) +hunter_config(OpenCL-cpp VERSION 2.0.10-p0) +hunter_config(OpenCV VERSION 3.3.0-p2) +hunter_config(OpenCV-Extra VERSION 3.3.0) +hunter_config(OpenNMTTokenizer VERSION 0.2.0-p1) +if(MSVC) + # FIXME: https://ci.appveyor.com/project/ingenue/hunter/build/1.0.1470 + hunter_config(OpenSSL VERSION 1.0.2l) +else() + hunter_config(OpenSSL VERSION 1.1.0f) +endif() +hunter_config(PNG VERSION 1.6.26-p1) +hunter_config(PocoCpp VERSION 1.7.8-p0) +hunter_config(PostgreSQL VERSION 9.6.3) +hunter_config(Protobuf VERSION 3.0.0-p1) + +string(COMPARE EQUAL "${CMAKE_SYSTEM_NAME}" "Linux" _is_linux) +if(_is_linux OR MINGW) + # qt-qml example is broken on Linux + # qt-core example is broken on MinGW + hunter_config(Qt VERSION 5.5.1-cvpixelbuffer-2-p9) +else() + hunter_config(Qt VERSION 5.9.1-p0) +endif() + +hunter_config(QtAndroidCMake VERSION 1.0.9) +hunter_config(QtCMakeExtra VERSION 1.0.27) +hunter_config(QtQmlManager VERSION 1.0.0) +hunter_config(RapidJSON VERSION 1.0.2-p2) +hunter_config(RapidXML VERSION 1.13) +hunter_config(SDL2 VERSION 2.0.4-p4) +hunter_config(SDL_image VERSION 2.0.1-p1) +hunter_config(SDL_mixer VERSION 2.0.1-p1) +hunter_config(SQLite3 VERSION autoconf-3080803) #R-Tree enabled +hunter_config(Sober VERSION 0.1.3) +hunter_config(stormlib VERSION 9.21-p1) +hunter_config(Sugar VERSION 1.2.2) +hunter_config(SuiteSparse VERSION 4.5.1-p1) +hunter_config(TIFF VERSION 4.0.2-p3) +hunter_config(tommath VERSION 1.0-p2) +hunter_config(tomcrypt VERSION 1.17-p3) +hunter_config(WTL VERSION 9.1.5321) +hunter_config(WDC VERSION 1.1.1) +hunter_config(Washer VERSION 0.1.2) +hunter_config(WinSparkle VERSION 0.4.0) +hunter_config(ZLIB VERSION 1.2.8-p3) +hunter_config(ZMQPP VERSION 4.1.2) +hunter_config(ZeroMQ VERSION 4.1.4-p2) +hunter_config(caffe VERSION rc3-p2) +hunter_config(Catch VERSION 1.8.2-p0) +hunter_config(aes VERSION 0.0.1-p1) +hunter_config(aglet VERSION 1.2.0) +hunter_config(autobahn-cpp VERSION 0.2.0) +hunter_config(boost-pba VERSION 1.0.0-p0) +hunter_config(ccv VERSION 0.7-p6) +hunter_config(cereal VERSION 1.2.2-p0) +hunter_config(ceres-solver VERSION 1.12.0-p2) +hunter_config(clBLAS VERSION 2.10.0-p0) +hunter_config(convertutf VERSION 1.0.1) +hunter_config(crashpad VERSION v0.0.1-p0) +hunter_config(crashup VERSION 0.0.2) +hunter_config(cvmatio VERSION 1.0.27-p3) +hunter_config(cxxopts VERSION 1.0.0-p0) +hunter_config(czmq VERSION 4.0.2-p1) +hunter_config(damageproto VERSION 1.2.1) +hunter_config(dbus VERSION 1.10.0-hunter-4) +hunter_config(dest VERSION 0.8.0-p4) +hunter_config(dlib VERSION 19.6-p0) +hunter_config(doctest VERSION 1.2.0) +hunter_config(double-conversion VERSION 3.0.0) +hunter_config(dri2proto VERSION 2.8) +hunter_config(dri3proto VERSION 1.0) +hunter_config(drishti_assets VERSION 1.8) +hunter_config(drishti_faces VERSION 1.2) +hunter_config(drm VERSION 2.4.67) +hunter_config(eigen3-nnls VERSION 1.0.0) +hunter_config(eos VERSION 0.12.1) +hunter_config(FakeIt VERSION 2.0.3) +hunter_config(fixesproto VERSION 5.0) +hunter_config(flatbuffers VERSION 1.3.0-p3) +hunter_config(flex VERSION 2.6.4) +hunter_config(fmt VERSION 4.0.0) +hunter_config(freetype VERSION 2.6.2) +hunter_config(gauze VERSION 0.1.1) +hunter_config(geos VERSION 3.4.2) +hunter_config(gflags VERSION 2.2.1) +hunter_config(glew VERSION 2.0.0) +hunter_config(glfw VERSION 3.3.0-p4) +hunter_config(glm VERSION 0.9.8.5) +hunter_config(glog VERSION 0.3.5-p1) +hunter_config(glproto VERSION 1.4.17) +hunter_config(half VERSION 1.1.0-p1) +hunter_config(hdf5 VERSION 1.8.15-p1) +hunter_config(hunter_box_1 VERSION 1.0.1) +hunter_config(ice VERSION 1.0.8) +hunter_config(imshow VERSION 1.0.0-p0) +hunter_config(inputproto VERSION 2.2) +hunter_config(intltool VERSION 0.51.0) +hunter_config(ios_sim VERSION 3.1.1) +hunter_config(ippicv VERSION 20151201) +hunter_config(irrXML VERSION 1.2) +hunter_config(kbproto VERSION 1.0.6) +hunter_config(libdaemon VERSION 0.14) +hunter_config(libjson-rpc-cpp VERSION 0.7.0-p3) +hunter_config(libogg VERSION 1.3.2-cmake3) +hunter_config(libsodium VERSION 1.0.10) +hunter_config(libuv VERSION 1.14.0-p1) +hunter_config(libxml2 VERSION 2.9.4) +hunter_config(libyuv VERSION 1514-p3) +hunter_config(log4cplus VERSION 1.2.0-p0) +hunter_config(lzma VERSION 5.2.3-p4) +hunter_config(mini_chromium VERSION 0.0.1-p2) +hunter_config(minizip VERSION 1.0.1-p1) +hunter_config(mpark_variant VERSION 1.0.0) +hunter_config(msgpack VERSION 1.4.1-p2) +hunter_config(mtplz VERSION 0.1-p3) +hunter_config(nanoflann VERSION 1.2.3-p0) +hunter_config(nlohmann_json VERSION 2.1.1-p1) +hunter_config(odb VERSION 2.4.0) +hunter_config(odb-boost VERSION 2.4.0) +hunter_config(odb-compiler VERSION 2.4.0) +hunter_config(odb-mysql VERSION 2.4.0) +hunter_config(odb-pgsql VERSION 2.4.0) +hunter_config(odb-sqlite VERSION 2.4.0) +hunter_config(ogles_gpgpu VERSION 0.2.1) +hunter_config(onmt VERSION 0.4.1-p2) +hunter_config(openddlparser VERSION 0.1.0-p2) +hunter_config(pciaccess VERSION 0.13.4) +hunter_config(poly2tri VERSION 1.0.0) +hunter_config(polyclipping VERSION 4.8.8-p0) # for Assimp +hunter_config(presentproto VERSION 1.0) +hunter_config(pthread-stubs VERSION 0.3) +hunter_config(pugixml VERSION 1.8.1) +hunter_config(rabbitmq-c VERSION 0.7.0-p1) +hunter_config(randrproto VERSION 1.3.2) +hunter_config(renderproto VERSION 0.11.1) +hunter_config(sm VERSION 1.2.1) +hunter_config(Snappy VERSION 1.1.6-p0) +hunter_config(sse2neon VERSION 1.0.0-p0) +hunter_config(sparsehash VERSION 2.0.2) +if(MSVC_VERSION LESS 1800) + # for VS12 - version without support C++11 + hunter_config(spdlog VERSION 1.0.0-p0) +else() + hunter_config(spdlog VERSION 0.13.0-p1) +endif() +hunter_config(szip VERSION 2.1.0-p1) +hunter_config(Tesseract VERSION 3.05.01-hunter-3) +hunter_config(thread-pool-cpp VERSION 1.1.0) +hunter_config(tinydir VERSION 1.2-p0) +hunter_config(websocketpp VERSION 0.7.0-p2) +hunter_config(wxWidgets VERSION 3.0.2) +hunter_config(x11 VERSION 1.5.0) +hunter_config(x264 VERSION snapshot-20170420-2245) +hunter_config(xau VERSION 1.0.7) +hunter_config(xcb VERSION 1.11.1) +hunter_config(xcb-proto VERSION 1.11) +hunter_config(xcursor VERSION 1.1.13) +hunter_config(xdamage VERSION 1.1.4) +hunter_config(xext VERSION 1.3.1) +hunter_config(xextproto VERSION 7.2.1) +hunter_config(xf86vidmodeproto VERSION 2.3.1) +hunter_config(xfixes VERSION 5.0.1) +hunter_config(xgboost VERSION 0.40-p9) +hunter_config(xi VERSION 1.6.1) +hunter_config(xinerama VERSION 1.1.2) +hunter_config(xineramaproto VERSION 1.1.2) +hunter_config(xorg-macros VERSION 1.17) +hunter_config(xproto VERSION 7.0.23) +hunter_config(xrandr VERSION 1.3.2) +hunter_config(xrender VERSION 0.9.7) +hunter_config(xshmfence VERSION 1.2) +hunter_config(xtrans VERSION 1.2.7) +hunter_config(xxf86vm VERSION 1.1.2) +hunter_config(yaml-cpp VERSION 0.5.3) + +if(MSVC80) + hunter_config(GTest VERSION 1.7.0-hunter-6) +else() + hunter_config(GTest VERSION 1.8.0-hunter-p7) +endif() + +if(ANDROID) + string(COMPARE EQUAL "${CMAKE_SYSTEM_VERSION}" "" _is_empty) + if(_is_empty) + hunter_user_error("CMAKE_SYSTEM_VERSION is empty") + endif() + + string(COMPARE EQUAL "${CMAKE_SYSTEM_VERSION}" "21" _is_api_21) + string(COMPARE EQUAL "${CMAKE_SYSTEM_VERSION}" "19" _is_api_19) + string(COMPARE EQUAL "${CMAKE_SYSTEM_VERSION}" "16" _is_api_16) + + if(_is_api_21) + hunter_config(Android-Google-APIs VERSION 21_r01) + hunter_config(Android-Google-APIs-Intel-x86-Atom-System-Image VERSION 21_r10) + hunter_config(Android-Intel-x86-Atom-System-Image VERSION 21) + hunter_config(Android-SDK-Platform VERSION 21_r02) + hunter_config(Sources-for-Android-SDK VERSION 21) + hunter_config(Android-ARM-EABI-v7a-System-Image VERSION 21_r04) + elseif(_is_api_19) + hunter_config(Android-Google-APIs VERSION 19_r18) + hunter_config(Android-Intel-x86-Atom-System-Image VERSION 19) + hunter_config(Android-SDK-Platform VERSION 19_r04) + hunter_config(Sources-for-Android-SDK VERSION 19) + hunter_config(Android-ARM-EABI-v7a-System-Image VERSION 19_r05) + elseif(_is_api_16) + hunter_config(Android-Google-APIs VERSION 16_r04) + hunter_config(Android-Intel-x86-Atom-System-Image VERSION 16) + hunter_config(Android-SDK-Platform VERSION 16_r05) + hunter_config(Sources-for-Android-SDK VERSION 16) + else() + hunter_user_error( + "Android API (CMAKE_SYSTEM_VERSION)" + " Expected: `21`, `19`, `16`" + " Got: `${CMAKE_SYSTEM_VERSION}`" + ) + endif() +endif() + +hunter_config(zookeeper VERSION 3.4.9-p2) +hunter_config(tacopie VERSION 2.4.0-h1) +hunter_config(cpp_redis VERSION 3.5.0-h1) diff --git a/docs/creating-new/default.cmake b/docs/creating-new/default.cmake new file mode 100644 index 0000000000..f290bd621a --- /dev/null +++ b/docs/creating-new/default.cmake @@ -0,0 +1,312 @@ +# Copyright (c) 2013-2017, Ruslan Baratov +# All rights reserved. + +# Do not place header guards here + +# Unset: +# * ${PACKAGE_NAME}_ROOT (CMake variable) +# * ${PACKAGE_NAME}_ROOT (CMake cache variable) +# * ${PACKAGE_NAME}_ROOT (environment variable) + +# Set CMake variables: +# * HUNTER_${PACKAGE_NAME}_VERSION +# * HUNTER_${PACKAGE_NAME}_CMAKE_ARGS (optionally) + +# Usage: +# hunter_config(Foo VERSION 1.0.0) +# hunter_config(Boo VERSION 1.2.3z CMAKE_ARGS BOO_WITH_A=ON) + +# Wiki: +# * https://github.com/ruslo/hunter/wiki/dev.modules#hunter_config + +include(hunter_config) +include(hunter_user_error) + +# NOTE: no names with spaces! + +hunter_config(AllTheFlopsThreads VERSION 0.1-p0) +hunter_config(Android-Apk VERSION 1.1.13) +hunter_config(Android-Build-Tools VERSION 22.0.1) +hunter_config(Android-Google-Repository VERSION 47) +hunter_config(Android-Modules VERSION 1.0.0) +hunter_config(Android-SDK VERSION 0.0.5) +hunter_config(Android-SDK-Platform-tools VERSION r25.0.5) +hunter_config(Android-SDK-Tools VERSION 25.2.5) +hunter_config(Android-Support-Repository VERSION 47) +hunter_config(ARM_NEON_2_x86_SSE VERSION 1.0.0-p0) +hunter_config(ArrayFire VERSION 3.3.1-p0) +hunter_config(Assimp VERSION 3.2-p1) +hunter_config(Async++ VERSION 0.0.3-hunter) +hunter_config(Avahi VERSION 0.6.31) +hunter_config(Beast VERSION 1.0.0-b84-hunter-0) +hunter_config(BZip2 VERSION 1.0.6-p3) +if(MSVC OR MINGW) + # FIXME: https://ci.appveyor.com/project/ingenue/hunter/build/1.0.2229 + hunter_config(Boost VERSION 1.64.0) +else() + hunter_config(Boost VERSION 1.65.0) +endif() +hunter_config(BoostCompute VERSION 0.5-p0) +hunter_config(BoostProcess VERSION 0.5) +hunter_config(CapnProto VERSION 0.6.1) +hunter_config(CLAPACK VERSION 3.2.1) +hunter_config(CURL VERSION 7.49.1-DEV-v8) +hunter_config(Clang VERSION 4.0.1-p0) +hunter_config(ClangToolsExtra VERSION 4.0.1) # Clang +hunter_config(Comet VERSION 4.0.2) +hunter_config(CppNetlib VERSION 0.10.1-hunter-3) +hunter_config(CppNetlibUri VERSION 1.0.4-hunter) +hunter_config(CsvParserCPlusPlus VERSION 1.0.1) +hunter_config(Eigen VERSION 3.3.4-p0) +hunter_config(enet VERSION 1.3.13-p1) +hunter_config(Expat VERSION 2.1.1) +if(MSVC) + hunter_config(getopt VERSION 1.0.0-p0) +endif() +hunter_config(GPUImage VERSION 0.1.6-p6) +hunter_config(GSL VERSION 2.1.0-p2) +hunter_config(Igloo VERSION 1.1.1-hunter) +hunter_config(intsizeof VERSION 2.0.1) +hunter_config(Jpeg VERSION 9b-p3) +hunter_config(JsonSpirit VERSION 0.0.4-hunter) +if(MSVC_VERSION LESS 1600) + # for VS10 - version without support C++11 + hunter_config(jsoncpp VERSION 0.7.0) +else() + hunter_config(jsoncpp VERSION 1.8.0) +endif() +hunter_config(LAPACK VERSION 3.7.1) +hunter_config(LLVM VERSION 4.0.1-p0) # Clang +hunter_config(LLVMCompilerRT VERSION 4.0.1-patched) # Clang +hunter_config(Leathers VERSION 0.1.6) +hunter_config(Leptonica VERSION 1.74.2-p4) +hunter_config(Libcxx VERSION 3.6.2) # Clang +hunter_config(Libcxxabi VERSION 3.6.2) # Clang +hunter_config(librtmp VERSION 2.4.0-p0) +hunter_config(Libssh2 VERSION 1.7.0) +hunter_config(Lua VERSION 5.3.2) +hunter_config(MySQL-client VERSION 6.1.9-p0) +hunter_config(NASM VERSION 2.12.02) +hunter_config(OpenBLAS VERSION 0.2.20-p0) +hunter_config(OpenCL VERSION 2.1-p3) +hunter_config(OpenCL-cpp VERSION 2.0.10-p0) +hunter_config(OpenCV VERSION 3.3.0-p2) +hunter_config(OpenCV-Extra VERSION 3.3.0) +hunter_config(OpenNMTTokenizer VERSION 0.2.0-p1) +if(MSVC) + # FIXME: https://ci.appveyor.com/project/ingenue/hunter/build/1.0.1470 + hunter_config(OpenSSL VERSION 1.0.2l) +else() + hunter_config(OpenSSL VERSION 1.1.0f) +endif() +hunter_config(PNG VERSION 1.6.26-p1) +hunter_config(PocoCpp VERSION 1.7.8-p0) +hunter_config(PostgreSQL VERSION 9.6.3) +hunter_config(Protobuf VERSION 3.0.0-p1) + +string(COMPARE EQUAL "${CMAKE_SYSTEM_NAME}" "Linux" _is_linux) +if(_is_linux OR MINGW) + # qt-qml example is broken on Linux + # qt-core example is broken on MinGW + hunter_config(Qt VERSION 5.5.1-cvpixelbuffer-2-p9) +else() + hunter_config(Qt VERSION 5.9.1-p0) +endif() + +hunter_config(QtAndroidCMake VERSION 1.0.9) +hunter_config(QtCMakeExtra VERSION 1.0.27) +hunter_config(QtQmlManager VERSION 1.0.0) +hunter_config(RapidJSON VERSION 1.0.2-p2) +hunter_config(RapidXML VERSION 1.13) +hunter_config(SDL2 VERSION 2.0.4-p4) +hunter_config(SDL_image VERSION 2.0.1-p1) +hunter_config(SDL_mixer VERSION 2.0.1-p1) +hunter_config(SQLite3 VERSION autoconf-3080803) #R-Tree enabled +hunter_config(Sober VERSION 0.1.3) +hunter_config(stormlib VERSION 9.21-p1) +hunter_config(Sugar VERSION 1.2.2) +hunter_config(SuiteSparse VERSION 4.5.1-p1) +hunter_config(TIFF VERSION 4.0.2-p3) +hunter_config(tommath VERSION 1.0-p2) +hunter_config(tomcrypt VERSION 1.17-p3) +hunter_config(WTL VERSION 9.1.5321) +hunter_config(WDC VERSION 1.1.1) +hunter_config(Washer VERSION 0.1.2) +hunter_config(WinSparkle VERSION 0.4.0) +hunter_config(ZLIB VERSION 1.2.8-p3) +hunter_config(ZMQPP VERSION 4.1.2) +hunter_config(ZeroMQ VERSION 4.1.4-p2) +hunter_config(caffe VERSION rc3-p2) +hunter_config(Catch VERSION 1.8.2-p0) +hunter_config(aes VERSION 0.0.1-p1) +hunter_config(aglet VERSION 1.2.0) +hunter_config(autobahn-cpp VERSION 0.2.0) +hunter_config(boost-pba VERSION 1.0.0-p0) +hunter_config(ccv VERSION 0.7-p6) +hunter_config(cereal VERSION 1.2.2-p0) +hunter_config(ceres-solver VERSION 1.12.0-p2) +hunter_config(clBLAS VERSION 2.10.0-p0) +hunter_config(convertutf VERSION 1.0.1) +hunter_config(crashpad VERSION v0.0.1-p0) +hunter_config(crashup VERSION 0.0.2) +hunter_config(cvmatio VERSION 1.0.27-p3) +hunter_config(cxxopts VERSION 1.0.0-p0) +hunter_config(czmq VERSION 4.0.2-p1) +hunter_config(damageproto VERSION 1.2.1) +hunter_config(dbus VERSION 1.10.0-hunter-4) +hunter_config(dest VERSION 0.8.0-p4) +hunter_config(dlib VERSION 19.6-p0) +hunter_config(doctest VERSION 1.2.0) +hunter_config(double-conversion VERSION 3.0.0) +hunter_config(dri2proto VERSION 2.8) +hunter_config(dri3proto VERSION 1.0) +hunter_config(drishti_assets VERSION 1.8) +hunter_config(drishti_faces VERSION 1.2) +hunter_config(drm VERSION 2.4.67) +hunter_config(eigen3-nnls VERSION 1.0.0) +hunter_config(eos VERSION 0.12.1) +hunter_config(FakeIt VERSION 2.0.3) +hunter_config(fixesproto VERSION 5.0) +hunter_config(flatbuffers VERSION 1.3.0-p3) +hunter_config(flex VERSION 2.6.4) +hunter_config(fmt VERSION 4.0.0) +hunter_config(freetype VERSION 2.6.2) +hunter_config(gauze VERSION 0.1.1) +hunter_config(geos VERSION 3.4.2) +hunter_config(gflags VERSION 2.2.1) +hunter_config(glew VERSION 2.0.0) +hunter_config(glfw VERSION 3.3.0-p4) +hunter_config(glm VERSION 0.9.8.5) +hunter_config(glog VERSION 0.3.5-p1) +hunter_config(glproto VERSION 1.4.17) +hunter_config(half VERSION 1.1.0-p1) +hunter_config(hdf5 VERSION 1.8.15-p1) +hunter_config(hunter_box_1 VERSION 1.0.0) +hunter_config(ice VERSION 1.0.8) +hunter_config(imshow VERSION 1.0.0-p0) +hunter_config(inputproto VERSION 2.2) +hunter_config(intltool VERSION 0.51.0) +hunter_config(ios_sim VERSION 3.1.1) +hunter_config(ippicv VERSION 20151201) +hunter_config(irrXML VERSION 1.2) +hunter_config(kbproto VERSION 1.0.6) +hunter_config(libdaemon VERSION 0.14) +hunter_config(libjson-rpc-cpp VERSION 0.7.0-p3) +hunter_config(libogg VERSION 1.3.2-cmake3) +hunter_config(libsodium VERSION 1.0.10) +hunter_config(libuv VERSION 1.14.0-p1) +hunter_config(libxml2 VERSION 2.9.4) +hunter_config(libyuv VERSION 1514-p3) +hunter_config(log4cplus VERSION 1.2.0-p0) +hunter_config(lzma VERSION 5.2.3-p4) +hunter_config(mini_chromium VERSION 0.0.1-p2) +hunter_config(minizip VERSION 1.0.1-p1) +hunter_config(mpark_variant VERSION 1.0.0) +hunter_config(msgpack VERSION 1.4.1-p2) +hunter_config(mtplz VERSION 0.1-p3) +hunter_config(nanoflann VERSION 1.2.3-p0) +hunter_config(nlohmann_json VERSION 2.1.1-p1) +hunter_config(odb VERSION 2.4.0) +hunter_config(odb-boost VERSION 2.4.0) +hunter_config(odb-compiler VERSION 2.4.0) +hunter_config(odb-mysql VERSION 2.4.0) +hunter_config(odb-pgsql VERSION 2.4.0) +hunter_config(odb-sqlite VERSION 2.4.0) +hunter_config(ogles_gpgpu VERSION 0.2.1) +hunter_config(onmt VERSION 0.4.1-p2) +hunter_config(openddlparser VERSION 0.1.0-p2) +hunter_config(pciaccess VERSION 0.13.4) +hunter_config(poly2tri VERSION 1.0.0) +hunter_config(polyclipping VERSION 4.8.8-p0) # for Assimp +hunter_config(presentproto VERSION 1.0) +hunter_config(pthread-stubs VERSION 0.3) +hunter_config(pugixml VERSION 1.8.1) +hunter_config(rabbitmq-c VERSION 0.7.0-p1) +hunter_config(randrproto VERSION 1.3.2) +hunter_config(renderproto VERSION 0.11.1) +hunter_config(sm VERSION 1.2.1) +hunter_config(Snappy VERSION 1.1.6-p0) +hunter_config(sse2neon VERSION 1.0.0-p0) +hunter_config(sparsehash VERSION 2.0.2) +if(MSVC_VERSION LESS 1800) + # for VS12 - version without support C++11 + hunter_config(spdlog VERSION 1.0.0-p0) +else() + hunter_config(spdlog VERSION 0.13.0-p1) +endif() +hunter_config(szip VERSION 2.1.0-p1) +hunter_config(Tesseract VERSION 3.05.01-hunter-3) +hunter_config(thread-pool-cpp VERSION 1.1.0) +hunter_config(tinydir VERSION 1.2-p0) +hunter_config(websocketpp VERSION 0.7.0-p2) +hunter_config(wxWidgets VERSION 3.0.2) +hunter_config(x11 VERSION 1.5.0) +hunter_config(x264 VERSION snapshot-20170420-2245) +hunter_config(xau VERSION 1.0.7) +hunter_config(xcb VERSION 1.11.1) +hunter_config(xcb-proto VERSION 1.11) +hunter_config(xcursor VERSION 1.1.13) +hunter_config(xdamage VERSION 1.1.4) +hunter_config(xext VERSION 1.3.1) +hunter_config(xextproto VERSION 7.2.1) +hunter_config(xf86vidmodeproto VERSION 2.3.1) +hunter_config(xfixes VERSION 5.0.1) +hunter_config(xgboost VERSION 0.40-p9) +hunter_config(xi VERSION 1.6.1) +hunter_config(xinerama VERSION 1.1.2) +hunter_config(xineramaproto VERSION 1.1.2) +hunter_config(xorg-macros VERSION 1.17) +hunter_config(xproto VERSION 7.0.23) +hunter_config(xrandr VERSION 1.3.2) +hunter_config(xrender VERSION 0.9.7) +hunter_config(xshmfence VERSION 1.2) +hunter_config(xtrans VERSION 1.2.7) +hunter_config(xxf86vm VERSION 1.1.2) +hunter_config(yaml-cpp VERSION 0.5.3) + +if(MSVC80) + hunter_config(GTest VERSION 1.7.0-hunter-6) +else() + hunter_config(GTest VERSION 1.8.0-hunter-p7) +endif() + +if(ANDROID) + string(COMPARE EQUAL "${CMAKE_SYSTEM_VERSION}" "" _is_empty) + if(_is_empty) + hunter_user_error("CMAKE_SYSTEM_VERSION is empty") + endif() + + string(COMPARE EQUAL "${CMAKE_SYSTEM_VERSION}" "21" _is_api_21) + string(COMPARE EQUAL "${CMAKE_SYSTEM_VERSION}" "19" _is_api_19) + string(COMPARE EQUAL "${CMAKE_SYSTEM_VERSION}" "16" _is_api_16) + + if(_is_api_21) + hunter_config(Android-Google-APIs VERSION 21_r01) + hunter_config(Android-Google-APIs-Intel-x86-Atom-System-Image VERSION 21_r10) + hunter_config(Android-Intel-x86-Atom-System-Image VERSION 21) + hunter_config(Android-SDK-Platform VERSION 21_r02) + hunter_config(Sources-for-Android-SDK VERSION 21) + hunter_config(Android-ARM-EABI-v7a-System-Image VERSION 21_r04) + elseif(_is_api_19) + hunter_config(Android-Google-APIs VERSION 19_r18) + hunter_config(Android-Intel-x86-Atom-System-Image VERSION 19) + hunter_config(Android-SDK-Platform VERSION 19_r04) + hunter_config(Sources-for-Android-SDK VERSION 19) + hunter_config(Android-ARM-EABI-v7a-System-Image VERSION 19_r05) + elseif(_is_api_16) + hunter_config(Android-Google-APIs VERSION 16_r04) + hunter_config(Android-Intel-x86-Atom-System-Image VERSION 16) + hunter_config(Android-SDK-Platform VERSION 16_r05) + hunter_config(Sources-for-Android-SDK VERSION 16) + else() + hunter_user_error( + "Android API (CMAKE_SYSTEM_VERSION)" + " Expected: `21`, `19`, `16`" + " Got: `${CMAKE_SYSTEM_VERSION}`" + ) + endif() +endif() + +hunter_config(zookeeper VERSION 3.4.9-p2) +hunter_config(tacopie VERSION 2.4.0-h1) +hunter_config(cpp_redis VERSION 3.5.0-h1) diff --git a/docs/creating-new/hunter-NEW.cmake b/docs/creating-new/hunter-NEW.cmake new file mode 100644 index 0000000000..05c7b14eb6 --- /dev/null +++ b/docs/creating-new/hunter-NEW.cmake @@ -0,0 +1,35 @@ +# Copyright (c) 2016-2017, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME + hunter_box_1 + VERSION + 1.0.0 + URL + "https://github.com/hunterbox/hunter_box_1/archive/v1.0.0.tar.gz" + SHA1 + 4fa7fe75629f148a61cedc6ba0bce74f177a6747 +) + +hunter_add_version( + PACKAGE_NAME + hunter_box_1 + VERSION + 1.0.1 + URL + "https://github.com/hunterbox/hunter_box_1/archive/v1.0.1.tar.gz" + SHA1 + 10d046eec6c8b0aabd28bd3d1b99faf6beeb226b +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(hunter_box_1) +hunter_download(PACKAGE_NAME hunter_box_1) diff --git a/docs/creating-new/hunter.cmake b/docs/creating-new/hunter.cmake new file mode 100644 index 0000000000..3253e79faa --- /dev/null +++ b/docs/creating-new/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2017, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME + hunter_box_1 + VERSION + 1.0.0 + URL + "https://github.com/hunterbox/hunter_box_1/archive/v1.0.0.tar.gz" + SHA1 + 4fa7fe75629f148a61cedc6ba0bce74f177a6747 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(hunter_box_1) +hunter_download(PACKAGE_NAME hunter_box_1) diff --git a/docs/creating-new/images/branches.png b/docs/creating-new/images/branches.png new file mode 100644 index 0000000000..3ee14b802e Binary files /dev/null and b/docs/creating-new/images/branches.png differ diff --git a/docs/creating-new/images/package-testing.png b/docs/creating-new/images/package-testing.png new file mode 100644 index 0000000000..90e7dbc12b Binary files /dev/null and b/docs/creating-new/images/package-testing.png differ diff --git a/docs/creating-new/images/pr-change-branch.png b/docs/creating-new/images/pr-change-branch.png new file mode 100644 index 0000000000..81aace052f Binary files /dev/null and b/docs/creating-new/images/pr-change-branch.png differ diff --git a/docs/creating-new/images/pr-number.png b/docs/creating-new/images/pr-number.png new file mode 100644 index 0000000000..9791ba5d7a Binary files /dev/null and b/docs/creating-new/images/pr-number.png differ diff --git a/docs/creating-new/images/pr-update-version.png b/docs/creating-new/images/pr-update-version.png new file mode 100644 index 0000000000..36a4fad874 Binary files /dev/null and b/docs/creating-new/images/pr-update-version.png differ diff --git a/docs/creating-new/images/pr-with-package.png b/docs/creating-new/images/pr-with-package.png new file mode 100644 index 0000000000..8c3e47a73d Binary files /dev/null and b/docs/creating-new/images/pr-with-package.png differ diff --git a/docs/creating-new/images/pr-with-tests.png b/docs/creating-new/images/pr-with-tests.png new file mode 100644 index 0000000000..ac7e9213eb Binary files /dev/null and b/docs/creating-new/images/pr-with-tests.png differ diff --git a/docs/creating-new/images/pull-request-testing.png b/docs/creating-new/images/pull-request-testing.png new file mode 100644 index 0000000000..6e6e9455a4 Binary files /dev/null and b/docs/creating-new/images/pull-request-testing.png differ diff --git a/docs/creating-new/images/pull-request.png b/docs/creating-new/images/pull-request.png new file mode 100644 index 0000000000..f7998e3c14 Binary files /dev/null and b/docs/creating-new/images/pull-request.png differ diff --git a/docs/creating-new/images/release.png b/docs/creating-new/images/release.png new file mode 100644 index 0000000000..7bf8332ad3 Binary files /dev/null and b/docs/creating-new/images/release.png differ diff --git a/docs/creating-new/images/upload.png b/docs/creating-new/images/upload.png new file mode 100644 index 0000000000..e964d12666 Binary files /dev/null and b/docs/creating-new/images/upload.png differ diff --git a/docs/creating-new/patch.rst b/docs/creating-new/patch.rst new file mode 100644 index 0000000000..794d5c9f0b --- /dev/null +++ b/docs/creating-new/patch.rst @@ -0,0 +1,52 @@ +.. Copyright (c) 2017, Ruslan Baratov +.. All rights reserved. + +Patch sources +------------- + +You may need to patch sources to apply CMake best practices or hunterize +package with dependencies. + +In practice patching requires to have a fork of a project. In general it does +not matter where the fork is located. But it matters that there is a central +place for the patched packages: + +* https://github.com/hunter-packages + +If you want to create new fork let me know about it in a corresponding issue +with `"new package" label`_, I will create a new team and add you so you can +push changes. + +Please follow next rules: + +* Instead of pushing changes directly to branch open pull request so other + developers can review your changes. + +* Start working on patches from latest stable upstream tag. I.e. if latest + release is ``v1.3.15`` then create branch ``hunter-v1.3.15`` and add + patches there. + +* Keep other branches in a **clean state** so we can always do + ``git merge --ff-only`` from upstream. + +* Please do push commits **only related to hunterization**. Do not push general + fixes and improvements, do push them **upstream** instead. Perfect + hunterization should contain only: + + * Adding ``HunterGate`` module (`example `__) + * Including it with some URL/SHA1 (`example `__) + * Adding ``hunter_add_package`` commands (`example `__) + +Note that I'm not willing and can't maintain all packages in practice. Therefore +I do add all developers to the team **if they ask to**. If you want to be +a **maintainer**, keep eye on changes, pull requests, be responsible for review +and releases - let me know. + +Also note that Hunter is designed to have **zero maintenance** for such tasks, +since you can add ``HUNTER_ENABLED=OFF`` option at the top of the project +to skip all package management stuff (see :doc:`/overview/compatibility`). It +means you can push branch ``hunter`` to upstream without affecting +functionality of the project. As a summary it may sounds strange, but the final +goal of this organization is to have no forks of packages at all. + +.. _"new package" label: https://github.com/ruslo/hunter/issues?q=is%3Aopen+is%3Aissue+label%3A%22new+package%22 diff --git a/docs/creating-new/update.rst b/docs/creating-new/update.rst new file mode 100644 index 0000000000..3a84abd560 --- /dev/null +++ b/docs/creating-new/update.rst @@ -0,0 +1,89 @@ +.. Copyright (c) 2017, Ruslan Baratov +.. All rights reserved. + +.. spelling:: + + diff + +Update package +-------------- + +Create branch for working on package update: + +.. code-block:: none + + [hunter]> git checkout master + [hunter]> git checkout -b pr.hunter_box_1 + +Calculate SHA1 of release: + +.. code-block:: none + + > wget https://github.com/hunterbox/hunter_box_1/archive/v1.0.1.tar.gz + > openssl sha1 v1.0.1.tar.gz + SHA1(v1.0.1.tar.gz)= 10d046eec6c8b0aabd28bd3d1b99faf6beeb226b + +Add URL and SHA1 to corresponding ``hunter.cmake``: + +.. literalinclude:: hunter-NEW.cmake + :diff: hunter.cmake + +.. hint:: + + Put new ``hunter_add_version`` at the bottom of file, diff will look + prettier in this case. + +Update default version in ``cmake/configs/default.cmake``: + +.. literalinclude:: default-NEW.cmake + :diff: default.cmake + +Commit changes: + +.. code-block:: none + + [hunter]> git add cmake/projects/hunter_box_1/hunter.cmake + [hunter]> git add cmake/configs/default.cmake + [hunter]> git commit -m "Update 'hunter_box_1' to v1.0.1" + +Testing +======= + +Create temporary branch ``test.hunter_box_1`` for testing and merge CI configs +from ``pkg.hunter_box_1``: + +.. code-block:: none + + [hunter]> git fetch ci + [hunter]> git checkout pkg.hunter_box_1 + [hunter]> git checkout -b test.hunter_box_1 + [hunter]> git merge pr.hunter_box_1 + +Push changes to remote to start tests: + +.. code-block:: none + + [hunter]> git push -u origin test.hunter_box_1 + +.. image:: /creating-new/images/pr-update-version.png + :align: center + :alt: Branches + +Add toolchains +============== + +If new version of package fix some build: + +* Add new version to ``master`` +* Tests against **old** set of toolchains +* New version merged to master +* Send pull request to ``pkg.hunter_box_1`` to enable **new** toolchains + +Remove toolchains +================= + +If new version broke some toolchain: + +* Disable toolchains in ``pkg.hunter_box_1`` +* Add new version to ``master`` +* Tests against **new** set of toolchains without broken diff --git a/docs/creating-new/yed/branches.graphml b/docs/creating-new/yed/branches.graphml new file mode 100644 index 0000000000..331084a829 --- /dev/null +++ b/docs/creating-new/yed/branches.graphml @@ -0,0 +1,711 @@ + + + + + + + + + + + + + + + + + + + + + + + master + + + + + + + + + + + + + + + + + + + pkg.template + + + + + + + + + + + + + + + + + + + pkg.<name> + + + + + + + + + + + + + + + + + + + upload.<name> + + + + + + + + + + + + + + + + + + + Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ruslo/hunter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + .travis.yml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Test 'examples/foo' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + .travis.yml/appveyor.yml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Test 'examples/<name>' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + .travis.yml/appveyor.yml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Upload '<name>' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + .travis.yml/appveyor.yml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ingenue/hunter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ingenue/hunter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ingenue/hunter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/creating-new/yed/pr-update-version.graphml b/docs/creating-new/yed/pr-update-version.graphml new file mode 100644 index 0000000000..e99e76877c --- /dev/null +++ b/docs/creating-new/yed/pr-update-version.graphml @@ -0,0 +1,373 @@ + + + + + + + + + + + + + + + + + + + + + + + master + + + + + + + + + + + + + + + + + + + pkg.template + + + + + + + + + + + + + + + + + + + pkg.hunter_box_1 + + + + + + + + + + + + + + + + + + + ruslo/hunter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ingenue/hunter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ingenue/hunter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + upload.hunter_box_1 + + + + + + + + + + + + + + + + + + + ingenue/hunter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + pr.hunter_box_1 + + + + + + + + + + + + + + + + + + + test.hunter_box_1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/creating-new/yed/pull-request-testing.graphml b/docs/creating-new/yed/pull-request-testing.graphml new file mode 100644 index 0000000000..006bfe830b --- /dev/null +++ b/docs/creating-new/yed/pull-request-testing.graphml @@ -0,0 +1,342 @@ + + + + + + + + + + + + + + + + + + + + + + + master + + + + + + + + + + + + + + + + + + + pkg.template + + + + + + + + + + + + + + + + + + + pkg.hunter_box_1 + + + + + + + + + + + + + + + + + + + ruslo/hunter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ingenue/hunter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ingenue/hunter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + pr.hunter_box_1 + + + + + + + + + + + + + + + + + + + pkg.hunter_box_1.pr-N + + + + + + + + + + + + + + + + + + + ingenue/hunter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/creating-new/yed/pull-request.graphml b/docs/creating-new/yed/pull-request.graphml new file mode 100644 index 0000000000..6a38275c4c --- /dev/null +++ b/docs/creating-new/yed/pull-request.graphml @@ -0,0 +1,440 @@ + + + + + + + + + + + + + + + + + + + + + + + master + + + + + + + + + + + + + + + + + + + pkg.template + + + + + + + + + + + + + + + + + + + pkg.<name> + + + + + + + + + + + + + + + + + + + upload.<name> + + + + + + + + + + + + + + + + + + + ruslo/hunter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ingenue/hunter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ingenue/hunter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ingenue/hunter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + pr.hunter_box_1 + + + + + + + + + + + + + + + + + + + pr.pkg.hunter_box_1 + + + + + + + + + + + + + + + + + + + test.hunter_box_1 + + + + + + + + + + + + + + + + + + + + Temporary branch. +No pull request with +this change. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/donations.rst b/docs/donations.rst index ea7bafc068..2be3f881b5 100644 --- a/docs/donations.rst +++ b/docs/donations.rst @@ -4,4 +4,11 @@ Donations --------- -* `Donations `_ +If you like this project and it's goals consider supporting it by making a +donation. + +.. image:: https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif + :target: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UN8PDZZ3Q7VVL + :alt: PayPal donation + +Thanks! :) diff --git a/docs/faq/why-binaries-from-server-not-used.rst b/docs/faq/why-binaries-from-server-not-used.rst index 2681700a2a..106cdf671b 100644 --- a/docs/faq/why-binaries-from-server-not-used.rst +++ b/docs/faq/why-binaries-from-server-not-used.rst @@ -4,7 +4,7 @@ Why binaries from server not used? ================================== -If settings and environment of your local project doesn't match environment +If settings and environment of your local project does not match environment of Travis/AppVeyor services (this is where binaries usually uploaded from) you will see ``Cache miss`` message and package will be build locally: @@ -45,18 +45,18 @@ Next information will help you to set your environment. .. code-block:: shell - > docker pull quay.io/ruslo/hunter-travis # pull/update image - > docker run -it quay.io/ruslo/hunter-travis bash - travis@...:~$ (cd polly && git pull) # fetch last changes, note that branch "develop" is used! + > docker pull quay.io/ruslo/hunter-travis-trusty # pull/update image + > docker run -it quay.io/ruslo/hunter-travis-trusty bash + travis@...:~$ (cd polly && git pull) # fetch last changes travis@...:~$ (cd hunter && git pull) # - // - - travis@...:~$ cd hunter && TOOLCHAIN=gcc-4-8 PROJECT_DIR=examples/GTest ./jenkins.py --verbose --clear-except + travis@...:~$ cd hunter && TOOLCHAIN=gcc PROJECT_DIR=examples/GTest ./jenkins.py --verbose --clear-except Starting GUI: .. code-block:: shell > xhost + - > docker run -it -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix quay.io/ruslo/hunter-travis bash + > docker run -it -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix quay.io/ruslo/hunter-travis-trusty bash travis@...:~$ firefox Information from logs @@ -133,11 +133,11 @@ in logs: .. code-block:: none - -- [hunter *** DEBUG *** ...] HUNTER_TOOLCHAIN_ID_PATH: /.../_Base/86b1bc9/cef4daf/aa85dd8 + -- [hunter *** DEBUG *** ...] HUNTER_TOOLCHAIN_ID_PATH: /.../_Base/86b1bc9/aa85dd8 .. code-block:: shell - > openssl sha1 /.../_Base/86b1bc9/cef4daf/aa85dd8/toolchain.info + > openssl sha1 /.../_Base/86b1bc9/aa85dd8/toolchain.info SHA1(toolchain.info)= aa85dd86f2feefe76397d7b624ccb6c09d971fe5 You can see that there is no ``aa85dd8`` entry in cache: @@ -159,7 +159,7 @@ Compare both files to figure out what's wrong: .. code-block:: shell - > diff hunter-cache/8928885/toolchain.info /.../_Base/86b1bc9/cef4daf/aa85dd8/toolchain.info + > diff hunter-cache/8928885/toolchain.info /.../_Base/86b1bc9/aa85dd8/toolchain.info ... < #define __GNUC_MINOR__ 8 < #define __GNUC_PATCHLEVEL__ 1 @@ -182,7 +182,7 @@ Uploading to server It is possible to upload Hunter binary cache to the server. For now only GitHub hosting supported. All big raw ``*.tar.bz2`` archives -uploaded as assets to release with name ``cache`` (directory layout doesn't +uploaded as assets to release with name ``cache`` (directory layout does not matter) and all small text files with meta information uploaded directly to branch ``master`` (directory layout matters) (see `hunter-cache `__ as example). diff --git a/docs/index.rst b/docs/index.rst index c770e5e1d3..aa9b21c3ae 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -9,7 +9,8 @@ Hunter: organize freedom Documentation is in process of migrating from `GitHub wiki `_. Some information may be missing: blank pages, broken links, etc. - Will be fixed soon... + See `issue #667 `__ + for details. Welcome to the Hunter package manager documentation! diff --git a/docs/overview/compatibility.rst b/docs/overview/compatibility.rst index 8038de0c81..b2d4bfab10 100644 --- a/docs/overview/compatibility.rst +++ b/docs/overview/compatibility.rst @@ -1,4 +1,4 @@ -.. Copyright (c) 2016, Ruslan Baratov +.. Copyright (c) 2016-2017, Ruslan Baratov .. All rights reserved. Backward compatibility @@ -8,15 +8,13 @@ Turn Hunter off by adding one option `HUNTER_ENABLED=NO`_ to use your old settings. For example: .. code-block:: cmake - :emphasize-lines: 1 + :emphasize-lines: 3 - hunter_add_package(OpenSSL) + add_executable(foo openssl-example.cpp) + hunter_add_package(OpenSSL) find_package(OpenSSL REQUIRED) - include_directories("${OPENSSL_INCLUDE_DIR}") - - add_executable(foo openssl-example.cpp) - target_link_libraries(foo ${OPENSSL_LIBRARIES}) + target_link_libraries(foo PUBLIC OpenSSL::SSL OpenSSL::Crypto) by default this code will trigger download and build of OpenSSL: @@ -49,8 +47,8 @@ system library will be used instead: CMakeFiles/foo.dir/openssl-example.cpp.o -o foo -rdynamic - -lssl - -lcrypto + /usr/lib/x86_64-linux-gnu/libssl.so + /usr/lib/x86_64-linux-gnu/libcrypto.so ``HUNTER_ENABLED=NO`` can be set by default using CMake ``option``: @@ -71,8 +69,35 @@ it still can be used in Hunter, no extra modifications needed. .. _HUNTER_ENABLED=NO: https://github.com/ruslo/hunter/wiki/usr.variables#hunter_enabled -.. warning:: +Helper modules +============== + +Not all packages have the same CMake usage API. E.g. for CURL in Hunter +there is imported target ``CURL::libcurl`` but there are only +``CURL_INCLUDE_DIRS`` and ``CURL_LIBRARIES`` defined in standard ``FindCURL`` +module. + +To mimic Hunter API `disabled-mode `__ +modules can be used. + +``HunterGate`` will load them automatically when ``HUNTER_ENABLED=OFF`` and +they are located in ``${CMAKE_CURRENT_LIST_DIR}/cmake/Hunter/disabled-mode``: + +.. code-block:: none + + > cmake -H. -B_builds -DHUNTER_ENABLED=NO -DHUNTER_STATUS_DEBUG=ON + -- [hunter *** DEBUG *** ...] Adding "disabled-mode" modules: /.../cmake/Hunter/disabled-mode + +Module ``CURLConfig`` from "disabled-mode" modules will be added to CMake +search path, loaded, call standard ``FindCURL`` and create imported target +``CURL::libcurl``. This will allow to use same API with and without Hunter: + +.. code-block:: cmake + + hunter_add_package(CURL) + find_package(CURL CONFIG REQUIRED) + target_link_libraries(foo PUBLIC CURL::libcurl) + +.. admonition:: Examples on GitHub - Using old-style ``FOO_LIBRARIES`` variable instead of imported ``Foo::foo`` - targets will make your project non-relocatable because of full paths, so - probably you have to change this code to ``Foo::foo`` anyway. + * `Disabled mode example `__ diff --git a/docs/overview/customization.rst b/docs/overview/customization.rst index a53f2d0362..9539f03e55 100644 --- a/docs/overview/customization.rst +++ b/docs/overview/customization.rst @@ -12,6 +12,6 @@ new build option to external package. :maxdepth: 1 Hunter-ID - Config-ID Toolchain-ID + Config-ID Build types diff --git a/docs/overview/customization/build-types.rst b/docs/overview/customization/build-types.rst index 54fd57286d..49b58b224c 100644 --- a/docs/overview/customization/build-types.rst +++ b/docs/overview/customization/build-types.rst @@ -4,4 +4,4 @@ Build types ----------- -* `Build types like Release/Debug `_ +* `Build types like Release/Debug `__ diff --git a/docs/overview/customization/config-id.rst b/docs/overview/customization/config-id.rst index 243c59166d..40e85de68b 100644 --- a/docs/overview/customization/config-id.rst +++ b/docs/overview/customization/config-id.rst @@ -10,8 +10,8 @@ Config-ID .. _config-id: -Second level of customization. Set version of package to build and build -options. +Third level of customization. Set version of package to build and +its build options. ``Config-ID`` is the first 7 digits of ``SHA1`` of the file with ``hunter_config`` commands (internal unified representation). This level can @@ -19,37 +19,37 @@ be customized with `HunterGate options`_: ``GLOBAL``, ``LOCAL`` and ``FILEPATH``. Packages from ``Hunter-ID 1eae623`` can be built using different versions and different CMake arguments: -+-------------------+ -| Hunter-ID 1eae623 | -+-------------------+ - -+-------------+----------------------------------------------------------------------+ -| Config-ID | | -+=============+===================+==================================================+ -| ``0fa873a`` | Working directory | ``${HUNTER_ROOT}/_Base/1eae623/0fa873a/...`` | -| +-------------------+---------+-----------+----------------------------+ -| | Packages | Name | Version | Options | -| | +---------+-----------+----------------------------+ -| | | ``Foo`` | ``1.0.0`` | | -| | +---------+-----------+----------------------------+ -| | | ``Boo`` | ``2.0.0`` | ``BOO_WITH_SOMETHING=YES`` | -+-------------+-------------------+---------+-----------+----------------------------+ -| ``e9da39c`` | Working directory | ``${HUNTER_ROOT}/_Base/1eae623/e9da39c/...`` | -| +-------------------+---------+-----------+----------------------------+ -| | Packages | Name | Version | Options | -| | +---------+-----------+----------------------------+ -| | | ``Foo`` | ``2.1.0`` | ``FOO_SUPER_MODE=YES`` | -| | +---------+-----------+----------------------------+ -| | | ``Boo`` | ``3.0.0`` | ``BUILD_SHARED_LIBS=ON`` | -+-------------+-------------------+---------+-----------+----------------------------+ ++-------------------+----------------------+ +| Hunter-ID 1eae623 | Toolchain-ID d46ea0b | ++-------------------+----------------------+ + ++-------------+--------------------------------------------------------------------------+ +| Config-ID | | ++=============+===================+======================================================+ +| ``0fa873a`` | Working directory | ``${HUNTER_ROOT}/_Base/1eae623/d46ea0b/0fa873a/...`` | +| +-------------------+---------+-----------+--------------------------------+ +| | Packages | Name | Version | Options | +| | +---------+-----------+--------------------------------+ +| | | ``Foo`` | ``1.0.0`` | | +| | +---------+-----------+--------------------------------+ +| | | ``Boo`` | ``2.0.0`` | ``BOO_WITH_SOMETHING=YES`` | ++-------------+-------------------+---------+-----------+--------------------------------+ +| ``e9da39c`` | Working directory | ``${HUNTER_ROOT}/_Base/1eae623/d46ea0b/e9da39c/...`` | +| +-------------------+---------+-----------+--------------------------------+ +| | Packages | Name | Version | Options | +| | +---------+-----------+--------------------------------+ +| | | ``Foo`` | ``2.1.0`` | ``FOO_SUPER_MODE=YES`` | +| | +---------+-----------+--------------------------------+ +| | | ``Boo`` | ``3.0.0`` | ``BUILD_SHARED_LIBS=ON`` | ++-------------+-------------------+---------+-----------+--------------------------------+ Message in logs: -:: +.. code-block:: none - -- [hunter] [ Hunter-ID: 1eae623 | Config-ID: 0fa873a | Toolchain-ID: ... ] - -- [hunter] [ Hunter-ID: 1eae623 | Config-ID: e9da39c | Toolchain-ID: ... ] + -- [hunter] [ Hunter-ID: 1eae623 | Toolchain-ID: d46ea0b | Config-ID: 0fa873a ] + -- [hunter] [ Hunter-ID: 1eae623 | Toolchain-ID: d46ea0b | Config-ID: e9da39c ] .. seealso:: diff --git a/docs/overview/customization/hunter-id.rst b/docs/overview/customization/hunter-id.rst index 008f4223a6..ef7676473a 100644 --- a/docs/overview/customization/hunter-id.rst +++ b/docs/overview/customization/hunter-id.rst @@ -50,10 +50,10 @@ of Hunter archive. This level defines list of available packages and mapping Message in logs: -:: +.. code-block:: none - -- [hunter] [ Hunter-ID: 1eae623 | Config-ID: ... | Toolchain-ID: ... ] - -- [hunter] [ Hunter-ID: e07a124 | Config-ID: ... | Toolchain-ID: ... ] + -- [hunter] [ Hunter-ID: 1eae623 | Toolchain-ID: ... | Config-ID: ... ] + -- [hunter] [ Hunter-ID: e07a124 | Toolchain-ID: ... | Config-ID: ... ] .. admonition:: Hunter diff --git a/docs/overview/customization/toolchain-id.rst b/docs/overview/customization/toolchain-id.rst index 942f58bc11..e6641e0f20 100644 --- a/docs/overview/customization/toolchain-id.rst +++ b/docs/overview/customization/toolchain-id.rst @@ -8,60 +8,60 @@ Toolchain-ID ------------ -Third level of customization. Compiler and flags. +Second level of customization. Compiler and flags. Each build can be run with different toolchains. In general the result is -completely different root ``lib``/``include`` directories. For example on +a completely different root directory (containing (``lib``/``include``). For example on Windows you can simultaneously build Visual Studio (32/64), NMake, Cygwin and MinGW projects, on Linux GCC/Clang, on Mac Xcode, Makefile, iOS. Or choose various clang tools like static analyzer/sanitizers and other platforms like -Android/Raspberry Pi. Each toolchain file will be forwarded to external project -so if you create toolchain with compiler ``g++`` and flag ``-std=c++11`` all +Android/Raspberry Pi. Each toolchain file will be forwarded to external project. +This means, if you create a toolchain with compiler ``g++`` and flag ``-std=c++11`` all dependent projects will be built by ``g++ -std=c++11``. Information about -toolchain has some internal representation (``toolchain.info``) and user can -see first 7 digits (ID) of ``SHA1`` hash of this file. +toolchain has some internal representation (``toolchain.info``). As identifier +(ID) the first 7 digits of the ``SHA1`` hash of this file are used. -Toolchain file is the only way to apply global settings for 3rd party projects +The toolchain file is the only way to apply global settings for 3rd party projects in Hunter. Only CMAKE_TOOLCHAIN_FILE will be forwarded for all packages, neither standard CMAKE_CXX_COMPILER/CMAKE_CXX_FLAGS nor custom variables like ANDROID_FOO=boo will be applied globally. First reason is the simplicity of forwarding logic, second reason is about distinguishing local and global -settings. E.g. if user want to set ``-Wall`` only for local project he can use -CMAKE_CXX_FLAGS. If user want to set ``-Wall`` globally then he can use +settings. E.g. if a user wants to set ``-Wall`` only for the local project he can use +CMAKE_CXX_FLAGS. If user wants to set ``-Wall`` globally then he can use CMAKE_TOOLCHAIN_FILE. -+-------------------+-------------------+ -| Hunter-ID 1eae623 | Config-ID 0fa873a | -+-------------------+-------------------+ ++-------------------+ +| Hunter-ID 1eae623 | ++-------------------+ +--------------+--------------------------------------------------------------------------+ | Toolchain-ID | | +==============+===================+======================================================+ -| ``d46ea0b`` | Working directory | ``${HUNTER_ROOT}/_Base/1eae623/0fa873a/d46ea0b/...`` | +| ``d46ea0b`` | Working directory | ``${HUNTER_ROOT}/_Base/1eae623/d46ea0b/...`` | | +-------------------+-------------------------------+----------------------+ | | | Compiler | Flags | | +-------------------+-------------------------------+----------------------+ | | | ``gcc`` | | +--------------+-------------------+-------------------------------+----------------------+ -| ``c018e63`` | Working directory | ``${HUNTER_ROOT}/_Base/1eae623/0fa873a/c018e63/...`` | +| ``c018e63`` | Working directory | ``${HUNTER_ROOT}/_Base/1eae623/c018e63/...`` | | +-------------------+-------------------------------+----------------------+ | | | Compiler | Flags | | +-------------------+-------------------------------+----------------------+ | | | ``clang`` | | +--------------+-------------------+-------------------------------+----------------------+ -| ``c39da39`` | Working directory | ``${HUNTER_ROOT}/_Base/1eae623/0fa873a/c39da39/...`` | +| ``c39da39`` | Working directory | ``${HUNTER_ROOT}/_Base/1eae623/c39da39/...`` | | +-------------------+-------------------------------+----------------------+ | | | Compiler | Flags | | +-------------------+-------------------------------+----------------------+ | | | ``clang`` | ``-std=c++11`` | +--------------+-------------------+-------------------------------+----------------------+ -| ``7450099`` | Working directory | ``${HUNTER_ROOT}/_Base/1eae623/0fa873a/7450099/...`` | +| ``7450099`` | Working directory | ``${HUNTER_ROOT}/_Base/1eae623/7450099/...`` | | +-------------------+-------------------------------+----------------------+ | | | Compiler | Flags | | +-------------------+-------------------------------+----------------------+ | | | ``arm-linux-androideabi-g++`` | ``-march=armv7-a`` | +--------------+-------------------+-------------------------------+----------------------+ -| ``2d935ea`` | Working directory | ``${HUNTER_ROOT}/_Base/1eae623/0fa873a/2d935ea/...`` | +| ``2d935ea`` | Working directory | ``${HUNTER_ROOT}/_Base/1eae623/2d935ea/...`` | | +-------------------+-------------------------------+----------------------+ | | | Compiler | Flags | | +-------------------+-------------------------------+----------------------+ @@ -74,9 +74,9 @@ Message in logs: .. code-block:: none - -- [hunter] [ Hunter-ID: 1eae623 | Config-ID: 0fa873a | Toolchain-ID: d46ea0b ] - -- [hunter] [ Hunter-ID: 1eae623 | Config-ID: 0fa873a | Toolchain-ID: c018e63 ] - -- [hunter] [ Hunter-ID: 1eae623 | Config-ID: 0fa873a | Toolchain-ID: c39da39 ] + -- [hunter] [ Hunter-ID: 1eae623 | Toolchain-ID: d46ea0b | Config-ID: ... ] + -- [hunter] [ Hunter-ID: 1eae623 | Toolchain-ID: c018e63 | Config-ID: ... ] + -- [hunter] [ Hunter-ID: 1eae623 | Toolchain-ID: c39da39 | Config-ID: ... ] .. admonition:: Examples on GitHub diff --git a/docs/overview/what-is-it.rst b/docs/overview/what-is-it.rst index 9adb13a954..4417f96d31 100644 --- a/docs/overview/what-is-it.rst +++ b/docs/overview/what-is-it.rst @@ -88,6 +88,7 @@ Default version from `default.cmake`_ .. seealso:: * :doc:`Detailed sources layout ` + * :doc:`Creating version on the fly from Git submodule ` .. _release: https://github.com/ruslo/hunter/releases .. _Atom feed: https://github.com/ruslo/hunter/releases.atom diff --git a/docs/packages.rst b/docs/packages.rst index 3800400872..aece67c60e 100644 --- a/docs/packages.rst +++ b/docs/packages.rst @@ -6,10 +6,19 @@ Packages List of packages and usage instructions for each package. +.. sidebar:: All packages + + * :doc:`Alphabetically ` + * :ref:`Index ` + .. toctree:: - :maxdepth: 1 + :hidden: /packages/all + +.. toctree:: + :maxdepth: 1 + /packages/concurrency /packages/containers /packages/commandline @@ -30,7 +39,6 @@ List of packages and usage instructions for each package. /packages/scripting /packages/serialize /packages/os - /packages/misc .. note:: diff --git a/docs/packages/all.rst b/docs/packages/all.rst index 1b4287f82d..e7da2cf36b 100644 --- a/docs/packages/all.rst +++ b/docs/packages/all.rst @@ -1,98 +1,12 @@ +.. spelling:: + + wiki + All packages ------------ -* `Android-Apk `__ -* `Android-Modules `__ -* `Android-SDK `__ -* `ArrayFire `__ -* `Assimp `__ -* `Async++ `__ -* `Autobahn-cpp `__ -* `Avahi `__ -* `BZip2 `__ -* `Boost `__ -* `Boost.compute `__ -* `Boost.process `__ -* `CLAPACK `__ -* `CURL `__ -* `Catch `__ -* `Comet `__ -* `CppNetlib.URI `__ -* `CsvParserCPlusPlus `__ -* `Eigen `__ -* `Expat `__ -* `GMock `__ -* `GPUImage `__ -* `GSL `__ -* `GTest `__ -* `Igloo `__ -* `IntSizeof `__ -* `Jpeg `__ -* `JsonSpirit `__ -* `LLVM (Clang) `__ -* `Leathers `__ -* `Libssh2 `__ -* `Lua `__ -* `MySQL-client `__ -* `OpenBLAS `__ -* `OpenCL `__ -* `OpenCL-cpp `__ -* `OpenCV `__ -* `OpenSSL `__ -* `PNG `__ -* `Poco C++ `__ -* `PostgreSQL `__ -* `Protobuf `__ -* `Qt `__ -* `Qt-Android-CMake `__ -* `QtQmlManager `__ -* `RapidJSON `__ -* `RapidXML `__ -* `Sugar `__ -* `TIFF `__ -* `WTL `__ -* `Washer `__ -* `ZLIB `__ -* `ZMQPP `__ -* `ZeroMQ `__ -* `caffe `__ -* `ccv `__ -* `cereal `__ -* `convertutf `__ -* `crashpad `__ -* `cvmatio `__ -* `cxxopts `__ -* `dest `__ -* `dlib `__ -* `eos `__ -* `flatbuffers `__ -* `fmt `__ -* `freetype `__ -* `gflags `__ -* `glm `__ -* `glog `__ -* `half `__ -* `hdf5 `__ -* `ios_sim `__ -* `irrXML `__ -* `libyuv `__ -* `log4cplus `__ -* `minizip `__ -* `msgpack `__ -* `nlohmann::json `__ -* `odb-mysql `__ -* `odb-pgsql `__ -* `ogles_gpgpu `__ -* `openddlparser `__ -* `poly2tri `__ -* `polyclipping `__ -* `rabbitmq-c `__ -* `sparsehash `__ -* `spdlog `__ -* `szip `__ -* `thread-pool-cpp `__ -* `tinydir `__ -* `websocketpp `__ -* `wxWidgets `__ -* `xgboost `__ -* `yaml-cpp `__ +.. toctree:: + :maxdepth: 1 + :glob: + + pkg/* diff --git a/docs/packages/commandline.rst b/docs/packages/commandline.rst index 577f696829..48b45b583b 100644 --- a/docs/packages/commandline.rst +++ b/docs/packages/commandline.rst @@ -6,5 +6,5 @@ Commandline Tools ----------------- - * `gflags `__ - contains a C++ library that implements commandline flags processing - * `cxxopts `__ - Lightweight C++ command line option parser + - :ref:`pkg.gflags` - contains a C++ library that implements commandline flags processing + - :ref:`pkg.cxxopts` - Lightweight C++ command line option parser diff --git a/docs/packages/compiler.rst b/docs/packages/compiler.rst index edcb62b64f..d68812b659 100644 --- a/docs/packages/compiler.rst +++ b/docs/packages/compiler.rst @@ -1,4 +1,6 @@ Compiler -------- - * `LLVM (Clang) `_ - collection of modular and reusable compiler and toolchain technologies. + - :ref:`pkg.bison` - general-purpose parser generator. + - :ref:`pkg.flex` - a tool for generating scanners. + - :ref:`pkg.LLVM` - collection of modular and reusable compiler and toolchain technologies. diff --git a/docs/packages/compression.rst b/docs/packages/compression.rst index cdc9de4670..0e9b4bb421 100644 --- a/docs/packages/compression.rst +++ b/docs/packages/compression.rst @@ -1,7 +1,8 @@ Compression ----------- - * `BZip2 `_ - high-quality data compressor. - * `minizip `_ - enables to extract files from a .zip archive file. - * `szip `_ - * `ZLIB `_ - A massively spiffy yet delicately unobtrusive compression library. + - :ref:`pkg.BZip2` - high-quality data compressor. + - :ref:`pkg.lzma` - A compression library with an API similar to that of zlib. + - :ref:`pkg.minizip` - enables to extract files from a .zip archive file. + - :ref:`pkg.szip` + - :ref:`pkg.ZLIB` - A massively spiffy yet delicately unobtrusive compression library. diff --git a/docs/packages/computer-vision.rst b/docs/packages/computer-vision.rst index 800796db1f..52b1038f83 100644 --- a/docs/packages/computer-vision.rst +++ b/docs/packages/computer-vision.rst @@ -3,14 +3,14 @@ Matlab Morphable -Computer Vision/Machine Learning/Image Processing -------------------------------------------------- +Computer Vision +--------------- - * `caffe `_ - fast open framework for deep learning. - * `ccv `_ - A Modern Computer Vision Library - * `cvmatio `_ - Matlab Mat file read and write C++ class with OpenCV bindings. - * `dest `_ - high performance 2D shape tracking leveraging machine learning methods. - * `dlib `_ - modern C++ toolkit containing machine learning algorithms and tools for creating complex software in C++ to solve real world problems. - * `eos `_ - A lightweight 3D Morphable Face Model fitting library in modern C++11/14 - * `OpenCV `_ - Open Source Computer Vision Library - * `xgboost `_ - Scalable, Portable and Distributed Gradient Boosting (GBDT, GBRT or GBM>`_ Library + - :ref:`pkg.caffe` - fast open framework for deep learning. + - :ref:`pkg.ccv` - A Modern Computer Vision Library + - :ref:`pkg.cvmatio` - Matlab Mat file read and write C++ class with OpenCV bindings. + - :ref:`pkg.dest` - high performance 2D shape tracking leveraging machine learning methods. + - :ref:`pkg.dlib` - modern C++ toolkit containing machine learning algorithms and tools for creating complex software in C++ to solve real world problems. + - :ref:`pkg.eos` - A lightweight 3D Morphable Face Model fitting library in modern C++11/14 + - :ref:`pkg.OpenCV` - Open Source Computer Vision Library + - :ref:`pkg.xgboost` - Scalable, Portable and Distributed Gradient Boosting (GBDT, GBRT or GBM>`_ Library diff --git a/docs/packages/concurrency.rst b/docs/packages/concurrency.rst index 79f3a3f50d..f06b3893d9 100644 --- a/docs/packages/concurrency.rst +++ b/docs/packages/concurrency.rst @@ -5,14 +5,14 @@ GPGPU GPU -Concurrency/MultiThreading/HPC/GPGPU ------------------------------------- +Concurrency +----------- - * `ArrayFire `_ - general-purpose library that simplifies the process of developing software that targets parallel and massively-parallel architectures including CPUs, GPUs, and other hardware acceleration devices. - * `Async++ `_ - concurrency framework for C++11 - * `Boost.compute `_ - * `GPUImage `_ - open source iOS framework for GPU-based image and video processing - * `ogles_gpgpu `_ - GPGPU for mobile devices and embedded systems using OpenGL ES 2.0 - * `OpenCL `_ - OpenCL headers and Installable Client Driver - * `OpenCL-cpp `_ - header only OpenCL c++ wrappers - * `thread-pool-cpp `_ - High performance C++14 thread pool + - :ref:`pkg.ArrayFire` - general-purpose library that simplifies the process of developing software that targets parallel and massively-parallel architectures including CPUs, GPUs, and other hardware acceleration devices. + - :ref:`pkg.Async++` - concurrency framework for C++11 + - :ref:`pkg.BoostCompute` + - :ref:`pkg.GPUImage` - open source iOS framework for GPU-based image and video processing + - :ref:`pkg.ogles_gpgpu` - GPGPU for mobile devices and embedded systems using OpenGL ES 2.0 + - :ref:`pkg.OpenCL` - OpenCL headers and Installable Client Driver + - :ref:`pkg.OpenCL-cpp` - header only OpenCL c++ wrappers + - :ref:`pkg.thread-pool-cpp` - High performance C++14 thread pool diff --git a/docs/packages/containers.rst b/docs/packages/containers.rst index 1472f043db..c8eaa9d165 100644 --- a/docs/packages/containers.rst +++ b/docs/packages/containers.rst @@ -1,4 +1,4 @@ Containers ---------- - * `sparsehash `_ - C++ associative containers + * :ref:`pkg.sparsehash` - C++ associative containers diff --git a/docs/packages/crypto.rst b/docs/packages/crypto.rst index 34aeb6c41f..fa2208913d 100644 --- a/docs/packages/crypto.rst +++ b/docs/packages/crypto.rst @@ -5,4 +5,4 @@ Crypto ------ - * `OpenSSL `_ - open source project that provides a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS>`_ and Secure Sockets Layer (SSL>`_ protocols. + - :ref:`pkg.OpenSSL` - open source project that provides a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS>`_ and Secure Sockets Layer (SSL>`_ protocols. diff --git a/docs/packages/database.rst b/docs/packages/database.rst index c241b4c19f..e2b5661bc5 100644 --- a/docs/packages/database.rst +++ b/docs/packages/database.rst @@ -1,7 +1,8 @@ Database -------- - * `MySQL-client `_ - * `odb-pgsql `_ - * `odb-mysql `_ - * `PostgreSQL `_ + - :ref:`pkg.MySQL-client` + - :ref:`pkg.odb-mysql` + - :ref:`pkg.odb-pgsql` + - :ref:`pkg.odb-sqlite` + - :ref:`pkg.PostgreSQL` diff --git a/docs/packages/filesystem.rst b/docs/packages/filesystem.rst index 14f664d633..37d6359561 100644 --- a/docs/packages/filesystem.rst +++ b/docs/packages/filesystem.rst @@ -5,6 +5,5 @@ Filesystem ---------- - * `fmt `_ - Small, safe and fast formatting library - * `hdf5 `_ - data model, library, and file format for storing and managing data. - * `tinydir `_ - Lightweight, portable and easy to integrate C directory and file reader + - :ref:`pkg.hdf5` - data model, library, and file format for storing and managing data. + - :ref:`pkg.tinydir` - Lightweight, portable and easy to integrate C directory and file reader diff --git a/docs/packages/frameworks.rst b/docs/packages/frameworks.rst index 61addfcf9e..daf7ad03ec 100644 --- a/docs/packages/frameworks.rst +++ b/docs/packages/frameworks.rst @@ -1,8 +1,8 @@ Frameworks ---------- - * `Boost `_ - peer-reviewed portable C++ source libraries. - * `Boost.process `_ - * `Qt `_ - * `QtQmlManager `_ - * `wxWidgets `_ - Cross-Platform GUI Library + - :ref:`pkg.Boost` - peer-reviewed portable C++ source libraries. + - :ref:`pkg.BoostProcess` + - :ref:`pkg.Qt` + - :ref:`pkg.QtQmlManager` + - :ref:`pkg.wxWidgets` - Cross-Platform GUI Library diff --git a/docs/packages/graphics.rst b/docs/packages/graphics.rst index 7b8135860e..2b9def98dc 100644 --- a/docs/packages/graphics.rst +++ b/docs/packages/graphics.rst @@ -5,5 +5,7 @@ Graphics 2D/3D -------------- - * `Assimp `_ - portable Open Source library to import various well-known 3D model formats in a uniform manner. - * `freetype `_ - render freetype fonts + - :ref:`pkg.aglet` - Tiny cross platform (headless) OpenGL context creation + - :ref:`pkg.Assimp` - portable Open Source library to import various well-known 3D model formats in a uniform manner + - :ref:`pkg.freetype` - render freetype fonts + - :ref:`pkg.ogles_gpgpu` - GPGPU for mobile devices and embedded systems using OpenGL ES 2.0 diff --git a/docs/packages/logging.rst b/docs/packages/logging.rst index 4b536d9161..1d01e1612a 100644 --- a/docs/packages/logging.rst +++ b/docs/packages/logging.rst @@ -1,5 +1,7 @@ Logging ------- - * `log4cplus `_ - simple to use C++ logging API providing thread-safe, flexible, and arbitrarily granular control over log management and configuration. - * `spdlog `_ - Super fast C++ logging library. + - :ref:`pkg.fmt` - Small, safe and fast formatting library + - :ref:`pkg.glog` - C++ implementation of the Google logging module + - :ref:`pkg.log4cplus` - simple to use C++ logging API providing thread-safe, flexible, and arbitrarily granular control over log management and configuration. + - :ref:`pkg.spdlog` - Super fast C++ logging library. diff --git a/docs/packages/math.rst b/docs/packages/math.rst index a03fa363b7..d6e328c9ad 100644 --- a/docs/packages/math.rst +++ b/docs/packages/math.rst @@ -5,11 +5,12 @@ Math ---- - * `CLAPACK `_ - * `Eigen `_ - C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms. - * `glm `_ - header only C++ mathematics library for graphics software based on the OpenGL Shading Language (GLSL>`_ specifications. - * `GSL `_ - GNU Scientific Library - * `half `_ - Half-precision floating point library - * `OpenBLAS `_ - OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version - * `poly2tri `_ - 2D constrained Delaunay triangulation library - * `polyclipping `_ - Polygon and line clipping and offsetting library + - :ref:`pkg.CLAPACK` + - :ref:`pkg.double-conversion` - provides binary-decimal and decimal-binary routines for IEEE doubles. + - :ref:`pkg.Eigen` - C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms. + - :ref:`pkg.glm` - header only C++ mathematics library for graphics software based on the OpenGL Shading Language (GLSL) specifications. + - :ref:`pkg.GSL` - GNU Scientific Library + - :ref:`pkg.half` - Half-precision floating point library + - :ref:`pkg.OpenBLAS` - OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version + - :ref:`pkg.poly2tri` - 2D constrained Delaunay triangulation library + - :ref:`pkg.polyclipping` - Polygon and line clipping and offsetting library diff --git a/docs/packages/media.rst b/docs/packages/media.rst index 15bcba6cde..8ffdeeec28 100644 --- a/docs/packages/media.rst +++ b/docs/packages/media.rst @@ -1,7 +1,7 @@ Media ----- - * `Jpeg `_ - library for JPEG image compression. - * `libyuv `_ - YUV scaling and conversion functionality. - * `PNG `_ - library for use in applications that read, create, and manipulate PNG (Portable Network Graphics>`_ raster image files. - * `TIFF `_ + - :ref:`pkg.Jpeg` - library for JPEG image compression. + - :ref:`pkg.libyuv` - YUV scaling and conversion functionality. + - :ref:`pkg.PNG` - library for use in applications that read, create, and manipulate PNG (Portable Network Graphics) raster image files. + - :ref:`pkg.TIFF` diff --git a/docs/packages/messaging.rst b/docs/packages/messaging.rst index 11a91b85a0..85e7048544 100644 --- a/docs/packages/messaging.rst +++ b/docs/packages/messaging.rst @@ -5,7 +5,8 @@ IPC/Messaging ------------- - * `Comet `_ - Modern (idiomatic>`_ binding between COM and C++ - * `rabbitmq-c `_ - C-language AMQP client library for use with v2.0+ of the RabbitMQ broker. - * `ZeroMQ `_ - provide an abstraction of asynchronous message queues, multiple messaging patterns, message filtering (subscriptions>`_, seamless access to multiple transport protocols and more. - * `ZMQPP `_ - "high-level" C++ binding for ZeroMQ/0mq/zmq + - :ref:`pkg.CapnProto` - Cap'n Proto serialization/RPC system - core tools and C++ library + - :ref:`pkg.Comet` - Modern (idiomatic>`_ binding between COM and C++ + - :ref:`pkg.rabbitmq-c` - C-language AMQP client library for use with v2.0+ of the RabbitMQ broker. + - :ref:`pkg.ZeroMQ` - provide an abstraction of asynchronous message queues, multiple messaging patterns, message filtering (subscriptions>`_, seamless access to multiple transport protocols and more. + - :ref:`pkg.ZMQPP` - "high-level" C++ binding for ZeroMQ/0mq/zmq diff --git a/docs/packages/misc.rst b/docs/packages/misc.rst deleted file mode 100644 index 213c75b5b7..0000000000 --- a/docs/packages/misc.rst +++ /dev/null @@ -1,7 +0,0 @@ -Misc ----- - - * `convertutf `_ - * `IntSizeof `_ - * `Sugar `_ - CMake tools and examples: collecting source files, warnings suppression, etc. - * `Leathers `_ - Warning suppression library (C++>`_ diff --git a/docs/packages/networking.rst b/docs/packages/networking.rst index 81756de7d4..0992bd5fd6 100644 --- a/docs/packages/networking.rst +++ b/docs/packages/networking.rst @@ -3,14 +3,16 @@ mDNS DNS websocket + Asio Networking ---------- - * `Autobahn-cpp `_ - open-source implementations of the The WebSocket Protocol and The Web Application Messaging Protocol (WAMP>`_ network protocols. - * `Avahi `_ - Service Discovery for Linux using mDNS/DNS-SD -- compatible with Bonjour - * `CppNetlib.URI `_ - C++ Network URI - * `CURL `_ - A command line tool and library for transferring data with URL syntax - * `Libssh2 `_ - * `Poco C++ `_ - Cross-platform C++ libraries with a network/internet focus. - * `websocketpp `_ - C++ websocket client/server library + - :ref:`pkg.autobahn-cpp` - open-source implementations of the The WebSocket Protocol and The Web Application Messaging Protocol (WAMP>`_ network protocols. + - :ref:`pkg.Avahi` - Service Discovery for Linux using mDNS/DNS-SD -- compatible with Bonjour + - :ref:`pkg.Beast` - HTTP and WebSocket built on Boost.Asio in C++11 + - :ref:`pkg.CppNetlibUri` - C++ Network URI + - :ref:`pkg.CURL` - A command line tool and library for transferring data with URL syntax + - :ref:`pkg.Libssh2` + - :ref:`pkg.PocoCpp` - Cross-platform C++ libraries with a network/internet focus. + - :ref:`pkg.websocketpp` - C++ websocket client/server library diff --git a/docs/packages/pkg/ARM_NEON_2_x86_SSE.rst b/docs/packages/pkg/ARM_NEON_2_x86_SSE.rst new file mode 100644 index 0000000000..d3319370f0 --- /dev/null +++ b/docs/packages/pkg/ARM_NEON_2_x86_SSE.rst @@ -0,0 +1,20 @@ +.. spelling:: + + ARM_NEON_2_x86_SSE + +.. index:: cpu ; ARM_NEON_2_x86_SSE + +.. _pkg.ARM_NEON_2_x86_SSE: + +ARM_NEON_2_x86_SSE +================== + +- `Official `__ +- `Hunterized `__ +- `Example `__ + +.. code-block:: cmake + + hunter_add_package(ARM_NEON_2_x86_SSE) + find_package(ARM_NEON_2_x86_SSE CONFIG REQUIRED) + target_link_libraries(... ARM_NEON_2_x86_SSE::ARM_NEON_2_x86_SSE) diff --git a/docs/packages/pkg/AllTheFlopsThreads.rst b/docs/packages/pkg/AllTheFlopsThreads.rst new file mode 100644 index 0000000000..b716f6460e --- /dev/null +++ b/docs/packages/pkg/AllTheFlopsThreads.rst @@ -0,0 +1,28 @@ +.. spelling:: + + AllTheFlopsThreads + +.. index:: unsorted ; AllTheFlopsThreads + +.. _pkg.AllTheFlopsThreads: + +AllTheFlopsThreads +================== + +.. warning:: + + This page is a template and contains no real information. + Please send pull request with real description. + +- `__FIXME__ Official `__ +- `__FIXME__ Hunterized `__ +- `__FIXME__ Example `__ +- Available since `__FIXME__ vX.Y.Z `__ +- Added by `__FIXME__ `__ (`__FIXME__ pr-N `__) + +.. code-block:: cmake + + hunter_add_package(__FIXME__) + find_package(__FIXME__ CONFIG REQUIRED) + target_link_libraries(foo __FIXME__::__FIXME__) + diff --git a/docs/packages/pkg/Android-ARM-EABI-v7a-System-Image.rst b/docs/packages/pkg/Android-ARM-EABI-v7a-System-Image.rst new file mode 100644 index 0000000000..87b67efef0 --- /dev/null +++ b/docs/packages/pkg/Android-ARM-EABI-v7a-System-Image.rst @@ -0,0 +1,29 @@ +.. spelling:: + + Android-ARM-EABI-v7a-System-Image + EABI + +.. index:: android_sdk_component; Android-ARM-EABI-v7a-System-Image + +.. _pkg.Android-ARM-EABI-v7a-System-Image: + +Android-ARM-EABI-v7a-System-Image +================================= + +.. warning:: + + This page is a template and contains no real information. + Please send pull request with real description. + +- `__FIXME__ Official `__ +- `__FIXME__ Hunterized `__ +- `__FIXME__ Example `__ +- Available since `__FIXME__ vX.Y.Z `__ +- Added by `__FIXME__ `__ (`__FIXME__ pr-N `__) + +.. code-block:: cmake + + hunter_add_package(__FIXME__) + find_package(__FIXME__ CONFIG REQUIRED) + target_link_libraries(foo __FIXME__::__FIXME__) + diff --git a/docs/packages/pkg/Android-Apk.rst b/docs/packages/pkg/Android-Apk.rst new file mode 100644 index 0000000000..4b89b463a4 --- /dev/null +++ b/docs/packages/pkg/Android-Apk.rst @@ -0,0 +1,23 @@ +.. spelling:: + + Android-Apk + Apk + +.. index:: android ; Android-Apk + +.. _pkg.Android-Apk: + +Android-Apk +=========== + +- `Official `__ +- `Hunterized `__ +- `Usage examples `__ + +.. code-block:: cmake + + hunter_add_package(Android-Apk) + list(APPEND CMAKE_MODULE_PATH "${ANDROID-APK_ROOT}") + include(AndroidApk) + add_library(simple ...) + android_create_apk(NAME simple DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/apk") diff --git a/docs/packages/pkg/Android-Build-Tools.rst b/docs/packages/pkg/Android-Build-Tools.rst new file mode 100644 index 0000000000..422ba14de8 --- /dev/null +++ b/docs/packages/pkg/Android-Build-Tools.rst @@ -0,0 +1,28 @@ +.. spelling:: + + Android-Build-Tools + +.. index:: android_sdk_component; Android-Build-Tools + +.. _pkg.Android-Build-Tools: + +Android-Build-Tools +=================== + +.. warning:: + + This page is a template and contains no real information. + Please send pull request with real description. + +- `__FIXME__ Official `__ +- `__FIXME__ Hunterized `__ +- `__FIXME__ Example `__ +- Available since `__FIXME__ vX.Y.Z `__ +- Added by `__FIXME__ `__ (`__FIXME__ pr-N `__) + +.. code-block:: cmake + + hunter_add_package(__FIXME__) + find_package(__FIXME__ CONFIG REQUIRED) + target_link_libraries(foo __FIXME__::__FIXME__) + diff --git a/docs/packages/pkg/Android-Google-APIs-Intel-x86-Atom-System-Image.rst b/docs/packages/pkg/Android-Google-APIs-Intel-x86-Atom-System-Image.rst new file mode 100644 index 0000000000..7b9977919d --- /dev/null +++ b/docs/packages/pkg/Android-Google-APIs-Intel-x86-Atom-System-Image.rst @@ -0,0 +1,29 @@ +.. spelling:: + + Android-Google-APIs-Intel-x86-Atom-System-Image + APIs + +.. index:: android_sdk_component ; Android-Google-APIs-Intel-x86-Atom-System-Image + +.. _pkg.Android-Google-APIs-Intel-x86-Atom-System-Image: + +Android-Google-APIs-Intel-x86-Atom-System-Image +=============================================== + +.. warning:: + + This page is a template and contains no real information. + Please send pull request with real description. + +- `__FIXME__ Official `__ +- `__FIXME__ Hunterized `__ +- `__FIXME__ Example `__ +- Available since `__FIXME__ vX.Y.Z `__ +- Added by `__FIXME__ `__ (`__FIXME__ pr-N `__) + +.. code-block:: cmake + + hunter_add_package(__FIXME__) + find_package(__FIXME__ CONFIG REQUIRED) + target_link_libraries(foo __FIXME__::__FIXME__) + diff --git a/docs/packages/pkg/Android-Google-APIs.rst b/docs/packages/pkg/Android-Google-APIs.rst new file mode 100644 index 0000000000..215ca59909 --- /dev/null +++ b/docs/packages/pkg/Android-Google-APIs.rst @@ -0,0 +1,29 @@ +.. spelling:: + + Android-Google-APIs + APIs + +.. index:: android_sdk_component ; Android-Google-APIs + +.. _pkg.Android-Google-APIs: + +Android-Google-APIs +=================== + +.. warning:: + + This page is a template and contains no real information. + Please send pull request with real description. + +- `__FIXME__ Official `__ +- `__FIXME__ Hunterized `__ +- `__FIXME__ Example `__ +- Available since `__FIXME__ vX.Y.Z `__ +- Added by `__FIXME__ `__ (`__FIXME__ pr-N `__) + +.. code-block:: cmake + + hunter_add_package(__FIXME__) + find_package(__FIXME__ CONFIG REQUIRED) + target_link_libraries(foo __FIXME__::__FIXME__) + diff --git a/docs/packages/pkg/Android-Google-Repository.rst b/docs/packages/pkg/Android-Google-Repository.rst new file mode 100644 index 0000000000..809acea010 --- /dev/null +++ b/docs/packages/pkg/Android-Google-Repository.rst @@ -0,0 +1,28 @@ +.. spelling:: + + Android-Google-Repository + +.. index:: android_sdk_component ; Android-Google-Repository + +.. _pkg.Android-Google-Repository: + +Android-Google-Repository +========================= + +.. warning:: + + This page is a template and contains no real information. + Please send pull request with real description. + +- `__FIXME__ Official `__ +- `__FIXME__ Hunterized `__ +- `__FIXME__ Example `__ +- Available since `__FIXME__ vX.Y.Z `__ +- Added by `__FIXME__ `__ (`__FIXME__ pr-N `__) + +.. code-block:: cmake + + hunter_add_package(__FIXME__) + find_package(__FIXME__ CONFIG REQUIRED) + target_link_libraries(foo __FIXME__::__FIXME__) + diff --git a/docs/packages/pkg/Android-Intel-x86-Atom-System-Image.rst b/docs/packages/pkg/Android-Intel-x86-Atom-System-Image.rst new file mode 100644 index 0000000000..be8d2f7af9 --- /dev/null +++ b/docs/packages/pkg/Android-Intel-x86-Atom-System-Image.rst @@ -0,0 +1,28 @@ +.. spelling:: + + Android-Intel-x86-Atom-System-Image + +.. index:: android_sdk_component ; Android-Intel-x86-Atom-System-Image + +.. _pkg.Android-Intel-x86-Atom-System-Image: + +Android-Intel-x86-Atom-System-Image +=================================== + +.. warning:: + + This page is a template and contains no real information. + Please send pull request with real description. + +- `__FIXME__ Official `__ +- `__FIXME__ Hunterized `__ +- `__FIXME__ Example `__ +- Available since `__FIXME__ vX.Y.Z `__ +- Added by `__FIXME__ `__ (`__FIXME__ pr-N `__) + +.. code-block:: cmake + + hunter_add_package(__FIXME__) + find_package(__FIXME__ CONFIG REQUIRED) + target_link_libraries(foo __FIXME__::__FIXME__) + diff --git a/docs/packages/pkg/Android-Modules.rst b/docs/packages/pkg/Android-Modules.rst new file mode 100644 index 0000000000..5180545360 --- /dev/null +++ b/docs/packages/pkg/Android-Modules.rst @@ -0,0 +1,22 @@ +.. spelling:: + + Android-Modules + +.. index:: android ; Android-Modules + +.. _pkg.Android-Modules: + +Android-Modules +=============== + +- `Official `__ +- `Hunterized `__ + +.. code-block:: cmake + + hunter_add_package(Android-Modules) + + list(APPEND CMAKE_MODULE_PATH "${ANDROID-MODULES_ROOT}") + + include(AndroidNdkGdb) + include(AndroidNdkModules) diff --git a/docs/packages/pkg/Android-SDK-Platform-tools.rst b/docs/packages/pkg/Android-SDK-Platform-tools.rst new file mode 100644 index 0000000000..21c5244174 --- /dev/null +++ b/docs/packages/pkg/Android-SDK-Platform-tools.rst @@ -0,0 +1,28 @@ +.. spelling:: + + Android-SDK-Platform-tools + +.. index:: android_sdk_component ; Android-SDK-Platform-tools + +.. _pkg.Android-SDK-Platform-tools: + +Android-SDK-Platform-tools +========================== + +.. warning:: + + This page is a template and contains no real information. + Please send pull request with real description. + +- `__FIXME__ Official `__ +- `__FIXME__ Hunterized `__ +- `__FIXME__ Example `__ +- Available since `__FIXME__ vX.Y.Z `__ +- Added by `__FIXME__ `__ (`__FIXME__ pr-N `__) + +.. code-block:: cmake + + hunter_add_package(__FIXME__) + find_package(__FIXME__ CONFIG REQUIRED) + target_link_libraries(foo __FIXME__::__FIXME__) + diff --git a/docs/packages/pkg/Android-SDK-Platform.rst b/docs/packages/pkg/Android-SDK-Platform.rst new file mode 100644 index 0000000000..930e928869 --- /dev/null +++ b/docs/packages/pkg/Android-SDK-Platform.rst @@ -0,0 +1,28 @@ +.. spelling:: + + Android-SDK-Platform + +.. index:: android_sdk_component ; Android-SDK-Platform + +.. _pkg.Android-SDK-Platform: + +Android-SDK-Platform +==================== + +.. warning:: + + This page is a template and contains no real information. + Please send pull request with real description. + +- `__FIXME__ Official `__ +- `__FIXME__ Hunterized `__ +- `__FIXME__ Example `__ +- Available since `__FIXME__ vX.Y.Z `__ +- Added by `__FIXME__ `__ (`__FIXME__ pr-N `__) + +.. code-block:: cmake + + hunter_add_package(__FIXME__) + find_package(__FIXME__ CONFIG REQUIRED) + target_link_libraries(foo __FIXME__::__FIXME__) + diff --git a/docs/packages/pkg/Android-SDK-Tools.rst b/docs/packages/pkg/Android-SDK-Tools.rst new file mode 100644 index 0000000000..ff5c683e86 --- /dev/null +++ b/docs/packages/pkg/Android-SDK-Tools.rst @@ -0,0 +1,28 @@ +.. spelling:: + + Android-SDK-Tools + +.. index:: android_sdk_component ; Android-SDK-Tools + +.. _pkg.Android-SDK-Tools: + +Android-SDK-Tools +================= + +.. warning:: + + This page is a template and contains no real information. + Please send pull request with real description. + +- `__FIXME__ Official `__ +- `__FIXME__ Hunterized `__ +- `__FIXME__ Example `__ +- Available since `__FIXME__ vX.Y.Z `__ +- Added by `__FIXME__ `__ (`__FIXME__ pr-N `__) + +.. code-block:: cmake + + hunter_add_package(__FIXME__) + find_package(__FIXME__ CONFIG REQUIRED) + target_link_libraries(foo __FIXME__::__FIXME__) + diff --git a/docs/packages/pkg/Android-SDK.rst b/docs/packages/pkg/Android-SDK.rst new file mode 100644 index 0000000000..3955b55bd6 --- /dev/null +++ b/docs/packages/pkg/Android-SDK.rst @@ -0,0 +1,23 @@ +.. spelling:: + + Android-SDK + +.. index:: android ; Android-SDK + +.. _pkg.Android-SDK: + +Android-SDK +=========== + +This module helps to create Android SDK directory: + +- https://github.com/hunter-packages/android-sdk + +.. code-block:: cmake + + hunter_add_package(Android-SDK) + message("Path to `android`: ${ANDROID-SDK_ROOT}/android-sdk/tools/android") + message("Path to `emulator`: ${ANDROID-SDK_ROOT}/android-sdk/tools/emulator") + message("Path to `adb`: ${ANDROID-SDK_ROOT}/android-sdk/platform-tools/adb") + +- `Examples `__ diff --git a/docs/packages/pkg/Android-Support-Repository.rst b/docs/packages/pkg/Android-Support-Repository.rst new file mode 100644 index 0000000000..973f83f6c3 --- /dev/null +++ b/docs/packages/pkg/Android-Support-Repository.rst @@ -0,0 +1,28 @@ +.. spelling:: + + Android-Support-Repository + +.. index:: android_sdk_component ; Android-Support-Repository + +.. _pkg.Android-Support-Repository: + +Android-Support-Repository +========================== + +.. warning:: + + This page is a template and contains no real information. + Please send pull request with real description. + +- `__FIXME__ Official `__ +- `__FIXME__ Hunterized `__ +- `__FIXME__ Example `__ +- Available since `__FIXME__ vX.Y.Z `__ +- Added by `__FIXME__ `__ (`__FIXME__ pr-N `__) + +.. code-block:: cmake + + hunter_add_package(__FIXME__) + find_package(__FIXME__ CONFIG REQUIRED) + target_link_libraries(foo __FIXME__::__FIXME__) + diff --git a/docs/packages/pkg/ArrayFire.rst b/docs/packages/pkg/ArrayFire.rst new file mode 100644 index 0000000000..bd9d330ba9 --- /dev/null +++ b/docs/packages/pkg/ArrayFire.rst @@ -0,0 +1,27 @@ +.. spelling:: + + ArrayFire + +.. index:: concurrency ; ArrayFire + +.. _pkg.ArrayFire: + +ArrayFire +========= + +.. |hunter| image:: https://img.shields.io/badge/hunter-v0.12.48-blue.svg + :target: https://github.com/ruslo/hunter/releases/tag/v0.12.48 + :alt: Hunter v0.12.48 + +- `Official `__ +- `Hunterized `__ +- `Example `__ +- `Testing `__ +- Available since |hunter| + +.. code-block:: cmake + + hunter_add_package(ArrayFire) + find_package(ArrayFire CONFIG REQUIRED) + target_link_libraries(... ArrayFire::af) + target_link_libraries(... ArrayFire::afcpu) diff --git a/docs/packages/pkg/Assimp.rst b/docs/packages/pkg/Assimp.rst new file mode 100644 index 0000000000..82b9d1a85d --- /dev/null +++ b/docs/packages/pkg/Assimp.rst @@ -0,0 +1,21 @@ +.. spelling:: + + Assimp + +.. index:: graphics ; Assimp + +.. _pkg.Assimp: + +Assimp +====== + +- http://assimp.org/ +- `Official GitHub repo `__ +- `Hunterized `__ +- `Example `__ + +.. code-block:: cmake + + hunter_add_package(Assimp) + find_package(Assimp CONFIG REQUIRED) + target_link_libraries(... Assimp::assimp) diff --git a/docs/packages/pkg/Async++.rst b/docs/packages/pkg/Async++.rst new file mode 100644 index 0000000000..5d2c1ba613 --- /dev/null +++ b/docs/packages/pkg/Async++.rst @@ -0,0 +1,25 @@ +.. spelling:: + + Async + +.. _pkg.Async++: + +Async++ +======= + +.. |hunter| image:: https://img.shields.io/badge/hunter-v0.12.28-blue.svg + :target: https://github.com/ruslo/hunter/releases/tag/v0.12.28 + :alt: Hunter v0.12.28 + +- `Official `__ +- `Hunterized `__ +- Available since |hunter| +- Added by `Andrei Laphin `__ + (`pr-268 `__) + +.. code-block:: cmake + + hunter_add_package(Async++) + find_package(Async++ CONFIG REQUIRED) + + target_link_libraries(... Async++::Async++) diff --git a/docs/packages/pkg/Avahi.rst b/docs/packages/pkg/Avahi.rst new file mode 100644 index 0000000000..f33141162a --- /dev/null +++ b/docs/packages/pkg/Avahi.rst @@ -0,0 +1,26 @@ +.. spelling:: + + Avahi + +.. index:: networking ; Avahi + +.. _pkg.Avahi: + +Avahi +===== + +.. |hunter| image:: https://img.shields.io/badge/hunter-v0.12.10-blue.svg + :target: https://github.com/ruslo/hunter/releases/tag/v0.12.10 + :alt: Hunter v0.12.10 + +- `Official `__ +- `Example `__ +- Available since |hunter| +- Added by `Damien Buhl `__ + (`pr-237 `__) + +.. code-block:: cmake + + hunter_add_package(Avahi) + find_package(Avahi REQUIRED) + target_link_libraries(... Avahi::common Avahi::client Avahi::compat_libdns_sd) diff --git a/docs/packages/pkg/BZip2.rst b/docs/packages/pkg/BZip2.rst new file mode 100644 index 0000000000..311b4d308f --- /dev/null +++ b/docs/packages/pkg/BZip2.rst @@ -0,0 +1,26 @@ +.. spelling:: + + BZip + +.. index:: compression ; BZip2 + +.. _pkg.BZip2: + +BZip2 +===== + +.. |hunter| image:: https://img.shields.io/badge/hunter-v0.9.9-blue.svg + :target: https://github.com/ruslo/hunter/releases/tag/v0.9.9 + :alt: Hunter v0.9.9 + +- `Official `__ +- `Hunterized `__ +- `Example `__ +- Available since |hunter| + +.. code-block:: cmake + + hunter_add_package(BZip2) + + find_package(BZip2 CONFIG REQUIRED) + target_link_libraries(... BZip2::bz2) diff --git a/docs/packages/pkg/Beast.rst b/docs/packages/pkg/Beast.rst new file mode 100644 index 0000000000..c3b2d22fec --- /dev/null +++ b/docs/packages/pkg/Beast.rst @@ -0,0 +1,24 @@ +.. spelling:: + + Beast + +.. index:: networking ; Beast + +.. _pkg.Beast: + +Beast +===== + +.. |hunter| image:: https://img.shields.io/badge/hunter-v0.9.9-blue.svg + :target: https://github.com/ruslo/hunter/releases/tag/v0.9.9 + :alt: Hunter v0.9.9 + +- `Official `__ +- `Hunterized `__ +- Available since |hunter| + +.. code-block:: cmake + + hunter_add_package(Beast) + find_package(Beast CONFIG REQUIRED) + target_link_libraries(... Beast::Beast) diff --git a/docs/packages/pkg/Boost.rst b/docs/packages/pkg/Boost.rst new file mode 100644 index 0000000000..c70121d7a2 --- /dev/null +++ b/docs/packages/pkg/Boost.rst @@ -0,0 +1,107 @@ +.. index:: frameworks ; Boost + +.. _pkg.Boost: + +Boost +===== + +.. code-block:: cmake + + # Header-only libraries + hunter_add_package(Boost) + find_package(Boost CONFIG REQUIRED) + target_link_libraries(... Boost::boost) + +- `Example `__ + +.. code-block:: cmake + + # Boost components (see list below) + hunter_add_package(Boost COMPONENTS system filesystem) + find_package(Boost CONFIG REQUIRED system filesystem) + target_link_libraries(... Boost::system Boost::filesystem) + +Examples: + +- `Boost-uuid `__ +- `Boost-system `__ +- `Boost-iostreams `__ +- `Boost-filesystem `__ + +List of components (other libraries are header-only): + +- ``atomic`` +- ``chrono`` +- ``context`` +- ``coroutine`` +- ``date_time`` +- ``exception`` +- ``filesystem`` +- ``graph`` +- ``graph_parallel`` +- ``iostreams`` +- ``locale`` +- ``log`` +- ``math`` +- ``mpi`` +- ``program_options`` +- ``python`` +- ``random`` +- ``regex`` +- ``serialization`` +- ``signals`` +- ``system`` +- ``test`` +- ``thread`` +- ``timer`` +- ``wave`` + +Compatibility mode +------------------ + +.. code-block:: cmake + + hunter_add_package(Boost COMPONENTS system filesystem) + set(Boost_USE_STATIC_LIBS ON) + find_package(Boost REQUIRED system filesystem) + if(MSVC) + add_definitions(-DBOOST_ALL_NO_LIB=1) + endif() + + include_directories(${Boost_INCLUDE_DIRS}) + target_link_libraries(... ${Boost_LIBRARIES}) + +CMake options +------------- + +CMake options can be passed to boost build using ``CMAKE_ARGS`` feature +(see +`customization `__). +Options of special form ``_