diff --git a/.travis.yml b/.travis.yml index 97506cbb8..3275f9da2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,17 +16,15 @@ addons: sources: - ubuntu-toolchain-r-test packages: - - python3 - - # python3-pip package is not available, use 'easy_install3': - # * https://github.com/travis-ci/apt-package-whitelist/issues/768 + - python3-pip - python3-setuptools # easy_install3 + - binutils # https://github.com/travis-ci-tester/travis-test-clang-cxx-11 - - libstdc++-4.8-dev + - libstdc++-7-dev # https://github.com/travis-ci-tester/travis-test-gcc-cxx-11 - - g++-4.8 + - g++-7 env: global: @@ -40,26 +38,27 @@ matrix: - os: linux env: PROJECT_DIR=examples/hdf5 TOOLCHAIN=clang-libstdcxx - os: linux - env: PROJECT_DIR=examples/hdf5 TOOLCHAIN=gcc-4-8 - - # FIXME: https://travis-ci.org/ingenue/hunter/jobs/164859218 - # - os: linux - # env: PROJECT_DIR=examples/hdf5 TOOLCHAIN=android-ndk-r10e-api-19-armeabi-v7a-neon - - # FIXME: https://travis-ci.org/ingenue/hunter/jobs/164859220 - # - os: linux - # env: PROJECT_DIR=examples/hdf5 TOOLCHAIN=analyze - - # FIXME: https://travis-ci.org/ingenue/hunter/jobs/164859221 - # - os: linux - # env: PROJECT_DIR=examples/hdf5 TOOLCHAIN=sanitize-address - + env: PROJECT_DIR=examples/hdf5 TOOLCHAIN=clang-cxx14 + - os: linux + env: PROJECT_DIR=examples/hdf5 TOOLCHAIN=clang-cxx14-pic + - os: linux + env: PROJECT_DIR=examples/hdf5 TOOLCHAIN=clang-fpic + - os: linux + env: PROJECT_DIR=examples/hdf5 TOOLCHAIN=clang-fpic-static-std + - os: linux + env: PROJECT_DIR=examples/hdf5 TOOLCHAIN=clang-fpic-static-std-cxx14 + - os: linux + env: PROJECT_DIR=examples/hdf5 TOOLCHAIN=gcc-lto + - os: linux + env: PROJECT_DIR=examples/hdf5 TOOLCHAIN=gcc-7 + - os: linux + env: PROJECT_DIR=examples/hdf5 TOOLCHAIN=gcc-7-cxx14-pic + - os: linux + env: PROJECT_DIR=examples/hdf5 TOOLCHAIN=sanitize-address - os: linux env: PROJECT_DIR=examples/hdf5 TOOLCHAIN=sanitize-leak - - # FIXME: https://travis-ci.org/ingenue/hunter/jobs/164859223 - # - os: linux - # env: PROJECT_DIR=examples/hdf5 TOOLCHAIN=sanitize-thread + - os: linux + env: PROJECT_DIR=examples/hdf5 TOOLCHAIN=sanitize-thread # } @@ -70,37 +69,37 @@ matrix: env: PROJECT_DIR=examples/hdf5 TOOLCHAIN=libcxx - os: osx env: PROJECT_DIR=examples/hdf5 TOOLCHAIN=clang-libstdcxx + - os: osx + env: PROJECT_DIR=examples/hdf5 TOOLCHAIN=osx-10-13-make-cxx14 + - os: osx + env: PROJECT_DIR=examples/hdf5 TOOLCHAIN=osx-10-13-cxx14 - os: osx env: PROJECT_DIR=examples/hdf5 TOOLCHAIN=osx-10-11 - # FIXME: https://travis-ci.org/ingenue/hunter/jobs/164878134 - # - os: osx - # env: PROJECT_DIR=examples/hdf5 TOOLCHAIN=ios-nocodesign-9-3 - - # FIXME: https://travis-ci.org/ingenue/hunter/jobs/164859218 - # - os: osx - # env: PROJECT_DIR=examples/hdf5 TOOLCHAIN=android-ndk-r10e-api-19-armeabi-v7a-neon - - # FIXME: https://travis-ci.org/ingenue/hunter/jobs/164859220 - # - os: osx - # env: PROJECT_DIR=examples/hdf5 TOOLCHAIN=analyze - - # } - install: # Info about OS - uname -a + # Info about available disk space + - df -h $HOME + + # 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 upgrade python || echo "Ignoring failure..."; fi - 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 easy_install3 --user requests==2.10.0; fi + - if [[ "`uname`" == "Darwin" ]]; then pip3 install gitpython; fi + - if [[ "`uname`" == "Linux" ]]; then travis_retry pip3 install --user requests; fi + - if [[ "`uname`" == "Linux" ]]; then travis_retry pip3 install --user gitpython; fi # Install latest Polly toolchains and scripts - - wget https://github.com/ruslo/polly/archive/master.zip + - wget https://github.com/cpp-pm/polly/archive/master.zip - unzip master.zip - POLLY_ROOT="`pwd`/polly-master" - export PATH="${POLLY_ROOT}/bin:${PATH}" diff --git a/LICENSE b/LICENSE index 519974325..64ea4d530 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2013-2016, Ruslan Baratov +Copyright (c) 2013-2018, 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 deleted file mode 100644 index 54d8fdf50..000000000 --- a/README.rst +++ /dev/null @@ -1,7 +0,0 @@ -Hunter CI testing -================= - -This repository is for deep per-package testing. -The only pull requests accepting here is about continuous integration testing on Travis/AppVeyor, i.e. should only affect ``.travis.yml`` or ``appveyor.yml`` (in some rare cases ``jenkins.py``). Please contribute other stuff to https://github.com/ruslo/hunter. - -Thanks. diff --git a/appveyor.yml b/appveyor.yml index 723f26107..add182a63 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,63 +4,128 @@ environment: global: # This variable used only if '--upload' added to 'jenkins.py' GITHUB_USER_PASSWORD: - secure: uW6WWlvCt7CRvvdO9ePjbymPcPNuV1C6HGF8u7Ey6EI= + secure: LNJ5FPxb7CPXpslLdb63M1Z2344XY5kxQOsnE1RQ6O+hslNqTHk7pvbS+YB5+05P matrix: # FIXME: # * https://ci.appveyor.com/project/ingenue/hunter/build/1.0.1053/job/l4ud1nf8pbo11tkh - # - TOOLCHAIN: "default" - # PROJECT_DIR: examples\hdf5 + #- TOOLCHAIN: "default" + # PROJECT_DIR: examples\hdf5 + # HUNTER_BINARY_DIR: C:\__BIN + # HUNTER_ROOT: C:\.HUNTER + + #- TOOLCHAIN: "ninja-vs-15-2017-win64-cxx17" + # PROJECT_DIR: examples\hdf5 + # HUNTER_BINARY_DIR: C:\__BIN + # HUNTER_ROOT: C:\.HUNTER + + #- TOOLCHAIN: "ninja-vs-15-2017-win64" + # PROJECT_DIR: examples\hdf5 + # HUNTER_BINARY_DIR: C:\__BIN + # HUNTER_ROOT: C:\.HUNTER + + - TOOLCHAIN: "ninja-vs-14-2015-win64" + PROJECT_DIR: examples\hdf5 + HUNTER_BINARY_DIR: C:\__BIN + HUNTER_ROOT: C:\.HUNTER + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - TOOLCHAIN: "ninja-vs-12-2013-win64" PROJECT_DIR: examples\hdf5 - - - TOOLCHAIN: "nmake-vs-12-2013-win64" + HUNTER_BINARY_DIR: C:\__BIN + HUNTER_ROOT: C:\.HUNTER + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + + - TOOLCHAIN: "nmake-vs-15-2017-win64-cxx17" PROJECT_DIR: examples\hdf5 - - - TOOLCHAIN: "nmake-vs-12-2013" + HUNTER_BINARY_DIR: C:\__BIN + HUNTER_ROOT: C:\.HUNTER + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + + - TOOLCHAIN: "nmake-vs-15-2017-win64" PROJECT_DIR: examples\hdf5 - - - TOOLCHAIN: "vs-10-2010" + HUNTER_BINARY_DIR: C:\__BIN + HUNTER_ROOT: C:\.HUNTER + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + + - TOOLCHAIN: "nmake-vs-12-2013-win64" PROJECT_DIR: examples\hdf5 - - - TOOLCHAIN: "vs-11-2012" + HUNTER_BINARY_DIR: C:\__BIN + HUNTER_ROOT: C:\.HUNTER + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + + - TOOLCHAIN: "nmake-vs-12-2013" PROJECT_DIR: examples\hdf5 - + HUNTER_BINARY_DIR: C:\__BIN + HUNTER_ROOT: C:\.HUNTER + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + - TOOLCHAIN: "vs-12-2013-win64" PROJECT_DIR: examples\hdf5 - + HUNTER_BINARY_DIR: C:\__BIN + HUNTER_ROOT: C:\.HUNTER + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + - TOOLCHAIN: "vs-12-2013-xp" PROJECT_DIR: examples\hdf5 - + HUNTER_BINARY_DIR: C:\__BIN + HUNTER_ROOT: C:\.HUNTER + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + - TOOLCHAIN: "vs-12-2013" PROJECT_DIR: examples\hdf5 - + HUNTER_BINARY_DIR: C:\__BIN + HUNTER_ROOT: C:\.HUNTER + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 + # FIXME: # * https://ci.appveyor.com/project/ingenue/hunter/build/1.0.1053/job/l4ud1nf8pbo11tkh - # - TOOLCHAIN: "vs-14-2015" - # PROJECT_DIR: examples\hdf5 - - - TOOLCHAIN: "vs-9-2008" + - TOOLCHAIN: "vs-14-2015" PROJECT_DIR: examples\hdf5 - - - TOOLCHAIN: "mingw" + HUNTER_BINARY_DIR: C:\__BIN + HUNTER_ROOT: C:\.HUNTER + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + + - TOOLCHAIN: "vs-14-2015-win64" PROJECT_DIR: examples\hdf5 - - # FIXME: - # * https://ci.appveyor.com/project/ingenue/hunter/build/1.0.1053/job/mtnnis065ibe658y - # - TOOLCHAIN: "msys" - # PROJECT_DIR: examples\hdf5 - + HUNTER_BINARY_DIR: C:\__BIN + HUNTER_ROOT: C:\.HUNTER + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + + - TOOLCHAIN: "vs-15-2017" + PROJECT_DIR: examples\hdf5 + HUNTER_BINARY_DIR: C:\__BIN + HUNTER_ROOT: C:\.HUNTER + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + + - TOOLCHAIN: "vs-15-2017-win64" + PROJECT_DIR: examples\hdf5 + HUNTER_BINARY_DIR: C:\__BIN + HUNTER_ROOT: C:\.HUNTER + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + + - TOOLCHAIN: "vs-16-2019" + PROJECT_DIR: examples\hdf5 + HUNTER_BINARY_DIR: C:\__BIN + HUNTER_ROOT: C:\.HUNTER + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + + - TOOLCHAIN: "vs-16-2019-win64" + PROJECT_DIR: examples\hdf5 + HUNTER_BINARY_DIR: C:\__BIN + HUNTER_ROOT: C:\.HUNTER + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + install: # Python 3 - cmd: set PATH=C:\Python34-x64;C:\Python34-x64\Scripts;%PATH% - # Install Python package 'requests' + # Install Python package 'requests', 'gitpython' - cmd: pip install requests + - cmd: pip install gitpython # Install latest Polly toolchains and scripts - - cmd: appveyor DownloadFile https://github.com/ruslo/polly/archive/master.zip + - cmd: appveyor DownloadFile https://github.com/cpp-pm/polly/archive/master.zip - cmd: 7z x master.zip - cmd: set POLLY_ROOT=%cd%\polly-master @@ -78,13 +143,19 @@ install: # * 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 + # Save git.exe in HUNTER_GIT_EXECUTABLE for upload + # * https://docs.hunter.sh/en/latest/reference/user-variables.html#hunter-git-executable + # Variable will be used in CMake so it's okay to use Unix style '/' + - cmd: set HUNTER_GIT_EXECUTABLE=C:/Program Files/Git/bin/git.exe + + - cmd: set MINGW_PATH=C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin # MSYS2 location - cmd: set MSYS_PATH=C:\msys64\usr\bin + # Visual Studio 15 2017: Mimic behavior of older versions + - cmd: set VS150COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools + build_script: - cmd: python .\jenkins.py diff --git a/cmake/Hunter b/cmake/Hunter index 07e94fe23..92465b0a2 100644 --- a/cmake/Hunter +++ b/cmake/Hunter @@ -7,15 +7,32 @@ else() set(HUNTER_CMAKE_HUNTER_ 1) endif() +if(CMAKE_VERSION VERSION_LESS "3.2") + message( + FATAL_ERROR + "At least CMake version 3.2 required for Hunter dependency management." + " Update CMake or set HUNTER_ENABLED to OFF." + ) +endif() + option(HUNTER_ENABLED "Enable Hunter package manager support" ON) option(HUNTER_STATUS_PRINT "Print working status" ON) option(HUNTER_STATUS_DEBUG "Print a lot info" OFF) +set( + HUNTER_CONFIGURATION_TYPES + "Release;Debug" + CACHE + STRING + "Hunter configuration types" +) + ### add cmake modules to search path list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/modules") list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/find") include(hunter_add_package) # For user project +include(hunter_private_data) # For user project include(hunter_initialize) # Basic initialization - only check arguments of HunterGate. Further diff --git a/cmake/HunterGate.cmake b/cmake/HunterGate.cmake new file mode 100644 index 000000000..e78d3e891 --- /dev/null +++ b/cmake/HunterGate.cmake @@ -0,0 +1,528 @@ +# Copyright (c) 2013-2019, Ruslan Baratov +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# This is a gate file to Hunter package manager. +# Include this file using `include` command and add package you need, example: +# +# cmake_minimum_required(VERSION 3.2) +# +# include("cmake/HunterGate.cmake") +# HunterGate( +# URL "https://github.com/path/to/hunter/archive.tar.gz" +# SHA1 "798501e983f14b28b10cda16afa4de69eee1da1d" +# ) +# +# project(MyProject) +# +# hunter_add_package(Foo) +# hunter_add_package(Boo COMPONENTS Bar Baz) +# +# Projects: +# * https://github.com/hunter-packages/gate/ +# * https://github.com/ruslo/hunter + +option(HUNTER_ENABLED "Enable Hunter package manager support" ON) + +if(HUNTER_ENABLED) + if(CMAKE_VERSION VERSION_LESS "3.2") + message( + FATAL_ERROR + "At least CMake version 3.2 required for Hunter dependency management." + " Update CMake or set HUNTER_ENABLED to OFF." + ) + endif() +endif() + +include(CMakeParseArguments) # cmake_parse_arguments + +option(HUNTER_STATUS_PRINT "Print working status" ON) +option(HUNTER_STATUS_DEBUG "Print a lot info" OFF) +option(HUNTER_TLS_VERIFY "Enable/disable TLS certificate checking on downloads" ON) + +set(HUNTER_ERROR_PAGE "https://docs.hunter.sh/en/latest/reference/errors") + +function(hunter_gate_status_print) + if(HUNTER_STATUS_PRINT OR HUNTER_STATUS_DEBUG) + foreach(print_message ${ARGV}) + message(STATUS "[hunter] ${print_message}") + endforeach() + endif() +endfunction() + +function(hunter_gate_status_debug) + if(HUNTER_STATUS_DEBUG) + foreach(print_message ${ARGV}) + string(TIMESTAMP timestamp) + message(STATUS "[hunter *** DEBUG *** ${timestamp}] ${print_message}") + endforeach() + endif() +endfunction() + +function(hunter_gate_error_page error_page) + message("------------------------------ ERROR ------------------------------") + message(" ${HUNTER_ERROR_PAGE}/${error_page}.html") + message("-------------------------------------------------------------------") + message("") + message(FATAL_ERROR "") +endfunction() + +function(hunter_gate_internal_error) + message("") + foreach(print_message ${ARGV}) + message("[hunter ** INTERNAL **] ${print_message}") + endforeach() + message("[hunter ** INTERNAL **] [Directory:${CMAKE_CURRENT_LIST_DIR}]") + message("") + hunter_gate_error_page("error.internal") +endfunction() + +function(hunter_gate_fatal_error) + cmake_parse_arguments(hunter "" "ERROR_PAGE" "" "${ARGV}") + if("${hunter_ERROR_PAGE}" STREQUAL "") + hunter_gate_internal_error("Expected ERROR_PAGE") + endif() + message("") + foreach(x ${hunter_UNPARSED_ARGUMENTS}) + message("[hunter ** FATAL ERROR **] ${x}") + endforeach() + message("[hunter ** FATAL ERROR **] [Directory:${CMAKE_CURRENT_LIST_DIR}]") + message("") + hunter_gate_error_page("${hunter_ERROR_PAGE}") +endfunction() + +function(hunter_gate_user_error) + hunter_gate_fatal_error(${ARGV} ERROR_PAGE "error.incorrect.input.data") +endfunction() + +function(hunter_gate_self root version sha1 result) + string(COMPARE EQUAL "${root}" "" is_bad) + if(is_bad) + hunter_gate_internal_error("root is empty") + endif() + + string(COMPARE EQUAL "${version}" "" is_bad) + if(is_bad) + hunter_gate_internal_error("version is empty") + endif() + + string(COMPARE EQUAL "${sha1}" "" is_bad) + if(is_bad) + hunter_gate_internal_error("sha1 is empty") + endif() + + string(SUBSTRING "${sha1}" 0 7 archive_id) + + set( + hunter_self + "${root}/_Base/Download/Hunter/${version}/${archive_id}/Unpacked" + ) + + set("${result}" "${hunter_self}" PARENT_SCOPE) +endfunction() + +# Set HUNTER_GATE_ROOT cmake variable to suitable value. +function(hunter_gate_detect_root) + # Check CMake variable + string(COMPARE NOTEQUAL "${HUNTER_ROOT}" "" not_empty) + if(not_empty) + set(HUNTER_GATE_ROOT "${HUNTER_ROOT}" PARENT_SCOPE) + hunter_gate_status_debug("HUNTER_ROOT detected by cmake variable") + return() + endif() + + # Check environment variable + string(COMPARE NOTEQUAL "$ENV{HUNTER_ROOT}" "" not_empty) + if(not_empty) + set(HUNTER_GATE_ROOT "$ENV{HUNTER_ROOT}" PARENT_SCOPE) + hunter_gate_status_debug("HUNTER_ROOT detected by environment variable") + return() + endif() + + # Check HOME environment variable + string(COMPARE NOTEQUAL "$ENV{HOME}" "" result) + if(result) + set(HUNTER_GATE_ROOT "$ENV{HOME}/.hunter" PARENT_SCOPE) + hunter_gate_status_debug("HUNTER_ROOT set using HOME environment variable") + return() + endif() + + # Check SYSTEMDRIVE and USERPROFILE environment variable (windows only) + if(WIN32) + string(COMPARE NOTEQUAL "$ENV{SYSTEMDRIVE}" "" result) + if(result) + set(HUNTER_GATE_ROOT "$ENV{SYSTEMDRIVE}/.hunter" PARENT_SCOPE) + hunter_gate_status_debug( + "HUNTER_ROOT set using SYSTEMDRIVE environment variable" + ) + return() + endif() + + string(COMPARE NOTEQUAL "$ENV{USERPROFILE}" "" result) + if(result) + set(HUNTER_GATE_ROOT "$ENV{USERPROFILE}/.hunter" PARENT_SCOPE) + hunter_gate_status_debug( + "HUNTER_ROOT set using USERPROFILE environment variable" + ) + return() + endif() + endif() + + hunter_gate_fatal_error( + "Can't detect HUNTER_ROOT" + ERROR_PAGE "error.detect.hunter.root" + ) +endfunction() + +function(hunter_gate_download dir) + string( + COMPARE + NOTEQUAL + "$ENV{HUNTER_DISABLE_AUTOINSTALL}" + "" + disable_autoinstall + ) + if(disable_autoinstall AND NOT HUNTER_RUN_INSTALL) + hunter_gate_fatal_error( + "Hunter not found in '${dir}'" + "Set HUNTER_RUN_INSTALL=ON to auto-install it from '${HUNTER_GATE_URL}'" + "Settings:" + " HUNTER_ROOT: ${HUNTER_GATE_ROOT}" + " HUNTER_SHA1: ${HUNTER_GATE_SHA1}" + ERROR_PAGE "error.run.install" + ) + endif() + string(COMPARE EQUAL "${dir}" "" is_bad) + if(is_bad) + hunter_gate_internal_error("Empty 'dir' argument") + endif() + + string(COMPARE EQUAL "${HUNTER_GATE_SHA1}" "" is_bad) + if(is_bad) + hunter_gate_internal_error("HUNTER_GATE_SHA1 empty") + endif() + + string(COMPARE EQUAL "${HUNTER_GATE_URL}" "" is_bad) + if(is_bad) + hunter_gate_internal_error("HUNTER_GATE_URL empty") + endif() + + set(done_location "${dir}/DONE") + set(sha1_location "${dir}/SHA1") + + set(build_dir "${dir}/Build") + set(cmakelists "${dir}/CMakeLists.txt") + + hunter_gate_status_debug("Locking directory: ${dir}") + file(LOCK "${dir}" DIRECTORY GUARD FUNCTION) + hunter_gate_status_debug("Lock done") + + if(EXISTS "${done_location}") + # while waiting for lock other instance can do all the job + hunter_gate_status_debug("File '${done_location}' found, skip install") + return() + endif() + + file(REMOVE_RECURSE "${build_dir}") + file(REMOVE_RECURSE "${cmakelists}") + + file(MAKE_DIRECTORY "${build_dir}") # check directory permissions + + # Disabling languages speeds up a little bit, reduces noise in the output + # and avoids path too long windows error + file( + WRITE + "${cmakelists}" + "cmake_minimum_required(VERSION 3.2)\n" + "project(HunterDownload LANGUAGES NONE)\n" + "include(ExternalProject)\n" + "ExternalProject_Add(\n" + " Hunter\n" + " URL\n" + " \"${HUNTER_GATE_URL}\"\n" + " URL_HASH\n" + " SHA1=${HUNTER_GATE_SHA1}\n" + " DOWNLOAD_DIR\n" + " \"${dir}\"\n" + " TLS_VERIFY\n" + " ${HUNTER_TLS_VERIFY}\n" + " SOURCE_DIR\n" + " \"${dir}/Unpacked\"\n" + " CONFIGURE_COMMAND\n" + " \"\"\n" + " BUILD_COMMAND\n" + " \"\"\n" + " INSTALL_COMMAND\n" + " \"\"\n" + ")\n" + ) + + if(HUNTER_STATUS_DEBUG) + set(logging_params "") + else() + set(logging_params OUTPUT_QUIET) + endif() + + hunter_gate_status_debug("Run generate") + + # Need to add toolchain file too. + # Otherwise on Visual Studio + MDD this will fail with error: + # "Could not find an appropriate version of the Windows 10 SDK installed on this machine" + if(EXISTS "${CMAKE_TOOLCHAIN_FILE}") + get_filename_component(absolute_CMAKE_TOOLCHAIN_FILE "${CMAKE_TOOLCHAIN_FILE}" ABSOLUTE) + set(toolchain_arg "-DCMAKE_TOOLCHAIN_FILE=${absolute_CMAKE_TOOLCHAIN_FILE}") + else() + # 'toolchain_arg' can't be empty + set(toolchain_arg "-DCMAKE_TOOLCHAIN_FILE=") + endif() + + string(COMPARE EQUAL "${CMAKE_MAKE_PROGRAM}" "" no_make) + if(no_make) + set(make_arg "") + else() + # Test case: remove Ninja from PATH but set it via CMAKE_MAKE_PROGRAM + set(make_arg "-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}") + endif() + + execute_process( + COMMAND + "${CMAKE_COMMAND}" + "-H${dir}" + "-B${build_dir}" + "-G${CMAKE_GENERATOR}" + "${toolchain_arg}" + ${make_arg} + WORKING_DIRECTORY "${dir}" + RESULT_VARIABLE download_result + ${logging_params} + ) + + if(NOT download_result EQUAL 0) + hunter_gate_internal_error( + "Configure project failed." + "To reproduce the error run: ${CMAKE_COMMAND} -H${dir} -B${build_dir} -G${CMAKE_GENERATOR} ${toolchain_arg} ${make_arg}" + "In directory ${dir}" + ) + endif() + + hunter_gate_status_print( + "Initializing Hunter workspace (${HUNTER_GATE_SHA1})" + " ${HUNTER_GATE_URL}" + " -> ${dir}" + ) + execute_process( + COMMAND "${CMAKE_COMMAND}" --build "${build_dir}" + WORKING_DIRECTORY "${dir}" + RESULT_VARIABLE download_result + ${logging_params} + ) + + if(NOT download_result EQUAL 0) + hunter_gate_internal_error("Build project failed") + endif() + + file(REMOVE_RECURSE "${build_dir}") + file(REMOVE_RECURSE "${cmakelists}") + + file(WRITE "${sha1_location}" "${HUNTER_GATE_SHA1}") + file(WRITE "${done_location}" "DONE") + + hunter_gate_status_debug("Finished") +endfunction() + +# Must be a macro so master file 'cmake/Hunter' can +# apply all variables easily just by 'include' command +# (otherwise PARENT_SCOPE magic needed) +macro(HunterGate) + if(HUNTER_GATE_DONE) + # variable HUNTER_GATE_DONE set explicitly for external project + # (see `hunter_download`) + set_property(GLOBAL PROPERTY HUNTER_GATE_DONE YES) + endif() + + # First HunterGate command will init Hunter, others will be ignored + get_property(_hunter_gate_done GLOBAL PROPERTY HUNTER_GATE_DONE SET) + + if(NOT HUNTER_ENABLED) + # Empty function to avoid error "unknown function" + function(hunter_add_package) + endfunction() + + set( + _hunter_gate_disabled_mode_dir + "${CMAKE_CURRENT_LIST_DIR}/cmake/Hunter/disabled-mode" + ) + if(EXISTS "${_hunter_gate_disabled_mode_dir}") + hunter_gate_status_debug( + "Adding \"disabled-mode\" modules: ${_hunter_gate_disabled_mode_dir}" + ) + list(APPEND CMAKE_PREFIX_PATH "${_hunter_gate_disabled_mode_dir}") + endif() + elseif(_hunter_gate_done) + hunter_gate_status_debug("Secondary HunterGate (use old settings)") + hunter_gate_self( + "${HUNTER_CACHED_ROOT}" + "${HUNTER_VERSION}" + "${HUNTER_SHA1}" + _hunter_self + ) + include("${_hunter_self}/cmake/Hunter") + else() + set(HUNTER_GATE_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}") + + string(COMPARE NOTEQUAL "${PROJECT_NAME}" "" _have_project_name) + if(_have_project_name) + hunter_gate_fatal_error( + "Please set HunterGate *before* 'project' command. " + "Detected project: ${PROJECT_NAME}" + ERROR_PAGE "error.huntergate.before.project" + ) + endif() + + cmake_parse_arguments( + HUNTER_GATE "LOCAL" "URL;SHA1;GLOBAL;FILEPATH" "" ${ARGV} + ) + + string(COMPARE EQUAL "${HUNTER_GATE_SHA1}" "" _empty_sha1) + string(COMPARE EQUAL "${HUNTER_GATE_URL}" "" _empty_url) + string( + COMPARE + NOTEQUAL + "${HUNTER_GATE_UNPARSED_ARGUMENTS}" + "" + _have_unparsed + ) + string(COMPARE NOTEQUAL "${HUNTER_GATE_GLOBAL}" "" _have_global) + string(COMPARE NOTEQUAL "${HUNTER_GATE_FILEPATH}" "" _have_filepath) + + if(_have_unparsed) + hunter_gate_user_error( + "HunterGate unparsed arguments: ${HUNTER_GATE_UNPARSED_ARGUMENTS}" + ) + endif() + if(_empty_sha1) + hunter_gate_user_error("SHA1 suboption of HunterGate is mandatory") + endif() + if(_empty_url) + hunter_gate_user_error("URL suboption of HunterGate is mandatory") + endif() + if(_have_global) + if(HUNTER_GATE_LOCAL) + hunter_gate_user_error("Unexpected LOCAL (already has GLOBAL)") + endif() + if(_have_filepath) + hunter_gate_user_error("Unexpected FILEPATH (already has GLOBAL)") + endif() + endif() + if(HUNTER_GATE_LOCAL) + if(_have_global) + hunter_gate_user_error("Unexpected GLOBAL (already has LOCAL)") + endif() + if(_have_filepath) + hunter_gate_user_error("Unexpected FILEPATH (already has LOCAL)") + endif() + endif() + if(_have_filepath) + if(_have_global) + hunter_gate_user_error("Unexpected GLOBAL (already has FILEPATH)") + endif() + if(HUNTER_GATE_LOCAL) + hunter_gate_user_error("Unexpected LOCAL (already has FILEPATH)") + endif() + endif() + + hunter_gate_detect_root() # set HUNTER_GATE_ROOT + + # Beautify path, fix probable problems with windows path slashes + get_filename_component( + HUNTER_GATE_ROOT "${HUNTER_GATE_ROOT}" ABSOLUTE + ) + hunter_gate_status_debug("HUNTER_ROOT: ${HUNTER_GATE_ROOT}") + if(NOT HUNTER_ALLOW_SPACES_IN_PATH) + string(FIND "${HUNTER_GATE_ROOT}" " " _contain_spaces) + if(NOT _contain_spaces EQUAL -1) + hunter_gate_fatal_error( + "HUNTER_ROOT (${HUNTER_GATE_ROOT}) contains spaces." + "Set HUNTER_ALLOW_SPACES_IN_PATH=ON to skip this error" + "(Use at your own risk!)" + ERROR_PAGE "error.spaces.in.hunter.root" + ) + endif() + endif() + + string( + REGEX + MATCH + "[0-9]+\\.[0-9]+\\.[0-9]+[-_a-z0-9]*" + HUNTER_GATE_VERSION + "${HUNTER_GATE_URL}" + ) + string(COMPARE EQUAL "${HUNTER_GATE_VERSION}" "" _is_empty) + if(_is_empty) + set(HUNTER_GATE_VERSION "unknown") + endif() + + hunter_gate_self( + "${HUNTER_GATE_ROOT}" + "${HUNTER_GATE_VERSION}" + "${HUNTER_GATE_SHA1}" + _hunter_self + ) + + set(_master_location "${_hunter_self}/cmake/Hunter") + get_filename_component(_archive_id_location "${_hunter_self}/.." ABSOLUTE) + set(_done_location "${_archive_id_location}/DONE") + set(_sha1_location "${_archive_id_location}/SHA1") + + # Check Hunter already downloaded by HunterGate + if(NOT EXISTS "${_done_location}") + hunter_gate_download("${_archive_id_location}") + endif() + + if(NOT EXISTS "${_done_location}") + hunter_gate_internal_error("hunter_gate_download failed") + endif() + + if(NOT EXISTS "${_sha1_location}") + hunter_gate_internal_error("${_sha1_location} not found") + endif() + file(READ "${_sha1_location}" _sha1_value) + string(COMPARE EQUAL "${_sha1_value}" "${HUNTER_GATE_SHA1}" _is_equal) + if(NOT _is_equal) + hunter_gate_internal_error( + "Short SHA1 collision:" + " ${_sha1_value} (from ${_sha1_location})" + " ${HUNTER_GATE_SHA1} (HunterGate)" + ) + endif() + if(NOT EXISTS "${_master_location}") + hunter_gate_user_error( + "Master file not found:" + " ${_master_location}" + "try to update Hunter/HunterGate" + ) + endif() + include("${_master_location}") + set_property(GLOBAL PROPERTY HUNTER_GATE_DONE YES) + endif() +endmacro() diff --git a/cmake/configs/default.cmake b/cmake/configs/default.cmake index 243341db0..b13229ee5 100644 --- a/cmake/configs/default.cmake +++ b/cmake/configs/default.cmake @@ -1,226 +1,585 @@ -# Copyright (c) 2013-2015, Ruslan Baratov +# Copyright (c) 2013-2018, 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 +# hunter_default_version(Foo VERSION 1.0.0) +# hunter_default_version(Boo VERSION 1.2.3z) -include(hunter_config) +include(hunter_default_version) include(hunter_user_error) # NOTE: no names with spaces! -hunter_config(AllTheFlopsThreads VERSION 0.1-p0) -hunter_config(Android-Apk VERSION 1.1.7) -hunter_config(Android-Build-Tools VERSION 22.0.1) -hunter_config(Android-Google-Repository VERSION 25) -hunter_config(Android-Modules VERSION 1.0.0) -hunter_config(Android-SDK VERSION 0.0.3) -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(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.62.0) -hunter_config(BoostCompute VERSION 0.5-p0) -hunter_config(BoostProcess VERSION 0.5) -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(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.2.4-p0) -hunter_config(Expat VERSION 2.1.1) -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(JsonSpirit VERSION 0.0.4-hunter) -hunter_config(LLVM VERSION ${HUNTER_Clang_VERSION}) -hunter_config(LLVMCompilerRT VERSION ${HUNTER_Clang_VERSION}) -hunter_config(Leathers VERSION 0.1.6) -hunter_config(Libcxx VERSION ${HUNTER_Clang_VERSION}) -hunter_config(Libcxxabi VERSION ${HUNTER_Clang_VERSION}) -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(OpenCV VERSION 3.1.0-p2) -hunter_config(OpenCV-Extra VERSION 3.0.0) -hunter_config(OpenSSL VERSION 1.0.2j) -hunter_config(PNG VERSION 1.6.16-p4) -hunter_config(PocoCpp VERSION 1.7.4) -hunter_config(PostgreSQL VERSION 9.5.0) -hunter_config(Protobuf VERSION 3.0.0-p1) -hunter_config(Qt VERSION 5.5.1-cvpixelbuffer-2-p7) -hunter_config(QtAndroidCMake VERSION 1.0.6) -hunter_config(QtCMakeExtra VERSION 1.0.19) -hunter_config(QtQmlManager VERSION 1.0.0) -hunter_config(RapidJSON VERSION 1.0.2-p2) -hunter_config(SDL2 VERSION 2.0.4-p2) -hunter_config(SQLite3 VERSION autoconf-3080803) #R-Tree enabled -hunter_config(Sober VERSION 0.1.3) -hunter_config(Sugar VERSION 1.2.2) -hunter_config(TIFF VERSION 4.0.2-p3) -hunter_config(WTL VERSION 9.1.5321) -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(ccv VERSION 0.7-p6) -hunter_config(cereal VERSION 1.1.2-p5) -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(damageproto VERSION 1.2.1) -hunter_config(dbus VERSION 1.10.0-hunter-4) -hunter_config(dest VERSION 0.8.0-p3) -hunter_config(dlib VERSION 18.17-p1) -hunter_config(dri2proto VERSION 2.8) -hunter_config(dri3proto VERSION 1.0) -hunter_config(drm VERSION 2.4.67) -hunter_config(eos VERSION 0.6.1-p0) -hunter_config(fixesproto VERSION 5.0) -hunter_config(flatbuffers VERSION 1.3.0-p3) -hunter_config(fmt VERSION 3.0.0) -hunter_config(freetype VERSION 2.6.2) -hunter_config(geos VERSION 3.4.2) -hunter_config(gflags VERSION 2.1.2-p0) -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-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(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(libogg VERSION 1.3.2-cmake3) -hunter_config(libsodium VERSION 1.0.10) -hunter_config(libyuv VERSION 1514-p3) -hunter_config(log4cplus VERSION 1.2.0-p0) -hunter_config(mini_chromium VERSION 0.0.1-p2) -hunter_config(minizip VERSION 1.0.1-p1) -hunter_config(msgpack VERSION 1.4.1) -hunter_config(nlohmann-json VERSION 1.0.0-rc1-hunter-3) -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.1) -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(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(sparsehash VERSION 2.0.2) -if(MSVC_VERSION LESS 1900) - # for VS12 - version without support C++11 - hunter_config(spdlog VERSION 1.0.0-p0) +hunter_default_version(ARM_NEON_2_x86_SSE VERSION 1.0.0-p0) +hunter_default_version(AllTheFlopsThreads VERSION 0.1-p0) +hunter_default_version(Android-Apk VERSION 1.1.14) +hunter_default_version(Android-Build-Tools VERSION 27.0.3) +hunter_default_version(Android-Google-Repository VERSION 58) +hunter_default_version(Android-Modules VERSION 1.0.0) +hunter_default_version(Android-SDK VERSION 0.0.6) +hunter_default_version(Android-SDK-Platform-tools VERSION r28.0.0) +hunter_default_version(Android-SDK-Tools VERSION 25.2.5) +hunter_default_version(Android-Support-Repository VERSION 47) +hunter_default_version(AngelScript VERSION 2.30-p0) +hunter_default_version(ArrayFire VERSION 3.3.1-p0) +hunter_default_version(Assimp VERSION 5.0.0-07779a7a) +hunter_default_version(Async++ VERSION 0.0.3-hunter) +hunter_default_version(Avahi VERSION 0.6.31) +hunter_default_version(BZip2 VERSION 1.0.6-p4) +hunter_default_version(Beast VERSION 1.0.0-b84-hunter-0) + +if(MINGW) + # https://github.com/boostorg/build/issues/301 + hunter_default_version(Boost VERSION 1.64.0) +else() + hunter_default_version(Boost VERSION 1.70.0-p0) +endif() + +hunter_default_version(BoostCompute VERSION 0.5-p0) +hunter_default_version(BoostProcess VERSION 0.5) +hunter_default_version(BoringSSL VERSION 0.0.0-0f5ecd3a8-p0) +hunter_default_version(Box2D VERSION 2.3.1-p0) +hunter_default_version(CLAPACK VERSION 3.2.1) +hunter_default_version(CLI11 VERSION 1.8.0) +hunter_default_version(CURL VERSION 7.60.0-p2) +hunter_default_version(CapnProto VERSION 0.7.0) +hunter_default_version(Catch VERSION 2.9.1) +hunter_default_version(Clang VERSION 6.0.1-p0) +hunter_default_version(ClangToolsExtra VERSION 6.0.1) # Clang +hunter_default_version(Comet VERSION 4.0.2) +hunter_default_version(CppNetlib VERSION 0.10.1-hunter-3) +hunter_default_version(CppNetlibUri VERSION 1.0.5-hunter) +hunter_default_version(CreateLaunchers VERSION 0.2.1) +hunter_default_version(CsvParserCPlusPlus VERSION 1.0.1) +hunter_default_version(Eigen VERSION 3.3.7) +hunter_default_version(EnumGroup VERSION 0.0.1) +hunter_default_version(Expat VERSION 2.1.1) +hunter_default_version(FP16 VERSION 0.0.0-febbb1c-p0) +hunter_default_version(FakeIt VERSION 2.0.3) +hunter_default_version(Fruit VERSION 3.1.1-p0) +hunter_default_version(FunctionalPlus VERSION 0.2-p0) +hunter_default_version(GPUImage VERSION 0.1.6-p9) +hunter_default_version(GSL VERSION 2.1.0-p2) + +if(MSVC80) + hunter_default_version(GTest VERSION 1.7.0-hunter-6) else() - hunter_config(spdlog VERSION 0.11.0-p0) + hunter_default_version(GTest VERSION 1.8.0-hunter-p11) endif() -hunter_config(szip VERSION 2.1.0-p1) -hunter_config(thread-pool-cpp VERSION 1.0.0-p2) -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(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-p4) -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) - -if(MINGW OR MSVC80) - hunter_config(GTest VERSION 1.7.0-hunter-6) + +hunter_default_version(HalideIR VERSION 0.0-32057b5-p0) +hunter_default_version(HastyNoise VERSION 0.8.2) +hunter_default_version(ICU VERSION 63.1-p5) +hunter_default_version(IF97 VERSION 2.1.2) +hunter_default_version(Igloo VERSION 1.1.1-hunter) +hunter_default_version(Jpeg VERSION 9c-p0) +hunter_default_version(JsonSpirit VERSION 0.0.4-hunter) +hunter_default_version(LAPACK VERSION 3.7.1) +hunter_default_version(LLVM VERSION 6.0.1-p0) # Clang +hunter_default_version(LLVMCompilerRT VERSION 6.0.1) # Clang +hunter_default_version(Leathers VERSION 0.1.8) +hunter_default_version(Leptonica VERSION 1.74.2-p4) +hunter_default_version(LibCDS VERSION 2.3.1) +hunter_default_version(Libcxx VERSION 3.6.2) # Clang +hunter_default_version(Libcxxabi VERSION 3.6.2) # Clang +hunter_default_version(Libevent VERSION 2.1.8-p4) +hunter_default_version(Libssh2 VERSION 1.7.0) +hunter_default_version(LodePNG VERSION 0.0.0-p1) +hunter_default_version(Lua VERSION 5.3.2-p2) +hunter_default_version(MathFu VERSION 1.1.0-p0) +hunter_default_version(Microsoft.GSL VERSION 2.0.0-p0) +hunter_default_version(MySQL-client VERSION 6.1.9-p1) +hunter_default_version(NASM VERSION 2.12.02) +hunter_default_version(NLopt VERSION 2.5.0-p0) +hunter_default_version(ONNX VERSION 1.4.1-p0) +hunter_default_version(OpenAL VERSION 1.18.2) +hunter_default_version(OpenBLAS VERSION 0.3.3) +hunter_default_version(OpenCL VERSION 2.1-p3) +hunter_default_version(OpenCL-cpp VERSION 2.0.10-p0) +hunter_default_version(OpenCV VERSION 4.0.0-p3) +hunter_default_version(OpenCV-Extra VERSION 4.0.0) +hunter_default_version(OpenNMTTokenizer VERSION 1.11.0-p1) +hunter_default_version(OpenSSL VERSION 1.1.1c) +hunter_default_version(OpenSceneGraph VERSION 3.6.3-p0) +hunter_default_version(PNG VERSION 1.6.26-p6) +hunter_default_version(PROJ4 VERSION 5.0.0) +hunter_default_version(PhysUnits VERSION 1.1.0-p0) +hunter_default_version(PocoCpp VERSION 1.7.9-p1) +hunter_default_version(PostgreSQL VERSION 10.0.0) +hunter_default_version(Protobuf VERSION 3.7.1-p0) + +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_default_version(Qt VERSION 5.5.1-cvpixelbuffer-2-p9) +elseif(IOS OR ANDROID) + hunter_default_version(Qt VERSION 5.9.1-p0) else() - hunter_config(GTest VERSION 1.8.0-hunter-p2) + hunter_default_version(Qt VERSION 5.11.3) endif() +hunter_default_version(QtAndroidCMake VERSION 1.0.9) +hunter_default_version(QtCMakeExtra VERSION 1.0.34) +hunter_default_version(QtPropertyEditor VERSION 2.1.3-p0) +hunter_default_version(QtQmlManager VERSION 1.0.0) +hunter_default_version(Qwt VERSION 6.1-p3) +hunter_default_version(RapidJSON VERSION 1.1.0-66eb606-p0) +hunter_default_version(RapidXML VERSION 1.13) +hunter_default_version(RedisClient VERSION 0.6.1-p1) +hunter_default_version(SDL2 VERSION 2.0.7-p3) +hunter_default_version(SDL_image VERSION 2.0.1-p1) +hunter_default_version(SDL_mixer VERSION 2.0.2-p0) +hunter_default_version(SDL_ttf VERSION 2.0.14-p0) +hunter_default_version(SimpleSignal VERSION 0.0.0-79c3f68-p1) +hunter_default_version(Snappy VERSION 1.1.7) +hunter_default_version(Sober VERSION 0.1.3) +hunter_default_version(Sqlpp11 VERSION 0.57-p0) +hunter_default_version(SuiteSparse VERSION 5.1.2-p0) +hunter_default_version(TCLAP VERSION 1.2.2-p1) +hunter_default_version(TIFF VERSION 4.0.2-p5) +hunter_default_version(Tesseract VERSION 3.05.01-hunter-3) +hunter_default_version(Urho3D VERSION 1.7-p15) +hunter_default_version(VulkanMemoryAllocator VERSION 2.1.0-p0) +hunter_default_version(WDC VERSION 1.1.5) +hunter_default_version(WTL VERSION 9.1.5321) +hunter_default_version(Washer VERSION 0.1.2) +hunter_default_version(WebKit VERSION 0.0.2-p0) +hunter_default_version(WebP VERSION 1.0.2-p3) +hunter_default_version(WinSparkle VERSION 0.4.0) +hunter_default_version(YAJL VERSION 2.1.0-p0) +hunter_default_version(ZLIB VERSION 1.2.11-p1) +hunter_default_version(ZMQPP VERSION 4.2.0-p0) +hunter_default_version(ZeroMQ VERSION 4.2.3-p1) + +hunter_default_version(acf VERSION 0.1.14) +hunter_default_version(actionlib VERSION 1.11.13-p0) +hunter_default_version(aes VERSION 0.0.1-p1) +hunter_default_version(aglet VERSION 1.2.2) +hunter_default_version(android_arm64_v8a_system_image_packer VERSION 1.0.0) +hunter_default_version(android_arm_eabi_v7a_system_image_packer VERSION 1.0) +hunter_default_version(android_build_tools_packer VERSION 1.0.0) +hunter_default_version(android_google_apis_intel_x86_atom_system_image_packer VERSION 1.0.0) +hunter_default_version(android_google_apis_packer VERSION 1.0.0) +hunter_default_version(android_google_repository_packer VERSION 1.0.0) +hunter_default_version(android_intel_x86_atom_system_image_packer VERSION 1.0.0) +hunter_default_version(android_mips_system_image_packer VERSION 1.0.0) +hunter_default_version(android_sdk_packer VERSION 1.0.0) +hunter_default_version(android_sdk_platform_packer VERSION 1.0.0) +hunter_default_version(android_sdk_platform_tools_packer VERSION 1.0.0) +hunter_default_version(android_sdk_tools_packer VERSION 1.0.3) +hunter_default_version(android_support_repository_packer VERSION 1.0.0) +hunter_default_version(angles VERSION 1.9.11-p0) +hunter_default_version(arabica VERSION 0.0.0-a202766-p0) +hunter_default_version(autobahn-cpp VERSION 0.2.0) +hunter_default_version(autoutils VERSION 0.3.0) +hunter_default_version(aws-c-common VERSION 0.2.1-p0) +hunter_default_version(benchmark VERSION 1.4.0) +hunter_default_version(bento4 VERSION 1.5.1-628-e6ee435-p0) +hunter_default_version(binaryen VERSION 1.38.28-p1) +hunter_default_version(bison VERSION 3.0.4-p0) +hunter_default_version(boost-pba VERSION 1.0.0-p0) +hunter_default_version(botan VERSION 2.11.0-110af9494) +hunter_default_version(breakpad VERSION 0.0.0-12ecff3-p2) +hunter_default_version(bullet VERSION 2.87-p0) +hunter_default_version(c-ares VERSION 1.14.0-p0) +hunter_default_version(caffe VERSION rc3-p2) +hunter_default_version(catkin VERSION 0.7.17-p0) +hunter_default_version(cctz VERSION 2.2.0) +hunter_default_version(ccv VERSION 0.7-p6) +hunter_default_version(cereal VERSION 1.2.2-p0) +hunter_default_version(ceres-solver VERSION 1.14.0-p1) +hunter_default_version(check_ci_tag VERSION 1.0.0) +hunter_default_version(civetweb VERSION 1.11-p0) +hunter_default_version(clBLAS VERSION 2.10.0-p0) +hunter_default_version(class_loader VERSION 0.4.1-p0) +hunter_default_version(cmcstl2 VERSION 0.0.0-bee0705e99) +hunter_default_version(convertutf VERSION 1.0.1) +hunter_default_version(corrade VERSION 2019.01) +hunter_default_version(cpp_redis VERSION 3.5.0-h1) +hunter_default_version(cppcodec VERSION 0.2-p0) +hunter_default_version(cpr VERSION 1.3.0) +hunter_default_version(cpuinfo VERSION 0.0.0-d5e37ad-p0) +hunter_default_version(crashpad VERSION v0.0.1-p0) +hunter_default_version(crashup VERSION 0.0.2) +hunter_default_version(crc32c VERSION 1.0.5) +hunter_default_version(cryptopp VERSION 8.2.0-p0) +hunter_default_version(ctti VERSION 0.0.2) +hunter_default_version(cub VERSION 1.8.0-p0) +hunter_default_version(cvmatio VERSION 1.0.28) +hunter_default_version(cvsteer VERSION 0.1.2) +hunter_default_version(cxxopts VERSION 2.1.1-pre) +hunter_default_version(czmq VERSION 4.0.2-p1) +hunter_default_version(damageproto VERSION 1.2.1) +hunter_default_version(date VERSION 2.4.1) +hunter_default_version(dbus VERSION 1.10.0-hunter-4) +hunter_default_version(debug_assert VERSION 1.3.2) +hunter_default_version(dest VERSION 0.8.0-p4) +hunter_default_version(dlib VERSION 19.17-p0) +hunter_default_version(dlpack VERSION 0.2-0acb731) +hunter_default_version(dmlc-core VERSION 0.3-3943914-p0) +hunter_default_version(doctest VERSION 2.2.0) +hunter_default_version(double-conversion VERSION 3.1.4) +hunter_default_version(draco VERSION 1.3.4-p0) +hunter_default_version(dri2proto VERSION 2.8) +hunter_default_version(dri3proto VERSION 1.0) +hunter_default_version(drishti VERSION 0.8.9) +hunter_default_version(drishti_assets VERSION 1.8) +hunter_default_version(drishti_faces VERSION 1.2) +hunter_default_version(drm VERSION 2.4.94) +hunter_default_version(duktape VERSION 2.2.1-p0) +hunter_default_version(dynalo VERSION 1.0.3) +hunter_default_version(eigen3-nnls VERSION 1.0.1) +hunter_default_version(enet VERSION 1.3.13-p1) +hunter_default_version(entityx VERSION 1.3.0-p1) +hunter_default_version(eos VERSION 0.12.1) +hunter_default_version(ethash VERSION 0.5.0) +hunter_default_version(farmhash VERSION 1.1) +hunter_default_version(ffmpeg VERSION n4.1-dev-45499e557c-p7) +hunter_default_version(fft2d VERSION 1.0.0-p0) +hunter_default_version(fixesproto VERSION 5.0) +hunter_default_version(flatbuffers VERSION 1.8.0-p1) +hunter_default_version(flex VERSION 2.6.4) +hunter_default_version(fmt VERSION 5.2.1) +hunter_default_version(folly VERSION 2018.10.22.00-p4) +hunter_default_version(freetype VERSION 2.9.1-p1) +hunter_default_version(frugally-deep VERSION 0.2.2-p0) +hunter_default_version(gRPC VERSION 1.17.2-p0) +hunter_default_version(gauze VERSION 0.7.1) +hunter_default_version(gemmlowp VERSION 1.0.0) +hunter_default_version(geos VERSION 3.4.2) +hunter_default_version(getopt VERSION 1.0.0-p0) +hunter_default_version(gflags VERSION 2.2.1) +hunter_default_version(giflib VERSION 5.1.4-p1) +hunter_default_version(glbinding VERSION 3.0.2-p0) +hunter_default_version(glew VERSION 2.0.0-p1) +hunter_default_version(glfw VERSION 3.3.0-f9923e9-p0) +hunter_default_version(glib VERSION 2.54.0) if(ANDROID) - string(COMPARE EQUAL "${ANDROID_NATIVE_API_LEVEL}" "" _is_empty) + #compile error in the latest glm on Android + hunter_default_version(glm VERSION 0.9.9.0) +else() + hunter_default_version(glm VERSION 0.9.9.2) +endif() +hunter_default_version(globjects VERSION 1.1.0-p0) +hunter_default_version(glog VERSION 0.4.0) +hunter_default_version(glproto VERSION 1.4.17) +hunter_default_version(glslang VERSION 7.7.2767-p0) +hunter_default_version(gst_plugins_bad VERSION 1.10.4) +hunter_default_version(gst_plugins_base VERSION 1.10.4) +hunter_default_version(gst_plugins_good VERSION 1.10.4) +hunter_default_version(gst_plugins_ugly VERSION 1.10.4) +hunter_default_version(gstreamer VERSION 1.10.4) +hunter_default_version(gumbo VERSION 0.10.1) +hunter_default_version(h3 VERSION 3.0.7) +hunter_default_version(half VERSION 1.1.0-p1) +hunter_default_version(harfbuzz VERSION 1.7.6-p2) +hunter_default_version(hdf5 VERSION 1.10.5-hp5) +hunter_default_version(highwayhash VERSION 0.0.0) +hunter_default_version(http-parser VERSION 2.8.0) +hunter_default_version(hunter_venv VERSION 1.0.1) +hunter_default_version(ice VERSION 1.0.9) +hunter_default_version(icu-le-hb VERSION 1.0.3-231788a-p0) +hunter_default_version(icu-lx VERSION 63.1-p1) +hunter_default_version(imagequant VERSION 2.12.2-p0) +hunter_default_version(imgui VERSION 1.70.p0) +hunter_default_version(imshow VERSION 1.0.0-p0) +hunter_default_version(inja VERSION 0.1.1) +hunter_default_version(inputproto VERSION 2.3) +hunter_default_version(intltool VERSION 0.51.0) +hunter_default_version(intsizeof VERSION 2.0.2) +hunter_default_version(intx VERSION 0.2.0) +hunter_default_version(ios_sim VERSION 3.1.1) +hunter_default_version(ippicv VERSION 20151201) +hunter_default_version(iroha-ed25519 VERSION 2.0.0) +hunter_default_version(irrXML VERSION 1.2-p0) +hunter_default_version(jaegertracing VERSION 0.4.1) +hunter_default_version(jansson VERSION 2.11.0) +hunter_default_version(jasper VERSION 2.0.14-p3) +hunter_default_version(jo_jpeg VERSION 0.0.1) + +if(MSVC_VERSION LESS 1600) + # for VS10 - version without support C++11 + hunter_default_version(jsoncpp VERSION 0.7.0) +else() + hunter_default_version(jsoncpp VERSION 1.8.0) +endif() + +hunter_default_version(kNet VERSION 2.7-p1) +hunter_default_version(kbproto VERSION 1.0.7) +hunter_default_version(lcms VERSION 2.9-p0) +hunter_default_version(lehrfempp VERSION 0.7.20) +hunter_default_version(leveldb VERSION 1.22) +hunter_default_version(libcpuid VERSION 0.4.0) +hunter_default_version(libdaemon VERSION 0.14) +hunter_default_version(libdill VERSION 1.6) +hunter_default_version(libevhtp VERSION 1.2.16-p4) +hunter_default_version(libffi VERSION 3.2.1) +hunter_default_version(libigl VERSION 2.0.0-e33f534-p1) +hunter_default_version(libjson-rpc-cpp VERSION 0.7.0-p3) +hunter_default_version(libmill VERSION 1.18) +hunter_default_version(libogg VERSION 1.3.3-p0) +hunter_default_version(libpcre VERSION 8.41) +hunter_default_version(librtmp VERSION 2.4.0-p0) +hunter_default_version(libscrypt VERSION 1.21-p1) +hunter_default_version(libsodium VERSION 1.0.16-p0) +hunter_default_version(libunibreak VERSION 4.0) +hunter_default_version(libusb VERSION 1.0.22) +hunter_default_version(libuv VERSION 1.24.0-p1) +hunter_default_version(libxdg-basedir VERSION 1.2.0) +hunter_default_version(libxml2 VERSION 2.9.7-p0) +hunter_default_version(libyuv VERSION 1514-p3) +hunter_default_version(libzip VERSION 1.5.2-d68a667-p0) +hunter_default_version(lmdb VERSION 0.9.21-p2) +hunter_default_version(lmdbxx VERSION 0.9.14.0) +hunter_default_version(log4cplus VERSION 1.2.0-p0) +hunter_default_version(lz4 VERSION 1.8.0-p2) +hunter_default_version(lzma VERSION 5.2.3-p4) +hunter_default_version(magnum VERSION 2019.01) +hunter_default_version(md5 VERSION 1.6) +hunter_default_version(mini_chromium VERSION 0.0.1-p2) +hunter_default_version(minizip VERSION 1.0.1-p3) +hunter_default_version(mkl VERSION 20190502) +hunter_default_version(mkldnn VERSION 0.19-p0) +hunter_default_version(mng VERSION 2.0.3-p2) +hunter_default_version(mojoshader VERSION 0.0.1) +hunter_default_version(mongoose VERSION 6.10) +hunter_default_version(mpark_variant VERSION 1.0.0) +hunter_default_version(msgpack VERSION 1.4.1-p2) +hunter_default_version(mshadow VERSION 1.1-1d79ecf-p0) +hunter_default_version(mtplz VERSION 0.1-p3) +hunter_default_version(mxnet VERSION 1.5.0.rc1-b64e00a-p0) +hunter_default_version(nanoflann VERSION 1.2.3-p0) +hunter_default_version(nanosvg VERSION 0.0.0-2b08dee-p0) +hunter_default_version(ncnn VERSION 20180314-p2) +hunter_default_version(ncursesw VERSION 6.1) +hunter_default_version(nlohmann_fifo_map VERSION 0.0.0-0dfbf5d-p1) +hunter_default_version(nlohmann_json VERSION 3.6.1) +hunter_default_version(nsync VERSION 1.14-p1) +hunter_default_version(odb VERSION 2.4.0) +hunter_default_version(odb-boost VERSION 2.4.0) +hunter_default_version(odb-compiler VERSION 2.4.0) +hunter_default_version(odb-mysql VERSION 2.4.0) +hunter_default_version(odb-pgsql VERSION 2.4.0) +hunter_default_version(odb-sqlite VERSION 2.4.0) +hunter_default_version(ogles_gpgpu VERSION 0.3.6) +hunter_default_version(oniguruma VERSION 6.8.1-p0) +hunter_default_version(onmt VERSION 0.4.1-p2) +hunter_default_version(openddlparser VERSION 0.1.0-p2) +hunter_default_version(opentracing-cpp VERSION 1.5.0) +hunter_default_version(pcg VERSION 0.0.0-p1) +hunter_default_version(pciaccess VERSION 0.13.4) +hunter_default_version(pcre2 VERSION 10.13-p0) +hunter_default_version(pegtl VERSION 2.8.1) + +# pip packages +hunter_default_version(pip_GitPython VERSION 2.1.11) +hunter_default_version(pip_astroid VERSION 2.2.5) +hunter_default_version(pip_boto3 VERSION 1.9.130) +hunter_default_version(pip_botocore VERSION 1.12.130) +hunter_default_version(pip_certifi VERSION 2019.3.9) +hunter_default_version(pip_chardet VERSION 3.0.4) +hunter_default_version(pip_cpplint VERSION 1.4.4) +hunter_default_version(pip_decorator VERSION 4.4.0) +hunter_default_version(pip_gitdb VERSION 2.0.5) +hunter_default_version(pip_idna VERSION 2.8) +hunter_default_version(pip_jmespath VERSION 0.9.4) +hunter_default_version(pip_lazy-object-proxy VERSION 1.3.1) +hunter_default_version(pip_nose VERSION 1.3.7) +hunter_default_version(pip_nose-timer VERSION 0.7.5) +hunter_default_version(pip_numpy VERSION 1.16.2) +hunter_default_version(pip_pylint VERSION 2.3.1) +hunter_default_version(pip_python-dateutil VERSION 2.8.0) +hunter_default_version(pip_requests VERSION 2.21.0) +hunter_default_version(pip_six VERSION 1.12.0) +hunter_default_version(pip_smmap VERSION 2.0.5) +hunter_default_version(pip_urllib3 VERSION 1.24.1) +hunter_default_version(pip_wrapt VERSION 1.11.1) + +hunter_default_version(pluginlib VERSION 1.12.1-p0) +hunter_default_version(poly2tri VERSION 1.0.0) +hunter_default_version(polyclipping VERSION 4.8.8-p0) # for Assimp +hunter_default_version(presentproto VERSION 1.0) +hunter_default_version(prometheus-cpp VERSION 0.6.0-p2) +hunter_default_version(protobuf-c VERSION 1.3.0-p1) +hunter_default_version(pthread-stubs VERSION 0.4) +hunter_default_version(pugixml VERSION 1.8.1) +hunter_default_version(pybind11 VERSION 2.2.4) +hunter_default_version(qhull VERSION 7.2.0-p1) +hunter_default_version(quickjs VERSION 2019-07-21-p0) +hunter_default_version(rabbitmq-c VERSION 0.7.0-p1) +hunter_default_version(rabit VERSION 0.0.0-p2) +hunter_default_version(randrproto VERSION 1.3.2) +hunter_default_version(rang VERSION 3.1.0-p0) + +if(MSVC) + if(MSVC_VERSION LESS 1916) + hunter_default_version(range-v3 VERSION vcpkg5-p) + else() + hunter_default_version(range-v3 VERSION 0.5.0) + endif() +else() + hunter_default_version(range-v3 VERSION 0.5.0) +endif() + +hunter_default_version(re2 VERSION 2017.11.01-p0) +hunter_default_version(readline VERSION 6.3) +hunter_default_version(recastnavigation VERSION 1.4-p0) +hunter_default_version(renderproto VERSION 0.11.1) +hunter_default_version(rocksdb VERSION 5.14.2) +hunter_default_version(ros VERSION 1.14.6-p0) +hunter_default_version(ros_comm VERSION 1.14.3-p1) +hunter_default_version(ros_comm_msgs VERSION 1.11.2-p0) +hunter_default_version(ros_common_msgs VERSION 1.12.7-p0) +hunter_default_version(ros_console_bridge VERSION 0.4.3-p0) +hunter_default_version(ros_environment VERSION 1.2.1-p0) +hunter_default_version(ros_gencpp VERSION 0.6.2-p0) +hunter_default_version(ros_geneus VERSION 2.2.6-p0) +hunter_default_version(ros_genlisp VERSION 0.4.16-p0) +hunter_default_version(ros_genmsg VERSION 0.5.12-p0) +hunter_default_version(ros_gennodejs VERSION 2.0.1-p0) +hunter_default_version(ros_genpy VERSION 0.6.8-p0) +hunter_default_version(ros_message_generation VERSION 0.4.0-p0) +hunter_default_version(ros_message_runtime VERSION 0.4.12-p0) +hunter_default_version(ros_std_msgs VERSION 0.5.12-p0) +hunter_default_version(rosconsole VERSION 1.13.10-p0) +hunter_default_version(roscpp_core VERSION 0.6.12-p0) +hunter_default_version(rospack VERSION 2.5.3-p0) +hunter_default_version(s3 VERSION 0.0.0-287e4be-p1) +hunter_default_version(sds VERSION 2.0.0) +hunter_default_version(sentencepiece VERSION 0.1.8-p1) +hunter_default_version(shaka_player_embedded VERSION 0.1.0-beta-p1) +hunter_default_version(sleef VERSION 3.3.1-p1) +hunter_default_version(sm VERSION 1.2.3) +hunter_default_version(soil VERSION 1.0.4) +hunter_default_version(sources_for_android_sdk_packer VERSION 1.0.0) +hunter_default_version(sparsehash VERSION 2.0.2) + +if(MSVC_VERSION LESS 1800) + # for VS12 - version without support C++11 + hunter_default_version(spdlog VERSION 1.0.0-p0) +else() + hunter_default_version(spdlog VERSION 1.3.1-p0) +endif() + +hunter_default_version(spirv-cross VERSION 20190220) +hunter_default_version(sqlite3 VERSION 3.27.2-p0) +hunter_default_version(sse2neon VERSION 1.0.0-p0) +hunter_default_version(stanhull VERSION 0.0.1) +hunter_default_version(state_machine VERSION 1.1) +hunter_default_version(stb VERSION 0.0.0-e6afb9c-p0) +hunter_default_version(stdext-path VERSION 0.0.1-p0) +hunter_default_version(stormlib VERSION 9.21-p1) +hunter_default_version(sugar VERSION 1.3.0) +hunter_default_version(szip VERSION 2.1.0-p1) +hunter_default_version(tacopie VERSION 3.2.0-h1) +hunter_default_version(taocpp-json VERSION 1.0.0-beta.11-e0895587) +hunter_default_version(tcl VERSION core8.6.8) +hunter_default_version(termcolor VERSION 1.0.0) +hunter_default_version(tf VERSION 1.12.0-p0) +hunter_default_version(tf2 VERSION 0.6.5-p0) +hunter_default_version(thread-pool-cpp VERSION 1.1.0) +hunter_default_version(thrift VERSION 0.12.0-p0) +hunter_default_version(tinydir VERSION 1.2-p0) +hunter_default_version(tinyxml2 VERSION 6.2.0-p1) +hunter_default_version(tmxparser VERSION 2.1.0-ab4125b-p1) +hunter_default_version(toluapp VERSION 1.0.93-p1) +hunter_default_version(tomcrypt VERSION 1.18.2-p1) +hunter_default_version(tommath VERSION 1.0.1-p0) +hunter_default_version(tvm VERSION 0.5-a4bc50e-p0) +hunter_default_version(type_safe VERSION 0.2.1-p2) +hunter_default_version(units VERSION 2.3.1) +hunter_default_version(utf8 VERSION 2.3.4-p1) +hunter_default_version(util_linux VERSION 2.30.1) +hunter_default_version(v8 VERSION 7.4.98-p3) +hunter_default_version(vectorial VERSION 0.0.0-ae7dc88-p0) +hunter_default_version(vorbis VERSION 1.3.6-p1) +hunter_default_version(websocketpp VERSION 0.8.1-p0) +hunter_default_version(wt VERSION 4.0.4-p0) +hunter_default_version(wxWidgets VERSION 3.0.2) +hunter_default_version(wyrm VERSION 0.1.0) +hunter_default_version(x11 VERSION 1.6.7) +hunter_default_version(x264 VERSION snapshot-20190513-2245) +hunter_default_version(xau VERSION 1.0.9) +hunter_default_version(xcb VERSION 1.13) +hunter_default_version(xcb-proto VERSION 1.13) +hunter_default_version(xcursor VERSION 1.1.13) +hunter_default_version(xdamage VERSION 1.1.4) +hunter_default_version(xext VERSION 1.3.1) +hunter_default_version(xextproto VERSION 7.3.0) +hunter_default_version(xf86vidmodeproto VERSION 2.3.1) +hunter_default_version(xfixes VERSION 5.0.3) +hunter_default_version(xgboost VERSION 0.7.0-p4) +hunter_default_version(xi VERSION 1.6.1) +hunter_default_version(xinerama VERSION 1.1.2) +hunter_default_version(xineramaproto VERSION 1.1.2) +hunter_default_version(xorg-macros VERSION 1.19.2) +hunter_default_version(xproto VERSION 7.0.31) +hunter_default_version(xrandr VERSION 1.3.2) +hunter_default_version(xrender VERSION 0.9.7) +hunter_default_version(xshmfence VERSION 1.3) +hunter_default_version(xtrans VERSION 1.4.0) +hunter_default_version(xxf86vm VERSION 1.1.2) +hunter_default_version(xxhash VERSION 0.6.5-p0) +hunter_default_version(yaml-cpp VERSION 0.6.2-0f9a586-p1) +hunter_default_version(zip VERSION 0.1.15) +hunter_default_version(zookeeper VERSION 3.4.9-p2) + +if(ANDROID) + string(COMPARE EQUAL "${CMAKE_SYSTEM_VERSION}" "" _is_empty) if(_is_empty) - hunter_user_error("ANDROID_NATIVE_API_LEVEL is empty") + hunter_user_error("CMAKE_SYSTEM_VERSION is empty") endif() - string(COMPARE EQUAL "${ANDROID_NATIVE_API_LEVEL}" "21" _is_api_21) - string(COMPARE EQUAL "${ANDROID_NATIVE_API_LEVEL}" "19" _is_api_19) - string(COMPARE EQUAL "${ANDROID_NATIVE_API_LEVEL}" "16" _is_api_16) + string(COMPARE EQUAL "${CMAKE_SYSTEM_VERSION}" "24" _is_api_24) + string(COMPARE EQUAL "${CMAKE_SYSTEM_VERSION}" "22" _is_api_22) + 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) + + set(__HUNTER_LAST_DEFAULT_VERSION_NAME "") # Reset alphabetical order checker 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_default_version(Android-ARM-EABI-v7a-System-Image VERSION 21_r04) + hunter_default_version(Android-Google-APIs VERSION 21_r01) + hunter_default_version(Android-Google-APIs-Intel-x86-Atom-System-Image VERSION 21_r10) + hunter_default_version(Android-Intel-x86-Atom-System-Image VERSION 21_r05) + hunter_default_version(Android-SDK-Platform VERSION 21_r02) + hunter_default_version(Sources-for-Android-SDK VERSION 21) 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_default_version(Android-ARM-EABI-v7a-System-Image VERSION 19_r05) + hunter_default_version(Android-Google-APIs VERSION 19_r18) + hunter_default_version(Android-Intel-x86-Atom-System-Image VERSION 19) + hunter_default_version(Android-SDK-Platform VERSION 19_r04) + hunter_default_version(Sources-for-Android-SDK VERSION 19) 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) + hunter_default_version(Android-ARM-EABI-v7a-System-Image VERSION 16_r04) + hunter_default_version(Android-Google-APIs VERSION 16_r04) + hunter_default_version(Android-Intel-x86-Atom-System-Image VERSION 16) + hunter_default_version(Android-MIPS-System-Image VERSION 16_r04) + hunter_default_version(Android-SDK-Platform VERSION 16_r05) + hunter_default_version(Sources-for-Android-SDK VERSION 16) + elseif(_is_api_22) + hunter_default_version(Android-ARM-EABI-v7a-System-Image VERSION 22_r02) + hunter_default_version(Android-Google-APIs VERSION 22_r01) + hunter_default_version(Android-Google-APIs-Intel-x86-Atom-System-Image VERSION 22_r21) + hunter_default_version(Android-Intel-x86-Atom-System-Image VERSION 22_r06) + hunter_default_version(Android-SDK-Platform VERSION 22_r02) + hunter_default_version(Sources-for-Android-SDK VERSION 22) + elseif(_is_api_24) + hunter_default_version(Android-ARM-EABI-v7a-System-Image VERSION 24_r07) + hunter_default_version(Android-ARM64-v8a-System-Image VERSION 24_r07) + hunter_default_version(Android-Google-APIs VERSION 24_r1) + hunter_default_version(Android-Google-APIs-Intel-x86-Atom-System-Image VERSION 24_r20) + hunter_default_version(Android-Intel-x86-Atom-System-Image VERSION 24_r08) + hunter_default_version(Android-SDK-Platform VERSION 24_r02) + hunter_default_version(Sources-for-Android-SDK VERSION 24) else() - hunter_user_error( - "Android API (ANDROID_NATIVE_API_LEVEL)" - " Expected: `21`, `19`, `16`" - " Got: `${ANDROID_NATIVE_API_LEVEL}`" - ) + # TODO: Add more versions endif() endif() diff --git a/cmake/find/FindBoost.cmake b/cmake/find/FindBoost.cmake index de7c74add..c3f3a9cb5 100644 --- a/cmake/find/FindBoost.cmake +++ b/cmake/find/FindBoost.cmake @@ -1030,6 +1030,19 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS}) ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}-${Boost_LIB_VERSION} ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG} ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT} ) + + # In Hunter it's possible to have only one variant in root, + # so it's okay to add all of them to search. + foreach(__type i x a m) + foreach(__bit 32 64) + list( + APPEND + _boost_RELEASE_NAMES + ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}-${__type}${__bit} + ) + endforeach() + endforeach() + if(_boost_STATIC_RUNTIME_WORKAROUND) set(_boost_RELEASE_STATIC_ABI_TAG "-s${_boost_RELEASE_ABI_TAG}") list(APPEND _boost_RELEASE_NAMES @@ -1072,6 +1085,19 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS}) ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG} ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED} ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT} ) + + # In Hunter it's possible to have only one variant in root, + # so it's okay to add all of them to search. + foreach(__type i x a m) + foreach(__bit 32 64) + list( + APPEND + _boost_DEBUG_NAMES + ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}-${__type}${__bit} + ) + endforeach() + endforeach() + if(_boost_STATIC_RUNTIME_WORKAROUND) set(_boost_DEBUG_STATIC_ABI_TAG "-s${_boost_DEBUG_ABI_TAG}") list(APPEND _boost_DEBUG_NAMES diff --git a/cmake/find/FindEigen.cmake b/cmake/find/FindEigen.cmake deleted file mode 100644 index 7158a593b..000000000 --- a/cmake/find/FindEigen.cmake +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright (c) 2015, Ruslan Baratov -# All rights reserved. - -if(NOT TARGET Eigen::eigen) - add_library(Eigen::eigen INTERFACE IMPORTED) - set_target_properties( - Eigen::eigen - PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${HUNTER_INSTALL_PREFIX}/include/eigen3" - ) -endif() diff --git a/cmake/find/FindJPEG.cmake b/cmake/find/FindJPEG.cmake deleted file mode 100644 index c5257e8f4..000000000 --- a/cmake/find/FindJPEG.cmake +++ /dev/null @@ -1,22 +0,0 @@ -if(HUNTER_STATUS_DEBUG) - message("[hunter] Custom FindJPEG module") -endif() - -find_package(JPEG CONFIG REQUIRED) -set(JPEG_LIBRARY JPEG::jpeg) -set(JPEG_INCLUDE_DIR "${JPEG_ROOT}/include") - -# handle the QUIETLY and REQUIRED arguments and set JPEG_FOUND to TRUE if -# all listed variables are TRUE -include(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(JPEG REQUIRED_VARS JPEG_LIBRARY JPEG_INCLUDE_DIR) - -if(JPEG_FOUND) - set(JPEG_LIBRARIES ${JPEG_LIBRARY}) -endif() - -# Do not mark as advanced: -# * JPEG_INCLUDE_DIR -# * JPEG_LIBRARY -# Problem with FindJasper. Looks like it's loading standard module anyway so -# expect some variables to be visible, otherwise will start a search again. diff --git a/cmake/find/FindLibR.cmake b/cmake/find/FindLibR.cmake new file mode 100644 index 000000000..db2b89a10 --- /dev/null +++ b/cmake/find/FindLibR.cmake @@ -0,0 +1,183 @@ +# CMake module for R +# Borrows ideas from RStudio's FindLibR.cmake +# +# Defines the following: +# LIBR_FOUND +# LIBR_HOME +# LIBR_EXECUTABLE +# LIBR_INCLUDE_DIRS +# LIBR_LIB_DIR +# LIBR_CORE_LIBRARY +# and a cmake function to create R.lib for MSVC +# +# The following could be provided by user through cmake's -D options: +# LIBR_EXECUTABLE (for unix and win) +# R_VERSION (for win) +# R_ARCH (for win 64 when want 32 bit build) +# +# TODO: +# - someone to verify OSX detection, +# - possibly, add OSX detection based on current R in PATH or LIBR_EXECUTABLE +# - improve registry-based R_HOME detection in Windows (from a set of R_VERSION's) + + +# Windows users might want to change this to their R version: +if(NOT R_VERSION) + set(R_VERSION "3.4.1") +endif() +if(NOT R_ARCH) + if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4") + set(R_ARCH "i386") + else() + set(R_ARCH "x64") + endif() +endif() + + +# Creates R.lib and R.def in the build directory for linking with MSVC +function(create_rlib_for_msvc) + # various checks and warnings + if(NOT WIN32 OR NOT MSVC) + message(FATAL_ERROR "create_rlib_for_msvc() can only be used with MSVC") + endif() + if(NOT EXISTS "${LIBR_LIB_DIR}") + message(FATAL_ERROR "LIBR_LIB_DIR was not set!") + endif() + find_program(GENDEF_EXE gendef) + find_program(DLLTOOL_EXE dlltool) + if(NOT GENDEF_EXE OR NOT DLLTOOL_EXE) + message(FATAL_ERROR "\nEither gendef.exe or dlltool.exe not found!\ + \nDo you have Rtools installed with its MinGW's bin/ in PATH?") + endif() + # extract symbols from R.dll into R.def and R.lib import library + execute_process(COMMAND gendef + "-" "${LIBR_LIB_DIR}/R.dll" + OUTPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/R.def") + execute_process(COMMAND dlltool + "--input-def" "${CMAKE_CURRENT_BINARY_DIR}/R.def" + "--output-lib" "${CMAKE_CURRENT_BINARY_DIR}/R.lib") +endfunction(create_rlib_for_msvc) + + +# detection for OSX +if(APPLE) + + find_library(LIBR_LIBRARIES R) + + if(LIBR_LIBRARIES MATCHES ".*\\.framework") + set(LIBR_HOME "${LIBR_LIBRARIES}/Resources" CACHE PATH "R home directory") + set(LIBR_INCLUDE_DIRS "${LIBR_HOME}/include" CACHE PATH "R include directory") + set(LIBR_EXECUTABLE "${LIBR_HOME}/R" CACHE PATH "R executable") + set(LIBR_LIB_DIR "${LIBR_HOME}/lib" CACHE PATH "R lib directory") + else() + get_filename_component(_LIBR_LIBRARIES "${LIBR_LIBRARIES}" REALPATH) + get_filename_component(_LIBR_LIBRARIES_DIR "${_LIBR_LIBRARIES}" DIRECTORY) + set(LIBR_EXECUTABLE "${_LIBR_LIBRARIES_DIR}/../bin/R") + execute_process( + COMMAND ${LIBR_EXECUTABLE} "--slave" "--vanilla" "-e" "cat(R.home())" + OUTPUT_VARIABLE LIBR_HOME) + set(LIBR_HOME ${LIBR_HOME} CACHE PATH "R home directory") + set(LIBR_INCLUDE_DIRS "${LIBR_HOME}/include" CACHE PATH "R include directory") + set(LIBR_LIB_DIR "${LIBR_HOME}/lib" CACHE PATH "R lib directory") + endif() + +# detection for UNIX & Win32 +else() + + # attempt to find R executable + if(NOT LIBR_EXECUTABLE) + find_program(LIBR_EXECUTABLE NAMES R R.exe) + endif() + + if(UNIX) + + if(NOT LIBR_EXECUTABLE) + message(FATAL_ERROR "Unable to locate R executable.\ + \nEither add its location to PATH or provide it through the LIBR_EXECUTABLE cmake variable") + endif() + + # ask R for the home path + execute_process( + COMMAND ${LIBR_EXECUTABLE} "--slave" "--vanilla" "-e" "cat(R.home())" + OUTPUT_VARIABLE LIBR_HOME + ) + # ask R for the include dir + execute_process( + COMMAND ${LIBR_EXECUTABLE} "--slave" "--no-save" "-e" "cat(R.home('include'))" + OUTPUT_VARIABLE LIBR_INCLUDE_DIRS + ) + # ask R for the lib dir + execute_process( + COMMAND ${LIBR_EXECUTABLE} "--slave" "--no-save" "-e" "cat(R.home('lib'))" + OUTPUT_VARIABLE LIBR_LIB_DIR + ) + + # Windows + else() + # ask R for R_HOME + if(LIBR_EXECUTABLE) + execute_process( + COMMAND ${LIBR_EXECUTABLE} "--slave" "--no-save" "-e" "cat(normalizePath(R.home(), winslash='/'))" + OUTPUT_VARIABLE LIBR_HOME) + endif() + # if R executable not available, query R_HOME path from registry + if(NOT LIBR_HOME) + get_filename_component(LIBR_HOME + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\R-core\\R\\${R_VERSION};InstallPath]" + ABSOLUTE) + if(NOT LIBR_HOME) + message(FATAL_ERROR "\nUnable to locate R executable.\ + \nEither add its location to PATH or provide it through the LIBR_EXECUTABLE cmake variable") + endif() + endif() + # set exe location based on R_ARCH + if(NOT LIBR_EXECUTABLE) + set(LIBR_EXECUTABLE "${LIBR_HOME}/bin/${R_ARCH}/R.exe") + endif() + # set other R paths based on home path + set(LIBR_INCLUDE_DIRS "${LIBR_HOME}/include") + set(LIBR_LIB_DIR "${LIBR_HOME}/bin/${R_ARCH}") + +message(STATUS "LIBR_HOME [${LIBR_HOME}]") +message(STATUS "LIBR_EXECUTABLE [${LIBR_EXECUTABLE}]") +message(STATUS "LIBR_INCLUDE_DIRS [${LIBR_INCLUDE_DIRS}]") +message(STATUS "LIBR_LIB_DIR [${LIBR_LIB_DIR}]") +message(STATUS "LIBR_CORE_LIBRARY [${LIBR_CORE_LIBRARY}]") + + endif() + +endif() + +if(WIN32 AND MSVC) + # create a local R.lib import library for R.dll if it doesn't exist + if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/R.lib") + create_rlib_for_msvc() + endif() +endif() + +# look for the core R library +find_library(LIBR_CORE_LIBRARY NAMES R + HINTS "${CMAKE_CURRENT_BINARY_DIR}" "${LIBR_LIB_DIR}" "${LIBR_HOME}/bin" "${LIBR_LIBRARIES}") +if(LIBR_CORE_LIBRARY-NOTFOUND) + message(STATUS "Could not find R core shared library.") +endif() + +set(LIBR_HOME ${LIBR_HOME} CACHE PATH "R home directory") +set(LIBR_EXECUTABLE ${LIBR_EXECUTABLE} CACHE PATH "R executable") +set(LIBR_INCLUDE_DIRS ${LIBR_INCLUDE_DIRS} CACHE PATH "R include directory") +set(LIBR_LIB_DIR ${LIBR_LIB_DIR} CACHE PATH "R shared libraries directory") +set(LIBR_CORE_LIBRARY ${LIBR_CORE_LIBRARY} CACHE PATH "R core shared library") + +# define find requirements +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(LibR DEFAULT_MSG + LIBR_HOME + LIBR_EXECUTABLE + LIBR_INCLUDE_DIRS + LIBR_LIB_DIR + LIBR_CORE_LIBRARY +) + +if(LIBR_FOUND) + message(STATUS "Found R: ${LIBR_EXECUTABLE}") +endif() diff --git a/cmake/find/FindOpenSSL.cmake b/cmake/find/FindOpenSSL.cmake index e765c99e2..c9265523f 100644 --- a/cmake/find/FindOpenSSL.cmake +++ b/cmake/find/FindOpenSSL.cmake @@ -118,8 +118,11 @@ if(WIN32 AND NOT CYGWIN) find_library(LIB_EAY_DEBUG NAMES + libcrypto${_OPENSSL_MSVC_RT_MODE}d + libcryptod libeay32${_OPENSSL_MSVC_RT_MODE}d libeay32d + cryptod HINTS "${OPENSSL_ROOT}" PATH_SUFFIXES @@ -128,8 +131,11 @@ if(WIN32 AND NOT CYGWIN) find_library(LIB_EAY_RELEASE NAMES + libcrypto${_OPENSSL_MSVC_RT_MODE} + libcrypto libeay32${_OPENSSL_MSVC_RT_MODE} libeay32 + crypto HINTS "${OPENSSL_ROOT}" PATH_SUFFIXES @@ -138,8 +144,11 @@ if(WIN32 AND NOT CYGWIN) find_library(SSL_EAY_DEBUG NAMES + libssl${_OPENSSL_MSVC_RT_MODE}d + libssld ssleay32${_OPENSSL_MSVC_RT_MODE}d ssleay32d + ssld HINTS "${OPENSSL_ROOT}" PATH_SUFFIXES @@ -148,6 +157,8 @@ if(WIN32 AND NOT CYGWIN) find_library(SSL_EAY_RELEASE NAMES + libssl${_OPENSSL_MSVC_RT_MODE} + libssl ssleay32${_OPENSSL_MSVC_RT_MODE} ssleay32 ssl @@ -362,8 +373,15 @@ 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) + if(WIN32) + # https://github.com/openssl/openssl/issues/1061 + set(_openssl_win32_crypt "crypt32") + else() + set(_openssl_win32_crypt "") + endif() set_target_properties(OpenSSL::Crypto PROPERTIES - INTERFACE_LINK_LIBRARIES "${CMAKE_DL_LIBS}") + INTERFACE_LINK_LIBRARIES "${CMAKE_DL_LIBS};Threads::Threads;${_openssl_win32_crypt}") if(EXISTS "${OPENSSL_CRYPTO_LIBRARY}") set_target_properties(OpenSSL::Crypto PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "C" diff --git a/cmake/find/FindSQLite3.cmake b/cmake/find/FindSQLite3.cmake deleted file mode 100644 index 7e0f4a63b..000000000 --- a/cmake/find/FindSQLite3.cmake +++ /dev/null @@ -1,67 +0,0 @@ -# ---------------------------------------------------------------------- -# FindSQLite3.cmake - SQLite3 CMake module -# -# Copyright (C) 2015 Alexandre Pretyman. All rights reserved. -# -# ---------------------------------------------------------------------- - -if(NOT HUNTER_ENABLED) - macro(hunter_status_debug) - message(${ARGV}) - endmacro() -endif() - -hunter_status_debug("SQLITE3_ROOT: ${SQLITE3_ROOT}") - -find_path( - SQLITE3_INCLUDE_DIR - sqlite3.h - PATHS - "${SQLITE3_ROOT}/include" - NO_DEFAULT_PATH -) - -hunter_status_debug("SQLITE3_INCLUDE_DIR: ${SQLITE3_INCLUDE_DIR}") - -find_library( - SQLITE3_LIBRARY - sqlite3 - PATHS - "${SQLITE3_ROOT}/lib" - NO_DEFAULT_PATH -) - -hunter_status_debug("SQLITE3_LIBRARY: ${SQLITE3_LIBRARY}") - -if(NOT TARGET "SQLite3") - if(SQLITE3_INCLUDE_DIR AND SQLITE3_LIBRARY) - set(SQLITE3_FOUND TRUE) - add_library("SQLite3" UNKNOWN IMPORTED) - set_target_properties("SQLite3" - PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${SQLITE3_INCLUDE_DIR}" - IMPORTED_LOCATION "${SQLITE3_LIBRARY}" - ) - get_filename_component( - SQLITE3_LIB_DIR - "${SQLITE3_LIBRARY}" - DIRECTORY CACHE - ) - - if(UNIX AND NOT APPLE AND NOT ANDROID) # if Linux - string(REGEX MATCH "\\.a$" _ends_in_dot_a "${SQLITE3_LIBRARY}") - string(COMPARE NOTEQUAL "${_ends_in_dot_a}" "" _sqlite_is_static) - if(_sqlite_is_static) - # when static linking we need to add pthread and dl libraries - find_package(Threads REQUIRED) - list(APPEND _sqlite3_static_library_dependencies Threads::Threads ${CMAKE_DL_LIBS}) - set_target_properties("SQLite3" - PROPERTIES - INTERFACE_LINK_LIBRARIES "${_sqlite3_static_library_dependencies}" - ) - endif() - endif() - elseif(SQLite3_FIND_REQUIRED) - message(FATAL_ERROR "Could not find SQLite3") - endif() -endif() diff --git a/cmake/find/Findaccelerate.cmake b/cmake/find/Findaccelerate.cmake new file mode 100644 index 000000000..4ed1c187e --- /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 000000000..dfc12b58b --- /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 000000000..ff6a4c770 --- /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 000000000..0d171d682 --- /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/Findapplicationservices.cmake b/cmake/find/Findapplicationservices.cmake new file mode 100644 index 000000000..9edcb6063 --- /dev/null +++ b/cmake/find/Findapplicationservices.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2017-2019, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper_framework) +hunter_find_helper_framework(FRAMEWORK "ApplicationServices") diff --git a/cmake/find/Findassetslibrary.cmake b/cmake/find/Findassetslibrary.cmake new file mode 100644 index 000000000..5f4af5516 --- /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 000000000..d9f861325 --- /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/Findaudiounit.cmake b/cmake/find/Findaudiounit.cmake new file mode 100644 index 000000000..e0e6aa682 --- /dev/null +++ b/cmake/find/Findaudiounit.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper_framework) +hunter_find_helper_framework(FRAMEWORK "AudioUnit") diff --git a/cmake/find/Findavfoundation.cmake b/cmake/find/Findavfoundation.cmake new file mode 100644 index 000000000..f17e61a6f --- /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/Findcarbon.cmake b/cmake/find/Findcarbon.cmake new file mode 100644 index 000000000..54b0db946 --- /dev/null +++ b/cmake/find/Findcarbon.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper_framework) +hunter_find_helper_framework(FRAMEWORK "Carbon") diff --git a/cmake/find/Findcoreaudio.cmake b/cmake/find/Findcoreaudio.cmake new file mode 100644 index 000000000..cf236a94d --- /dev/null +++ b/cmake/find/Findcoreaudio.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper_framework) +hunter_find_helper_framework(FRAMEWORK "CoreAudio") diff --git a/cmake/find/Findcoredata.cmake b/cmake/find/Findcoredata.cmake new file mode 100644 index 000000000..308ec63ca --- /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 000000000..fc820c989 --- /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 000000000..e6cc3bba9 --- /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 000000000..d26a8318b --- /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 000000000..19e2d1d01 --- /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/Findcoremotion.cmake b/cmake/find/Findcoremotion.cmake new file mode 100644 index 000000000..ad7c9a9f1 --- /dev/null +++ b/cmake/find/Findcoremotion.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2018, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper_framework) +hunter_find_helper_framework(FRAMEWORK "CoreMotion") diff --git a/cmake/find/Findcoretext.cmake b/cmake/find/Findcoretext.cmake new file mode 100644 index 000000000..381e4b612 --- /dev/null +++ b/cmake/find/Findcoretext.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2017-2019, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper_framework) +hunter_find_helper_framework(FRAMEWORK "CoreText") diff --git a/cmake/find/Findcorevideo.cmake b/cmake/find/Findcorevideo.cmake new file mode 100644 index 000000000..8533f7262 --- /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 000000000..72c132341 --- /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/Findforcefeedback.cmake b/cmake/find/Findforcefeedback.cmake new file mode 100644 index 000000000..d97badd29 --- /dev/null +++ b/cmake/find/Findforcefeedback.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper_framework) +hunter_find_helper_framework(FRAMEWORK "ForceFeedback") diff --git a/cmake/find/Findfoundation.cmake b/cmake/find/Findfoundation.cmake new file mode 100644 index 000000000..b825aafa7 --- /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/Findgamecontroller.cmake b/cmake/find/Findgamecontroller.cmake new file mode 100644 index 000000000..eca46844a --- /dev/null +++ b/cmake/find/Findgamecontroller.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2018, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper_framework) +hunter_find_helper_framework(FRAMEWORK "GameController") diff --git a/cmake/find/Findglapi.cmake b/cmake/find/Findglapi.cmake new file mode 100644 index 000000000..746c2eea3 --- /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 000000000..3f484274f --- /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 000000000..736036697 --- /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 000000000..aa118ab27 --- /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 000000000..9e51ece10 --- /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 000000000..65ea2258c --- /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/Findjavascriptcore.cmake b/cmake/find/Findjavascriptcore.cmake new file mode 100644 index 000000000..cd116bfbf --- /dev/null +++ b/cmake/find/Findjavascriptcore.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2019, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper_framework) +hunter_find_helper_framework(FRAMEWORK "JavaScriptCore") diff --git a/cmake/find/Findmetal.cmake b/cmake/find/Findmetal.cmake new file mode 100644 index 000000000..949aa7825 --- /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 000000000..1143c56d5 --- /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/Findodb.cmake b/cmake/find/Findodb.cmake index 04aafe4f1..3917e4cdb 100644 --- a/cmake/find/Findodb.cmake +++ b/cmake/find/Findodb.cmake @@ -80,8 +80,8 @@ foreach(_odb_component ${odb_FIND_COMPONENTS}) string(COMPARE EQUAL "${_odb_component}" "mysql" is_mysql) string(COMPARE EQUAL "${_odb_component}" "boost" is_boost) if(is_sqlite) - find_package(SQLite3 REQUIRED) - list(APPEND _component_link_libraries "SQLite3") + find_package(sqlite3 CONFIG REQUIRED) + list(APPEND _component_link_libraries "sqlite3::sqlite3") elseif(is_pgsql) find_package(PostgreSQL REQUIRED) list(APPEND _component_link_libraries "PostgreSQL::libpq") diff --git a/cmake/find/Findopengles.cmake b/cmake/find/Findopengles.cmake new file mode 100644 index 000000000..e3824a306 --- /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 000000000..cb4b756b7 --- /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 000000000..091f550dc --- /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/Findreadline.cmake b/cmake/find/Findreadline.cmake new file mode 100644 index 000000000..0009fa754 --- /dev/null +++ b/cmake/find/Findreadline.cmake @@ -0,0 +1,23 @@ + +# The readline library is autotools-based, but does not include +# pkgconfig files. So, a find module is needed to locate the outputs. +find_library(readline_library "libreadline.a") +find_library(history_library "libhistory.a") +find_path(readline_INCLUDE_DIRS readline/readline.h) + +find_package(ncursesw CONFIG REQUIRED) + +add_library("readline::readline" UNKNOWN IMPORTED) +set_target_properties("readline::readline" + PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${readline_INCLUDE_DIRS}" + IMPORTED_LOCATION "${readline_library}" + INTERFACE_LINK_LIBRARIES PkgConfig::ncursesw +) + +add_library("readline::history" UNKNOWN IMPORTED) +set_target_properties("readline::history" + PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${readline_INCLUDE_DIRS}" + IMPORTED_LOCATION "${history_library}" +) diff --git a/cmake/find/Findtcl.cmake b/cmake/find/Findtcl.cmake new file mode 100644 index 000000000..abfea5440 --- /dev/null +++ b/cmake/find/Findtcl.cmake @@ -0,0 +1,39 @@ +find_path( + TCL_INCLUDE_DIR + tcl.h + PATHS + "${TCL_ROOT}/include" + NO_DEFAULT_PATH +) + +find_library( + TCL_LIBRARY + tcl8.6 + PATHS + "${TCL_ROOT}/lib" + NO_DEFAULT_PATH +) + +set(interface_libraries m z) +if(ANDROID) + list(APPEND interface_libraries dl) +elseif(APPLE) + list(APPEND interface_libraries pthread) +else() + list(APPEND interface_libraries dl pthread) +endif() + +if(NOT TARGET "tcl::tcl") + if(NOT TCL_LIBRARY) + message(FATAL_ERROR "TCL_LIBRARY not found!") + endif() + add_library("tcl::tcl" UNKNOWN IMPORTED) + set_target_properties( + "tcl::tcl" + PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${TCL_INCLUDE_DIR}" + IMPORTED_LOCATION "${TCL_LIBRARY}" + IMPORTED_LINK_INTERFACE_LIBRARIES "${interface_libraries}" + ) + set(TCL_FOUND TRUE) +endif() diff --git a/cmake/find/Finduikit.cmake b/cmake/find/Finduikit.cmake new file mode 100644 index 000000000..f3dad94de --- /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/find/Findvideotoolbox.cmake b/cmake/find/Findvideotoolbox.cmake new file mode 100644 index 000000000..30a612fde --- /dev/null +++ b/cmake/find/Findvideotoolbox.cmake @@ -0,0 +1,5 @@ +# Copyright (c) 2017-2019, Ruslan Baratov +# All rights reserved. + +include(hunter_find_helper_framework) +hunter_find_helper_framework(FRAMEWORK "VideoToolbox") diff --git a/cmake/modules/hunter_add_package.cmake b/cmake/modules/hunter_add_package.cmake index 5b6c03338..f9826ee88 100644 --- a/cmake/modules/hunter_add_package.cmake +++ b/cmake/modules/hunter_add_package.cmake @@ -5,9 +5,9 @@ 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) # internal variables: _hunter_ap_* macro(hunter_add_package) @@ -15,7 +15,7 @@ macro(hunter_add_package) if(_project_name_is_empty) hunter_fatal_error( "Please set hunter_add_package *after* project command" - WIKI "error.hunteraddpackage.after.project" + ERROR_PAGE "error.hunteraddpackage.after.project" ) endif() @@ -36,55 +36,31 @@ 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 + NEW_INJECTED_PACKAGE _hunter_ap_new_injected_package ) - 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}") - include("${x}") - hunter_status_debug("load: ${x} ... end") - endforeach() + if(_hunter_ap_new_injected_package) + hunter_status_debug("Injected package '${_hunter_ap_project}'") + include(hunter_cacheable) + include(hunter_download) + include(hunter_pick_scheme) + hunter_pick_scheme(DEFAULT url_sha1_cmake) + hunter_cacheable("${_hunter_ap_project}") + hunter_download(PACKAGE_NAME "${_hunter_ap_project}") + else() + # 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() + endif() endmacro() diff --git a/cmake/modules/hunter_add_version.cmake b/cmake/modules/hunter_add_version.cmake index fe0ae9009..7c750db55 100644 --- a/cmake/modules/hunter_add_version.cmake +++ b/cmake/modules/hunter_add_version.cmake @@ -5,6 +5,7 @@ include(CMakeParseArguments) # cmake_parse_arguments include(hunter_internal_error) include(hunter_status_debug) +include(hunter_user_error) # If 'HUNTER__VERSION' is equal to 'h_VERSION', then # this function will set 'HUNTER__URL' and 'HUNTER__SHA1'. @@ -42,17 +43,24 @@ function(hunter_add_version) hunter_internal_error( "HUNTER__VERSION can't be empty " "(${h_PACKAGE_NAME})" - "(probably `hunter_config(...)` missing in config file)" + "(probably hunter_default_version/hunter_config call is missing)" ) 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() + set(user_url "${__HUNTER_FINAL_URL_${h_PACKAGE_NAME}}") + set(user_sha1 "${__HUNTER_FINAL_SHA1_${h_PACKAGE_NAME}}") + + if(NOT user_url STREQUAL "" OR NOT user_sha1 STREQUAL "") + hunter_user_error( + "${h_VERSION} already used in 'hunter.cmake'." + " Please specify another version in hunter_config(${h_PACKAGE_NAME})." + ) + endif() + # HUNTER__VERSION found set(h_url_name "HUNTER_${h_PACKAGE_NAME}_URL") set(h_sha1_name "HUNTER_${h_PACKAGE_NAME}_SHA1") diff --git a/cmake/modules/hunter_append_component.cmake b/cmake/modules/hunter_append_component.cmake new file mode 100644 index 000000000..e093f79fd --- /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_assert_not_empty_string) + +# 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_copy_rules.cmake b/cmake/modules/hunter_apply_copy_rules.cmake index dfbb7ce87..010c0b06e 100644 --- a/cmake/modules/hunter_apply_copy_rules.cmake +++ b/cmake/modules/hunter_apply_copy_rules.cmake @@ -3,10 +3,10 @@ include(hunter_internal_error) include(hunter_status_debug) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) function(hunter_apply_copy_rules) - hunter_test_string_not_empty("${HUNTER_INSTALL_PREFIX}") + hunter_assert_not_empty_string("${HUNTER_INSTALL_PREFIX}") get_property(copy_list GLOBAL PROPERTY HUNTER_COPY_FILES) diff --git a/cmake/modules/hunter_apply_gate_settings.cmake b/cmake/modules/hunter_apply_gate_settings.cmake index 52fb2c236..04a69b464 100644 --- a/cmake/modules/hunter_apply_gate_settings.cmake +++ b/cmake/modules/hunter_apply_gate_settings.cmake @@ -12,9 +12,11 @@ include(hunter_check_flush_needed) include(hunter_internal_error) include(hunter_set_config_location) include(hunter_status_debug) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) function(hunter_apply_gate_settings) + hunter_assert_not_empty_string("${HUNTER_CONFIGURATION_TYPES}") + get_property(gate_done GLOBAL PROPERTY HUNTER_GATE_SETTINGS_APPLIED SET) set_property(GLOBAL PROPERTY HUNTER_GATE_SETTINGS_APPLIED YES) @@ -53,6 +55,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,16 +86,6 @@ 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}" - ) - - string(COMPARE EQUAL "${HUNTER_CONFIGURATION_TYPES}" "" use_default) - if(use_default) - set(HUNTER_CONFIGURATION_TYPES "Release;Debug") - endif() - foreach(configuration ${HUNTER_CONFIGURATION_TYPES}) string(TOUPPER "${configuration}" configuration_upper) string(COMPARE EQUAL "${configuration_upper}" "RELEASE" is_release) @@ -102,14 +104,69 @@ function(hunter_apply_gate_settings) endif() endforeach() - # HUNTER_GATE_TOOLCHAIN_SHA1 - hunter_calculate_toolchain_sha1("${hunter_self}" "${hunter_base}") + hunter_make_directory("${hunter_base}" "${HUNTER_GATE_SHA1}" hunter_id_path) + + if("${HUNTER_TOOLCHAIN_SHA1}" STREQUAL "") + set(skip_toolchain_calculation NO) + elseif(HUNTER_NO_TOOLCHAIN_ID_RECALCULATION) + hunter_make_directory( + "${hunter_id_path}" + "${HUNTER_TOOLCHAIN_SHA1}" + hunter_toolchain_id_path + ) + if(EXISTS "${hunter_toolchain_id_path}/toolchain.info") + set(skip_toolchain_calculation YES) + else() + set(skip_toolchain_calculation NO) + endif() + else() + set(skip_toolchain_calculation NO) + endif() + + if(skip_toolchain_calculation) + hunter_status_debug("Toolchain-ID recalculation will be skipped") + set(HUNTER_GATE_TOOLCHAIN_SHA1 "${HUNTER_TOOLCHAIN_SHA1}") + else() + # * defines: HUNTER_GATE_TOOLCHAIN_SHA1 + # * needs: HUNTER_CONFIGURATION_TYPES + # * needs: HUNTER_BUILD_SHARED_LIBS + # * creates: global_toolchain_info at + # "${hunter_base}/${HUNTER_GATE_SHA1}/${HUNTER_GATE_TOOLCHAIN_SHA1}/toolchain.info" + hunter_calculate_toolchain_sha1("${hunter_self}" "${hunter_base}") + endif() + + # set PATH variables for hunter and toolchain + 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) + - 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}") - hunter_test_string_not_empty("${HUNTER_GATE_VERSION}") - hunter_test_string_not_empty("${HUNTER_GATE_TOOLCHAIN_SHA1}") + # test if mandatory variables are set + hunter_assert_not_empty_string("${HUNTER_GATE_ROOT}") + hunter_assert_not_empty_string("${HUNTER_GATE_SHA1}") + hunter_assert_not_empty_string("${HUNTER_GATE_CONFIG_SHA1}") + hunter_assert_not_empty_string("${HUNTER_GATE_VERSION}") + hunter_assert_not_empty_string("${HUNTER_GATE_TOOLCHAIN_SHA1}") if(cache_init) hunter_check_flush_needed("${hunter_self}" flush_done) @@ -122,9 +179,9 @@ function(hunter_apply_gate_settings) endif() # See hunter_initialize - hunter_test_string_not_empty("${HUNTER_CACHED_ROOT}") - hunter_test_string_not_empty("${HUNTER_VERSION}") - hunter_test_string_not_empty("${HUNTER_SHA1}") + hunter_assert_not_empty_string("${HUNTER_CACHED_ROOT}") + hunter_assert_not_empty_string("${HUNTER_VERSION}") + hunter_assert_not_empty_string("${HUNTER_SHA1}") # This variables will be saved in HUNTER_CACHE_FILE (hunter_create_cache_file) set(HUNTER_CONFIG_SHA1 "${HUNTER_GATE_CONFIG_SHA1}" CACHE INTERNAL "") @@ -146,4 +203,11 @@ function(hunter_apply_gate_settings) "" ) endforeach() + set( + HUNTER_CACHED_BUILD_SHARED_LIBS + "${HUNTER_BUILD_SHARED_LIBS}" + CACHE + INTERNAL + "" + ) endfunction() diff --git a/cmake/modules/hunter_assert_empty_string.cmake b/cmake/modules/hunter_assert_empty_string.cmake new file mode 100644 index 000000000..dbb66f976 --- /dev/null +++ b/cmake/modules/hunter_assert_empty_string.cmake @@ -0,0 +1,14 @@ +# Copyright (c) 2018, Ruslan Baratov +# All rights reserved. + +include(hunter_internal_error) + +function(hunter_assert_empty_string string_to_check) + if(NOT ARGN STREQUAL "") + hunter_internal_error("Unexpected: '${ARGN}'") + endif() + + if(NOT string_to_check STREQUAL "") + hunter_internal_error("Expected to be empty: '${string_to_check}'") + endif() +endfunction() diff --git a/cmake/modules/hunter_test_string_not_empty.cmake b/cmake/modules/hunter_assert_not_empty_string.cmake similarity index 81% rename from cmake/modules/hunter_test_string_not_empty.cmake rename to cmake/modules/hunter_assert_not_empty_string.cmake index 085564413..3bd724758 100644 --- a/cmake/modules/hunter_test_string_not_empty.cmake +++ b/cmake/modules/hunter_assert_not_empty_string.cmake @@ -3,7 +3,7 @@ include(hunter_internal_error) -function(hunter_test_string_not_empty test_string) +function(hunter_assert_not_empty_string test_string) string(COMPARE EQUAL "${test_string}" "" is_empty) if(is_empty) hunter_internal_error("Unexpected empty string") diff --git a/cmake/modules/hunter_autotools_configure_command.cmake b/cmake/modules/hunter_autotools_configure_command.cmake new file mode 100644 index 000000000..a5150e8fd --- /dev/null +++ b/cmake/modules/hunter_autotools_configure_command.cmake @@ -0,0 +1,238 @@ +# 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_user_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_user_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" + ERROR_PAGE "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}") + + # See: https://github.com/ruslo/hunter/pull/1910#discussion_r300725504 + list( + APPEND + configure_command + "--with-pkg-config-libdir=${PARAM_PACKAGE_INSTALL_DIR}/lib/pkgconfig" + ) + + 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 4308243ac..fab01d7cb 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 @@ -48,6 +48,9 @@ # --enable-feature # --disable-other # --with-library +# PATCH_COMMAND # add a patch command +# ${CMAKE_COMMAND} -E copy "@HUNTER_PACKAGE_SCRIPT_DIR@/patch.sh" "@HUNTER_PACKAGE_SOURCE_DIR@" +# COMMAND "./patch.sh" # BOOTSTRAP # add a bootstrap command to be run # "./autogen.sh" # before ./configure such as # # ./autogen.sh or ./bootstrap @@ -56,12 +59,17 @@ include(ExternalProject) # ExternalProject_Add include(CMakeParseArguments) # cmake_parse_arguments -include(hunter_fatal_error) +include(hunter_autotools_configure_command) +include(hunter_user_error) include(hunter_status_debug) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) +# Packages to test this function: +# * xau +# * gstreamer +# * libxml2 +# * ncursesw function(hunter_autotools_project target_name) - set(optional_params) set(one_value_params HUNTER_SELF @@ -82,6 +90,7 @@ function(hunter_autotools_project target_name) set(multi_value_params PACKAGE_CONFIGURATION_TYPES EXTRA_FLAGS + PATCH_COMMAND ) cmake_parse_arguments( PARAM @@ -96,255 +105,77 @@ 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() - hunter_test_string_not_empty("${PARAM_BUILD_DIR}") - hunter_test_string_not_empty("${PARAM_GLOBAL_INSTALL_DIR}") - hunter_test_string_not_empty("${PARAM_INSTALL_DIR}") - hunter_test_string_not_empty("${PARAM_PACKAGE_CONFIGURATION_TYPES}") + hunter_assert_not_empty_string("${PARAM_BUILD_DIR}") + hunter_assert_not_empty_string("${PARAM_GLOBAL_INSTALL_DIR}") + hunter_assert_not_empty_string("${PARAM_INSTALL_DIR}") + hunter_assert_not_empty_string("${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() - - 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() - - 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(default_path "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin") + set(shell_env_path "PATH=${PARAM_GLOBAL_INSTALL_DIR}/bin:${default_path}") - # 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} - ) - 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() + set(shell_ld_path "LD_LIBRARY_PATH=${PARAM_GLOBAL_INSTALL_DIR}/lib:$ENV{LD_LIBRARY_PATH}") - get_directory_property(include_dirs INCLUDE_DIRECTORIES) - foreach(include_dir ${include_dirs}) - set(cppflags - "${cppflags} ${CMAKE_INCLUDE_SYSTEM_FLAG_CXX} ${include_dir}" - ) - endforeach() + 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}") - set(cppflags "${cppflags} ${PARAM_CPPFLAGS}") - string(STRIP "${cppflags}" cppflags) - hunter_status_debug("CPPFLAGS=${cppflags}") + set(clear_vars_shell_script "${PARAM_HUNTER_SELF}/scripts/clear-all.sh") - # 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}") + set(shell_env + . + ${clear_vars_shell_script} + && + ${shell_env_path} + ${shell_pkg_config_libdir} + ${shell_ld_path} + ) - # 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("${ANDROID_TOOLCHAIN_MACHINE_NAME}") - set(configure_host --host=${ANDROID_TOOLCHAIN_MACHINE_NAME}) - 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") + hunter_user_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} @@ -352,18 +183,21 @@ function(hunter_autotools_project target_name) ${PARAM_URL_HASH} DOWNLOAD_DIR ${PARAM_DOWNLOAD_DIR} + TLS_VERIFY + "${HUNTER_TLS_VERIFY}" SOURCE_DIR ${PARAM_SOURCE_DIR} INSTALL_DIR ${PARAM_INSTALL_DIR} # not used, just avoid creating Install/ empty directory + PATCH_COMMAND + ${PARAM_PATCH_COMMAND} 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 @@ -375,6 +209,8 @@ function(hunter_autotools_project target_name) ExternalProject_Add(${ios_universal_target} DOWNLOAD_COMMAND "" + TLS_VERIFY + "${HUNTER_TLS_VERIFY}" SOURCE_DIR ${PARAM_SOURCE_DIR}/universal INSTALL_DIR @@ -410,25 +246,41 @@ function(hunter_autotools_project target_name) set(configure_host "x86_64-apple-darwin") set(is_simulator TRUE) else() - hunter_fatal_error("iOS architecture: ${ios_architecture} not supported") + hunter_user_error("iOS architecture: ${ios_architecture} not supported") 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) - set(arch_flags "-arch ${ios_architecture} -isysroot ${IPHONESIMULATOR_SDK_ROOT} -miphoneos-version-min=${IOS_SDK_VERSION} ") + set(arch_flags "-arch ${ios_architecture} -isysroot ${IPHONESIMULATOR_SDK_ROOT} ") else() - set(arch_flags "-arch ${ios_architecture} -isysroot ${IPHONEOS_SDK_ROOT} -miphoneos-version-min=${IOS_SDK_VERSION} ") + set(arch_flags "-arch ${ios_architecture} -isysroot ${IPHONEOS_SDK_ROOT} ") 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 @@ -437,9 +289,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} @@ -447,18 +296,21 @@ function(hunter_autotools_project target_name) ${PARAM_URL_HASH} DOWNLOAD_DIR ${PARAM_DOWNLOAD_DIR} + TLS_VERIFY + "${HUNTER_TLS_VERIFY}" SOURCE_DIR ${arch_source_dir} INSTALL_DIR ${arch_install_dir} # not used, just avoid creating Install/ empty directory + PATCH_COMMAND + ${PARAM_PATCH_COMMAND} 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_boost_component_b2_args.cmake b/cmake/modules/hunter_boost_component_b2_args.cmake index fe80475ca..bb5c58d11 100644 --- a/cmake/modules/hunter_boost_component_b2_args.cmake +++ b/cmake/modules/hunter_boost_component_b2_args.cmake @@ -9,6 +9,8 @@ include(hunter_add_package) include("${CMAKE_CURRENT_LIST_DIR}/../Hunter") function(hunter_boost_component_b2_args compName boostCmakeArgs outList) + hunter_assert_not_empty_string("${BOOST_VERSION}") + string(TOUPPER ${compName} upperCompName) set(myList "")#empty @@ -96,8 +98,8 @@ function(hunter_boost_component_b2_args compName boostCmakeArgs outList) endif() get_filename_component(zlib_dir ${zlib_path} DIRECTORY) get_filename_component(zlib_name ${zlib_path} NAME_WE) - if(NOT WIN32) - string(REPLACE "lib" "" zlib_name ${zlib_name}) + if(NOT WIN32 OR MINGW) + string(REGEX REPLACE "^lib" "" zlib_name ${zlib_name}) endif() list(APPEND myList "-s" "ZLIB_INCLUDE=${zlib_include}" "-s" "ZLIB_LIBPATH=${zlib_dir}" "-s" "ZLIB_BINARY=${zlib_name}") set(BOOST_CONFIG_LINK_ZLIB 1 PARENT_SCOPE) @@ -123,8 +125,8 @@ function(hunter_boost_component_b2_args compName boostCmakeArgs outList) endif() get_filename_component(bzip2_dir ${bzip2_path} DIRECTORY) get_filename_component(bzip2_name ${bzip2_path} NAME_WE) - if(NOT WIN32) - string(REPLACE "lib" "" bzip2_name ${bzip2_name}) + if(NOT WIN32 OR MINGW) + string(REGEX REPLACE "^lib" "" bzip2_name ${bzip2_name}) endif() list(APPEND myList "-s" "BZIP2_INCLUDE=${bzip2_include}" "-s" "BZIP2_LIBPATH=${bzip2_dir}" "-s" "BZIP2_BINARY=${bzip2_name}") set(BOOST_CONFIG_LINK_BZIP2 1 PARENT_SCOPE) diff --git a/cmake/modules/hunter_cache_run.cmake b/cmake/modules/hunter_cache_run.cmake index 93c4c88c7..c824dedc6 100644 --- a/cmake/modules/hunter_cache_run.cmake +++ b/cmake/modules/hunter_cache_run.cmake @@ -5,7 +5,7 @@ include(CMakeParseArguments) # cmake_parse_arguments include(hunter_add_package) include(hunter_internal_error) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) # Do not install any packages. # Check cache and load cache.sha1 to home directory on hit. @@ -15,7 +15,7 @@ function(hunter_cache_run) # -> x_PACKAGE # -> x_COMPONENT - hunter_test_string_not_empty("${x_PACKAGE}") + hunter_assert_not_empty_string("${x_PACKAGE}") string(COMPARE NOTEQUAL "${x_COMPONENT}" "" has_component) string(COMPARE NOTEQUAL "${x_UNPARSED_ARGUMENTS}" "" has_unparsed) diff --git a/cmake/modules/hunter_cache_server_password.cmake b/cmake/modules/hunter_cache_server_password.cmake new file mode 100644 index 000000000..6de2e84b9 --- /dev/null +++ b/cmake/modules/hunter_cache_server_password.cmake @@ -0,0 +1,59 @@ +# Copyright (c) 2018, Ruslan Baratov +# All rights reserved. + +include(CMakeParseArguments) # cmake_parse_arguments + +include(hunter_status_debug) +include(hunter_user_error) + +function(hunter_cache_server_password) + set(opt SUB_SHA1_SUFFIX) + set(one SERVER USERNAME PASSWORD) + set(multi HTTPHEADER) + + cmake_parse_arguments(x "${opt}" "${one}" "${multi}" "${ARGN}") + # -> x_SUB_SHA1_SUFFIX + # -> x_SERVER + # -> x_USERNAME + # -> x_PASSWORD + # -> x_HTTPHEADER + + string(COMPARE NOTEQUAL "${x_UNPARSED_ARGUMENTS}" "" has_unparsed) + if(has_unparsed) + hunter_user_error( + "'hunter_cache_server_password' unparsed arguments: ${x_UNPARSED_ARGUMENTS}" + ) + endif() + + string(COMPARE EQUAL "${x_SERVER}" "" no_server) + if(no_server) + hunter_user_error("'SERVER' required") + endif() + + string(COMPARE EQUAL "${HUNTER_CACHE_SERVER_NAME}" "" no_cache_server) + if(no_cache_server) + return() + endif() + + string(COMPARE EQUAL "${HUNTER_CACHE_SERVER_NAME}" "${x_SERVER}" hit) + if(NOT hit) + hunter_status_debug("Skip '${HUNTER_CACHE_SERVER_NAME}' server") + return() + endif() + + set(httpheaders) + foreach(httpheader ${x_HTTPHEADER}) + list(APPEND httpheaders HTTPHEADER "${httpheader}") + endforeach() + + string(COMPARE NOTEQUAL "${x_USERNAME}" "" has_username) + string(COMPARE NOTEQUAL "${x_PASSWORD}" "" has_password) + set(userpwd) + if(has_username OR has_password) + set(userpwd USERPWD "${x_USERNAME}:${x_PASSWORD}") + endif() + + set(HUNTER_CACHE_SERVER_USERPWD "${userpwd}" PARENT_SCOPE) + set(HUNTER_CACHE_SERVER_HTTPHEADER "${httpheaders}" PARENT_SCOPE) + set(HUNTER_CACHE_SERVER_SUB_SHA1_SUFFIX "${x_SUB_SHA1_SUFFIX}" PARENT_SCOPE) +endfunction() diff --git a/cmake/modules/hunter_cacheable.cmake b/cmake/modules/hunter_cacheable.cmake index 4120c2779..819afbc8e 100644 --- a/cmake/modules/hunter_cacheable.cmake +++ b/cmake/modules/hunter_cacheable.cmake @@ -1,9 +1,11 @@ # Copyright (c) 2015, Ruslan Baratov # All rights reserved. -include(hunter_test_string_not_empty) +include(hunter_assert_empty_string) -macro(hunter_cacheable package) - hunter_test_string_not_empty("${package}") - set(HUNTER_${package}_CACHEABLE TRUE) -endmacro() +function(hunter_cacheable package) + hunter_assert_empty_string("${ARGN}") + hunter_assert_not_empty_string("${package}") + + set("__HUNTER_CACHEABLE_${package}" TRUE PARENT_SCOPE) +endfunction() diff --git a/cmake/modules/hunter_calculate_config_sha1.cmake b/cmake/modules/hunter_calculate_config_sha1.cmake index 5e2724538..6d9b37b03 100644 --- a/cmake/modules/hunter_calculate_config_sha1.cmake +++ b/cmake/modules/hunter_calculate_config_sha1.cmake @@ -3,20 +3,21 @@ cmake_minimum_required(VERSION 3.0) +include(hunter_assert_not_empty_string) +include(hunter_config) include(hunter_internal_error) include(hunter_lock_directory) include(hunter_make_directory) include(hunter_print_cmd) include(hunter_status_debug) -include(hunter_test_string_not_empty) include(hunter_user_error) function(hunter_calculate_config_sha1 hunter_self hunter_base user_config) - hunter_test_string_not_empty("${HUNTER_GATE_SHA1}") - hunter_test_string_not_empty("${hunter_self}") - hunter_test_string_not_empty("${hunter_base}") - hunter_test_string_not_empty("${user_config}") - hunter_test_string_not_empty("${CMAKE_BINARY_DIR}") + hunter_assert_not_empty_string("${HUNTER_GATE_SHA1}") + hunter_assert_not_empty_string("${hunter_self}") + hunter_assert_not_empty_string("${hunter_base}") + hunter_assert_not_empty_string("${user_config}") + hunter_assert_not_empty_string("${CMAKE_BINARY_DIR}") hunter_status_print("Calculating Config-SHA1") @@ -25,17 +26,20 @@ function(hunter_calculate_config_sha1 hunter_self hunter_base user_config) if(NOT EXISTS "${default_config}") hunter_internal_error("File `${default_config}` not exists") endif() - set(HUNTER_ALLOW_CONFIG_LOADING YES) + + set(__HUNTER_ALLOW_DEFAULT_VERSION_LOADING YES) include("${default_config}") - set(HUNTER_ALLOW_CONFIG_LOADING NO) + set(__HUNTER_ALLOW_DEFAULT_VERSION_LOADING NO) - # Include user_config - if(NOT EXISTS "${user_config}") - hunter_internal_error("Hunter config not exists") + if(NOT user_config STREQUAL default_config) + # Include user_config + if(NOT EXISTS "${user_config}") + hunter_internal_error("Hunter config not exists") + endif() + set(__HUNTER_ALLOW_CONFIG_LOADING YES) + include("${user_config}") # Use 'hunter_config' + set(__HUNTER_ALLOW_CONFIG_LOADING NO) endif() - set(HUNTER_ALLOW_CONFIG_LOADING YES) - include("${user_config}") - set(HUNTER_ALLOW_CONFIG_LOADING NO) # Create list of the projects set(directory_with_projects "${hunter_self}/cmake/projects") @@ -70,6 +74,8 @@ function(hunter_calculate_config_sha1 hunter_self hunter_base user_config) endif() set(projects "${real_projects}") + list(APPEND projects ${__HUNTER_USER_PACKAGES}) + list(REMOVE_DUPLICATES projects) list(SORT projects) # Create unified version @@ -77,54 +83,107 @@ function(hunter_calculate_config_sha1 hunter_self hunter_base user_config) file(REMOVE_RECURSE "${work_dir}") file(MAKE_DIRECTORY "${work_dir}") - set(input_file "${work_dir}/config.cmake") - file(WRITE "${input_file}" "include(hunter_config)\n") + set(config_cmake_nolf "${work_dir}/config.cmake.NOLF") + set(config_cmake_local "${work_dir}/config.cmake") + + file(WRITE "${config_cmake_nolf}" "include(hunter_final_config)\n") foreach(x ${projects}) set(version "${HUNTER_${x}_VERSION}") - if(version) + if("${version}" STREQUAL "") + # Not a real project or not a project directory + continue() + endif() + + file( + APPEND + "${config_cmake_nolf}" + "hunter_final_config(\n" + " PACKAGE \"${x}\"\n" + " VERSION \"${version}\"\n" + ) + + set(sha1 "${__HUNTER_USER_SHA1_${x}}") + set(cmake_args "${__HUNTER_USER_CMAKE_ARGS_${x}}") + set(configuration_types "${__HUNTER_USER_CONFIGURATION_TYPES_${x}}") + set(url "${__HUNTER_USER_URL_${x}}") + set(keep_package_sources "${__HUNTER_USER_KEEP_PACKAGE_SOURCES_${x}}") + + if(NOT sha1 STREQUAL "") + file(APPEND "${config_cmake_nolf}" " SHA1 \"${sha1}\"\n") + endif() + + if(NOT cmake_args STREQUAL "") + # " (double quotes) symbol should be escaped, + # if cmake_args equals to 'FOO=""' then it should be written as 'FOO=\"\"' + string(REPLACE "\"" "\\\"" cmake_args "${cmake_args}") + + file(APPEND "${config_cmake_nolf}" " CMAKE_ARGS \"${cmake_args}\"\n") + endif() + + if(NOT configuration_types STREQUAL "") file( APPEND - "${input_file}" - "hunter_config(${x} " - "VERSION ${version}" + "${config_cmake_nolf}" + " CONFIGURATION_TYPES \"${configuration_types}\"\n" ) - string(COMPARE NOTEQUAL "${HUNTER_${x}_CMAKE_ARGS}" "" have_args) - if(have_args) - file(APPEND "${input_file}" " CMAKE_ARGS") - foreach(y ${HUNTER_${x}_CMAKE_ARGS}) - 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") - foreach(y ${HUNTER_${x}_CONFIGURATION_TYPES}) - file(APPEND "${input_file}" " ${y}") - endforeach() + endif() + + if(NOT url STREQUAL "") + file(APPEND "${config_cmake_nolf}" " URL \"${url}\"\n") + endif() + + if(NOT keep_package_sources STREQUAL "") + if(keep_package_sources STREQUAL "TRUE") + file(APPEND "${config_cmake_nolf}" " KEEP_PACKAGE_SOURCES\n") + else() + hunter_internal_error("Unexpected value: '${keep_package_sources}'") endif() - file(APPEND "${input_file}" ")\n") endif() + + file(APPEND "${config_cmake_nolf}" ")\n") endforeach() - file(SHA1 "${work_dir}/config.cmake" HUNTER_GATE_CONFIG_SHA1) + # About '@ONLY': no substitutions expected but COPYONLY can't be + # used with NEWLINE_STYLE + configure_file( + "${config_cmake_nolf}" + "${config_cmake_local}" + @ONLY + NEWLINE_STYLE LF + ) + + file(SHA1 "${config_cmake_local}" 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_TOOLCHAIN_SHA1}" + hunter_toolchain_id_path + ) + hunter_make_directory( - "${hunter_id_path}" "${HUNTER_GATE_CONFIG_SHA1}" hunter_config_id_path + "${hunter_toolchain_id_path}" + "${HUNTER_GATE_CONFIG_SHA1}" + hunter_config_id_path ) - set(dst "${hunter_config_id_path}/config.cmake") + set(config_cmake_global "${hunter_config_id_path}/config.cmake") - if(EXISTS "${dst}") + if(EXISTS "${config_cmake_global}") return() endif() hunter_lock_directory("${hunter_config_id_path}" "") - if(EXISTS "${dst}") + if(EXISTS "${config_cmake_global}") return() endif() - configure_file("${work_dir}/config.cmake" "${dst}" COPYONLY) - hunter_status_debug("Config: ${dst}") + set(config_cmake_torename "${hunter_config_id_path}/config.cmake.TORENAME") + configure_file("${config_cmake_local}" "${config_cmake_torename}" COPYONLY) + + file(RENAME "${config_cmake_torename}" "${config_cmake_global}") + hunter_status_debug("Config: ${config_cmake_global}") hunter_status_debug("Config sha1: ${HUNTER_GATE_CONFIG_SHA1}") endfunction() diff --git a/cmake/modules/hunter_calculate_self.cmake b/cmake/modules/hunter_calculate_self.cmake index 92469177a..b847ba904 100644 --- a/cmake/modules/hunter_calculate_self.cmake +++ b/cmake/modules/hunter_calculate_self.cmake @@ -4,13 +4,13 @@ cmake_minimum_required(VERSION 3.0) include(hunter_internal_error) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) function(hunter_calculate_self root version sha1 result) - hunter_test_string_not_empty("${root}") - hunter_test_string_not_empty("${version}") - hunter_test_string_not_empty("${sha1}") - hunter_test_string_not_empty("${result}") + hunter_assert_not_empty_string("${root}") + hunter_assert_not_empty_string("${version}") + hunter_assert_not_empty_string("${sha1}") + hunter_assert_not_empty_string("${result}") string(SUBSTRING "${sha1}" 0 7 archive_id) diff --git a/cmake/modules/hunter_calculate_toolchain_sha1.cmake b/cmake/modules/hunter_calculate_toolchain_sha1.cmake index 30460db64..b88b33b8b 100644 --- a/cmake/modules/hunter_calculate_toolchain_sha1.cmake +++ b/cmake/modules/hunter_calculate_toolchain_sha1.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015-2017, Ruslan Baratov # All rights reserved. include(hunter_internal_error) @@ -7,13 +7,13 @@ include(hunter_make_directory) include(hunter_print_cmd) include(hunter_status_debug) include(hunter_status_print) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) function(hunter_calculate_toolchain_sha1 hunter_self hunter_base) - hunter_test_string_not_empty("${hunter_self}") - hunter_test_string_not_empty("${hunter_base}") - hunter_test_string_not_empty("${CMAKE_BINARY_DIR}") - hunter_test_string_not_empty("${CMAKE_GENERATOR}") + hunter_assert_not_empty_string("${hunter_self}") + hunter_assert_not_empty_string("${hunter_base}") + hunter_assert_not_empty_string("${CMAKE_BINARY_DIR}") + hunter_assert_not_empty_string("${CMAKE_GENERATOR}") if(CMAKE_TOOLCHAIN_FILE) set(use_toolchain "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}") @@ -25,9 +25,11 @@ function(hunter_calculate_toolchain_sha1 hunter_self hunter_base) set(temp_project_dir "${CMAKE_BINARY_DIR}/_3rdParty/Hunter/toolchain") set(create_script "${hunter_self}/scripts/create-toolchain-info.cmake") - set(local_toolchain_info "${temp_project_dir}/toolchain.info") - file(REMOVE_RECURSE "${local_toolchain_info}") + set(toolchain_info_nolf "${temp_project_dir}/toolchain.info.NOLF") + set(toolchain_info_local "${temp_project_dir}/toolchain.info") + + file(REMOVE_RECURSE "${toolchain_info_nolf}") if(HUNTER_BINARY_DIR) hunter_lock_directory("${HUNTER_BINARY_DIR}" "") @@ -56,7 +58,7 @@ function(hunter_calculate_toolchain_sha1 hunter_self hunter_base) set( cmd "${CMAKE_COMMAND}" - "-DTOOLCHAIN_INFO_FILE=${local_toolchain_info}" + "-DTOOLCHAIN_INFO_FILE=${toolchain_info_nolf}" "${use_toolchain}" "-DHUNTER_SELF=${hunter_self}" "-G${CMAKE_GENERATOR}" @@ -64,6 +66,11 @@ function(hunter_calculate_toolchain_sha1 hunter_self hunter_base) "-B${temp_build_dir}" ) + string(COMPARE NOTEQUAL "${CMAKE_MAKE_PROGRAM}" "" has_make) + if(has_make) + list(APPEND cmd "-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}") + endif() + string(COMPARE NOTEQUAL "${CMAKE_GENERATOR_TOOLSET}" "" has_toolset) if(has_toolset) list(APPEND cmd "-T" "${CMAKE_GENERATOR_TOOLSET}") @@ -83,6 +90,11 @@ function(hunter_calculate_toolchain_sha1 hunter_self hunter_base) ) endforeach() + string(COMPARE EQUAL "${HUNTER_BUILD_SHARED_LIBS}" "" is_empty) + if(NOT is_empty) + list(APPEND cmd "-DHUNTER_BUILD_SHARED_LIBS=${HUNTER_BUILD_SHARED_LIBS}") + endif() + hunter_print_cmd("${temp_project_dir}" "${cmd}") # HUNTER_CONFIGURATION_TYPES notes: list is tricky... @@ -100,37 +112,51 @@ function(hunter_calculate_toolchain_sha1 hunter_self hunter_base) ) endif() - file(SHA1 "${local_toolchain_info}" HUNTER_GATE_TOOLCHAIN_SHA1) + # About '@ONLY': no substitutions expected but COPYONLY can't be + # used with NEWLINE_STYLE + configure_file( + "${toolchain_info_nolf}" + "${toolchain_info_local}" + @ONLY + NEWLINE_STYLE LF + ) + + file(SHA1 "${toolchain_info_local}" HUNTER_GATE_TOOLCHAIN_SHA1) set(HUNTER_GATE_TOOLCHAIN_SHA1 "${HUNTER_GATE_TOOLCHAIN_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_make_directory( - "${hunter_config_id_path}" "${HUNTER_GATE_TOOLCHAIN_SHA1}" hunter_toolchain_id_path ) - set(global_toolchain_info "${hunter_toolchain_id_path}/toolchain.info") - if(EXISTS "${global_toolchain_info}") - hunter_status_debug("Already exists: ${global_toolchain_info}") + set(toolchain_info_global "${hunter_toolchain_id_path}/toolchain.info") + if(EXISTS "${toolchain_info_global}") + hunter_status_debug("Already exists: ${toolchain_info_global}") return() endif() hunter_lock_directory("${hunter_toolchain_id_path}" "") - if(EXISTS "${global_toolchain_info}") - hunter_status_debug("Already exists: ${global_toolchain_info}") + if(EXISTS "${toolchain_info_global}") + hunter_status_debug("Already exists: ${toolchain_info_global}") return() endif() - configure_file("${local_toolchain_info}" "${global_toolchain_info}" COPYONLY) - hunter_status_debug("Toolchain info: ${global_toolchain_info}") + set( + toolchain_info_torename + "${hunter_toolchain_id_path}/toolchain.info.TORENAME" + ) + configure_file( + "${toolchain_info_local}" + "${toolchain_info_torename}" + COPYONLY + ) + + file(RENAME "${toolchain_info_torename}" "${toolchain_info_global}") + + hunter_status_debug("Toolchain info: ${toolchain_info_global}") hunter_status_debug("Toolchain SHA1: ${HUNTER_GATE_TOOLCHAIN_SHA1}") file(REMOVE_RECURSE "${temp_build_dir}") diff --git a/cmake/modules/hunter_check_download_error_message.cmake b/cmake/modules/hunter_check_download_error_message.cmake index 126673c39..623ebb4e6 100644 --- a/cmake/modules/hunter_check_download_error_message.cmake +++ b/cmake/modules/hunter_check_download_error_message.cmake @@ -15,10 +15,10 @@ function(hunter_check_download_error_message) # x_NOT_FOUND_COUNTER # x_UNPARSED_ARGUMENTS - hunter_test_string_not_empty("${x_ERROR_CODE}") - hunter_test_string_not_empty("${x_ERROR_MESSAGE}") - hunter_test_string_not_empty("${x_REMOVE_ON_ERROR}") - hunter_test_string_not_empty("${x_NOT_FOUND_COUNTER}") + hunter_assert_not_empty_string("${x_ERROR_CODE}") + hunter_assert_not_empty_string("${x_ERROR_MESSAGE}") + hunter_assert_not_empty_string("${x_REMOVE_ON_ERROR}") + hunter_assert_not_empty_string("${x_NOT_FOUND_COUNTER}") string(COMPARE NOTEQUAL "${x_UNPARSED_ARGUMENTS}" "" has_unparsed) if(has_unparsed) @@ -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_check_flush_needed.cmake b/cmake/modules/hunter_check_flush_needed.cmake index c6ad21dfd..bf4f08958 100644 --- a/cmake/modules/hunter_check_flush_needed.cmake +++ b/cmake/modules/hunter_check_flush_needed.cmake @@ -4,11 +4,11 @@ include(hunter_flush_cache_variables) include(hunter_internal_error) include(hunter_status_debug) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) function(hunter_check_flush_needed hunter_self flush_done) - hunter_test_string_not_empty("${flush_done}") - hunter_test_string_not_empty("${hunter_self}") + hunter_assert_not_empty_string("${flush_done}") + hunter_assert_not_empty_string("${hunter_self}") # Variables must be checked in 'hunter_initialize' string(COMPARE EQUAL "${HUNTER_CACHED_ROOT}" "${HUNTER_GATE_ROOT}" is_ok) @@ -66,6 +66,20 @@ function(hunter_check_flush_needed hunter_self flush_done) set(flush TRUE) endif() + string( + COMPARE + EQUAL + "${HUNTER_BUILD_SHARED_LIBS}" + "${HUNTER_CACHED_BUILD_SHARED_LIBS}" + is_ok + ) + if(NOT is_ok) + hunter_status_debug("HUNTER_BUILD_SHARED_LIBS changed:") + hunter_status_debug(" ${HUNTER_BUILD_SHARED_LIBS}") + hunter_status_debug(" ${HUNTER_CACHED_BUILD_SHARED_LIBS}") + set(flush TRUE) + endif() + if(NOT flush) set("${flush_done}" FALSE PARENT_SCOPE) return() diff --git a/cmake/modules/hunter_check_toolchain_definition.cmake b/cmake/modules/hunter_check_toolchain_definition.cmake new file mode 100644 index 000000000..5156274a4 --- /dev/null +++ b/cmake/modules/hunter_check_toolchain_definition.cmake @@ -0,0 +1,82 @@ +# Copyright (c) 2016 NeroBurner +# All rights reserved. + +include(CMakeParseArguments) # cmake_parse_arguments + +include(hunter_assert_not_empty_string) + +function(hunter_check_toolchain_definition) + set(function_name "hunter_check_toolchain_definition") + set(function_synopsis "${function_name}(NAME definition [DEFINED out_is_defined] [VALUE out_value])") + + # parse arguments + set(one_value_args NAME DEFINED VALUE) + cmake_parse_arguments(hunter_ct_arg "" "${one_value_args}" "" ${ARGV}) + + string(COMPARE NOTEQUAL "${hunter_ct_arg_NAME}" "" arg_NAME) + string(COMPARE NOTEQUAL "${hunter_ct_arg_DEFINED}" "" arg_DEFINED) + string(COMPARE NOTEQUAL "${hunter_ct_arg_VALUE}" "" arg_VALUE) + # No free arguments allowed + list(LENGTH hunter_ct_arg_UNPARSED_ARGUMENTS hunter_ct_len) + if(NOT hunter_ct_len EQUAL 0) + hunter_internal_error( + "'${function_name}' incorrect usage," + " expected no free arguments '${hunter_ct_arg_UNPARSED_ARGUMENTS}'." + " Synopsis: ${function_synopsis}" + ) + endif() + # option NAME is mandatory + if(NOT arg_NAME) + hunter_internal_error( + "'${function_name}' incorrect usage," + " option 'NAME' with one argument is mandatory." + " Synopsis: ${function_synopsis}" + ) + endif() + string(FIND "${hunter_ct_arg_NAME}" " " arg_NAME_whitespace_position) + if(NOT arg_NAME_whitespace_position EQUAL -1) + hunter_internal_error( + "'${function_name}' incorrect usage," + " definition '${hunter_ct_arg_NAME}' with whitespaces not allowed." + ) + endif() + set(definition "${hunter_ct_arg_NAME}") + + # the toolchain path must be set + hunter_assert_not_empty_string("${HUNTER_TOOLCHAIN_ID_PATH}") + set(TOOLCHAIN_INFO_FILE "${HUNTER_TOOLCHAIN_ID_PATH}/toolchain.info") + + # read toolchain.info file into memory, each line a entry in a list + file(STRINGS "${TOOLCHAIN_INFO_FILE}" toolchain_contents) + + # clean ouptut variables + set(is_defined NO) + set(defined_value) + + foreach(line ${toolchain_contents}) + # find the specified define + string(REGEX MATCH "^#define ${definition} .*$" match "${line}") + if(match) + # check for double definition + if(is_defined) + hunter_internal_error( + "'${function_name}' incorrect toolchain.info file," + " double definition of define '${definition}'" + " in file '${TOOLCHAIN_INFO_FILE}'." + ) + endif() + # definition found + set(is_defined YES) + # extract the definition + string(REGEX REPLACE "^#define ${definition} " "" defined_value "${match}") + endif() + endforeach() + + # set output_var to found definition + if(arg_DEFINED) + set(${hunter_ct_arg_DEFINED} ${is_defined} PARENT_SCOPE) + endif() + if(arg_VALUE) + set(${hunter_ct_arg_VALUE} ${defined_value} PARENT_SCOPE) + endif() +endfunction() diff --git a/cmake/modules/hunter_cmake_args.cmake b/cmake/modules/hunter_cmake_args.cmake index adefe1b5d..66089ce87 100644 --- a/cmake/modules/hunter_cmake_args.cmake +++ b/cmake/modules/hunter_cmake_args.cmake @@ -4,31 +4,23 @@ include(CMakeParseArguments) # cmake_parse_arguments -include(hunter_user_error) - -# internal variables: _hunter_c_* -macro(hunter_cmake_args) - set(_hunter_c_multiple_values CMAKE_ARGS) - cmake_parse_arguments( - _hunter_c - "" - "" - "${_hunter_c_multiple_values}" - ${ARGV} - ) - list(LENGTH _hunter_c_UNPARSED_ARGUMENTS _hunter_c_len) - if(NOT ${_hunter_c_len} EQUAL 1) - hunter_user_error("unparsed: ${_hunter_c_UNPARSED_ARGUMENTS}") - endif() - - list(GET _hunter_c_UNPARSED_ARGUMENTS 0 _hunter_c_current_project) - - if(NOT _hunter_c_CMAKE_ARGS) - hunter_user_error("Expected CMAKE_ARGS") - endif() - - set( - "HUNTER_${_hunter_c_current_project}_DEFAULT_CMAKE_ARGS" - ${_hunter_c_CMAKE_ARGS} - ) -endmacro() +include(hunter_assert_empty_string) +include(hunter_assert_not_empty_string) + +function(hunter_cmake_args package) + hunter_assert_not_empty_string("${package}") + + set(optional "") + set(one "") + set(multiple CMAKE_ARGS) + + # Introduce: + # * x_CMAKE_ARGS + cmake_parse_arguments(x "${optional}" "${one}" "${multiple}" "${ARGN}") + + hunter_assert_empty_string("${x_UNPARSED_ARGUMENTS}") + + hunter_assert_not_empty_string("${x_CMAKE_ARGS}") + + set("__HUNTER_DEFAULT_CMAKE_ARGS_${package}" "${x_CMAKE_ARGS}" PARENT_SCOPE) +endfunction() diff --git a/cmake/modules/hunter_config.cmake b/cmake/modules/hunter_config.cmake index 5b13f5619..de2e3610f 100644 --- a/cmake/modules/hunter_config.cmake +++ b/cmake/modules/hunter_config.cmake @@ -1,54 +1,147 @@ -# Copyright (c) 2013-2015, Ruslan Baratov +# Copyright (c) 2013-2018, Ruslan Baratov # All rights reserved. include(CMakeParseArguments) # cmake_parse_arguments +include(hunter_assert_empty_string) +include(hunter_assert_not_empty_string) include(hunter_fatal_error) -include(hunter_unsetvar) +include(hunter_pack_git_self) +include(hunter_pack_git_submodule) +include(hunter_parse_cmake_args_for_keyword) include(hunter_user_error) -macro(hunter_config) - if(NOT HUNTER_ALLOW_CONFIG_LOADING) +# Usage: +# * hunter_config(${package} GIT_SELF) +# * hunter_config(${package} GIT_SUBMODULE "...") +# * hunter_config(${package} VERSION "...") +# * hunter_config(${package} URL "..." SHA1 "...") + +# All variants accepts extra: +# * KEEP_PACKAGE_SOURCES +# * VERSION +# * CMAKE_ARGS +# * CONFIGURATION_TYPES + +function(hunter_config package) + hunter_assert_not_empty_string("${package}") + + if(NOT __HUNTER_ALLOW_CONFIG_LOADING) hunter_fatal_error( "Unexpected 'hunter_config' usage from:" " ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE}" - WIKI + ERROR_PAGE "error.unexpected.hunter_config" ) endif() - set(_hunter_one_value VERSION) - set(_hunter_multiple_values CMAKE_ARGS CONFIGURATION_TYPES) - cmake_parse_arguments( - _hunter - "" - "${_hunter_one_value}" - "${_hunter_multiple_values}" - ${ARGV} - ) - list(LENGTH _hunter_UNPARSED_ARGUMENTS _hunter_len) - if(NOT ${_hunter_len} EQUAL 1) + + set(optional KEEP_PACKAGE_SOURCES GIT_SELF) + set(one VERSION GIT_SUBMODULE URL SHA1) + set(multiple CMAKE_ARGS CONFIGURATION_TYPES) + + # Introduce: + # * x_KEEP_PACKAGE_SOURCES + # * x_GIT_SELF + # * x_VERSION + # * x_GIT_SUBMODULE + # * x_URL + # * x_SHA1 + # * x_CMAKE_ARGS + # * x_CONFIGURATION_TYPES + cmake_parse_arguments(x "${optional}" "${one}" "${multiple}" "${ARGN}") + + hunter_assert_empty_string("${x_UNPARSED_ARGUMENTS}") + + if(x_GIT_SELF) + if(NOT "${x_GIT_SUBMODULE}" STREQUAL "") + hunter_user_error("GIT_SUBMODULE can't be used with GIT_SELF") + endif() + if(NOT "${x_URL}" STREQUAL "") + hunter_user_error("URL can't be used with GIT_SELF") + endif() + if(NOT "${x_SHA1}" STREQUAL "") + hunter_user_error("SHA1 can't be used with GIT_SELF") + endif() + elseif(NOT "${x_GIT_SUBMODULE}" STREQUAL "") + if(NOT "${x_URL}" STREQUAL "") + hunter_user_error("URL can't be used with GIT_SUBMODULE") + endif() + if(NOT "${x_SHA1}" STREQUAL "") + hunter_user_error("SHA1 can't be used with GIT_SUBMODULE") + endif() + elseif(NOT "${x_URL}" STREQUAL "") + if("${x_SHA1}" STREQUAL "") + hunter_user_error("Expected SHA1") + endif() + elseif(NOT "${x_SHA1}" STREQUAL "") + if("${x_URL}" STREQUAL "") + hunter_user_error("Expected URL") + endif() + elseif("${x_VERSION}" STREQUAL "") hunter_user_error( - "Unparsed arguments for 'hunter_config' command: " - "${_hunter_UNPARSED_ARGUMENTS}" + "No VERSION, GIT_SELF, GIT_SUBMODULE or URL/SHA1 specified" ) endif() - # calc _ROOT - list(GET _hunter_UNPARSED_ARGUMENTS 0 _hunter_current_project) - string(TOUPPER "${_hunter_current_project}" _hunter_root) - set(_hunter_root "${_hunter_root}_ROOT") + if(NOT "${x_GIT_SUBMODULE}" STREQUAL "") + # get HUNTER_SUBMODULE_SOURCE_SUBDIR from CMAKE_ARGS + hunter_parse_cmake_args_for_keyword( + CMAKE_ARGS ${x_CMAKE_ARGS} + KEYWORD HUNTER_SUBMODULE_SOURCE_SUBDIR + OUTPUT subdir + ) - # clear all - hunter_unsetvar(${_hunter_root}) + hunter_pack_git_submodule( + PACKAGE "${package}" + GIT_SUBMODULE "${x_GIT_SUBMODULE}" + SUBMODULE_SOURCE_SUBDIR "${subdir}" + URL_OUT x_URL + SHA1_OUT x_SHA1 + ) + elseif(x_GIT_SELF) + hunter_pack_git_self( + PACKAGE "${package}" + URL_OUT x_URL + SHA1_OUT x_SHA1 + ) + endif() - if(_hunter_VERSION) - set(HUNTER_${_hunter_current_project}_VERSION ${_hunter_VERSION}) - set(HUNTER_${_hunter_current_project}_CMAKE_ARGS ${_hunter_CMAKE_ARGS}) + if("${x_VERSION}" STREQUAL "") + # GIT_SELF, GIT_SUBMODULE or URL/SHA1 variant may not provide version. + # Use SHA1 or packge in this case + set(x_VERSION "${x_SHA1}") + endif() + + hunter_assert_not_empty_string("${x_VERSION}") + set("HUNTER_${package}_VERSION" "${x_VERSION}" PARENT_SCOPE) + + set( + __HUNTER_USER_PACKAGES + "${__HUNTER_USER_PACKAGES};${package}" + PARENT_SCOPE + ) + + if(NOT "${x_SHA1}" STREQUAL "") + set("__HUNTER_USER_SHA1_${package}" "${x_SHA1}" PARENT_SCOPE) + endif() + + if(NOT "${x_CMAKE_ARGS}" STREQUAL "") + set("__HUNTER_USER_CMAKE_ARGS_${package}" "${x_CMAKE_ARGS}" PARENT_SCOPE) + endif() + + if(NOT "${x_CONFIGURATION_TYPES}" STREQUAL "") set( - HUNTER_${_hunter_current_project}_CONFIGURATION_TYPES - ${_hunter_CONFIGURATION_TYPES} + "__HUNTER_USER_CONFIGURATION_TYPES_${package}" + "${x_CONFIGURATION_TYPES}" + PARENT_SCOPE ) - else() - hunter_user_error("Expected VERSION option for 'hunter_config' command") endif() -endmacro() + + if(NOT "${x_URL}" STREQUAL "") + set("__HUNTER_USER_URL_${package}" "${x_URL}" PARENT_SCOPE) + endif() + + if(x_KEEP_PACKAGE_SOURCES) + set("__HUNTER_USER_KEEP_PACKAGE_SOURCES_${package}" "TRUE" PARENT_SCOPE) + endif() +endfunction() diff --git a/cmake/modules/hunter_configuration_types.cmake b/cmake/modules/hunter_configuration_types.cmake index b62772896..6347390c2 100644 --- a/cmake/modules/hunter_configuration_types.cmake +++ b/cmake/modules/hunter_configuration_types.cmake @@ -3,38 +3,26 @@ include(CMakeParseArguments) # cmake_parse_arguments -include(hunter_user_error) +include(hunter_assert_not_empty_string) +include(hunter_assert_empty_string) -macro(hunter_configuration_types) - set(_hunter_multiple_values CONFIGURATION_TYPES) - cmake_parse_arguments( - _hunter - "" - "" - "${_hunter_multiple_values}" - ${ARGV} - ) - list(LENGTH _hunter_UNPARSED_ARGUMENTS _hunter_len) - if(NOT ${_hunter_len} EQUAL 1) - hunter_user_error("unparsed: ${_hunter_UNPARSED_ARGUMENTS}") - endif() +function(hunter_configuration_types package) + hunter_assert_not_empty_string("${package}") - list(GET _hunter_UNPARSED_ARGUMENTS 0 _hunter_current_project) + set(optional "") + set(one "") + set(multiple CONFIGURATION_TYPES) - # Set value only if not defined in 'config.cmake', - # i.e. when *_CONFIGURATIONS_TYPES is empty - string( - COMPARE - EQUAL - "${HUNTER_${_hunter_current_project}_CONFIGURATION_TYPES}" - "" - _hunter_is_empty - ) + # Introduce: + # * x_CONFIGURATION_TYPES + cmake_parse_arguments(x "" "" "${multiple}" "${ARGN}") - if(_hunter_is_empty) - set( - "HUNTER_${_hunter_current_project}_CONFIGURATION_TYPES" - ${_hunter_CONFIGURATION_TYPES} - ) - endif() -endmacro() + hunter_assert_empty_string("${x_UNPARSED_ARGUMENTS}") + hunter_assert_not_empty_string("${x_CONFIGURATION_TYPES}") + + set( + "__HUNTER_DEFAULT_CONFIGURATION_TYPES_${package}" + "${x_CONFIGURATION_TYPES}" + PARENT_SCOPE + ) +endfunction() diff --git a/cmake/modules/hunter_create_args_file.cmake b/cmake/modules/hunter_create_args_file.cmake index 07787bfda..1e69105f1 100644 --- a/cmake/modules/hunter_create_args_file.cmake +++ b/cmake/modules/hunter_create_args_file.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ruslan Baratov +# Copyright (c) 2015, 2018 Ruslan Baratov # All rights reserved. include(hunter_status_debug) @@ -26,13 +26,27 @@ function(hunter_create_args_file args filename) # "A", "B", "C" # 'var_value' will have values: # "value1", "value2", "value3", "value4" - file(REMOVE "${filename}") - file(WRITE "${filename}" "") # create empty file if no option + set(filename_nolf "${filename}.NOLF") + file(REMOVE "${filename_nolf}") + file(WRITE "${filename_nolf}" "") # create empty file if no option set(var_name "") foreach(entry ${args}) - string(FIND "${entry}" "=" update_var) - if(update_var EQUAL -1) + set(appending_mode FALSE) + + string(FIND "${entry}" "=" equal_symbol_index) + if(equal_symbol_index EQUAL -1) # There is no '=' symbol - appending mode + set(appending_mode TRUE) + endif() + + string(REGEX MATCH "^--.*" starts_with_double_dash "${entry}") + if(NOT "${starts_with_double_dash}" STREQUAL "") + # Assumed that variable name doesn't start with '--' and we are appending. + # Needed to pass options like `--foo=a,b,c,d` + set(appending_mode TRUE) + endif() + + if(appending_mode) if(NOT var_name) hunter_user_error( "${bad_message} (expected '=' symbol): ${args}" @@ -53,13 +67,13 @@ function(hunter_create_args_file args filename) ) endif() ### -- end - file(APPEND "${filename}" "set(") + file(APPEND "${filename_nolf}" "set(") file( APPEND - "${filename}" + "${filename_nolf}" "\"${var_name}\" \"\${${var_name}}\" \"${var_value}\"" ) - file(APPEND "${filename}" " CACHE INTERNAL \"\")\n") + file(APPEND "${filename_nolf}" " CACHE INTERNAL \"\")\n") hunter_status_debug( "Add extra CMake args: '${var_name}' += '${var_value}'" ) @@ -97,12 +111,27 @@ function(hunter_create_args_file args filename) endif() ### -- end - file(APPEND "${filename}" "set(") - file(APPEND "${filename}" "\"${var_name}\" \"${var_value}\"") - file(APPEND "${filename}" " CACHE INTERNAL \"\")\n") + file(APPEND "${filename_nolf}" "set(") + + if("${var_value}" STREQUAL "\"\"") + file(APPEND "${filename_nolf}" "\"${var_name}\" \"\"") + else() + file(APPEND "${filename_nolf}" "\"${var_name}\" \"${var_value}\"") + endif() + + file(APPEND "${filename_nolf}" " CACHE INTERNAL \"\")\n") hunter_status_debug( "Add extra CMake args: '${var_name}' = '${var_value}'" ) endif() endforeach() + + # About '@ONLY': no substitutions expected but COPYONLY can't be + # used with NEWLINE_STYLE + configure_file( + "${filename_nolf}" + "${filename}" + @ONLY + NEWLINE_STYLE LF + ) endfunction() diff --git a/cmake/modules/hunter_create_cache_file.cmake b/cmake/modules/hunter_create_cache_file.cmake index 2dd3b0bc3..2bcb94e27 100644 --- a/cmake/modules/hunter_create_cache_file.cmake +++ b/cmake/modules/hunter_create_cache_file.cmake @@ -2,23 +2,23 @@ # All rights reserved. include(hunter_status_debug) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) function(hunter_create_cache_file cache_path) - hunter_test_string_not_empty("${cache_path}") + hunter_assert_not_empty_string("${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_VERSION}") - hunter_test_string_not_empty("${HUNTER_TOOLCHAIN_SHA1}") - hunter_test_string_not_empty("${HUNTER_TOOLCHAIN_ID_PATH}") + hunter_assert_not_empty_string("${HUNTER_CACHED_ROOT}") + hunter_assert_not_empty_string("${HUNTER_SHA1}") + hunter_assert_not_empty_string("${HUNTER_CONFIG_SHA1}") + hunter_assert_not_empty_string("${HUNTER_CONFIG_ID_PATH}") + hunter_assert_not_empty_string("${HUNTER_VERSION}") + hunter_assert_not_empty_string("${HUNTER_TOOLCHAIN_SHA1}") 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}") @@ -93,6 +93,12 @@ function(hunter_create_cache_file cache_path) "${temp_path}" "set(CMAKE_${lang}_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES \"${CMAKE_${lang}_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES}\" CACHE INTERNAL \"\")\n" ) + hunter_status_debug("ABI forwarding: CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES = ${CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES}") + file( + APPEND + "${temp_path}" + "set(CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES \"${CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES}\" CACHE INTERNAL \"\")\n" + ) if(DEFINED CMAKE_${lang}_LIBRARY_ARCHITECTURE) hunter_status_debug("ABI forwarding: CMAKE_${lang}_LIBRARY_ARCHITECTURE = ${CMAKE_${lang}_LIBRARY_ARCHITECTURE}") file( @@ -117,13 +123,6 @@ function(hunter_create_cache_file cache_path) ) endif() - # Let all project build with the same number of jobs - file( - APPEND - "${temp_path}" - "set(HUNTER_JOBS_NUMBER \"${HUNTER_JOBS_NUMBER}\" CACHE INTERNAL \"\")\n" - ) - # Let all projects have same postfixes foreach(configuration ${HUNTER_CACHED_CONFIGURATION_TYPES}) string(TOUPPER "${configuration}" configuration_upper) @@ -157,6 +156,11 @@ function(hunter_create_cache_file cache_path) "${temp_path}" "set(HUNTER_SHA1 \"${HUNTER_SHA1}\" CACHE INTERNAL \"\")\n" ) + file( + APPEND + "${temp_path}" + "set(HUNTER_URL \"${HUNTER_URL}\" CACHE INTERNAL \"\")\n" + ) file( APPEND "${temp_path}" @@ -177,6 +181,45 @@ function(hunter_create_cache_file cache_path) "${temp_path}" "set(HUNTER_CACHED_CONFIGURATION_TYPES \"${HUNTER_CACHED_CONFIGURATION_TYPES}\" CACHE INTERNAL \"\")\n" ) + file( + APPEND + "${temp_path}" + "set(HUNTER_CACHED_BUILD_SHARED_LIBS \"${HUNTER_CACHED_BUILD_SHARED_LIBS}\" 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" + ) + + # Disable package registry { + ### http://www.cmake.org/cmake/help/v3.1/manual/cmake-packages.7.html#disabling-the-package-registry + file( + APPEND + "${temp_path}" + "set(CMAKE_EXPORT_NO_PACKAGE_REGISTRY ON CACHE INTERNAL \"\")\n" + ) + file( + APPEND + "${temp_path}" + "set(CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY ON CACHE INTERNAL \"\")\n" + ) + file( + APPEND + "${temp_path}" + "set(CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY ON CACHE INTERNAL \"\")\n" + ) + # } + + # Package can use this variable to check if it's building by Hunter + file( + APPEND + "${temp_path}" + "set(HUNTER_PACKAGE_BUILD ON CACHE INTERNAL \"\")\n" + ) # Atomic operation file(RENAME "${temp_path}" "${cache_path}") diff --git a/cmake/modules/hunter_create_cache_meta_directory.cmake b/cmake/modules/hunter_create_cache_meta_directory.cmake index 44807a1f6..e59c1d16f 100644 --- a/cmake/modules/hunter_create_cache_meta_directory.cmake +++ b/cmake/modules/hunter_create_cache_meta_directory.cmake @@ -3,19 +3,19 @@ include(hunter_internal_error) include(hunter_make_directory) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) function(hunter_create_cache_meta_directory cache_directory result) - hunter_test_string_not_empty("${HUNTER_ARGS_FILE}") - hunter_test_string_not_empty("${HUNTER_PACKAGE_CONFIGURATION_TYPES}") - hunter_test_string_not_empty("${HUNTER_PACKAGE_HOME_DIR}") - hunter_test_string_not_empty("${HUNTER_PACKAGE_NAME}") - hunter_test_string_not_empty("${HUNTER_PACKAGE_SHA1}") - hunter_test_string_not_empty("${HUNTER_PACKAGE_VERSION}") - hunter_test_string_not_empty("${HUNTER_TOOLCHAIN_ID_PATH}") - hunter_test_string_not_empty("${HUNTER_TOOLCHAIN_SHA1}") - hunter_test_string_not_empty("${cache_directory}") - hunter_test_string_not_empty("${result}") + hunter_assert_not_empty_string("${HUNTER_ARGS_FILE}") + hunter_assert_not_empty_string("${HUNTER_PACKAGE_CONFIGURATION_TYPES}") + hunter_assert_not_empty_string("${HUNTER_PACKAGE_HOME_DIR}") + hunter_assert_not_empty_string("${HUNTER_PACKAGE_NAME}") + hunter_assert_not_empty_string("${HUNTER_PACKAGE_SHA1}") + hunter_assert_not_empty_string("${HUNTER_PACKAGE_VERSION}") + hunter_assert_not_empty_string("${HUNTER_TOOLCHAIN_ID_PATH}") + hunter_assert_not_empty_string("${HUNTER_TOOLCHAIN_SHA1}") + hunter_assert_not_empty_string("${cache_directory}") + hunter_assert_not_empty_string("${result}") string(COMPARE NOTEQUAL "${HUNTER_PACKAGE_COMPONENT}" "" has_component) @@ -49,21 +49,50 @@ function(hunter_create_cache_meta_directory cache_directory result) hunter_make_directory("${cache_meta_dir}" "${args_sha1}" cache_meta_dir) file(COPY "${HUNTER_ARGS_FILE}" DESTINATION "${cache_meta_dir}") - # Save package configuration types + # Save package configuration types { + set(types_info "${HUNTER_PACKAGE_HOME_DIR}/types.info") - file(WRITE "${types_info}" "${HUNTER_PACKAGE_CONFIGURATION_TYPES}") + set(types_info_nolf "${types_info}.NOLF") + + file(WRITE "${types_info_nolf}" "${HUNTER_PACKAGE_CONFIGURATION_TYPES}") + + # About '@ONLY': no substitutions expected but COPYONLY can't be + # used with NEWLINE_STYLE + configure_file( + "${types_info_nolf}" + "${types_info}" + @ONLY + NEWLINE_STYLE LF + ) + file(SHA1 "${types_info}" types_sha1) hunter_make_directory("${cache_meta_dir}" "${types_sha1}" cache_meta_dir) file(COPY "${types_info}" DESTINATION "${cache_meta_dir}") - # Save internal-dependencies information + # } + + # Save internal-dependencies information { + set(internal_deps_id "${HUNTER_PACKAGE_HOME_DIR}/internal_deps.id") - file(WRITE "${internal_deps_id}" "${HUNTER_PACKAGE_INTERNAL_DEPS_ID}") + set(internal_deps_id_nolf "${internal_deps_id}.NOLF") + file(WRITE "${internal_deps_id_nolf}" "${HUNTER_PACKAGE_INTERNAL_DEPS_ID}") + + # About '@ONLY': no substitutions expected but COPYONLY can't be + # used with NEWLINE_STYLE + configure_file( + "${internal_deps_id_nolf}" + "${internal_deps_id}" + @ONLY + NEWLINE_STYLE LF + ) + file(SHA1 "${internal_deps_id}" internal_deps_sha1) hunter_make_directory( "${cache_meta_dir}" "${internal_deps_sha1}" cache_meta_dir ) file(COPY "${internal_deps_id}" DESTINATION "${cache_meta_dir}") + # } + set("${result}" "${cache_meta_dir}" PARENT_SCOPE) endfunction() diff --git a/cmake/modules/hunter_create_dependency_entry.cmake b/cmake/modules/hunter_create_dependency_entry.cmake index f81a9b94c..d451bd374 100644 --- a/cmake/modules/hunter_create_dependency_entry.cmake +++ b/cmake/modules/hunter_create_dependency_entry.cmake @@ -5,7 +5,7 @@ include(CMakeParseArguments) # cmake_parse_arguments include(hunter_internal_error) include(hunter_status_debug) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) function(hunter_create_dependency_entry) set(one PACKAGE COMPONENT RESULT) @@ -14,9 +14,9 @@ function(hunter_create_dependency_entry) # x_COMPONENT optional component # x_RESULT optional component - hunter_test_string_not_empty("${x_PACKAGE}") - hunter_test_string_not_empty("${x_RESULT}") - hunter_test_string_not_empty("${HUNTER_TOOLCHAIN_ID_PATH}") + hunter_assert_not_empty_string("${x_PACKAGE}") + hunter_assert_not_empty_string("${x_RESULT}") + hunter_assert_not_empty_string("${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_create_deps_info.cmake b/cmake/modules/hunter_create_deps_info.cmake index 6f01f5b9b..8e3293a79 100644 --- a/cmake/modules/hunter_create_deps_info.cmake +++ b/cmake/modules/hunter_create_deps_info.cmake @@ -4,10 +4,10 @@ include(hunter_create_dependency_entry) include(hunter_get_package_deps_recurse) include(hunter_internal_error) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) function(hunter_create_deps_info temp_deps_info) - hunter_test_string_not_empty("${HUNTER_PACKAGE_NAME}") + hunter_assert_not_empty_string("${HUNTER_PACKAGE_NAME}") string(COMPARE NOTEQUAL "${HUNTER_PACKAGE_COMPONENT}" "" has_component) if(has_component) @@ -23,7 +23,8 @@ function(hunter_create_deps_info temp_deps_info) ) endif() - file(WRITE "${temp_deps_info}" "") + set(temp_deps_info_nolf "${temp_deps_info}.NOLF") + file(WRITE "${temp_deps_info_nolf}" "") foreach(dependency ${dependencies_list}) string(REPLACE " " ";" dep_string "${dependency}") @@ -48,6 +49,15 @@ function(hunter_create_deps_info temp_deps_info) "Unexpected length ${dep_string_len} (string: ${dep_string})" ) endif() - file(APPEND "${temp_deps_info}" "${dep_entry}\n") + file(APPEND "${temp_deps_info_nolf}" "${dep_entry}\n") endforeach() + + # About '@ONLY': no substitutions expected but COPYONLY can't be + # used with NEWLINE_STYLE + configure_file( + "${temp_deps_info_nolf}" + "${temp_deps_info}" + @ONLY + NEWLINE_STYLE LF + ) endfunction() diff --git a/cmake/modules/hunter_default_version.cmake b/cmake/modules/hunter_default_version.cmake new file mode 100644 index 000000000..20fae2c6e --- /dev/null +++ b/cmake/modules/hunter_default_version.cmake @@ -0,0 +1,51 @@ +# Copyright (c) 2018, Ruslan Baratov +# All rights reserved. + +include(CMakeParseArguments) # cmake_parse_arguments + +include(hunter_assert_empty_string) +include(hunter_assert_not_empty_string) +include(hunter_fatal_error) +include(hunter_internal_error) + +function(hunter_default_version package) + hunter_assert_not_empty_string("${package}") + + set(optional "") + set(one VERSION) + set(multiple "") + + # Introduce: + # * x_VERSION + cmake_parse_arguments(x "${optional}" "${one}" "${multiple}" "${ARGN}") + + hunter_assert_empty_string("${x_UNPARSED_ARGUMENTS}") + + hunter_assert_not_empty_string("${x_VERSION}") + + if(NOT __HUNTER_ALLOW_DEFAULT_VERSION_LOADING) + hunter_fatal_error( + "Unexpected 'hunter_default_version' usage from:" + " ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE}" + ERROR_PAGE "error.unexpected.hunter_config" + ) + endif() + + set(last_name "${__HUNTER_LAST_DEFAULT_VERSION_NAME}") + if(NOT last_name STREQUAL "") + if(package STREQUAL last_name) + hunter_internal_error("'${package}' specified twice") + endif() + + if(package STRLESS last_name) + hunter_internal_error( + "Alphabetical order violation:" + " '${package}' should appear before '${last_name}'" + ) + endif() + endif() + + set(__HUNTER_LAST_DEFAULT_VERSION_NAME "${package}" PARENT_SCOPE) + + set("HUNTER_${package}_VERSION" "${x_VERSION}" PARENT_SCOPE) +endfunction() diff --git a/cmake/modules/hunter_download.cmake b/cmake/modules/hunter_download.cmake index 8d898d48c..1fb3e27b1 100644 --- a/cmake/modules/hunter_download.cmake +++ b/cmake/modules/hunter_download.cmake @@ -1,52 +1,62 @@ -# Copyright (c) 2013-2015, Ruslan Baratov, Aaditya Kalsi +# Copyright (c) 2013-2018, Ruslan Baratov +# Copyright (c) 2015-2018, Aaditya Kalsi +# Copyright (c) 2018, David Hirvonen # All rights reserved. include(CMakeParseArguments) # cmake_parse_arguments +include(hunter_assert_empty_string) +include(hunter_assert_not_empty_string) include(hunter_create_args_file) +include(hunter_find_licenses) include(hunter_find_stamps) +include(hunter_get_cacheable) +include(hunter_get_cmake_args) +include(hunter_get_configuration_types) +include(hunter_get_keep_package_sources) +include(hunter_get_package_sha1) +include(hunter_get_package_url) include(hunter_internal_error) include(hunter_jobs_number) include(hunter_load_from_cache) include(hunter_print_cmd) +include(hunter_read_http_credentials) include(hunter_register_dependency) include(hunter_save_to_cache) include(hunter_status_debug) include(hunter_status_print) -include(hunter_test_string_not_empty) +include(hunter_upload_cache) 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 - if(HUNTER_UNPARSED_ARGUMENTS) - hunter_internal_error("Unparsed: ${HUNTER_UNPARSED_ARGUMENTS}") - endif() + hunter_assert_empty_string("${HUNTER_UNPARSED_ARGUMENTS}") set(versions "[${HUNTER_${HUNTER_PACKAGE_NAME}_VERSIONS}]") hunter_status_debug( "${HUNTER_PACKAGE_NAME} versions available: ${versions}" ) - hunter_test_string_not_empty("${HUNTER_DOWNLOAD_SCHEME}") - hunter_test_string_not_empty("${HUNTER_SELF}") + hunter_assert_not_empty_string("${HUNTER_DOWNLOAD_SCHEME}") + hunter_assert_not_empty_string("${HUNTER_SELF}") - 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_CACHE_FILE}") + hunter_assert_not_empty_string("${HUNTER_INSTALL_PREFIX}") + hunter_assert_not_empty_string("${HUNTER_PACKAGE_NAME}") + hunter_assert_not_empty_string("${HUNTER_CONFIG_ID_PATH}") + hunter_assert_not_empty_string("${HUNTER_CACHE_FILE}") - string(COMPARE NOTEQUAL "${HUNTER_BINARY_DIR}" "" hunter_has_binary_dir) - string(COMPARE NOTEQUAL "${HUNTER_PACKAGE_COMPONENT}" "" hunter_has_component) - string(COMPARE NOTEQUAL "${CMAKE_TOOLCHAIN_FILE}" "" hunter_has_toolchain) + string(COMPARE NOTEQUAL "${HUNTER_BINARY_DIR}" "" has_binary_dir) + string(COMPARE NOTEQUAL "${HUNTER_PACKAGE_COMPONENT}" "" has_component) + string(COMPARE NOTEQUAL "${CMAKE_TOOLCHAIN_FILE}" "" has_toolchain) string( COMPARE NOTEQUAL @@ -54,58 +64,50 @@ function(hunter_download) "" has_internal_deps_id ) - string( - COMPARE - NOTEQUAL - "${HUNTER_PACKAGE_UNRELOCATABLE_TEXT_FILES}" - "" - has_unrelocatable_text_files - ) - if(hunter_has_component) + if(has_component) set(HUNTER_EP_NAME "${HUNTER_PACKAGE_NAME}-${HUNTER_PACKAGE_COMPONENT}") else() set(HUNTER_EP_NAME "${HUNTER_PACKAGE_NAME}") endif() # Set _ROOT variables - set(h_name "${HUNTER_PACKAGE_NAME}") # Foo + set(package "${HUNTER_PACKAGE_NAME}") # Foo string(TOUPPER "${HUNTER_PACKAGE_NAME}" root_name) # FOO set(root_name "${root_name}_ROOT") # FOO_ROOT - set(HUNTER_PACKAGE_VERSION "${HUNTER_${h_name}_VERSION}") + set(HUNTER_PACKAGE_VERSION "${HUNTER_${package}_VERSION}") set(ver "${HUNTER_PACKAGE_VERSION}") - set(HUNTER_PACKAGE_URL "${HUNTER_${h_name}_URL}") - set(HUNTER_PACKAGE_SHA1 "${HUNTER_${h_name}_SHA1}") - set( - HUNTER_PACKAGE_CONFIGURATION_TYPES - "${HUNTER_${h_name}_CONFIGURATION_TYPES}" - ) - string(COMPARE EQUAL "${HUNTER_PACKAGE_CONFIGURATION_TYPES}" "" no_types) - if(no_types) - set(HUNTER_PACKAGE_CONFIGURATION_TYPES ${HUNTER_CACHED_CONFIGURATION_TYPES}) - endif() - set(HUNTER_PACKAGE_CACHEABLE "${HUNTER_${h_name}_CACHEABLE}") + hunter_get_package_sha1( + PACKAGE "${package}" + VERSION "${ver}" + AVAILABLE_VERSIONS "${HUNTER_${package}_VERSIONS}" + OUT HUNTER_PACKAGE_SHA1 + ) - if(has_unrelocatable_text_files AND NOT HUNTER_PACKAGE_CACHEABLE) - hunter_user_error( - "PACKAGE_UNRELOCATABLE_TEXT_FILES for uncacheable package:" - " please add hunter_cacheable to hunter.cmake" - ) - endif() + hunter_get_package_url( + PACKAGE "${package}" + VERSION "${ver}" + SHA1 "${HUNTER_PACKAGE_SHA1}" + OUT HUNTER_PACKAGE_URL + ) - hunter_test_string_not_empty("${HUNTER_PACKAGE_CONFIGURATION_TYPES}") + hunter_get_configuration_types( + PACKAGE "${package}" + OUT HUNTER_PACKAGE_CONFIGURATION_TYPES + ) - string(COMPARE EQUAL "${HUNTER_PACKAGE_URL}" "" hunter_no_url) + hunter_get_cacheable( + PACKAGE "${package}" + UNRELOCATABLE "${HUNTER_PACKAGE_UNRELOCATABLE_TEXT_FILES}" + OUT HUNTER_PACKAGE_CACHEABLE + ) - string(COMPARE EQUAL "${HUNTER_PACKAGE_SHA1}" "" version_not_found) - if(version_not_found) - hunter_user_error("Version not found: ${ver}. See 'hunter_config' command.") - endif() + set(HUNTER_PACKAGE_PROTECTED_SOURCES "${HUNTER_${package}_PROTECTED_SOURCES}") - hunter_test_string_not_empty("${HUNTER_PACKAGE_URL}") - hunter_test_string_not_empty("${HUNTER_PACKAGE_SHA1}") + hunter_assert_not_empty_string("${HUNTER_PACKAGE_URL}") + hunter_assert_not_empty_string("${HUNTER_PACKAGE_SHA1}") hunter_make_directory( "${HUNTER_CACHED_ROOT}/_Base/Download/${HUNTER_PACKAGE_NAME}/${ver}" @@ -113,7 +115,6 @@ function(hunter_download) HUNTER_PACKAGE_DOWNLOAD_DIR ) - # Check that only one scheme is set to 1 set(all_schemes "") set(all_schemes "${all_schemes}${HUNTER_PACKAGE_SCHEME_DOWNLOAD}") @@ -143,33 +144,40 @@ 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}" ) - if(hunter_has_component) + if(has_component) set( HUNTER_PACKAGE_HOME_DIR "${HUNTER_PACKAGE_HOME_DIR}/__${HUNTER_PACKAGE_COMPONENT}" ) endif() - set(HUNTER_PACKAGE_DONE_STAMP "${HUNTER_PACKAGE_HOME_DIR}/DONE") - if(hunter_has_binary_dir) + if(has_binary_dir) + # When cross-compiling we may need two build directories for + # the package - one for host and one for target. To avoid conflicts + # add random string. + string(RANDOM random) + set(helper_dir_to_remove "${HUNTER_BINARY_DIR}/${random}") set( HUNTER_PACKAGE_BUILD_DIR - "${HUNTER_BINARY_DIR}/${HUNTER_PACKAGE_NAME}" + "${helper_dir_to_remove}/${HUNTER_PACKAGE_NAME}" ) - if(hunter_has_component) + if(has_component) set( HUNTER_PACKAGE_BUILD_DIR "${HUNTER_PACKAGE_BUILD_DIR}/__${HUNTER_PACKAGE_COMPONENT}" ) endif() + if(EXISTS ${HUNTER_PACKAGE_BUILD_DIR}) + hunter_internal_error("Not so random...") + endif() else() set(HUNTER_PACKAGE_BUILD_DIR "${HUNTER_PACKAGE_HOME_DIR}/Build") + set(helper_dir_to_remove "${HUNTER_PACKAGE_BUILD_DIR}") endif() - set(HUNTER_PACKAGE_SOURCE_DIR "${HUNTER_PACKAGE_HOME_DIR}/Source") if(HUNTER_PACKAGE_CACHEABLE) if(NOT HUNTER_PACKAGE_SCHEME_INSTALL) @@ -180,11 +188,30 @@ 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}") else() - if(hunter_has_component) + if(has_component) hunter_internal_error( "Component for non-install package:" " ${HUNTER_PACKAGE_NAME} ${HUNTER_PACKAGE_COMPONENT}" @@ -204,27 +231,15 @@ function(hunter_download) endif() endif() - # license file variable - set(HUNTER_PACKAGE_LICENSE_FILE "${HUNTER_PACKAGE_INSTALL_PREFIX}/licenses/${HUNTER_PACKAGE_NAME}/LICENSE") - set(license_var "${HUNTER_PACKAGE_NAME}_LICENSE") - set(license_val "${HUNTER_INSTALL_PREFIX}/licenses/${HUNTER_PACKAGE_NAME}/LICENSE") - set(${root_name} "${${root_name}}" PARENT_SCOPE) set(ENV{${root_name}} "${${root_name}}") hunter_status_print("${root_name}: ${${root_name}} (ver.: ${ver})") - hunter_status_debug( - "Default arguments: ${HUNTER_${h_name}_DEFAULT_CMAKE_ARGS}" - ) - hunter_status_debug("User arguments: ${HUNTER_${h_name}_CMAKE_ARGS}") - # Same for the "snake case" string(REPLACE "-" "_" snake_case_root_name "${root_name}") set(${snake_case_root_name} "${${root_name}}" PARENT_SCOPE) set(ENV{${snake_case_root_name}} "${${root_name}}") - set(${license_var} ${license_val} PARENT_SCOPE) - # temp toolchain file to set variables and include real toolchain set(HUNTER_DOWNLOAD_TOOLCHAIN "${HUNTER_PACKAGE_HOME_DIR}/toolchain.cmake") @@ -240,80 +255,133 @@ 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) + if(has_component) hunter_status_debug("Component: ${HUNTER_PACKAGE_COMPONENT}") endif() + + # In: + # * 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() + return() endif() + # Root should be locked first: + # - https://github.com/ruslo/hunter/issues/1806 + # - https://github.com/forexample/deadlock-test hunter_lock_directory( - "${HUNTER_PACKAGE_DOWNLOAD_DIR}" HUNTER_ALREADY_LOCKED_DIRECTORIES + "${HUNTER_CONFIG_ID_PATH}" HUNTER_ALREADY_LOCKED_DIRECTORIES ) hunter_lock_directory( - "${HUNTER_TOOLCHAIN_ID_PATH}" HUNTER_ALREADY_LOCKED_DIRECTORIES + "${HUNTER_PACKAGE_DOWNLOAD_DIR}" HUNTER_ALREADY_LOCKED_DIRECTORIES ) - if(hunter_has_binary_dir) + if(hunter_lock_sources) hunter_lock_directory( - "${HUNTER_BINARY_DIR}" HUNTER_ALREADY_LOCKED_DIRECTORIES + "${hunter_lock_sources_dir}" HUNTER_ALREADY_LOCKED_DIRECTORIES ) endif() # While locking other instance can finish package building if(EXISTS "${HUNTER_PACKAGE_DONE_STAMP}") hunter_status_debug("Package already installed: ${HUNTER_PACKAGE_NAME}") - if(hunter_has_component) + if(has_component) hunter_status_debug("Component: ${HUNTER_PACKAGE_COMPONENT}") endif() + + # In: + # * 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() + return() endif() - # load from cache using SHA1 of args.cmake file + hunter_get_cmake_args(PACKAGE "${package}" OUT package_cmake_args) + file(REMOVE "${HUNTER_ARGS_FILE}") - hunter_create_args_file( - "${HUNTER_${h_name}_DEFAULT_CMAKE_ARGS};${HUNTER_${h_name}_CMAKE_ARGS}" - "${HUNTER_ARGS_FILE}" - ) + hunter_create_args_file("${package_cmake_args}" "${HUNTER_ARGS_FILE}") + + # Pass the raw list of arguments to build scheme: + # * https://github.com/ruslo/hunter/blob/v0.23.18/cmake/projects/Boost/schemes/url_sha1_boost.cmake.in#L95-L100 + # * https://github.com/ruslo/hunter/issues/1525 + set(HUNTER_${HUNTER_PACKAGE_NAME}_CMAKE_ARGS "${package_cmake_args}") # Check if package can be loaded from cache hunter_load_from_cache() if(HUNTER_CACHE_RUN) + # No need for licenses here (no 'hunter_find_licenses' call) + return() + endif() + + if(HUNTER_PACKAGE_SCHEME_UNPACK AND HUNTER_SKIP_SCHEME_UNPACK) + # We don't need sources if parent is available in cache + hunter_status_debug("Skip unpacking of ${HUNTER_PACKAGE_NAME}") return() endif() if(EXISTS "${HUNTER_PACKAGE_DONE_STAMP}") hunter_status_debug("Package installed from cache: ${HUNTER_PACKAGE_NAME}") - if(hunter_has_component) + if(has_component) hunter_status_debug("Component: ${HUNTER_PACKAGE_COMPONENT}") endif() + + # In: + # * 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() + return() endif() + if(HUNTER_PACKAGE_PROTECTED_SOURCES) + # -> HUNTER_PACKAGE_HTTP_USERNAME + # -> HUNTER_PACKAGE_HTTP_PASSWORD + hunter_read_http_credentials() + + string(COMPARE EQUAL "${HUNTER_PACKAGE_HTTP_USERNAME}" "" name_is_empty) + string(COMPARE EQUAL "${HUNTER_PACKAGE_HTTP_PASSWORD}" "" pass_is_empty) + + if(name_is_empty OR pass_is_empty) + hunter_user_error( + "Credentials for '${HUNTER_PACKAGE_NAME}' are not defined" + ) + endif() + endif() + file(REMOVE_RECURSE "${HUNTER_PACKAGE_BUILD_DIR}") file(REMOVE "${HUNTER_PACKAGE_HOME_DIR}/CMakeLists.txt") file(REMOVE "${HUNTER_DOWNLOAD_TOOLCHAIN}") + hunter_get_keep_package_sources(PACKAGE "${package}" OUT keep_sources) + file(WRITE "${HUNTER_DOWNLOAD_TOOLCHAIN}" "") hunter_jobs_number(HUNTER_JOBS_OPTION "${HUNTER_DOWNLOAD_TOOLCHAIN}") hunter_status_debug("HUNTER_JOBS_NUMBER: ${HUNTER_JOBS_NUMBER}") + hunter_status_debug("HUNTER_JOBS_NUMBER (env): $ENV{HUNTER_JOBS_NUMBER}") hunter_status_debug("HUNTER_JOBS_OPTION: ${HUNTER_JOBS_OPTION}") # support for toolchain file forwarding - if(hunter_has_toolchain) + if(has_toolchain) # Fix windows path get_filename_component(x "${CMAKE_TOOLCHAIN_FILE}" ABSOLUTE) file(APPEND "${HUNTER_DOWNLOAD_TOOLCHAIN}" "include(\"${x}\")\n") @@ -343,44 +411,89 @@ function(hunter_download) file( APPEND "${HUNTER_DOWNLOAD_TOOLCHAIN}" - "list(APPEND HUNTER_CACHE_SERVERS ${HUNTER_CACHE_SERVERS})\n" + "set(HUNTER_CACHE_SERVERS \"${HUNTER_CACHE_SERVERS}\" CACHE INTERNAL \"\")\n" + ) + string(COMPARE NOTEQUAL "${HUNTER_PASSWORDS_PATH}" "" has_passwords) + if(has_passwords) + # Fix Windows slashes + get_filename_component( + passwords_path "${HUNTER_PASSWORDS_PATH}" ABSOLUTE + ) + file( + APPEND + "${HUNTER_DOWNLOAD_TOOLCHAIN}" + "set(HUNTER_PASSWORDS_PATH \"${passwords_path}\" CACHE INTERNAL \"\")\n" + ) + endif() + 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" + ) + file( + APPEND + "${HUNTER_DOWNLOAD_TOOLCHAIN}" + "set(HUNTER_DOWNLOAD_SERVER \"${HUNTER_DOWNLOAD_SERVER}\" CACHE INTERNAL \"\")\n" + ) + file( + APPEND + "${HUNTER_DOWNLOAD_TOOLCHAIN}" + "set(HUNTER_TLS_VERIFY \"${HUNTER_TLS_VERIFY}\" CACHE INTERNAL \"\")\n" + ) + file( + APPEND + "${HUNTER_DOWNLOAD_TOOLCHAIN}" + "set(HUNTER_RUN_UPLOAD \"${HUNTER_RUN_UPLOAD}\" CACHE INTERNAL \"\")\n" + ) + file( + APPEND + "${HUNTER_DOWNLOAD_TOOLCHAIN}" + "set(HUNTER_JOBS_NUMBER \"${HUNTER_JOBS_NUMBER}\" CACHE INTERNAL \"\")\n" + ) + file( + APPEND + "${HUNTER_DOWNLOAD_TOOLCHAIN}" + "set(HUNTER_NO_TOOLCHAIN_ID_RECALCULATION \"${HUNTER_NO_TOOLCHAIN_ID_RECALCULATION}\" CACHE INTERNAL \"\")\n" ) - if(hunter_no_url) - set(avail ${HUNTER_${h_name}_VERSIONS}) - hunter_internal_error( - "${h_name} version(${ver}) not found. Available: [${avail}]" + string(COMPARE NOTEQUAL "${CMAKE_MAKE_PROGRAM}" "" has_make) + if(has_make) + file( + APPEND + "${HUNTER_DOWNLOAD_TOOLCHAIN}" + "set(CMAKE_MAKE_PROGRAM \"${CMAKE_MAKE_PROGRAM}\" CACHE INTERNAL \"\")\n" ) endif() # print info before start generation/run hunter_status_debug("Add package: ${HUNTER_PACKAGE_NAME}") - if(hunter_has_component) + if(has_component) hunter_status_debug("Component: ${HUNTER_PACKAGE_COMPONENT}") endif() hunter_status_debug("Download scheme: ${HUNTER_DOWNLOAD_SCHEME}") hunter_status_debug("Url: ${HUNTER_PACKAGE_URL}") hunter_status_debug("SHA1: ${HUNTER_PACKAGE_SHA1}") - if(HUNTER_PACKAGE_SCHEME_INSTALL) - hunter_status_debug( - "Configuration types: ${HUNTER_PACKAGE_CONFIGURATION_TYPES}" - ) - endif() + hunter_status_debug("HUNTER_TLS_VERIFY: ${HUNTER_TLS_VERIFY}") if(has_internal_deps_id) hunter_status_debug( "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 @@ -391,7 +504,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}" ) @@ -403,7 +516,7 @@ function(hunter_download) ) set(build_message "Building ${HUNTER_PACKAGE_NAME}") - if(hunter_has_component) + if(has_component) set( build_message "${build_message} (component: ${HUNTER_PACKAGE_COMPONENT})" @@ -423,7 +536,7 @@ function(hunter_download) if(NOT allow_builds AND HUNTER_PACKAGE_SCHEME_INSTALL) hunter_fatal_error( "Building package from source is disabled (dir: ${HUNTER_PACKAGE_HOME_DIR})" - WIKI "error.build.disabled" + ERROR_PAGE "error.build.disabled" ) endif() @@ -447,9 +560,14 @@ function(hunter_download) ) string(COMPARE NOTEQUAL "${CMAKE_GENERATOR_TOOLSET}" "" has_toolset) if(has_toolset) + hunter_status_debug("Add toolset: '${CMAKE_GENERATOR_TOOLSET}'") list(APPEND cmd "-T" "${CMAKE_GENERATOR_TOOLSET}") endif() + if(has_make) + list(APPEND cmd "-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}") + endif() + string(COMPARE NOTEQUAL "${CMAKE_GENERATOR_PLATFORM}" "" has_gen_platform) if(has_gen_platform) list(APPEND cmd "-A" "${CMAKE_GENERATOR_PLATFORM}") @@ -472,7 +590,7 @@ function(hunter_download) else() hunter_fatal_error( "Configure step failed (dir: ${HUNTER_PACKAGE_HOME_DIR})" - WIKI "error.external.build.failed" + ERROR_PAGE "error.external.build.failed" ) endif() @@ -498,7 +616,7 @@ function(hunter_download) else() hunter_fatal_error( "Build step failed (dir: ${HUNTER_PACKAGE_HOME_DIR}" - WIKI "error.external.build.failed" + ERROR_PAGE "error.external.build.failed" ) endif() @@ -512,10 +630,18 @@ function(hunter_download) hunter_status_debug("Cleaning up build directories...") + file(REMOVE_RECURSE "${helper_dir_to_remove}") + 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(keep_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") @@ -529,4 +655,17 @@ function(hunter_download) hunter_status_debug("Clean up done") file(WRITE "${HUNTER_PACKAGE_DONE_STAMP}" "") + + # Note: will remove 'HUNTER_PACKAGE_BUILD_DIR' + hunter_upload_cache() + + # In: + # * 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() endfunction() diff --git a/cmake/modules/hunter_download_cache_meta_file.cmake b/cmake/modules/hunter_download_cache_meta_file.cmake index 9f52856b9..77add18be 100644 --- a/cmake/modules/hunter_download_cache_meta_file.cmake +++ b/cmake/modules/hunter_download_cache_meta_file.cmake @@ -3,16 +3,21 @@ include(CMakeParseArguments) # cmake_parse_arguments +include(hunter_cache_server_password) include(hunter_check_download_error_message) +include(hunter_get_passwords_path) +include(hunter_http_password) include(hunter_init_not_found_counter) include(hunter_internal_error) +include(hunter_private_data_password) include(hunter_sleep_before_download) include(hunter_status_debug) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) +include(hunter_upload_password) include(hunter_user_error) function(hunter_download_cache_meta_file) - hunter_test_string_not_empty("${HUNTER_CACHED_ROOT}") + hunter_assert_not_empty_string("${HUNTER_CACHED_ROOT}") cmake_parse_arguments(x "" "LOCAL;DONE" "" ${ARGV}) # -> x_LOCAL @@ -40,6 +45,9 @@ function(hunter_download_cache_meta_file) string(REPLACE "${cache_directory}/meta/" "" local_suffix "${x_LOCAL}") string(REPLACE "${cache_directory}/meta/" "" done_suffix "${x_DONE}") + set(local_temp "${x_LOCAL}.__HUNTER_TEMP__") + set(done_temp "${x_DONE}.__HUNTER_TEMP__") + if(EXISTS "${x_DONE}") return() endif() @@ -52,33 +60,72 @@ function(hunter_download_cache_meta_file) return() endif() - 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}") - endif() - - string( - REPLACE - "https://github.com/" - "https://raw.githubusercontent.com/" - url - "${server}" - ) + list(LENGTH HUNTER_CACHE_SERVERS number_of_servers) + hunter_init_not_found_counter( + NOT_FOUND_NEEDED not_found_counter "${number_of_servers}" + ) + + hunter_get_passwords_path(pass_path) + string(COMPARE NOTEQUAL "${pass_path}" "" has_pass) + + set(total_retry 10) + foreach(x RANGE ${total_retry}) + foreach(server ${HUNTER_CACHE_SERVERS}) + set(HUNTER_CACHE_SERVER_NAME "${server}") + + set(HUNTER_CACHE_SERVER_USERPWD "") + set(HUNTER_CACHE_SERVER_HTTPHEADER "") + set(HUNTER_CACHE_SERVER_SUB_SHA1_SUFFIX FALSE) + + if(has_pass) + # May use: + # * hunter_http_password + # * hunter_private_data_password + # * hunter_upload_password + # * hunter_cache_server_password + include("${pass_path}") + endif() - set(local_url "${url}/master/${local_suffix}") - set(done_url "${url}/master/${done_suffix}") + string(REGEX MATCH "^https://github.com/" is_github "${server}") + if(NOT is_github) + 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() - hunter_init_not_found_counter(NOT_FOUND_NEEDED not_found_counter) + if(HUNTER_CACHE_SERVER_SUB_SHA1_SUFFIX) + string( + REGEX + REPLACE + "/cache\\.sha1$" + "/cache_sha1" + local_url + "${local_url}" + ) + endif() - set(total_retry 10) - foreach(x RANGE ${total_retry}) - hunter_status_debug("Downloading file (try #${x} of ${total_retry}):") + hunter_status_debug("Downloading DONE metafile (try #${x} of ${total_retry}):") hunter_status_debug(" ${done_url}") hunter_status_debug(" -> ${x_DONE}") hunter_sleep_before_download("${x}") - file(DOWNLOAD "${done_url}" "${x_DONE}" STATUS status) + file( + DOWNLOAD "${done_url}" "${done_temp}" + STATUS status + TLS_VERIFY "${HUNTER_TLS_VERIFY}" + ${HUNTER_CACHE_SERVER_USERPWD} + ${HUNTER_CACHE_SERVER_HTTPHEADER} + ) list(GET status 0 error_code) list(GET status 1 error_message) @@ -86,68 +133,72 @@ function(hunter_download_cache_meta_file) hunter_check_download_error_message( ERROR_CODE "${error_code}" ERROR_MESSAGE "${error_message}" - REMOVE_ON_ERROR "${x_DONE}" + REMOVE_ON_ERROR "${done_temp}" NOT_FOUND_COUNTER not_found_counter ) - if(error_code EQUAL 0) - break() - elseif(error_code EQUAL 22) - hunter_status_debug("File not found") - if(NOT_FOUND_NEEDED EQUAL not_found_counter) - break() + if(NOT error_code EQUAL 0) + if(error_code EQUAL 22) + hunter_status_debug("File not found") + if(NOT_FOUND_NEEDED EQUAL not_found_counter) + return() + endif() + else() + hunter_status_debug("Download error (${error_message})") endif() - else() - hunter_status_debug("Download error (${error_message})") + continue() endif() - endforeach() - - if(NOT EXISTS "${x_DONE}") - # DONE stamp not found on this server, try next - continue() - endif() - - hunter_init_not_found_counter(NOT_FOUND_NEEDED not_found_counter) - - set(total_retry 10) - foreach(x RANGE ${total_retry}) - hunter_status_debug("Downloading file (try #${x} of ${total_retry}):") - hunter_status_debug(" ${local_url}") - hunter_status_debug(" -> ${x_LOCAL}") - - hunter_sleep_before_download("${x}") - file(DOWNLOAD "${local_url}" "${x_LOCAL}" STATUS status) - - list(GET status 0 error_code) - list(GET status 1 error_message) - hunter_check_download_error_message( - ERROR_CODE "${error_code}" - ERROR_MESSAGE "${error_message}" - REMOVE_ON_ERROR "${x_LOCAL}" - NOT_FOUND_COUNTER not_found_counter + # Done stamp exists, now downloading real file + hunter_init_not_found_counter( + NOT_FOUND_NEEDED not_found_counter 1 # polling one server ) - if(error_code EQUAL 0) - return() - elseif(error_code EQUAL 22) - hunter_status_debug("File not found") - if(NOT_FOUND_NEEDED EQUAL not_found_counter) - file(REMOVE "${x_DONE}") - hunter_internal_error( - "Server error. File not exists but DONE stamp found.\n" - " file: ${local_url}" - " done: ${done_url}" - ) + set(total_retry ${NOT_FOUND_NEEDED}) + foreach(x RANGE ${total_retry}) + hunter_status_debug("Downloading metafile (try #${x} of ${total_retry}):") + hunter_status_debug(" ${local_url}") + hunter_status_debug(" -> ${x_LOCAL}") + + hunter_sleep_before_download("${x}") + file( + DOWNLOAD "${local_url}" "${local_temp}" + STATUS status + TLS_VERIFY "${HUNTER_TLS_VERIFY}" + ${HUNTER_CACHE_SERVER_USERPWD} + ${HUNTER_CACHE_SERVER_HTTPHEADER} + ) + + list(GET status 0 error_code) + list(GET status 1 error_message) + + hunter_check_download_error_message( + ERROR_CODE "${error_code}" + ERROR_MESSAGE "${error_message}" + REMOVE_ON_ERROR "${local_temp}" + NOT_FOUND_COUNTER not_found_counter + ) + + if(error_code EQUAL 0) + # Success. Rename temporary files to the final destination. + # RENAME operation is atomic. Note that DONE should be the last to + # signal that everything ended as expected. + file(RENAME "${local_temp}" "${x_LOCAL}") + file(RENAME "${done_temp}" "${x_DONE}") + return() + elseif(error_code EQUAL 22) + hunter_status_debug("File not found") + else() + hunter_status_debug("Download error (${error_message})") endif() - else() - hunter_status_debug("Download error (${error_message})") - endif() - endforeach() + endforeach() - if(NOT EXISTS "${x_LOCAL}") - # some errors, remove DONE stamp and try next server - file(REMOVE "${x_DONE}") - endif() + file(REMOVE "${done_temp}") + hunter_internal_error( + "Server error. File not exists but DONE stamp found.\n" + " file: ${local_url}" + " done: ${done_url}" + ) + endforeach() endforeach() endfunction() diff --git a/cmake/modules/hunter_download_cache_raw_file.cmake b/cmake/modules/hunter_download_cache_raw_file.cmake index f19d05f2d..04bfa3e96 100644 --- a/cmake/modules/hunter_download_cache_raw_file.cmake +++ b/cmake/modules/hunter_download_cache_raw_file.cmake @@ -3,16 +3,22 @@ include(CMakeParseArguments) # cmake_parse_arguments +include(hunter_cache_server_password) include(hunter_check_download_error_message) +include(hunter_get_passwords_path) +include(hunter_http_password) include(hunter_init_not_found_counter) include(hunter_internal_error) +include(hunter_private_data_password) include(hunter_sleep_before_download) include(hunter_status_debug) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) +include(hunter_upload_password) include(hunter_user_error) function(hunter_download_cache_raw_file) - hunter_test_string_not_empty("${HUNTER_CACHED_ROOT}") + hunter_assert_not_empty_string("${HUNTER_CACHED_ROOT}") + hunter_assert_not_empty_string("${HUNTER_TLS_VERIFY}") cmake_parse_arguments(x "" "LOCAL;SHA1;FROMSERVER" "" ${ARGV}) # -> x_LOCAL @@ -61,24 +67,60 @@ function(hunter_download_cache_raw_file) return() endif() - hunter_init_not_found_counter(NOT_FOUND_NEEDED not_found_counter) - - 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}") - endif() + list(LENGTH HUNTER_CACHE_SERVERS number_of_servers) + hunter_init_not_found_counter( + NOT_FOUND_NEEDED not_found_counter "${number_of_servers}" + ) + + hunter_get_passwords_path(pass_path) + string(COMPARE NOTEQUAL "${pass_path}" "" has_pass) + + set(total_retry 10) + foreach(x RANGE ${total_retry}) + foreach(server ${HUNTER_CACHE_SERVERS}) + set(HUNTER_CACHE_SERVER_NAME "${server}") + + set(HUNTER_CACHE_SERVER_USERPWD "") + set(HUNTER_CACHE_SERVER_HTTPHEADER "") + + if(has_pass) + # May use: + # * hunter_http_password + # * hunter_private_data_password + # * hunter_upload_password + # * hunter_cache_server_password + include("${pass_path}") + endif() - set(url "${server}/releases/download/cache/${suffix}") + string(REGEX MATCH "^https://github.com/" is_github "${server}") + if(NOT is_github) + set(url "${server}/raw/${suffix}") + else() + string(SUBSTRING "${suffix}" 0 7 cache_tag) + set(url "${server}/releases/download/cache-${cache_tag}/${suffix}") + endif() - set(total_retry 10) - foreach(x RANGE ${total_retry}) - hunter_status_debug("Downloading file (try #${x} of ${total_retry}):") + hunter_status_debug("Downloading raw file (try #${x} of ${total_retry}):") hunter_status_debug(" ${url}") hunter_status_debug(" -> ${x_LOCAL}") hunter_sleep_before_download("${x}") - file(DOWNLOAD "${url}" "${x_LOCAL}" STATUS status) + + if(HUNTER_STATUS_DEBUG) + set(showprogress SHOW_PROGRESS) + else() + set(showprogress "") + endif() + + file( + DOWNLOAD "${url}" "${x_LOCAL}" + STATUS status + ${showprogress} + TLS_VERIFY "${HUNTER_TLS_VERIFY}" + ${HUNTER_CACHE_SERVER_USERPWD} + ${HUNTER_CACHE_SERVER_HTTPHEADER} + ) + file(SHA1 "${x_LOCAL}" local_sha1) string(COMPARE EQUAL "${local_sha1}" "${x_SHA1}" sha1_is_good) @@ -105,7 +147,7 @@ function(hunter_download_cache_raw_file) elseif(error_code EQUAL 22) hunter_status_debug("File not found") if(NOT_FOUND_NEEDED EQUAL not_found_counter) - break() + return() endif() else() hunter_status_debug("Download error (${error_message})") diff --git a/cmake/modules/hunter_download_server_url.cmake b/cmake/modules/hunter_download_server_url.cmake new file mode 100644 index 000000000..050e3913c --- /dev/null +++ b/cmake/modules/hunter_download_server_url.cmake @@ -0,0 +1,135 @@ +# Copyright (c) 2017 NeroBurner +# All rights reserved. + +include(CMakeParseArguments) # cmake_parse_arguments + +include(hunter_status_print) +include(hunter_internal_error) +include(hunter_assert_not_empty_string) + +# used gobal variables +# - HUNTER_DOWNLOAD_SERVER +# - if given, a list of servers to download from + +# update download url to point to HUNTER_DOWNLOAD_SERVER +# - PACKAGE: name of the package to update the url for +# - VERSION: version of the package +# - SHA1: SHA1 of the package to download, only first 7 digits are used as archive-ID +# - URL: original URL for the package +# - OUTPUT: variable to output the updated URL +function(hunter_download_server_url) + set(function_name "hunter_download_server_url") + set(function_synopsis "${function_name}(PACKAGE foo VERSION 0.1.2-p3 SHA1 somelongsha URL http://original_url.example.com OUTPUT variable)") + + # parse arguments + set(one_value_args PACKAGE VERSION SHA1 URL OUTPUT) + 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 PACKAGE VERSION SHA1 URL OUTPUT) + 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() + + # default to the given URL + set(hunter_package_new_url "${x_URL}") + + # check if download server is given + string(COMPARE NOTEQUAL "${HUNTER_DOWNLOAD_SERVER}" "" use_download_server) + if(NOT use_download_server) + # nothing to be done, set variable and exit + set(${x_OUTPUT} ${hunter_package_new_url} PARENT_SCOPE) + return() + endif() + + # update download url to point to HUNTER_DOWNLOAD_SERVER + set(hunter_main_url) # variable for main_url (x_URL if it matches one of the download server) + set(hunter_url_list) # list of URLs to try downloading from + + # extract archive-ID from archive SHA1 + string(SUBSTRING "${x_SHA1}" 0 7 archive_id) + + # get filename from download URL + get_filename_component(package_filename_raw "${x_URL}" NAME) + # replace special characters from filename + string(REGEX REPLACE "[!@#$%^&*?]" "_" package_filename "${package_filename_raw}") + + foreach(list_item ${HUNTER_DOWNLOAD_SERVER}) + # create new URL + set(download_server_url "${list_item}/${x_PACKAGE}/${x_VERSION}/${archive_id}/${package_filename}") + + # check if package URL is in the download server list + string(FIND "${x_URL}" "${list_item}" found) + if(NOT (found EQUAL "-1")) + # if in list use the original URL instead of name mangling + hunter_status_print("DOWNLOAD_SERVER: \"${x_PACKAGE}\": URL \"${x_URL}\" matches list item \"${list_item}\".") + set(hunter_main_url "${x_URL}") + else() + # append URL to list of download URLs + list(APPEND hunter_url_list "${download_server_url}") + endif() + endforeach() + + # check version to determine if external_project_add can handle multiple download URLs + set(multiple_urls_allowed TRUE) + if(CMAKE_VERSION VERSION_LESS "3.7") + set(msg "DOWNLOAD_SERVER: Multiple URLs are not supported,") + set(msg "${msg} only one URL will be used as download server.") + set(msg "${msg} Use CMake 3.7+ for multiple URLs (current version: ${CMAKE_VERSION})") + hunter_status_debug("${msg}") + set(multiple_urls_allowed FALSE) + endif() + + string(COMPARE NOTEQUAL "${hunter_main_url}" "" has_main_url) + if(has_main_url) + if(multiple_urls_allowed) + # highest priority for original URL + set(hunter_package_new_url "${hunter_main_url}" ${hunter_url_list}) + else() + # use only original URL + set(hunter_package_new_url "${hunter_main_url}") + endif() + else() + if(multiple_urls_allowed) + # try all download server one after another + set(hunter_package_new_url ${hunter_url_list}) + else() + # use only first server + list(GET hunter_url_list 0 hunter_package_new_url) + endif() + endif() + + hunter_status_print("DOWNLOAD_SERVER: replacing URL + PACKAGE: \"${x_PACKAGE}\" + VERSION: \"${x_VERSION}\" + SHA1: \"${x_SHA1}\" + old URL: \"${x_URL}\" + new URL: \"${hunter_package_new_url}\"") + + set(download_command "./download_package_for_server.sh") + set(download_command "${download_command} --PACKAGE \"${x_PACKAGE}\"") + set(download_command "${download_command} --VERSION \"${x_VERSION}\" ") + set(download_command "${download_command} --SHA1 \"${x_SHA1}\" ") + set(download_command "${download_command} --URL \"${x_URL}\"") + hunter_status_print("DOWNLOAD_SERVER: download with maintenance-script: + ${download_command}") + + # set output_var to found definition + set(${x_OUTPUT} ${hunter_package_new_url} PARENT_SCOPE) +endfunction() diff --git a/cmake/modules/hunter_dump_cmake_flags.cmake b/cmake/modules/hunter_dump_cmake_flags.cmake new file mode 100644 index 000000000..cba81ab1c --- /dev/null +++ b/cmake/modules/hunter_dump_cmake_flags.cmake @@ -0,0 +1,202 @@ +# Copyright (c) 2016-2017, Ruslan Baratov +# All rights reserved. + +include(CMakeParseArguments) # cmake_parse_arguments + +include(hunter_internal_error) +include(hunter_get_lang_standard_flag) +include(hunter_assert_not_empty_string) + +# Packages to test this function: +# * Boost +# * libxml2 +# * OpenSSL +# * odb-boost +# * ncursesw +function(hunter_dump_cmake_flags) + cmake_parse_arguments(x "SKIP_INCLUDES;SKIP_PIC" "CPPFLAGS" "" "${ARGV}") + # -> x_SKIP_INCLUDES + # -> x_SKIP_PIC + # -> x_CPPFLAGS + + string(COMPARE NOTEQUAL "${x_UNPARSED_ARGUMENTS}" "" has_unparsed) + if(has_unparsed) + hunter_internal_error("Unparsed arguments: ${x_UNPARSED_ARGUMENTS}") + endif() + + + if(IOS) + hunter_assert_not_empty_string("${IOS_SDK_VERSION}") + string(COMPARE EQUAL "${IOS_DEPLOYMENT_SDK_VERSION}" "" _no_deployment_sdk_version) + if(_no_deployment_sdk_version) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -miphoneos-version-min=${IOS_SDK_VERSION}") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -miphoneos-version-min=${IOS_SDK_VERSION}") + else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -miphoneos-version-min=${IOS_DEPLOYMENT_SDK_VERSION}") + set(CMAKE_C_FLAGS "${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(APPLE AND NOT IOS) + if(NOT "${CMAKE_OSX_SYSROOT}" STREQUAL "") + if(NOT EXISTS "${CMAKE_OSX_SYSROOT}") + hunter_internal_error("Not exists: '${CMAKE_OSX_SYSROOT}'") + endif() + # Note: do not use quotes here, see OpenSSL-1.0.2 example + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isysroot ${CMAKE_OSX_SYSROOT}") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -isysroot ${CMAKE_OSX_SYSROOT}") + set(cppflags "-isysroot ${CMAKE_OSX_SYSROOT}") + endif() + + if(NOT "${CMAKE_OSX_DEPLOYMENT_TARGET}" STREQUAL "") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}") + set(cppflags "${cppflags} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}") + endif() + endif() + + if(ANDROID) + string(COMPARE EQUAL "${CMAKE_SYSROOT_COMPILE}" "" no_sysroot_compile) + if(no_sysroot_compile) + set(android_sysroot "${CMAKE_SYSROOT}") + else() + set(android_sysroot "${CMAKE_SYSROOT_COMPILE}") + + hunter_assert_not_empty_string("${CMAKE_SYSROOT}") + set(CMAKE_EXE_LINKER_FLAGS "--sysroot=${CMAKE_SYSROOT} ${CMAKE_EXE_LINKER_FLAGS}") + endif() + + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --sysroot=${android_sysroot}") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --sysroot=${android_sysroot}") + set(cppflags "${cppflags} --sysroot=${android_sysroot}") + + if(NOT x_SKIP_INCLUDES) + foreach(x ${CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES}) + set( + CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS} ${CMAKE_INCLUDE_SYSTEM_FLAG_CXX} ${x}" + ) + set( + cppflags + "${cppflags} ${CMAKE_INCLUDE_SYSTEM_FLAG_CXX} ${x}" + ) + endforeach() + + foreach(x ${CMAKE_C_STANDARD_INCLUDE_DIRECTORIES}) + set( + CMAKE_C_FLAGS + "${CMAKE_C_FLAGS} ${CMAKE_INCLUDE_SYSTEM_FLAG_CXX} ${x}" + ) + endforeach() + endif() + + foreach(x ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES}) + if(EXISTS "${x}") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${x}") + else() + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -l${x}") + endif() + 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) + set( + CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_COMPILE_OPTIONS_TARGET}${CMAKE_CXX_COMPILER_TARGET}" + ) + endif() + + string(COMPARE NOTEQUAL "${CMAKE_C_COMPILER_TARGET}" "" has_value) + string(COMPARE NOTEQUAL "${CMAKE_C_COMPILE_OPTIONS_TARGET}" "" has_option) + if(has_value AND has_option) + set( + CMAKE_C_FLAGS + "${CMAKE_C_FLAGS} ${CMAKE_C_COMPILE_OPTIONS_TARGET}${CMAKE_C_COMPILER_TARGET}" + ) + endif() + + string(COMPARE NOTEQUAL "${CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN}" "" has_value) + string(COMPARE NOTEQUAL "${CMAKE_CXX_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN}" "" has_option) + if(has_value AND has_option) + set( + CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN}${CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN}" + ) + endif() + + string(COMPARE NOTEQUAL "${CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN}" "" has_value) + string(COMPARE NOTEQUAL "${CMAKE_C_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN}" "" has_option) + if(has_value AND has_option) + set( + CMAKE_C_FLAGS + "${CMAKE_C_FLAGS} ${CMAKE_C_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN}${CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN}" + ) + endif() + + # PIC { + string(COMPARE NOTEQUAL "${CMAKE_CXX_COMPILE_OPTIONS_PIC}" "" has_pic) + if(CMAKE_POSITION_INDEPENDENT_CODE AND has_pic AND NOT x_SKIP_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 AND NOT x_SKIP_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) + endif() + + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" PARENT_SCOPE) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" PARENT_SCOPE) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}" PARENT_SCOPE) +endfunction() diff --git a/cmake/modules/hunter_error_page.cmake b/cmake/modules/hunter_error_page.cmake new file mode 100644 index 000000000..3fbfafaa3 --- /dev/null +++ b/cmake/modules/hunter_error_page.cmake @@ -0,0 +1,13 @@ +# Copyright (c) 2014-2015, Ruslan Baratov +# All rights reserved. + +# Do not move to master - build schemes use this module but they not use master +set(HUNTER_ERROR_PAGE "https://docs.hunter.sh/en/latest/reference/errors") + +function(hunter_error_page error_page) + message("------------------------------ ERROR -----------------------------") + message(" ${HUNTER_ERROR_PAGE}/${error_page}.html") + message("------------------------------------------------------------------") + message("") + message(FATAL_ERROR "") +endfunction() diff --git a/cmake/modules/hunter_experimental_add_host_project.cmake b/cmake/modules/hunter_experimental_add_host_project.cmake index 85ab90f9f..bd399b0d1 100644 --- a/cmake/modules/hunter_experimental_add_host_project.cmake +++ b/cmake/modules/hunter_experimental_add_host_project.cmake @@ -4,7 +4,7 @@ # ************************* !!! WARNING !!! ************************* # # You're using experimental feature. This may not work well -# and can be removed anytime. It's a workaround for existsing +# and can be removed anytime. It's a workaround for existing # feature request: # # https://github.com/ruslo/hunter/issues/495 @@ -20,16 +20,21 @@ include(CMakeParseArguments) # cmake_parse_arguments -include(hunter_user_error) -include(hunter_status_print) include(hunter_status_debug) +include(hunter_status_print) +include(hunter_assert_not_empty_string) +include(hunter_user_error) function(hunter_experimental_add_host_project) + hunter_assert_not_empty_string("${HUNTER_CACHED_ROOT}") + hunter_assert_not_empty_string("${HUNTER_SHA1}") + hunter_assert_not_empty_string("${HUNTER_URL}") + hunter_status_print(" ************************* !!! WARNING !!! ************************* You're using experimental feature. This may not work well -and can be removed anytime. It's a workaround for existsing +and can be removed anytime. It's a workaround for existing feature request: https://github.com/ruslo/hunter/issues/495 @@ -62,11 +67,38 @@ https://github.com/ruslo/hunter/issues/495 hunter_status_print("Building host project: ${home_directory}") + string(COMPARE EQUAL "${HUNTER_EXPERIMENTAL_HOST_GENERATOR}" "" no_generator) + if(no_generator) + set(host_generator "") + hunter_status_debug("Using default host generator") + else() + hunter_status_debug("Using host generator: ${HUNTER_EXPERIMENTAL_HOST_GENERATOR}") + set(host_generator -G${HUNTER_EXPERIMENTAL_HOST_GENERATOR}) + endif() + + string(COMPARE EQUAL "${HUNTER_EXPERIMENTAL_HOST_TOOLCHAIN_FILE}" "" no_toolchain) + if(no_toolchain) + set(host_toolchain "") + hunter_status_debug("Not using host toolchain") + else() + hunter_status_debug("Using host toolchain: ${HUNTER_EXPERIMENTAL_HOST_TOOLCHAIN_FILE}") + set(host_toolchain -DCMAKE_TOOLCHAIN_FILE=${HUNTER_EXPERIMENTAL_HOST_TOOLCHAIN_FILE}) + endif() + # invoke cmake for host project include(${HUNTER_SELF}/scripts/clear-all.cmake) execute_process( - COMMAND "${CMAKE_COMMAND}" "-H${home_directory}" "-B${binary_directory}" - "-DHUNTER_HOST_URL=${HUNTER_GATE_URL}" "-DHUNTER_HOST_SHA1=${HUNTER_GATE_SHA1}" "-DHUNTER_ROOT=${HUNTER_ROOT}" + COMMAND + "${CMAKE_COMMAND}" + "-H${home_directory}" + "-B${binary_directory}" + "-DHUNTER_HOST_URL=${HUNTER_URL}" + "-DHUNTER_HOST_SHA1=${HUNTER_SHA1}" + "-DHUNTER_ROOT=${HUNTER_CACHED_ROOT}" + "-DHUNTER_ALREADY_LOCKED_DIRECTORIES=${HUNTER_ALREADY_LOCKED_DIRECTORIES}" + "-DHUNTER_CACHE_SERVERS=${HUNTER_CACHE_SERVERS}" + ${host_generator} + ${host_toolchain} RESULT_VARIABLE exit_code ) string(COMPARE EQUAL "${exit_code}" "0" success) diff --git a/cmake/modules/hunter_fatal_error.cmake b/cmake/modules/hunter_fatal_error.cmake index 4eb5745f9..a16841ca3 100644 --- a/cmake/modules/hunter_fatal_error.cmake +++ b/cmake/modules/hunter_fatal_error.cmake @@ -4,18 +4,18 @@ include(CMakeParseArguments) # cmake_parse_arguments include(hunter_internal_error) -include(hunter_wiki) +include(hunter_error_page) function(hunter_fatal_error) - cmake_parse_arguments(hunter "" "WIKI" "" "${ARGV}") - if(NOT hunter_WIKI) - hunter_internal_error("Expected wiki") + cmake_parse_arguments(x "" "ERROR_PAGE" "" "${ARGV}") + if(NOT x_ERROR_PAGE) + hunter_internal_error("Expected argument ERROR_PAGE") 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_error_page("${x_ERROR_PAGE}") endfunction() diff --git a/cmake/modules/hunter_final_config.cmake b/cmake/modules/hunter_final_config.cmake new file mode 100644 index 000000000..6e62ab340 --- /dev/null +++ b/cmake/modules/hunter_final_config.cmake @@ -0,0 +1,62 @@ +# Copyright (c) 2018, Ruslan Baratov +# All rights reserved. + +include(CMakeParseArguments) # cmake_parse_arguments + +include(hunter_assert_empty_string) +include(hunter_assert_not_empty_string) + +function(hunter_final_config) + set(optional KEEP_PACKAGE_SOURCES) + set(one PACKAGE SHA1 VERSION URL ) + set(multiple CMAKE_ARGS CONFIGURATION_TYPES) + + # Introduce: + # * x_KEEP_PACKAGE_SOURCES + # * x_PACKAGE + # * x_SHA1 + # * x_VERSION + # * x_URL + # * x_CMAKE_ARGS + # * x_CONFIGURATION_TYPES + cmake_parse_arguments(x "${optional}" "${one}" "${multiple}" "${ARGV}") + + hunter_assert_empty_string("${x_UNPARSED_ARGUMENTS}") + + hunter_assert_not_empty_string("${x_PACKAGE}") + hunter_assert_not_empty_string("${x_VERSION}") + + set(package "${x_PACKAGE}") + + set("HUNTER_${package}_VERSION" "${x_VERSION}" PARENT_SCOPE) + + if(NOT "${x_SHA1}" STREQUAL "") + set("__HUNTER_FINAL_SHA1_${package}" "${x_SHA1}" PARENT_SCOPE) + endif() + + if(NOT "${x_CMAKE_ARGS}" STREQUAL "") + set("__HUNTER_FINAL_CMAKE_ARGS_${package}" "${x_CMAKE_ARGS}" PARENT_SCOPE) + endif() + + if(NOT "${x_CONFIGURATION_TYPES}" STREQUAL "") + set( + "__HUNTER_FINAL_CONFIGURATION_TYPES_${package}" + "${x_CONFIGURATION_TYPES}" + PARENT_SCOPE + ) + endif() + + if(NOT "${x_URL}" STREQUAL "") + set("__HUNTER_FINAL_URL_${package}" "${x_URL}" PARENT_SCOPE) + endif() + + if(x_KEEP_PACKAGE_SOURCES) + set("__HUNTER_FINAL_KEEP_PACKAGE_SOURCES_${package}" TRUE PARENT_SCOPE) + endif() + + string(TOUPPER "${package}" package_upper) + set(package_root "${package_upper}_ROOT") + + hunter_unsetvar("${package_root}") + set("${package_root}" "" PARENT_SCOPE) +endfunction() diff --git a/cmake/modules/hunter_finalize.cmake b/cmake/modules/hunter_finalize.cmake index b24a7e062..27e2a30d9 100644 --- a/cmake/modules/hunter_finalize.cmake +++ b/cmake/modules/hunter_finalize.cmake @@ -6,10 +6,11 @@ include(hunter_apply_gate_settings) include(hunter_calculate_self) include(hunter_create_cache_file) include(hunter_fatal_error) +include(hunter_internal_error) include(hunter_sanity_checks) include(hunter_status_debug) include(hunter_status_print) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) # Continue initialization of key variables (also see 'hunter_initialize') # * calculate toolchain-id @@ -18,8 +19,12 @@ macro(hunter_finalize) # Check preconditions hunter_sanity_checks() - list(APPEND HUNTER_CACHE_SERVERS "https://github.com/ingenue/hunter-cache") - list(REMOVE_DUPLICATES HUNTER_CACHE_SERVERS) + string(COMPARE EQUAL "${HUNTER_CACHE_SERVERS}" "" _is_empty) + if(_is_empty) + hunter_status_debug("Using default cache server") + set(HUNTER_CACHE_SERVERS "https://github.com/ingenue/hunter-cache") + endif() + hunter_status_debug("List of cache servers:") foreach(_server ${HUNTER_CACHE_SERVERS}) hunter_status_debug(" * ${_server}") @@ -43,13 +48,13 @@ macro(hunter_finalize) if(_c_enabled AND NOT CMAKE_C_ABI_COMPILED) hunter_fatal_error( - "ABI not detected for C compiler" WIKI "error.abi.detection.failure" + "ABI not detected for C compiler" ERROR_PAGE "error.abi.detection.failure" ) endif() if(_cxx_enabled AND NOT CMAKE_CXX_ABI_COMPILED) hunter_fatal_error( - "ABI not detected for CXX compiler" WIKI "error.abi.detection.failure" + "ABI not detected for CXX compiler" ERROR_PAGE "error.abi.detection.failure" ) endif() @@ -62,21 +67,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") @@ -88,14 +99,17 @@ macro(hunter_finalize) hunter_status_debug( "HUNTER_CONFIGURATION_TYPES: ${HUNTER_CACHED_CONFIGURATION_TYPES}" ) + hunter_status_debug( + "HUNTER_BUILD_SHARED_LIBS: ${HUNTER_BUILD_SHARED_LIBS}" + ) 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) @@ -119,12 +133,12 @@ macro(hunter_finalize) ### 1. Clear all '_ROOT' variables (cache, environment, ...) ### 2. Set '_ROOT' or 'HUNTER__VERSION' variables - set(HUNTER_ALLOW_CONFIG_LOADING YES) + set(__HUNTER_ALLOW_FINAL_CONFIG_LOADING YES) include("${HUNTER_CONFIG_ID_PATH}/config.cmake") - set(HUNTER_ALLOW_CONFIG_LOADING NO) + set(__HUNTER_ALLOW_FINAL_CONFIG_LOADING NO) - hunter_test_string_not_empty("${HUNTER_INSTALL_PREFIX}") - hunter_test_string_not_empty("${CMAKE_BINARY_DIR}") + hunter_assert_not_empty_string("${HUNTER_INSTALL_PREFIX}") + hunter_assert_not_empty_string("${CMAKE_BINARY_DIR}") file( WRITE @@ -133,4 +147,39 @@ macro(hunter_finalize) ) hunter_apply_copy_rules() + + if(ANDROID AND CMAKE_VERSION VERSION_LESS "3.7.1") + hunter_user_error( + "CMake version 3.7.1+ required for Android platforms, see" + " https://docs.hunter.sh/en/latest/quick-start/cmake.html" + ) + endif() + + # Android GDBSERVER moved to + # https://github.com/hunter-packages/android-apk/commit/32531adeb287d3e3b20498ff1a0f76336cbe0551 + + # Fix backslashed provided by user: + # * https://github.com/ruslo/hunter/issues/693 + # Note: we can't use 'get_filename_component(... ABSOLUTE)' because sometimes + # 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() + + string(COMPARE EQUAL "${HUNTER_TLS_VERIFY}" "" _is_empty) + if(_is_empty) + hunter_user_error( + "HUNTER_TLS_VERIFY is empty, please update HunterGate module" + ) + endif() endmacro() diff --git a/cmake/modules/hunter_find_helper.cmake b/cmake/modules/hunter_find_helper.cmake new file mode 100644 index 000000000..b6260e8f9 --- /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 000000000..31ebff264 --- /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 new file mode 100644 index 000000000..d50e08ac5 --- /dev/null +++ b/cmake/modules/hunter_find_licenses.cmake @@ -0,0 +1,37 @@ +# Copyright (c) 2017, Ruslan Baratov +# All rights reserved. + +include(CMakeParseArguments) # cmake_parse_arguments + +include(hunter_assert_not_empty_string) + +# We must use macro to set variable to parent scope of the caller. +# +# In: +# * 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_assert_not_empty_string("${HUNTER_PACKAGE_LICENSE_SEARCH_DIR}") + hunter_assert_not_empty_string("${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_assert_not_empty_string("${HUNTER_PACKAGE_HOME_DIR}") + hunter_assert_not_empty_string("${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 a79d7879e..110ce748d 100644 --- a/cmake/modules/hunter_flush_cache_variables.cmake +++ b/cmake/modules/hunter_flush_cache_variables.cmake @@ -2,11 +2,11 @@ # All rights reserved. include(hunter_status_debug) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) include(hunter_unsetvar) function(hunter_flush_cache_variables hunter_self) - hunter_test_string_not_empty("${hunter_self}") + hunter_assert_not_empty_string("${hunter_self}") hunter_status_debug("Flushing cache") @@ -25,6 +25,36 @@ function(hunter_flush_cache_variables hunter_self) set(cleanup TRUE) endif() + # Issue https://github.com/ruslo/hunter/issues/569 { + if(x MATCHES "^Boost_.*_LIBRARY_.*$") + set(cleanup TRUE) + endif() + + if(x MATCHES "^Boost_LIBRARY_DIR_.*$") + set(cleanup TRUE) + endif() + + if(x MATCHES "^_Boost_LIBRARY_DIR_.*_LAST$") + set(cleanup TRUE) + 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() + # } + + # From FindOpenSSL.cmake { + if(x MATCHES "^OPENSSL_(SSL|CRYPTO)_LIBRARY$") + set(cleanup TRUE) + endif() + # } + # Exclude standard variables { set( std_variables_list diff --git a/cmake/modules/hunter_generate_qt_5_10_info.cmake b/cmake/modules/hunter_generate_qt_5_10_info.cmake new file mode 100644 index 000000000..9cf165eab --- /dev/null +++ b/cmake/modules/hunter_generate_qt_5_10_info.cmake @@ -0,0 +1,191 @@ +# Copyright (c) 2015-2018, Ruslan Baratov +# All rights reserved. + +include(hunter_internal_error) +include(hunter_qt_add_module) +include(hunter_assert_not_empty_string) + +# 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_10_info + component_name + skip_components_varname + component_depends_on_varname + is_android + is_win32 +) + hunter_assert_not_empty_string("${component_name}") + hunter_assert_not_empty_string("${skip_components_varname}") + hunter_assert_not_empty_string("${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 + 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 ${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 qtxmlpatterns COMPONENTS qtsvg) + # -- + + # -- + hunter_qt_add_module(NAME qtdeclarative COMPONENTS 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_5_11_info.cmake b/cmake/modules/hunter_generate_qt_5_11_info.cmake new file mode 100644 index 000000000..cc84ed666 --- /dev/null +++ b/cmake/modules/hunter_generate_qt_5_11_info.cmake @@ -0,0 +1,190 @@ +# Copyright (c) 2015-2018, Ruslan Baratov +# All rights reserved. + +include(hunter_internal_error) +include(hunter_qt_add_module) +include(hunter_assert_not_empty_string) + +# 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_11_info + component_name + skip_components_varname + component_depends_on_varname + is_android + is_win32 +) + hunter_assert_not_empty_string("${component_name}") + hunter_assert_not_empty_string("${skip_components_varname}") + hunter_assert_not_empty_string("${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 + qtquickcontrols + qtquickcontrols2 + qtremoteobjects + qtrepotools + qtscript + qtscxml + qtsensors + qtserialbus + qtserialport + qtspeech + qtsvg + qtsystems + qttools + qttranslations + qtvirtualkeyboard + qtwayland + qtwebchannel + qtwebengine + 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 ${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 qtxmlpatterns COMPONENTS qtsvg) + # -- + + # -- + hunter_qt_add_module(NAME qtdeclarative COMPONENTS 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_5_12_info.cmake b/cmake/modules/hunter_generate_qt_5_12_info.cmake new file mode 100644 index 000000000..17fa04d99 --- /dev/null +++ b/cmake/modules/hunter_generate_qt_5_12_info.cmake @@ -0,0 +1,186 @@ +# Copyright (c) 2015-2019, Ruslan Baratov +# All rights reserved. + +include(hunter_internal_error) +include(hunter_qt_add_module) +include(hunter_assert_not_empty_string) + +# 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_12_info + component_name + skip_components_varname + component_depends_on_varname + is_android + is_win32 +) + hunter_assert_not_empty_string("${component_name}") + hunter_assert_not_empty_string("${skip_components_varname}") + hunter_assert_not_empty_string("${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 + qtgamepad + qtgraphicaleffects + qtimageformats + qtlocation + qtmacextras + qtmultimedia + qtnetworkauth + qtpurchasing + qtqa + qtquickcontrols + qtquickcontrols2 + qtremoteobjects + qtrepotools + qtscript + qtscxml + qtsensors + qtserialbus + qtserialport + qtspeech + qtsvg + qttools + qttranslations + qtvirtualkeyboard + qtwayland + qtwebchannel + qtwebengine + qtwebglplugin + 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 ${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 qtxmlpatterns COMPONENTS qtsvg) + # -- + + # -- + hunter_qt_add_module(NAME qtdeclarative COMPONENTS 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 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 qtwebglplugin COMPONENTS qtbase qtdeclarative qtwebsockets) + # -- + + # -- + 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_5_5_info.cmake b/cmake/modules/hunter_generate_qt_5_5_info.cmake index acf88d23c..8064a7c97 100644 --- a/cmake/modules/hunter_generate_qt_5_5_info.cmake +++ b/cmake/modules/hunter_generate_qt_5_5_info.cmake @@ -3,7 +3,7 @@ include(hunter_internal_error) include(hunter_qt_add_module) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) # See cmake/projects/Qt/generate.sh @@ -18,9 +18,9 @@ function( 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}") + hunter_assert_not_empty_string("${component_name}") + hunter_assert_not_empty_string("${skip_components_varname}") + hunter_assert_not_empty_string("${component_depends_on_varname}") string(COMPARE NOTEQUAL "${ARGN}" "" has_unparsed) if(has_unparsed) diff --git a/cmake/modules/hunter_generate_qt_5_6_info.cmake b/cmake/modules/hunter_generate_qt_5_6_info.cmake index 7087a9a6a..dfef6bd55 100644 --- a/cmake/modules/hunter_generate_qt_5_6_info.cmake +++ b/cmake/modules/hunter_generate_qt_5_6_info.cmake @@ -3,7 +3,7 @@ include(hunter_internal_error) include(hunter_qt_add_module) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) # See cmake/projects/Qt/generate.sh @@ -18,9 +18,9 @@ function( 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}") + hunter_assert_not_empty_string("${component_name}") + hunter_assert_not_empty_string("${skip_components_varname}") + hunter_assert_not_empty_string("${component_depends_on_varname}") string(COMPARE NOTEQUAL "${ARGN}" "" has_unparsed) if(has_unparsed) 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 000000000..7f36a8b00 --- /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_assert_not_empty_string) + +# 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_assert_not_empty_string("${component_name}") + hunter_assert_not_empty_string("${skip_components_varname}") + hunter_assert_not_empty_string("${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 92495f20e..6ba6f132b 100644 --- a/cmake/modules/hunter_generate_qt_info.cmake +++ b/cmake/modules/hunter_generate_qt_info.cmake @@ -3,11 +3,19 @@ include(hunter_generate_qt_5_5_info) include(hunter_generate_qt_5_6_info) -include(hunter_test_string_not_empty) +include(hunter_generate_qt_5_9_info) +include(hunter_generate_qt_5_10_info) +include(hunter_generate_qt_5_11_info) +include(hunter_generate_qt_5_12_info) +include(hunter_assert_not_empty_string) include(hunter_user_error) # See cmake/projects/Qt/generate.sh +# Notes: +# * We need full list of dependencies on configuration step (see `qt-configure`) +# hence the `depends_on` should contains implicit dependencies too +# (dependencies of dependencies). function( hunter_generate_qt_info component_name @@ -18,11 +26,11 @@ function( 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}") - hunter_test_string_not_empty("${nobuild_varname}") - hunter_test_string_not_empty("${qt_version}") + hunter_assert_not_empty_string("${component_name}") + hunter_assert_not_empty_string("${skip_components_varname}") + hunter_assert_not_empty_string("${component_depends_on_varname}") + hunter_assert_not_empty_string("${nobuild_varname}") + hunter_assert_not_empty_string("${qt_version}") if(qt_version MATCHES "^5\\.5\\.") hunter_generate_qt_5_5_info( @@ -40,6 +48,38 @@ 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}" + ) + elseif(qt_version MATCHES "^5\\.10\\.") + hunter_generate_qt_5_10_info( + "${component_name}" + toskip + depends_on + "${is_android}" + "${is_win32}" + ) + elseif(qt_version MATCHES "^5\\.11\\.") + hunter_generate_qt_5_11_info( + "${component_name}" + toskip + depends_on + "${is_android}" + "${is_win32}" + ) + elseif(qt_version MATCHES "^5\\.12\\.") + hunter_generate_qt_5_12_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 000000000..716583e4a --- /dev/null +++ b/cmake/modules/hunter_get_boost_libs.cmake @@ -0,0 +1,90 @@ +# Copyright (c) 2017 NeroBurner +# All rights reserved. + +include(CMakeParseArguments) # cmake_parse_arguments + +include(hunter_assert_not_empty_string) +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}) + + # DOCUMENTATION_START { + 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 contract SINCE 1.67.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 UNTIL 1.66.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 UNTIL 1.69.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) + # DOCUMENTATION_END } + + # 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 000000000..b4a3aa212 --- /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} ${cxxflags} 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_cacheable.cmake b/cmake/modules/hunter_get_cacheable.cmake new file mode 100644 index 000000000..88c65c2af --- /dev/null +++ b/cmake/modules/hunter_get_cacheable.cmake @@ -0,0 +1,43 @@ +# Copyright (c) 2018, Ruslan Baratov +# All rights reserved. + +include(CMakeParseArguments) # cmake_parse_arguments + +include(hunter_assert_empty_string) +include(hunter_status_debug) +include(hunter_assert_not_empty_string) +include(hunter_user_error) + +function(hunter_get_cacheable) + set(optional "") + set(one PACKAGE OUT) + set(multiple UNRELOCATABLE) + + # Introduce: + # * x_PACKAGE + # * x_OUT + # * x_UNRELOCATABLE + cmake_parse_arguments(x "${optional}" "${one}" "${multiple}" "${ARGV}") + + hunter_assert_empty_string("${x_UNPARSED_ARGUMENTS}") + + hunter_assert_not_empty_string("${x_PACKAGE}") + hunter_assert_not_empty_string("${x_OUT}") + + if(__HUNTER_CACHEABLE_${x_PACKAGE}) + set(cacheable YES) + else() + set(cacheable NO) + + if(NOT "${x_UNRELOCATABLE}" STREQUAL "") + hunter_user_error( + "PACKAGE_UNRELOCATABLE_TEXT_FILES for uncacheable package:" + " please add hunter_cacheable to hunter.cmake" + ) + endif() + endif() + + hunter_status_debug("Package '${x_PACKAGE}' is cacheable: ${cacheable}") + + set("${x_OUT}" "${cacheable}" PARENT_SCOPE) +endfunction() diff --git a/cmake/modules/hunter_get_cmake_args.cmake b/cmake/modules/hunter_get_cmake_args.cmake new file mode 100644 index 000000000..c42c452df --- /dev/null +++ b/cmake/modules/hunter_get_cmake_args.cmake @@ -0,0 +1,57 @@ +# Copyright (c) 2018, Ruslan Baratov +# All rights reserved. + +include(CMakeParseArguments) # cmake_parse_arguments + +include(hunter_assert_empty_string) +include(hunter_status_debug) +include(hunter_assert_not_empty_string) + +function(hunter_get_cmake_args) + set(optional "") + set(one PACKAGE OUT) + set(multiple "") + + # Introduce: + # * x_PACKAGE + # * x_OUT + cmake_parse_arguments(x "${optional}" "${one}" "${multiple}" "${ARGV}") + + hunter_assert_empty_string("${x_UNPARSED_ARGUMENTS}") + + hunter_assert_not_empty_string("${x_PACKAGE}") + hunter_assert_not_empty_string("${x_OUT}") + + set(default_args "${__HUNTER_DEFAULT_CMAKE_ARGS_${x_PACKAGE}}") + set(user_args "${__HUNTER_FINAL_CMAKE_ARGS_${x_PACKAGE}}") + + set(cmake_args "") + + # Lowest priority: CMAKE_ARGS from 'hunter.cmake' + if(NOT default_args STREQUAL "") + hunter_status_debug( + "Package '${x_PACKAGE}' default arguments: '${default_args}'" + ) + list(APPEND cmake_args "${default_args}") + endif() + + # Priority is higher than default CMAKE_ARGS from 'hunter.cmake' but + # lower than user's CMAKE_ARGS from 'config.cmake' + if(NOT "${HUNTER_CACHED_BUILD_SHARED_LIBS}" STREQUAL "") + list( + APPEND + cmake_args + "BUILD_SHARED_LIBS=${HUNTER_CACHED_BUILD_SHARED_LIBS}" + ) + endif() + + # Highest priority: CMAKE_ARGS from user's 'config.cmake' + if(NOT user_args STREQUAL "") + hunter_status_debug( + "Package '${x_PACKAGE}' user arguments: '${user_args}'" + ) + list(APPEND cmake_args "${user_args}") + endif() + + set("${x_OUT}" "${cmake_args}" PARENT_SCOPE) +endfunction() diff --git a/cmake/modules/hunter_get_configuration_types.cmake b/cmake/modules/hunter_get_configuration_types.cmake new file mode 100644 index 000000000..99b7a73f7 --- /dev/null +++ b/cmake/modules/hunter_get_configuration_types.cmake @@ -0,0 +1,52 @@ +# Copyright (c) 2018, Ruslan Baratov +# All rights reserved. + +include(CMakeParseArguments) # cmake_parse_arguments + +include(hunter_assert_empty_string) +include(hunter_assert_not_empty_string) +include(hunter_internal_error) +include(hunter_status_debug) + +function(hunter_get_configuration_types) + set(optional "") + set(one PACKAGE OUT) + set(multiple "") + + # Introduce: + # * x_PACKAGE + # * x_OUT + cmake_parse_arguments(x "${optional}" "${one}" "${multiple}" "${ARGV}") + + hunter_assert_empty_string("${x_UNPARSED_ARGUMENTS}") + + hunter_assert_not_empty_string("${x_PACKAGE}") + hunter_assert_not_empty_string("${x_OUT}") + + if(NOT HUNTER_PACKAGE_SCHEME_INSTALL) + return() + endif() + + set(user_types "${__HUNTER_FINAL_CONFIGURATION_TYPES_${x_PACKAGE}}") + set( + package_default_types + "${__HUNTER_DEFAULT_CONFIGURATION_TYPES_${x_PACKAGE}}" + ) + set(global_default_types "${HUNTER_CACHED_CONFIGURATION_TYPES}") + + if(NOT user_types STREQUAL "") + set(types "${user_types}") + elseif(NOT package_default_types STREQUAL "") + set(types "${package_default_types}") + elseif(NOT global_default_types STREQUAL "") + set(types "${global_default_types}") + else() + hunter_internal_error("No CONFIGURATION_TYPES") + endif() + + hunter_assert_not_empty_string("${types}") + + hunter_status_debug("Package '${x_PACKAGE}' CONFIGURATION_TYPES: ${types}") + + set("${x_OUT}" "${types}" PARENT_SCOPE) +endfunction() diff --git a/cmake/modules/hunter_get_git_executable.cmake b/cmake/modules/hunter_get_git_executable.cmake new file mode 100644 index 000000000..7302b237e --- /dev/null +++ b/cmake/modules/hunter_get_git_executable.cmake @@ -0,0 +1,50 @@ +# Copyright (c) 2018, Ruslan Baratov +# All rights reserved. + +include(hunter_assert_empty_string) +include(hunter_assert_not_empty_string) +include(hunter_internal_error) +include(hunter_user_error) + +function(hunter_get_git_executable git_executable_varname) + hunter_assert_not_empty_string("${git_executable_varname}") + hunter_assert_empty_string("${ARGN}") + + if("$ENV{HUNTER_GIT_EXECUTABLE}" STREQUAL "") + find_package(Git REQUIRED) + set(git_executable ${GIT_EXECUTABLE}) + set(git_version ${GIT_VERSION_STRING}) + else() + set(git_executable "$ENV{HUNTER_GIT_EXECUTABLE}") + execute_process( + COMMAND + ${git_executable} --version + RESULT_VARIABLE result + OUTPUT_VARIABLE output + ERROR_VARIABLE output + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_STRIP_TRAILING_WHITESPACE + ) + if(result EQUAL "0") + if(output MATCHES "^git version [0-9]") + string(REPLACE "git version " "" git_version "${output}") + else() + hunter_internal_error("Unexpected output: ${output}") + endif() + else() + hunter_internal_error("Can't get Git version: ${result} ${output}") + endif() + endif() + + hunter_status_debug("Using git executable: ${git_executable}") + + hunter_assert_not_empty_string("${git_version}") + + # For '--git-path': + # * https://git-scm.com/docs/git-rev-parse/2.5.0 + if(git_version VERSION_LESS "2.5.0") + hunter_user_error("At least Git 2.5.0 required") + endif() + + set("${git_executable_varname}" "${git_executable}" PARENT_SCOPE) +endfunction() diff --git a/cmake/modules/hunter_get_keep_package_sources.cmake b/cmake/modules/hunter_get_keep_package_sources.cmake new file mode 100644 index 000000000..24baf058e --- /dev/null +++ b/cmake/modules/hunter_get_keep_package_sources.cmake @@ -0,0 +1,46 @@ +# Copyright (c) 2018, Ruslan Baratov +# All rights reserved. + +include(CMakeParseArguments) # cmake_parse_arguments + +include(hunter_assert_empty_string) +include(hunter_assert_not_empty_string) +include(hunter_internal_error) +include(hunter_status_debug) + +function(hunter_get_keep_package_sources) + set(optional "") + set(one PACKAGE OUT) + set(multiple "") + + # Introduce: + # * x_PACKAGE + # * x_OUT + cmake_parse_arguments(x "${optional}" "${one}" "${multiple}" "${ARGV}") + + hunter_assert_empty_string("${x_UNPARSED_ARGUMENTS}") + + hunter_assert_not_empty_string("${x_PACKAGE}") + hunter_assert_not_empty_string("${x_OUT}") + + set(user_keep "${__HUNTER_FINAL_KEEP_PACKAGE_SOURCES_${x_PACKAGE}}") + if(user_keep STREQUAL "") + if(HUNTER_KEEP_PACKAGE_SOURCES) + set(keep_sources YES) + else() + set(keep_sources NO) + endif() + else() + if(user_keep STREQUAL "TRUE") + set(keep_sources YES) + else() + hunter_internal_error("Unexpected") + endif() + endif() + + hunter_status_debug( + "Keep sources for package '${x_PACKAGE}': ${keep_sources}" + ) + + set("${x_OUT}" "${keep_sources}" PARENT_SCOPE) +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 000000000..abb0cd9aa --- /dev/null +++ b/cmake/modules/hunter_get_lang_standard_flag.cmake @@ -0,0 +1,69 @@ +# Copyright (c) 2017 Pawel Bylica +# All rights reserved. + +include(hunter_status_debug) + +function(hunter_get_lang_standard_flag LANG OUTPUT) + # https://github.com/Kitware/CMake/blob/9d48d3f61b25400a191f12ea92b8e5496ab47a8f/Source/cmLocalGenerator.cxx#L1766-L1782 + set(CXX_standards 20 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 096b51689..e5da5167d 100644 --- a/cmake/modules/hunter_get_package_deps.cmake +++ b/cmake/modules/hunter_get_package_deps.cmake @@ -4,7 +4,7 @@ include(CMakeParseArguments) # cmake_parse_arguments include(hunter_internal_error) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) # Get list of dependencies sorted alphabetically in format: # @@ -33,14 +33,14 @@ function(hunter_get_package_deps) hunter_internal_error("Unparsed: ${x_UNPARSED_ARGUMENTS}") endif() - hunter_test_string_not_empty("${x_PACKAGE}") - hunter_test_string_not_empty("${x_RESULT}") + hunter_assert_not_empty_string("${x_PACKAGE}") + hunter_assert_not_empty_string("${x_RESULT}") - hunter_test_string_not_empty("${HUNTER_TOOLCHAIN_ID_PATH}") + hunter_assert_not_empty_string("${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_package_deps_recurse.cmake b/cmake/modules/hunter_get_package_deps_recurse.cmake index 4c1c57cef..57037c6ca 100644 --- a/cmake/modules/hunter_get_package_deps_recurse.cmake +++ b/cmake/modules/hunter_get_package_deps_recurse.cmake @@ -5,7 +5,7 @@ include(CMakeParseArguments) # cmake_parse_arguments include(hunter_get_package_deps) include(hunter_internal_error) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) # Get list of dependencies sorted alphabetically in format: # @@ -29,8 +29,8 @@ function(hunter_get_package_deps_recurse) hunter_internal_error("Unparsed: ${x_UNPARSED_ARGUMENTS}") endif() - hunter_test_string_not_empty("${x_PACKAGE}") - hunter_test_string_not_empty("${x_RESULT}") + hunter_assert_not_empty_string("${x_PACKAGE}") + hunter_assert_not_empty_string("${x_RESULT}") set(basic_dependencies "") diff --git a/cmake/modules/hunter_get_package_sha1.cmake b/cmake/modules/hunter_get_package_sha1.cmake new file mode 100644 index 000000000..58fb3f3cb --- /dev/null +++ b/cmake/modules/hunter_get_package_sha1.cmake @@ -0,0 +1,52 @@ +# Copyright (c) 2018, Ruslan Baratov +# All rights reserved. + +include(CMakeParseArguments) # cmake_parse_arguments + +include(hunter_assert_empty_string) +include(hunter_status_debug) +include(hunter_assert_not_empty_string) +include(hunter_user_error) + +function(hunter_get_package_sha1) + set(optional "") + set(one PACKAGE VERSION OUT) + set(multiple AVAILABLE_VERSIONS) + + # Introduce: + # * x_PACKAGE + # * x_VERSION + # * x_AVAILABLE_VERSIONS + # * x_OUT + cmake_parse_arguments(x "${optional}" "${one}" "${multiple}" "${ARGV}") + + hunter_assert_empty_string("${x_UNPARSED_ARGUMENTS}") + + hunter_assert_not_empty_string("${x_PACKAGE}") + hunter_assert_not_empty_string("${x_VERSION}") + hunter_assert_not_empty_string("${x_OUT}") + + set(user_sha1 "${__HUNTER_FINAL_SHA1_${x_PACKAGE}}") + set(hunter_sha1 "${HUNTER_${x_PACKAGE}_SHA1}") + + if(NOT user_sha1 STREQUAL "" AND NOT hunter_sha1 STREQUAL "") + hunter_internal_error("Unexpected") + endif() + + if(NOT user_sha1 STREQUAL "") + set("${x_OUT}" "${user_sha1}" PARENT_SCOPE) + elseif(NOT hunter_sha1 STREQUAL "") + set("${x_OUT}" "${hunter_sha1}" PARENT_SCOPE) + else() + if(NOT "${x_AVAILABLE_VERSIONS}" STREQUAL "") + hunter_status_debug("Available versions:") + foreach(version ${x_AVAILABLE_VERSIONS}) + hunter_status_debug("* ${version}") + endforeach() + endif() + + hunter_user_error( + "Version not found: ${x_VERSION}. Please check 'hunter_config' command." + ) + endif() +endfunction() diff --git a/cmake/modules/hunter_get_package_url.cmake b/cmake/modules/hunter_get_package_url.cmake new file mode 100644 index 000000000..df74a7a7f --- /dev/null +++ b/cmake/modules/hunter_get_package_url.cmake @@ -0,0 +1,51 @@ +# Copyright (c) 2018, Ruslan Baratov +# All rights reserved. + +include(CMakeParseArguments) # cmake_parse_arguments + +include(hunter_assert_empty_string) +include(hunter_assert_not_empty_string) +include(hunter_download_server_url) + +function(hunter_get_package_url) + set(optional "") + set(one PACKAGE VERSION SHA1 OUT) + set(multiple "") + + # Introduce: + # * x_PACKAGE + # * x_VERSION + # * x_SHA1 + # * x_OUT + cmake_parse_arguments(x "${optional}" "${one}" "${multiple}" "${ARGV}") + + hunter_assert_empty_string("${x_UNPARSED_ARGUMENTS}") + + hunter_assert_not_empty_string("${x_PACKAGE}") + hunter_assert_not_empty_string("${x_VERSION}") + hunter_assert_not_empty_string("${x_SHA1}") + hunter_assert_not_empty_string("${x_OUT}") + + set(user_url "${__HUNTER_FINAL_URL_${x_PACKAGE}}") + if(NOT user_url STREQUAL "") + # URL from user's local 'hunter_config'. It's either local Git archive or + # explicitly specified URL. + set("${x_OUT}" "${user_url}" PARENT_SCOPE) + return() + endif() + + set(hunter_url "${HUNTER_${x_PACKAGE}_URL}") + + hunter_assert_not_empty_string("${hunter_url}") + + # set download URL, either direct download or redirected if HUNTER_DOWNLOAD_SERVER is set + hunter_download_server_url( + PACKAGE "${x_PACKAGE}" + VERSION "${x_VERSION}" + SHA1 "${x_SHA1}" + URL "${hunter_url}" + OUTPUT result_url + ) + + set("${x_OUT}" "${result_url}" PARENT_SCOPE) +endfunction() diff --git a/cmake/modules/hunter_get_passwords_path.cmake b/cmake/modules/hunter_get_passwords_path.cmake new file mode 100644 index 000000000..c6484401d --- /dev/null +++ b/cmake/modules/hunter_get_passwords_path.cmake @@ -0,0 +1,56 @@ +# Copyright (c) 2016-2018, Ruslan Baratov +# All rights reserved. + +include(hunter_status_debug) +include(hunter_user_error) + +function(hunter_get_passwords_path varname) + string(COMPARE EQUAL "${HUNTER_PASSWORDS_PATH}" "" cmake_is_empty) + string(COMPARE EQUAL "$ENV{HUNTER_PASSWORDS_PATH}" "" env_is_empty) + string(COMPARE EQUAL "$ENV{HOME}" "" home_is_empty) + string(COMPARE EQUAL "$ENV{USERPROFILE}" "" userprofile_is_empty) + + if(NOT cmake_is_empty) + hunter_status_debug("Using CMake variable HUNTER_PASSWORDS_PATH") + set(pass_path "${HUNTER_PASSWORDS_PATH}") + if(NOT EXISTS ${pass_path}) + hunter_user_error( + "File not found: '${pass_path}'." + " Check HUNTER_PASSWORDS_PATH CMake variable." + ) + endif() + elseif(NOT env_is_empty) + hunter_status_debug("Using environment variable HUNTER_PASSWORDS_PATH") + set(pass_path "$ENV{HUNTER_PASSWORDS_PATH}") + if(NOT EXISTS ${pass_path}) + hunter_user_error( + "File not found: '${pass_path}'." + " Check HUNTER_PASSWORDS_PATH environment variable." + ) + endif() + elseif(home_is_empty AND CMAKE_HOST_WIN32) + if(userprofile_is_empty) + hunter_user_error( + "USERPROFILE environment variable is empty on Windows host" + ) + endif() + hunter_status_debug("Using environment variable USERPROFILE") + set(pass_path "$ENV{USERPROFILE}/.config/Hunter/passwords.cmake") + if(NOT EXISTS ${pass_path}) + # Ignore USERPROFILE + set(pass_path "") + endif() + else() + if(home_is_empty) + hunter_user_error("HOME environment variable is empty") + endif() + hunter_status_debug("Using environment variable HOME") + set(pass_path "$ENV{HOME}/.config/Hunter/passwords.cmake") + if(NOT EXISTS ${pass_path}) + # Ignore USERPROFILE + set(pass_path "") + endif() + endif() + + set("${varname}" "${pass_path}" PARENT_SCOPE) +endfunction() 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 000000000..1969251ca --- /dev/null +++ b/cmake/modules/hunter_get_project_files_to_load.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2017 Ruslan Baratov +# All rights reserved. + +include(CMakeParseArguments) # cmake_parse_arguments + +include(hunter_assert_empty_string) +include(hunter_assert_not_empty_string) +include(hunter_internal_error) + +function(hunter_get_project_files_to_load) + hunter_assert_not_empty_string("${HUNTER_SELF}") + + set(optional "") + set(one PROJECT_NAME FILES NEW_INJECTED_PACKAGE) + set(multiple COMPONENTS) + + # Introduce: + # * x_PROJECT_NAME + # * x_FILES + # * x_NEW_INJECTED_PACKAGE + # * x_COMPONENTS + cmake_parse_arguments(x "${optional}" "${one}" "${multiple}" "${ARGV}") + + hunter_assert_empty_string("${x_UNPARSED_ARGUMENTS}") + + hunter_assert_not_empty_string("${x_PROJECT_NAME}") + hunter_assert_not_empty_string("${x_FILES}") + hunter_assert_not_empty_string("${x_NEW_INJECTED_PACKAGE}") + + set(project_dir "${HUNTER_SELF}/cmake/projects/${x_PROJECT_NAME}") + set(hunter_cmake "${project_dir}/hunter.cmake") + + if(NOT EXISTS "${hunter_cmake}") + hunter_status_debug("File not found (injected package): ${hunter_cmake}") + set("${x_NEW_INJECTED_PACKAGE}" "TRUE" PARENT_SCOPE) + return() + endif() + + set("${x_NEW_INJECTED_PACKAGE}" "FALSE" PARENT_SCOPE) + + set(result_list "") + list(APPEND result_list "${hunter_cmake}") + + # 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() + set(component_cmake "${dir}/hunter.cmake") + if(NOT EXISTS "${component_cmake}") + hunter_internal_error( + "File not found: ${component_cmake}" + ) + endif() + list(APPEND result_list "${component_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 000000000..6f7221a45 --- /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_assert_not_empty_string) + +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_assert_not_empty_string("${CMAKE_CXX_ANDROID_TOOLCHAIN_MACHINE}") + hunter_assert_not_empty_string("${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}") + # GCC has been removed from NDK r18. + set(CMAKE_C_PREPROCESSOR "") + endif() + endif() + + if(is_android OR is_raspberry_pi) + hunter_assert_not_empty_string("${CMAKE_C_FLAGS}") + hunter_assert_not_empty_string("${CMAKE_CXX_FLAGS}") + hunter_assert_not_empty_string("${CMAKE_AR}") + hunter_assert_not_empty_string("${CMAKE_C_COMPILER}") + hunter_assert_not_empty_string("${CMAKE_CXX_COMPILER}") + hunter_assert_not_empty_string("${CMAKE_LINKER}") + hunter_assert_not_empty_string("${CMAKE_NM}") + hunter_assert_not_empty_string("${CMAKE_OBJCOPY}") + hunter_assert_not_empty_string("${CMAKE_OBJDUMP}") + hunter_assert_not_empty_string("${CMAKE_RANLIB}") + hunter_assert_not_empty_string("${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_http_password.cmake b/cmake/modules/hunter_http_password.cmake new file mode 100644 index 000000000..821a8f401 --- /dev/null +++ b/cmake/modules/hunter_http_password.cmake @@ -0,0 +1,27 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +include(CMakeParseArguments) # cmake_parse_arguments + +include(hunter_user_error) + +function(hunter_http_password package_name) + set(one USERNAME PASSWORD) + + cmake_parse_arguments(x "" "${one}" "" "${ARGN}") + # -> x_USERNAME + # -> x_PASSWORD + + string(COMPARE NOTEQUAL "${x_UNPARSED_ARGUMENTS}" "" has_unparsed) + if(has_unparsed) + hunter_user_error( + "'hunter_user_error' unparsed arguments: ${x_UNPARSED_ARGUMENTS}" + ) + endif() + + string(COMPARE EQUAL "${HUNTER_PACKAGE_NAME}" "${package_name}" hit) + if(hit) + set(HUNTER_PACKAGE_HTTP_USERNAME "${x_USERNAME}" PARENT_SCOPE) + set(HUNTER_PACKAGE_HTTP_PASSWORD "${x_PASSWORD}" PARENT_SCOPE) + endif() +endfunction() diff --git a/cmake/modules/hunter_init_not_found_counter.cmake b/cmake/modules/hunter_init_not_found_counter.cmake index 97f75e0e1..ae764e437 100644 --- a/cmake/modules/hunter_init_not_found_counter.cmake +++ b/cmake/modules/hunter_init_not_found_counter.cmake @@ -1,12 +1,14 @@ # Copyright (c) 2016, Ruslan Baratov # All rights reserved. -function(hunter_init_not_found_counter not_found_needed_name not_found_counter_name) +function(hunter_init_not_found_counter not_found_needed_name not_found_counter_name number_of_servers) string(COMPARE EQUAL "${HUNTER_USE_CACHE_SERVERS}" "ONLY" only_servers) if(only_servers) - set("${not_found_needed_name}" 4 PARENT_SCOPE) + set(x 4) else() - set("${not_found_needed_name}" 2 PARENT_SCOPE) + set(x 2) endif() + math(EXPR x "${x} * ${number_of_servers}") + set("${not_found_needed_name}" "${x}" PARENT_SCOPE) set("${not_found_counter_name}" 0 PARENT_SCOPE) endfunction() diff --git a/cmake/modules/hunter_initialize.cmake b/cmake/modules/hunter_initialize.cmake index 6fe5b347b..ef640a2a9 100644 --- a/cmake/modules/hunter_initialize.cmake +++ b/cmake/modules/hunter_initialize.cmake @@ -5,7 +5,7 @@ include(hunter_calculate_self) include(hunter_flush_cache_variables) include(hunter_internal_error) include(hunter_status_debug) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) macro(hunter_initialize) get_property(_gate_done GLOBAL PROPERTY HUNTER_GATE_DONE SET) @@ -73,10 +73,39 @@ macro(hunter_initialize) set(_flush TRUE) endif() + string( + COMPARE + EQUAL + "${HUNTER_CACHED_CONFIGURATION_TYPES}" + "${HUNTER_CONFIGURATION_TYPES}" + _is_ok + ) + if(NOT _is_ok) + hunter_status_debug("HUNTER_CONFIGURATION_TYPES changed:") + hunter_status_debug(" ${HUNTER_CACHED_CONFIGURATION_TYPES}") + hunter_status_debug(" ${HUNTER_CONFIGURATION_TYPES}") + set(_flush TRUE) + endif() + + string( + COMPARE + EQUAL + "${HUNTER_CACHED_BUILD_SHARED_LIBS}" + "${HUNTER_BUILD_SHARED_LIBS}" + _is_ok + ) + if(NOT _is_ok) + hunter_status_debug("HUNTER_BUILD_SHARED_LIBS changed:") + hunter_status_debug(" ${HUNTER_CACHED_BUILD_SHARED_LIBS}") + hunter_status_debug(" ${HUNTER_BUILD_SHARED_LIBS}") + set(_flush TRUE) + endif() + if(_flush) set(HUNTER_CACHED_ROOT "${HUNTER_GATE_ROOT}" CACHE INTERNAL "") set(HUNTER_VERSION "${HUNTER_GATE_VERSION}" CACHE INTERNAL "") set(HUNTER_SHA1 "${HUNTER_GATE_SHA1}" CACHE INTERNAL "") + set(HUNTER_URL "${HUNTER_GATE_URL}" CACHE INTERNAL "") hunter_calculate_self( "${HUNTER_CACHED_ROOT}" @@ -90,16 +119,20 @@ macro(hunter_initialize) set(HUNTER_CONFIG_SHA1 "" CACHE INTERNAL "") set(HUNTER_TOOLCHAIN_SHA1 "" CACHE INTERNAL "") set(HUNTER_CACHED_CONFIGURATION_TYPES "" CACHE INTERNAL "") + set(HUNTER_CACHED_BUILD_SHARED_LIBS "" CACHE INTERNAL "") endif() else() set(HUNTER_CACHED_ROOT "${HUNTER_GATE_ROOT}" CACHE INTERNAL "") set(HUNTER_VERSION "${HUNTER_GATE_VERSION}" CACHE INTERNAL "") set(HUNTER_SHA1 "${HUNTER_GATE_SHA1}" CACHE INTERNAL "") + set(HUNTER_URL "${HUNTER_GATE_URL}" CACHE INTERNAL "") endif() - hunter_test_string_not_empty("${HUNTER_CACHED_ROOT}") - hunter_test_string_not_empty("${HUNTER_VERSION}") - hunter_test_string_not_empty("${HUNTER_SHA1}") + + hunter_assert_not_empty_string("${HUNTER_CACHED_ROOT}") + hunter_assert_not_empty_string("${HUNTER_VERSION}") + hunter_assert_not_empty_string("${HUNTER_SHA1}") + hunter_assert_not_empty_string("${HUNTER_URL}") # All variables are ready so let's set HUNTER_SELF here. Usually it's not # needed before 'hunter_finalize' but it some cases may be useful diff --git a/cmake/modules/hunter_install_boost_config.cmake b/cmake/modules/hunter_install_boost_config.cmake index 12cafd9c1..a3526897b 100644 --- a/cmake/modules/hunter_install_boost_config.cmake +++ b/cmake/modules/hunter_install_boost_config.cmake @@ -1,12 +1,12 @@ # Copyright (c) 2015, Ruslan Baratov # All rights reserved. -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) function(hunter_install_boost_config) - hunter_test_string_not_empty("${HUNTER_SELF}") - hunter_test_string_not_empty("${HUNTER_PACKAGE_INSTALL_PREFIX}") - hunter_test_string_not_empty("${HUNTER_Boost_VERSION}") + hunter_assert_not_empty_string("${HUNTER_SELF}") + hunter_assert_not_empty_string("${HUNTER_PACKAGE_INSTALL_PREFIX}") + hunter_assert_not_empty_string("${HUNTER_Boost_VERSION}") set(templates "${HUNTER_SELF}/cmake/templates") set(configs "${HUNTER_PACKAGE_INSTALL_PREFIX}/lib/cmake/Boost") diff --git a/cmake/modules/hunter_internal_error.cmake b/cmake/modules/hunter_internal_error.cmake index 4fa6386c4..648f03bfc 100644 --- a/cmake/modules/hunter_internal_error.cmake +++ b/cmake/modules/hunter_internal_error.cmake @@ -1,7 +1,7 @@ # Copyright (c) 2014, Ruslan Baratov # All rights reserved. -include(hunter_wiki) +include(hunter_error_page) function(hunter_internal_error) message("") @@ -10,5 +10,5 @@ function(hunter_internal_error) endforeach() message("[hunter ** INTERNAL **] [Directory:${CMAKE_CURRENT_LIST_DIR}]") message("") - hunter_wiki("error.internal") + hunter_error_page("error.internal") endfunction() diff --git a/cmake/modules/hunter_jobs_number.cmake b/cmake/modules/hunter_jobs_number.cmake index e4511e04a..64ab359ce 100644 --- a/cmake/modules/hunter_jobs_number.cmake +++ b/cmake/modules/hunter_jobs_number.cmake @@ -8,33 +8,56 @@ function(hunter_jobs_number jobs_options_varname toolchain_path) return() endif() - string(COMPARE EQUAL "${HUNTER_JOBS_NUMBER}" "" use_default_jobs) - if(use_default_jobs) + string(COMPARE EQUAL "$ENV{HUNTER_JOBS_NUMBER}" "0" disable_jobs) + if(disable_jobs) + set("${jobs_options_varname}" "" PARENT_SCOPE) + return() + endif() + + string(COMPARE NOTEQUAL "${HUNTER_JOBS_NUMBER}" "" has_cmake_var) + string(COMPARE NOTEQUAL "$ENV{HUNTER_JOBS_NUMBER}" "" has_env_var) + + if(has_cmake_var) + set(jobs_number "${HUNTER_JOBS_NUMBER}") + elseif(has_env_var) + set(jobs_number "$ENV{HUNTER_JOBS_NUMBER}") + else() cmake_host_system_information( - RESULT jobs_number + RESULT l_cores QUERY NUMBER_OF_LOGICAL_CORES ) + cmake_host_system_information( + RESULT p_cores + QUERY NUMBER_OF_PHYSICAL_CORES + ) + hunter_status_debug("Number of physical cores: ${p_cores}") + hunter_status_debug("Number of logical cores: ${l_cores}") + + set(jobs_number ${p_cores}) + if(jobs_number LESS l_cores) + set(jobs_number ${l_cores}) + endif() + string(COMPARE EQUAL "${jobs_number}" "0" is_zero) if(is_zero) - hunter_status_debug("Number of logical cores is 0 - forcing 1") + hunter_status_debug("Force jobs number: 1") set(jobs_number "1") - else() - hunter_status_debug("Number of logical cores: ${jobs_number}") endif() - else() - set(jobs_number "${HUNTER_JOBS_NUMBER}") + + hunter_status_debug("Number of jobs: ${jobs_number}") endif() string(COMPARE NOTEQUAL "${XCODE_VERSION}" "" is_xcode) string(COMPARE EQUAL "${CMAKE_GENERATOR}" "MSYS Makefiles" is_msys) string(COMPARE EQUAL "${CMAKE_GENERATOR}" "Unix Makefiles" is_makefiles) + string(COMPARE EQUAL "${CMAKE_GENERATOR}" "Ninja" is_ninja) if(MSVC_IDE AND (MSVC_VERSION VERSION_LESS 1800)) # No /maxcpucount:N support set(jobs_number "") endif() - if(MINGW OR is_msys OR is_xcode OR is_makefiles OR MSVC_IDE) + if(MINGW OR is_msys OR is_xcode OR is_makefiles OR MSVC_IDE OR is_ninja) set("${jobs_options_varname}" "${jobs_number}" PARENT_SCOPE) return() endif() diff --git a/cmake/modules/hunter_libsodium_install_tools.cmake b/cmake/modules/hunter_libsodium_install_tools.cmake index 44c6b2d11..73c795554 100644 --- a/cmake/modules/hunter_libsodium_install_tools.cmake +++ b/cmake/modules/hunter_libsodium_install_tools.cmake @@ -1,11 +1,11 @@ include(CMakePackageConfigHelpers) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) function(hunter_install_libsodium_config) - hunter_test_string_not_empty("${HUNTER_libsodium_VERSION}") - hunter_test_string_not_empty("${HUNTER_PACKAGE_INSTALL_PREFIX}") - hunter_test_string_not_empty("${HUNTER_SELF}") + hunter_assert_not_empty_string("${HUNTER_libsodium_VERSION}") + hunter_assert_not_empty_string("${HUNTER_PACKAGE_INSTALL_PREFIX}") + hunter_assert_not_empty_string("${HUNTER_SELF}") set(templates "${HUNTER_SELF}/cmake/templates") set(configs "${HUNTER_PACKAGE_INSTALL_PREFIX}/lib/cmake/libsodium") @@ -27,10 +27,10 @@ endfunction() function(hunter_install_libsodium_targets) - hunter_test_string_not_empty("${HUNTER_PACKAGE_INSTALL_PREFIX}") - hunter_test_string_not_empty("${HUNTER_SELF}") - hunter_test_string_not_empty("${TARGET_CONFIGURATION}") - hunter_test_string_not_empty("${TARGET_LIB_FILE}") + hunter_assert_not_empty_string("${HUNTER_PACKAGE_INSTALL_PREFIX}") + hunter_assert_not_empty_string("${HUNTER_SELF}") + hunter_assert_not_empty_string("${TARGET_CONFIGURATION}") + hunter_assert_not_empty_string("${TARGET_LIB_FILE}") set(templates "${HUNTER_SELF}/cmake/templates") set(configs "${HUNTER_PACKAGE_INSTALL_PREFIX}/lib/cmake/libsodium") diff --git a/cmake/modules/hunter_libxml2_install_tools.cmake b/cmake/modules/hunter_libxml2_install_tools.cmake new file mode 100644 index 000000000..8c393b616 --- /dev/null +++ b/cmake/modules/hunter_libxml2_install_tools.cmake @@ -0,0 +1,41 @@ +include(CMakePackageConfigHelpers) +include(hunter_assert_not_empty_string) + +function(hunter_install_libxml2_config) + + hunter_assert_not_empty_string("${HUNTER_libxml2_VERSION}") + hunter_assert_not_empty_string("${HUNTER_PACKAGE_INSTALL_PREFIX}") + hunter_assert_not_empty_string("${HUNTER_SELF}") + + set(templates "${HUNTER_SELF}/cmake/templates") + set(configs "${HUNTER_PACKAGE_INSTALL_PREFIX}/lib/cmake/libxml2") + file(MAKE_DIRECTORY "${templates}" "${HUNTER_PACKAGE_INSTALL_PREFIX}/lib/cmake" "${configs}") + + write_basic_package_version_file("${configs}/libxml2Config.cmake" VERSION "${HUNTER_libxml2_VERSION}" COMPATIBILITY ExactVersion) + + configure_file( + "${templates}/libxml2Config.cmake.in" + "${configs}/libxml2Config.cmake" + @ONLY + ) + +endfunction() + + +function(hunter_install_libxml2_targets) + + hunter_assert_not_empty_string("${HUNTER_PACKAGE_INSTALL_PREFIX}") + hunter_assert_not_empty_string("${HUNTER_SELF}") + hunter_assert_not_empty_string("${TARGET_CONFIGURATION}") + hunter_assert_not_empty_string("${TARGET_LIB_FILE}") + + set(templates "${HUNTER_SELF}/cmake/templates") + set(configs "${HUNTER_PACKAGE_INSTALL_PREFIX}/lib/cmake/libxml2") + + configure_file( + "${templates}/libxml2Targets.cmake.in" + "${configs}/libxml2Targets-${TARGET_CONFIGURATION}.cmake" + @ONLY + ) + +endfunction() \ No newline at end of file diff --git a/cmake/modules/hunter_load_from_cache.cmake b/cmake/modules/hunter_load_from_cache.cmake index c35cfca39..70893c4e6 100644 --- a/cmake/modules/hunter_load_from_cache.cmake +++ b/cmake/modules/hunter_load_from_cache.cmake @@ -10,7 +10,7 @@ include(hunter_download_cache_raw_file) include(hunter_internal_error) include(hunter_patch_unrelocatable_text_files) include(hunter_status_debug) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) include(hunter_unpack_directory) # Try to load package from cache @@ -21,14 +21,14 @@ include(hunter_unpack_directory) # 3. Toolchain-ID directory already locked # 4. Cache directory is not locked function(hunter_load_from_cache) - hunter_test_string_not_empty("${HUNTER_CACHED_ROOT}") - hunter_test_string_not_empty("${HUNTER_INSTALL_PREFIX}") - hunter_test_string_not_empty("${HUNTER_PACKAGE_DONE_STAMP}") - hunter_test_string_not_empty("${HUNTER_PACKAGE_HOME_DIR}") - hunter_test_string_not_empty("${HUNTER_PACKAGE_NAME}") - hunter_test_string_not_empty("${HUNTER_PACKAGE_SHA1}") + hunter_assert_not_empty_string("${HUNTER_CACHED_ROOT}") + hunter_assert_not_empty_string("${HUNTER_INSTALL_PREFIX}") + hunter_assert_not_empty_string("${HUNTER_PACKAGE_DONE_STAMP}") + hunter_assert_not_empty_string("${HUNTER_PACKAGE_HOME_DIR}") + hunter_assert_not_empty_string("${HUNTER_PACKAGE_NAME}") + hunter_assert_not_empty_string("${HUNTER_PACKAGE_SHA1}") - hunter_test_string_not_empty("${CMAKE_BINARY_DIR}") + hunter_assert_not_empty_string("${CMAKE_BINARY_DIR}") set(human_readable "${HUNTER_PACKAGE_NAME}") string(COMPARE NOTEQUAL "${HUNTER_PACKAGE_COMPONENT}" "" has_component) @@ -175,6 +175,8 @@ function(hunter_load_from_cache) return() endif() + set(HUNTER_SKIP_SCHEME_UNPACK TRUE) + # Install dependencies file(STRINGS "${basic_deps_info}" basic_deps_list) foreach(dependency_string ${basic_deps_list}) @@ -203,10 +205,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_lock_directory.cmake b/cmake/modules/hunter_lock_directory.cmake index 1e870ff48..30aad849a 100644 --- a/cmake/modules/hunter_lock_directory.cmake +++ b/cmake/modules/hunter_lock_directory.cmake @@ -5,33 +5,25 @@ cmake_minimum_required(VERSION 3.0) include(hunter_fatal_error) include(hunter_status_debug) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) macro(hunter_lock_directory dir already_locked_varname) - hunter_test_string_not_empty("${dir}") + hunter_assert_not_empty_string("${dir}") - if(NOT HUNTER_SKIP_LOCK) - if("${CMAKE_VERSION}" VERSION_LESS "3.2") - hunter_fatal_error( - "Can't lock, upgrade to CMake 3.2 or use HUNTER_SKIP_LOCK" - WIKI "error.can.not.lock" - ) - endif() - set(_hunter_already_locked FALSE) - foreach(_hunter_locked_dir ${${already_locked_varname}}) - hunter_status_debug("Already locked: ${_hunter_locked_dir}") - string(COMPARE EQUAL "${_hunter_locked_dir}" "${dir}" _is_locked) - if(_is_locked) - set(_hunter_already_locked TRUE) - endif() - endforeach() - if(_hunter_already_locked) - hunter_status_debug("Skip locking for: ${dir}") - else() - hunter_status_debug("Locking directory: ${dir}") - file(LOCK "${dir}" DIRECTORY GUARD FUNCTION) - hunter_status_debug("Lock done") - list(APPEND ${already_locked_varname} "${dir}") + set(_hunter_already_locked FALSE) + foreach(_hunter_locked_dir ${${already_locked_varname}}) + hunter_status_debug("Already locked: ${_hunter_locked_dir}") + string(COMPARE EQUAL "${_hunter_locked_dir}" "${dir}" _is_locked) + if(_is_locked) + set(_hunter_already_locked TRUE) endif() + endforeach() + if(_hunter_already_locked) + hunter_status_debug("Skip locking for: ${dir}") + else() + hunter_status_debug("Locking directory: ${dir}") + file(LOCK "${dir}" DIRECTORY GUARD FUNCTION) + hunter_status_debug("Lock done") + list(APPEND ${already_locked_varname} "${dir}") endif() endmacro() diff --git a/cmake/modules/hunter_make_directory.cmake b/cmake/modules/hunter_make_directory.cmake index c3e742b85..663f16377 100644 --- a/cmake/modules/hunter_make_directory.cmake +++ b/cmake/modules/hunter_make_directory.cmake @@ -5,12 +5,12 @@ cmake_minimum_required(VERSION 3.0) include(hunter_internal_error) include(hunter_lock_directory) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) function(hunter_make_directory parent sha1 result) - hunter_test_string_not_empty("${parent}") - hunter_test_string_not_empty("${sha1}") - hunter_test_string_not_empty("${result}") + hunter_assert_not_empty_string("${parent}") + hunter_assert_not_empty_string("${sha1}") + hunter_assert_not_empty_string("${result}") string(SUBSTRING "${sha1}" 0 7 dir_id) diff --git a/cmake/modules/hunter_pack_directory.cmake b/cmake/modules/hunter_pack_directory.cmake index 258ffa69e..96da4ad52 100644 --- a/cmake/modules/hunter_pack_directory.cmake +++ b/cmake/modules/hunter_pack_directory.cmake @@ -5,13 +5,14 @@ include(hunter_internal_error) include(hunter_print_cmd) include(hunter_status_debug) include(hunter_status_print) +include(hunter_assert_not_empty_string) function(hunter_pack_directory dir_to_pack dest_dir result_sha1) file(MAKE_DIRECTORY "${dest_dir}") 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,30 +37,34 @@ 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() + + if(NOT EXISTS "${temp}") + hunter_internal_error("File not found: '${temp}'") endif() file(SHA1 "${temp}" archive_sha1) + + hunter_assert_not_empty_string("${archive_sha1}") + set(dest_archive "${dest_dir}/${archive_sha1}.tar.bz2") file(RENAME "${temp}" "${dest_archive}") diff --git a/cmake/modules/hunter_pack_git_self.cmake b/cmake/modules/hunter_pack_git_self.cmake new file mode 100644 index 000000000..e7abf0aee --- /dev/null +++ b/cmake/modules/hunter_pack_git_self.cmake @@ -0,0 +1,311 @@ +include(CMakeParseArguments) # cmake_parse_arguments + +include(hunter_assert_not_empty_string) +include(hunter_get_git_executable) +include(hunter_internal_error) +include(hunter_status_debug) + +function(hunter_pack_git_self) + hunter_assert_not_empty_string("${HUNTER_GATE_LOCATION}") + + set(optional "") + set(one PACKAGE URL_OUT SHA1_OUT) + set(multiple "") + + # Introduce: + # * x_PACKAGE + # * x_URL_OUT + # * x_SHA1_OUT + cmake_parse_arguments(x "${optional}" "${one}" "${multiple}" "${ARGV}") + + hunter_assert_empty_string("${x_UNPARSED_ARGUMENTS}") + + hunter_assert_not_empty_string("${x_PACKAGE}") + hunter_assert_not_empty_string("${x_URL_OUT}") + hunter_assert_not_empty_string("${x_SHA1_OUT}") + + hunter_get_git_executable(git_executable) + + 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}") + + if(NOT EXISTS "${top_git_directory}") + hunter_internal_error("Directory not found: ${top_git_directory}") + endif() + + if(NOT IS_DIRECTORY "${top_git_directory}") + hunter_internal_error("Not a directory: ${top_git_directory}") + endif() + + set(cmd "${git_executable}" status --porcelain) + hunter_status_debug( + "Run command '${cmd}' in '${top_git_directory}' directory" + ) + hunter_status_debug( + "All changes in '${HUNTER_GATE_LOCATION}' directory will be ignored" + ) + 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") + hunter_internal_error( + "Command failed: ${cmd} (${result}, ${output}, ${error})" + ) + endif() + + # https://git-scm.com/docs/git-status#_short_format + string(REPLACE "\n" ";" output "${output}") + foreach(status_full_line ${output}) + # status_full_line can be: + # * 'XY PATH' + # * 'XY ORIG_PATH -> PATH' + string(REGEX REPLACE "^.. " "" no_status_line "${status_full_line}") + string(COMPARE EQUAL "${no_status_line}" "${status_full_line}" no_change) + if(no_change) + hunter_internal_error("Unexpected status format: '${status_full_line}'") + endif() + + if(HUNTER_GIT_SELF_IGNORE_UNTRACKED) + string(REGEX MATCH "^\\?\\? " status_only "${status_full_line}") + if(status_only STREQUAL "?? ") + hunter_status_debug("File will be ignored: '${status_full_line}'") + continue() + endif() + endif() + + # no_status_line can be: + # * 'PATH' + # * 'ORIG_PATH -> PATH' + string(REGEX REPLACE " -> " ";" status_files "${no_status_line}") + + # status_files can be: + # * 'PATH' + # * 'ORIG_PATH;PATH' + + # Check that dirty files are part of directory with HunterGate + foreach(status_file ${status_files}) + set(path_to_check "${top_git_directory}/${status_file}") + + string(LENGTH "${path_to_check}" path_to_check_len) + string(LENGTH "${HUNTER_GATE_LOCATION}" hunter_gate_location_len) + + if(hunter_gate_location_len EQUAL path_to_check_len) + # HUNTER_GATE_LOCATION is a directory, path_to_check is a file, + # if they have same size then path_to_check is not in + # HUNTER_GATE_LOCATION directory for sure + hunter_user_error( + "Git directory is dirty: '${path_to_check}'" + "Please commit or stash changes." + ) + endif() + + if(hunter_gate_location_len GREATER path_to_check_len) + hunter_user_error( + "Git directory is dirty: '${path_to_check}'" + "Please commit or stash changes." + ) + endif() + + string( + SUBSTRING + "${path_to_check}" + 0 + ${hunter_gate_location_len} + path_to_check_begin + ) + + math( + EXPR + path_to_check_end_len + "${path_to_check_len} - ${hunter_gate_location_len}" + ) + + string( + SUBSTRING + "${path_to_check}" + ${hunter_gate_location_len} + ${path_to_check_end_len} + path_to_check_end + ) + + string( + COMPARE + EQUAL + "${path_to_check}" + "${path_to_check_begin}${path_to_check_end}" + is_ok + ) + if(NOT is_ok) + hunter_internal_error("Split failed") + endif() + + string( + COMPARE + EQUAL + "${path_to_check_begin}" + "${HUNTER_GATE_LOCATION}" + is_same + ) + + if(NOT is_same) + hunter_user_error( + "Git directory is dirty: '${path_to_check}'" + "Please commit or stash changes." + ) + endif() + + get_filename_component( + full_path_1 + "${HUNTER_GATE_LOCATION}/${path_to_check_end}" + ABSOLUTE + ) + + get_filename_component( + full_path_2 + "${path_to_check}" + ABSOLUTE + ) + + string(COMPARE EQUAL "${full_path_1}" "${full_path_2}" is_same) + if(is_same) + hunter_status_debug("Change ignored: '${path_to_check}'") + else() + hunter_user_error( + "Git directory is dirty: '${path_to_check}'" + "Please commit or stash changes." + ) + endif() + endforeach() + endforeach() + + set(cmd "${git_executable}" rev-parse --git-path HEAD) + 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") + hunter_internal_error( + "Command failed: ${cmd} (${result}, ${output}, ${error})" + ) + endif() + + set(head_file "${output}") + if(NOT IS_ABSOLUTE "${head_file}") + set(head_file ${top_git_directory}/${head_file}) + endif() + + 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 "${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") + 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 "${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") + hunter_internal_error( + "Command failed: ${cmd} (${result}, ${output}, ${error})" + ) + endif() + + set(ref_file "${output}") + if(NOT IS_ABSOLUTE "${ref_file}") + set(ref_file "${top_git_directory}/${ref_file}") + endif() + 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}/${x_PACKAGE}.tar") + hunter_status_debug("Creating archive '${archive}'") + + set(cmd "${git_executable}" archive HEAD -o "${archive}") + 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") + hunter_internal_error( + "Command failed: ${cmd} (${result}, ${output}, ${error})" + ) + endif() + + file(SHA1 "${archive}" package_sha1) + set(package_url "file://${archive}") + + set("${x_URL_OUT}" "${package_url}" PARENT_SCOPE) + set("${x_SHA1_OUT}" "${package_sha1}" PARENT_SCOPE) +endfunction() diff --git a/cmake/modules/hunter_pack_git_submodule.cmake b/cmake/modules/hunter_pack_git_submodule.cmake new file mode 100644 index 000000000..58049fa4d --- /dev/null +++ b/cmake/modules/hunter_pack_git_submodule.cmake @@ -0,0 +1,220 @@ +include(CMakeParseArguments) # cmake_parse_arguments + +include(hunter_internal_error) +include(hunter_status_debug) +include(hunter_user_error) + +function(hunter_pack_git_submodule) + set(optional "") + set(one PACKAGE GIT_SUBMODULE SUBMODULE_SOURCE_SUBDIR URL_OUT SHA1_OUT) + set(multiple "") + + # Introduce: + # * x_PACKAGE + # * x_GIT_SUBMODULE + # * x_SUBMODULE_SOURCE_SUBDIR + # * x_URL_OUT + # * x_SHA1_OUT + cmake_parse_arguments(x "${optional}" "${one}" "${multiple}" "${ARGV}") + + hunter_assert_empty_string("${x_UNPARSED_ARGUMENTS}") + + hunter_assert_not_empty_string("${x_PACKAGE}") + hunter_assert_not_empty_string("${x_GIT_SUBMODULE}") + hunter_assert_not_empty_string("${x_URL_OUT}") + hunter_assert_not_empty_string("${x_SHA1_OUT}") + + hunter_get_git_executable(git_executable) + + 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() + + if(NOT "${output}" STREQUAL "") + 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 found: ${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}/${x_PACKAGE}.tar") + hunter_status_debug("Creating archive '${archive}'") + + # check if whole submodule or just a subfolder is to be archived + if("${x_SUBMODULE_SOURCE_SUBDIR}" STREQUAL "") + 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() + + file(SHA1 "${archive}" package_sha1) + set(package_url "file://${archive}") + + set("${x_URL_OUT}" "${package_url}" PARENT_SCOPE) + set("${x_SHA1_OUT}" "${package_sha1}" PARENT_SCOPE) +endfunction() diff --git a/cmake/modules/hunter_parse_boost_config_macros.cmake b/cmake/modules/hunter_parse_boost_config_macros.cmake new file mode 100644 index 000000000..02c439c4c --- /dev/null +++ b/cmake/modules/hunter_parse_boost_config_macros.cmake @@ -0,0 +1,22 @@ +function(hunter_parse_boost_config_macros outvar) + # parse ARGN to convert 'CONFIG_MACRO=id1;id2;CONFIG_MACRO_id3=3' to 'id1;id2;id3=3' + unset(boost_config_macros_list) + set(config_macros_without_value_mode FALSE) + foreach(arg ${ARGN}) + if ("${arg}" MATCHES "[^=]+=.+") + set(config_macros_without_value_mode FALSE) + endif() + if(config_macros_without_value_mode) + # CONFIG_MACRO=id_1 id_2 ... id_n -> APPEND id_n + list(APPEND boost_config_macros_list "${arg}") + elseif("${arg}" MATCHES "^CONFIG_MACRO=(.+)" ) + # CONFIG_MACRO=id_1 id_2 ... id_n -> APPEND id_1 + list(APPEND boost_config_macros_list "${CMAKE_MATCH_1}") + set(config_macros_without_value_mode TRUE) + elseif("${arg}" MATCHES "^CONFIG_MACRO_([^=]+=.+)" ) + # CONFIG_MACRO_id=val -> APPEND id=val + list(APPEND boost_config_macros_list "${CMAKE_MATCH_1}") + endif() + endforeach() + set(${outvar} ${boost_config_macros_list} 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 000000000..f5f800d15 --- /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 84e853487..024382664 100644 --- a/cmake/modules/hunter_patch_unrelocatable_text_files.cmake +++ b/cmake/modules/hunter_patch_unrelocatable_text_files.cmake @@ -5,7 +5,7 @@ include(CMakeParseArguments) # cmake_parse_arguments include(hunter_internal_error) include(hunter_status_debug) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) include(hunter_user_error) function(hunter_patch_unrelocatable_text_files) @@ -21,9 +21,9 @@ function(hunter_patch_unrelocatable_text_files) hunter_internal_error("Unparsed: ${hunter_UNPARSED_ARGUMENTS}") endif() - hunter_test_string_not_empty("${x_FROM}") - hunter_test_string_not_empty("${x_TO}") - hunter_test_string_not_empty("${x_INSTALL_PREFIX}") + hunter_assert_not_empty_string("${x_FROM}") + hunter_assert_not_empty_string("${x_TO}") + hunter_assert_not_empty_string("${x_INSTALL_PREFIX}") foreach(text_file ${HUNTER_PACKAGE_UNRELOCATABLE_TEXT_FILES}) set(text_full_path "${x_INSTALL_PREFIX}/${text_file}") @@ -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 000000000..68dc6c2b4 --- /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 84ad65eee..9748c8aec 100644 --- a/cmake/modules/hunter_pick_scheme.cmake +++ b/cmake/modules/hunter_pick_scheme.cmake @@ -4,7 +4,7 @@ include(CMakeParseArguments) # cmake_parse_arguments include(hunter_internal_error) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) # Set variable: # * HUNTER_DOWNLOAD_SCHEME @@ -13,7 +13,7 @@ include(hunter_test_string_not_empty) # * HUNTER_PACKAGE_SCHEME_UNPACK # * HUNTER_PACKAGE_SCHEME_INSTALL function(hunter_pick_scheme) - hunter_test_string_not_empty("${CMAKE_GENERATOR}") + hunter_assert_not_empty_string("${CMAKE_GENERATOR}") # parse args set(one DEFAULT IPHONEOS WINDOWS) @@ -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 000000000..c470bc00a --- /dev/null +++ b/cmake/modules/hunter_pkgconfig_export_target.cmake @@ -0,0 +1,112 @@ +# ---------------------------------------------------------------------- +# 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) + +# Packages to test this function: +# * x11 +# * x264 +# * xcb +function(hunter_pkgconfig_export_target PKG_CONFIG_MODULE PKG_GENERATE_SHARED) + 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) + + if(${PKG_GENERATE_SHARED}) + set(PKG_CONFIG_PREFIX "${PKG_CONFIG_MODULE}") + else() + set(PKG_CONFIG_PREFIX "${PKG_CONFIG_MODULE}_STATIC") + endif() + + hunter_status_debug( + "PKG_CONFIG_MODULE ${PKG_CONFIG_MODULE} Using prefix ${PKG_CONFIG_PREFIX}" + ) + + # --- INTERFACE_INCLUDE_DIRECTORIES begin --- + hunter_status_debug( + "PKG_CONFIG_MODULE ${PKG_CONFIG_MODULE} INCLUDE_DIRS: ${${PKG_CONFIG_PREFIX}_INCLUDE_DIRS}" + ) + if(NOT "${${PKG_CONFIG_PREFIX}_INCLUDE_DIRS}" STREQUAL "") + set_target_properties("${target_name}" + PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES + "${${PKG_CONFIG_PREFIX}_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_PREFIX}_LDFLAGS}" + ) + if(NOT "${${PKG_CONFIG_PREFIX}_LDFLAGS}" STREQUAL "") + # turn "-framework;A;-framework;B" into "-framework A;-framework B" + string(REPLACE "-framework;" "-framework " ldflags "${${PKG_CONFIG_PREFIX}_LDFLAGS}") + list(APPEND link_libs ${ldflags}) + endif() + + hunter_status_debug( + "PKG_CONFIG_MODULE ${PKG_CONFIG_MODULE} LDFLAGS_OTHER: ${${PKG_CONFIG_PREFIX}_LDFLAGS_OTHER}" + ) + if(NOT "${${PKG_CONFIG_PREFIX}_LDFLAGS_OTHER}" STREQUAL "") + # turn "-framework;A;-framework;B" into "-framework A;-framework B" + string(REPLACE "-framework;" "-framework " ldflags_other "${${PKG_CONFIG_PREFIX}_LDFLAGS_OTHER}") + list(APPEND link_libs ${ldflags_other}) + endif() + + # No need to treat the pkg-config module's _LIBRARY_DIRS and _LIBRARIES + # as they are already included in LD_FLAGS + if(NOT "${link_libs}" STREQUAL "") + 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_PREFIX}_CFLAGS}" + ) + if(NOT "${${PKG_CONFIG_PREFIX}_CFLAGS}" STREQUAL "") + list(APPEND compile_opts ${${PKG_CONFIG_PREFIX}_CFLAGS}) + endif() + + hunter_status_debug( + "PKG_CONFIG_MODULE ${PKG_CONFIG_MODULE} CFLAGS_OTHER: ${${PKG_CONFIG_PREFIX}_CFLAGS_OTHER}" + ) + if(NOT "${${PKG_CONFIG_PREFIX}_CFLAGS_OTHER}" STREQUAL "") + list(APPEND compile_opts ${${PKG_CONFIG_PREFIX}_CFLAGS_OTHER}) + endif() + + if(NOT "${compile_opts}" STREQUAL "") + set_target_properties("${target_name}" + PROPERTIES + INTERFACE_COMPILE_OPTIONS + "${compile_opts}" + ) + endif() + # --- INTERFACE_COMPILE_OPTIONS end --- +endfunction() diff --git a/cmake/modules/hunter_private_data.cmake b/cmake/modules/hunter_private_data.cmake new file mode 100644 index 000000000..995bc78cf --- /dev/null +++ b/cmake/modules/hunter_private_data.cmake @@ -0,0 +1,304 @@ +# Copyright (c) 2018, Ruslan Baratov +# All rights reserved. + +include(CMakeParseArguments) # cmake_parse_arguments + +include(hunter_cache_server_password) +include(hunter_check_download_error_message) +include(hunter_get_passwords_path) +include(hunter_http_password) +include(hunter_init_not_found_counter) +include(hunter_internal_error) +include(hunter_lock_directory) +include(hunter_private_data_password) +include(hunter_sleep_before_download) +include(hunter_step_into_unpacked_directory) +include(hunter_upload_password) +include(hunter_user_error) + +function(hunter_private_data) + set(func "'hunter_private_data'") + + hunter_assert_not_empty_string("${HUNTER_CACHED_ROOT}") + + set(one URL SHA1 CREDENTIALS LOCATION FILE) + set(multiple HTTPHEADER) + + cmake_parse_arguments(x "" "${one}" "${multiple}" "${ARGN}") + # -> x_URL + # -> x_SHA1 + # -> x_CREDENTIALS + # -> x_LOCATION + # -> x_FILE + # -> x_HTTPHEADER + + string(COMPARE NOTEQUAL "${x_UNPARSED_ARGUMENTS}" "" has_unparsed) + if(has_unparsed) + hunter_user_error("${func} unparsed arguments: ${x_UNPARSED_ARGUMENTS}") + endif() + + string(COMPARE EQUAL "${x_URL}" "" is_empty) + if(is_empty) + hunter_user_error("${func}: URL is missing") + endif() + + string(COMPARE EQUAL "${x_SHA1}" "" is_empty) + if(is_empty) + hunter_user_error("${func}: SHA1 is missing") + endif() + + string(COMPARE EQUAL "${x_LOCATION}" "" is_empty) + if(is_empty) + hunter_user_error("${func}: LOCATION is missing") + endif() + + string(COMPARE EQUAL "${x_FILE}" "" do_unpack) + if(NOT do_unpack) + get_filename_component(file_name "${x_FILE}" NAME) + string(COMPARE EQUAL "${file_name}" "${x_FILE}" ok) + if(NOT ok) + hunter_user_error( + "${func}: FILE with directories not allowed '${x_FILE}'" + ) + endif() + endif() + + set(priv_dir_root "${HUNTER_CACHED_ROOT}/_Base/PrivateData") + + hunter_make_directory("${priv_dir_root}/${x_SHA1}" "${x_SHA1}" priv_dir) + set(done_stamp "${priv_dir}/unpack.DONE") + set(raw_dir "${priv_dir}/raw") + set(param_file "${priv_dir}/param.file") # consistency check + + if(do_unpack) + # return path to unpacked directory + set(output "${raw_dir}") + set(dst_file "${priv_dir}/archive.file") + else() + # return path to file + set(output "${raw_dir}/${x_FILE}") + set(dst_file "${output}") + endif() + + if(NOT EXISTS "${done_stamp}") + hunter_lock_directory("${priv_dir}" "") + endif() + + # While waiting for lock other instance can do all the job + if(EXISTS "${done_stamp}") + if(EXISTS "${dst_file}") + if(NOT EXISTS "${output}") + hunter_internal_error("File not found: '${output}'") + endif() + + if(do_unpack) + hunter_step_into_unpacked_directory("${output}" output) + endif() + + set("${x_LOCATION}" ${output} PARENT_SCOPE) + return() + endif() + + # Something went wrong + if(EXISTS "${param_file}") + # Previous call was with FILE + file(READ "${param_file}" file_value) + string(COMPARE EQUAL "${file_value}" "" is_empty) + if(is_empty) + hunter_internal_error("Value from ${param_file} is empty") + endif() + else() + set(file_value "") + endif() + + if(do_unpack) + # archive.file not found, previous call was with FILE + hunter_user_error( + "Inconsistent ${func}.\n" + "Previous call was with 'FILE ${file_value}'" + ) + else() + # raw/ not found, previous call was with different FILE + # or without FILE + string(COMPARE EQUAL "${file_value}" "" is_empty) + if(is_empty) + hunter_user_error( + "Inconsistent ${func}.\n" + "Previous call was without 'FILE'" + ) + else() + hunter_user_error( + "Inconsistent ${func}.\n" + "Previous call was with 'FILE ${file_value}'" + ) + endif() + endif() + endif() + + file(REMOVE "${param_file}") + + string(COMPARE NOTEQUAL "${x_CREDENTIALS}" "" protected) + if(protected) + set(HUNTER_PRIVATE_DATA_CREDENTIALS "${x_CREDENTIALS}") + hunter_get_passwords_path(pass_path) + + # May use: + # * hunter_http_password + # * hunter_private_data_password + # * hunter_upload_password + # * hunter_cache_server_password + include("${pass_path}") + + string(COMPARE EQUAL "${HUNTER_PRIVATE_DATA_USERNAME}" "" no_username) + string(COMPARE EQUAL "${HUNTER_PRIVATE_DATA_PASSWORD}" "" no_password) + + if(no_username AND no_password) + hunter_user_error( + "Credentials for '${x_CREDENTIALS}' are empty,\n" + "'hunter_private_data_password' is missing?" + ) + endif() + + if(no_username) + hunter_user_error("Private data: USERNAME is missing") + endif() + + if(no_password) + hunter_user_error("Private data: PASSWORD is missing") + endif() + endif() + + if(HUNTER_STATUS_DEBUG) + set(progress SHOW_PROGRESS) + else() + set(progress "") + endif() + + if(protected) + set( + userpwd + USERPWD + "${HUNTER_PRIVATE_DATA_USERNAME}:${HUNTER_PRIVATE_DATA_PASSWORD}" + ) + else() + set(userpwd "") + endif() + + string(COMPARE EQUAL "${x_HTTPHEADER}" "" no_header) + if(no_header) + set(httpheader "") + else() + foreach(header ${x_HTTPHEADER}) + list(APPEND httpheader HTTPHEADER "${header}") + endforeach() + endif() + + hunter_init_not_found_counter(NOT_FOUND_NEEDED not_found_counter "1") + + set(download_done FALSE) + + set(total_retry 10) + foreach(x RANGE ${total_retry}) + if(EXISTS "${dst_file}") + file(SHA1 "${dst_file}" local_sha1) + string(COMPARE EQUAL "${local_sha1}" "${x_SHA1}" is_good) + if(is_good) + set(download_done TRUE) + else() + hunter_status_debug("File exists but SHA1 differs: '${dst_file}'") + file(REMOVE "${dst_file}") + endif() + endif() + + if(download_done) + # TODO: Update to CMake 3.2 to use 'continue' + else() + + hunter_status_debug("Downloading file (try #${x} of ${total_retry}):") + hunter_status_debug(" ${x_URL}") + hunter_status_debug(" -> ${dst_file}") + + hunter_sleep_before_download("${x}") + + file( + DOWNLOAD + "${x_URL}" + "${dst_file}" + ${progress} + STATUS status + ${userpwd} + ${httpheader} + TLS_VERIFY ${HUNTER_TLS_VERIFY} + ) + file(SHA1 "${dst_file}" local_sha1) + + string(COMPARE EQUAL "${local_sha1}" "${x_SHA1}" sha1_is_good) + + list(GET status 0 error_code) + list(GET status 1 error_message) + + hunter_check_download_error_message( + ERROR_CODE "${error_code}" + ERROR_MESSAGE "${error_message}" + REMOVE_ON_ERROR "${dst_file}" + NOT_FOUND_COUNTER not_found_counter + ) + + if(error_code EQUAL 0) + if(sha1_is_good) + set(download_done TRUE) + else() + hunter_status_debug("SHA1 mismatch (retry):") + hunter_status_debug(" ${local_sha1} (local)") + hunter_status_debug(" ${x_SHA1} (expected)") + file(REMOVE "${dst_file}") + endif() + elseif(error_code EQUAL 22) + hunter_status_debug("File not found") + if(NOT_FOUND_NEEDED EQUAL not_found_counter) + hunter_user_error("File not found by URL '${x_URL}'") + endif() + else() + hunter_status_debug("Download error (${error_message})") + endif() + endif() + endforeach() + + if(NOT download_done) + hunter_user_error("Download failed") + endif() + + if(do_unpack) + if(EXISTS "${output}") + hunter_status_debug("Removing directory '${output}'") + file(REMOVE_RECURSE "${output}") + endif() + file(MAKE_DIRECTORY "${output}") + hunter_status_debug("Unpacking archive '${dst_file}' to '${output}'") + if(HUNTER_STATUS_DEBUG AND NOT HUNTER_SUPPRESS_LIST_OF_FILES) + set(tar_params "xvf") + else() + set(tar_params "xf") + endif() + execute_process( + COMMAND "${CMAKE_COMMAND}" -E tar ${tar_params} "${dst_file}" + WORKING_DIRECTORY "${output}" + RESULT_VARIABLE result + ) + if(NOT result EQUAL "0") + hunter_user_error("Unpacking failed") + endif() + endif() + + if(do_unpack) + hunter_step_into_unpacked_directory("${output}" output) + endif() + + set("${x_LOCATION}" ${output} PARENT_SCOPE) + + if(NOT do_unpack) + file(WRITE "${param_file}" "${x_FILE}") + endif() + + file(WRITE "${done_stamp}" "") +endfunction() diff --git a/cmake/modules/hunter_private_data_password.cmake b/cmake/modules/hunter_private_data_password.cmake new file mode 100644 index 000000000..aa26db9b7 --- /dev/null +++ b/cmake/modules/hunter_private_data_password.cmake @@ -0,0 +1,34 @@ +# Copyright (c) 2018, Ruslan Baratov +# All rights reserved. + +include(CMakeParseArguments) # cmake_parse_arguments + +include(hunter_user_error) + +function(hunter_private_data_password) + set(one CREDENTIALS USERNAME PASSWORD) + + cmake_parse_arguments(x "" "${one}" "" "${ARGN}") + # -> x_CREDENTIALS + # -> x_USERNAME + # -> x_PASSWORD + + string(COMPARE NOTEQUAL "${x_UNPARSED_ARGUMENTS}" "" has_unparsed) + if(has_unparsed) + set(func "'hunter_private_data_password'") + hunter_user_error("${func} unparsed arguments: ${x_UNPARSED_ARGUMENTS}") + endif() + + string( + COMPARE + EQUAL + "${x_CREDENTIALS}" + "${HUNTER_PRIVATE_DATA_CREDENTIALS}" + hit + ) + + if(hit) + set(HUNTER_PRIVATE_DATA_USERNAME "${x_USERNAME}" PARENT_SCOPE) + set(HUNTER_PRIVATE_DATA_PASSWORD "${x_PASSWORD}" PARENT_SCOPE) + endif() +endfunction() diff --git a/cmake/modules/hunter_protected_sources.cmake b/cmake/modules/hunter_protected_sources.cmake new file mode 100644 index 000000000..c161fbd40 --- /dev/null +++ b/cmake/modules/hunter_protected_sources.cmake @@ -0,0 +1,14 @@ +# Copyright (c) 2016 Ruslan Baratov +# All rights reserved. + +include(hunter_user_error) + +function(hunter_protected_sources package_name) + if(CMAKE_VERSION VERSION_LESS "3.7") + hunter_user_error( + "'hunter_protected_sources' need CMake version 3.7+, see" + " https://docs.hunter.sh/en/latest/quick-start/cmake.html" + ) + endif() + set("HUNTER_${package_name}_PROTECTED_SOURCES" YES PARENT_SCOPE) +endfunction() diff --git a/cmake/modules/hunter_qt_add_module.cmake b/cmake/modules/hunter_qt_add_module.cmake index 1bcdd1366..50e4c8354 100644 --- a/cmake/modules/hunter_qt_add_module.cmake +++ b/cmake/modules/hunter_qt_add_module.cmake @@ -24,15 +24,19 @@ function(hunter_qt_add_module) return() endif() - set(dep_list "${x_COMPONENTS}") + set(dep_list "") - foreach(dep ${dep_list}) + # "Base" components should be build first so adding dependencies of + # dependencies for the start. + foreach(dep ${x_COMPONENTS}) list(APPEND dep_list ${component_${dep}_depends_on}) endforeach() + # Now we can proceed with explicit dependencies + list(APPEND dep_list "${x_COMPONENTS}") + list(REMOVE_ITEM dep_list "") # remove empty elements list(REMOVE_DUPLICATES dep_list) - list(SORT dep_list) set(component_${x_NAME}_depends_on "${dep_list}" PARENT_SCOPE) endfunction() diff --git a/cmake/modules/hunter_read_http_credentials.cmake b/cmake/modules/hunter_read_http_credentials.cmake new file mode 100644 index 000000000..86c718821 --- /dev/null +++ b/cmake/modules/hunter_read_http_credentials.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2016, Ruslan Baratov +# All rights reserved. + +include(hunter_cache_server_password) +include(hunter_get_passwords_path) +include(hunter_http_password) +include(hunter_private_data_password) +include(hunter_status_debug) +include(hunter_upload_password) + +# Read credentials for package HUNTER_PACKAGE_NAME and +# save them in parent scope variables: +# * HUNTER_PACKAGE_HTTP_USERNAME +# * HUNTER_PACKAGE_HTTP_PASSWORD +function(hunter_read_http_credentials) + hunter_status_debug( + "Reading HTTP credentials for protected package '${HUNTER_PACKAGE_NAME}'" + ) + + hunter_get_passwords_path(pass_path) + + hunter_status_debug("Including file '${pass_path}'") + + # May use: + # * hunter_http_password + # * hunter_private_data_password + # * hunter_upload_password + # * hunter_cache_server_password + include("${pass_path}") + + set( + HUNTER_PACKAGE_HTTP_USERNAME + "${HUNTER_PACKAGE_HTTP_USERNAME}" + PARENT_SCOPE + ) + + set( + HUNTER_PACKAGE_HTTP_PASSWORD + "${HUNTER_PACKAGE_HTTP_PASSWORD}" + PARENT_SCOPE + ) +endfunction() diff --git a/cmake/modules/hunter_register_dependency.cmake b/cmake/modules/hunter_register_dependency.cmake index d28584e7a..08939192b 100644 --- a/cmake/modules/hunter_register_dependency.cmake +++ b/cmake/modules/hunter_register_dependency.cmake @@ -5,7 +5,7 @@ include(CMakeParseArguments) # cmake_parse_arguments include(hunter_internal_error) include(hunter_status_debug) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) function(hunter_register_dependency) set(one DEPENDS_ON_PACKAGE DEPENDS_ON_COMPONENT) @@ -50,11 +50,11 @@ function(hunter_register_dependency) hunter_internal_error("Incorrect PACKAGE: ${hunter_PACKAGE}") endif() - hunter_test_string_not_empty("${hunter_PACKAGE_NAME}") - hunter_test_string_not_empty("${HUNTER_TOOLCHAIN_ID_PATH}") + hunter_assert_not_empty_string("${hunter_PACKAGE_NAME}") + hunter_assert_not_empty_string("${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_report_broken_package.cmake b/cmake/modules/hunter_report_broken_package.cmake index 410e6c234..649e528a9 100644 --- a/cmake/modules/hunter_report_broken_package.cmake +++ b/cmake/modules/hunter_report_broken_package.cmake @@ -11,5 +11,5 @@ function(hunter_report_broken_package) foreach(x ${ARGV}) set(msg "${msg} ${x}") endforeach() - hunter_fatal_error("Broken package: ${msg}" WIKI "error.broken.package") + hunter_fatal_error("Broken package: ${msg}" ERROR_PAGE "error.broken.package") endfunction() diff --git a/cmake/modules/hunter_save_to_cache.cmake b/cmake/modules/hunter_save_to_cache.cmake index 556418d76..7f1ba1bc9 100644 --- a/cmake/modules/hunter_save_to_cache.cmake +++ b/cmake/modules/hunter_save_to_cache.cmake @@ -9,7 +9,7 @@ include(hunter_make_directory) include(hunter_pack_directory) include(hunter_patch_unrelocatable_text_files) include(hunter_status_debug) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) include(hunter_unpack_directory) # Save results of install @@ -20,11 +20,11 @@ include(hunter_unpack_directory) # 4. Unpack archive from Cache to HUNTER_INSTALL_PREFIX # 5. Save cache.sha1 file function(hunter_save_to_cache) - hunter_test_string_not_empty("${HUNTER_CACHED_ROOT}") - hunter_test_string_not_empty("${HUNTER_INSTALL_PREFIX}") - hunter_test_string_not_empty("${HUNTER_PACKAGE_HOME_DIR}") - hunter_test_string_not_empty("${HUNTER_PACKAGE_INSTALL_PREFIX}") - hunter_test_string_not_empty("${HUNTER_PACKAGE_NAME}") + hunter_assert_not_empty_string("${HUNTER_CACHED_ROOT}") + hunter_assert_not_empty_string("${HUNTER_INSTALL_PREFIX}") + hunter_assert_not_empty_string("${HUNTER_PACKAGE_HOME_DIR}") + hunter_assert_not_empty_string("${HUNTER_PACKAGE_INSTALL_PREFIX}") + hunter_assert_not_empty_string("${HUNTER_PACKAGE_NAME}") string(COMPARE NOTEQUAL "${HUNTER_PACKAGE_COMPONENT}" "" has_component) string( @@ -97,14 +97,10 @@ function(hunter_save_to_cache) archive_sha1 ) - 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() + hunter_assert_not_empty_string("${archive_sha1}") ### 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__" @@ -114,12 +110,25 @@ function(hunter_save_to_cache) ### Save cache meta-data hunter_create_cache_meta_directory("${cache_directory}" cache_meta_dir) - hunter_test_string_not_empty("${cache_meta_dir}") + hunter_assert_not_empty_string("${cache_meta_dir}") ### create cache.sha1 file in home (before saving dependencies) hunter_status_debug("Saving cache file: ${cache_file}") + hunter_status_debug("With SHA1: ${archive_sha1}") file(WRITE "${cache_file}" "${archive_sha1}") + # Sanity check + file(READ "${cache_file}" archive_sha1_check) + + string(COMPARE EQUAL "${archive_sha1}" "${archive_sha1_check}" is_ok) + if(NOT is_ok) + hunter_internal_error( + "Sanity check failed (${cache_file}):" + " * '${archive_sha1}'" + " * '${archive_sha1_check}'" + ) + endif() + # Get dependencies (non-recursively) if(has_component) hunter_get_package_deps( @@ -135,9 +144,10 @@ function(hunter_save_to_cache) endif() set(basic_deps_info "${cache_meta_dir}/basic-deps.info") set(basic_deps_done "${cache_meta_dir}/basic-deps.DONE") - set(basic_deps_info_temp "${cache_meta_dir}/basic-deps.info-TEMP") + set(basic_deps_info_nolf "${cache_meta_dir}/basic-deps.info.NOLF") + set(basic_deps_info_temp "${cache_meta_dir}/basic-deps.info.TEMP") - file(WRITE "${basic_deps_info_temp}" "") + file(WRITE "${basic_deps_info_nolf}" "") list(LENGTH basic_dependencies len) if(len EQUAL 0) hunter_status_debug("No basic dependencies for package: ${human_readable}") @@ -145,10 +155,19 @@ function(hunter_save_to_cache) hunter_status_debug("Basic dependencies for package: ${human_readable}") foreach(x ${basic_dependencies}) hunter_status_debug(" ${x}") - file(APPEND "${basic_deps_info_temp}" "${x}\n") + file(APPEND "${basic_deps_info_nolf}" "${x}\n") endforeach() endif() + # About '@ONLY': no substitutions expected but COPYONLY can't be + # used with NEWLINE_STYLE + configure_file( + "${basic_deps_info_nolf}" + "${basic_deps_info_temp}" + @ONLY + NEWLINE_STYLE LF + ) + if(EXISTS "${basic_deps_info}") if(NOT EXISTS "${basic_deps_done}") hunter_internal_error("File not found: ${basic_deps_done}") @@ -204,4 +223,16 @@ function(hunter_save_to_cache) file(WRITE "${cache_meta_dir}/cache.sha1" "${archive_sha1}") file(WRITE "${cache_meta_dir}/CACHE.DONE" "") + + # Sanity check + file(READ "${cache_meta_dir}/cache.sha1" archive_sha1_check) + + string(COMPARE EQUAL "${archive_sha1}" "${archive_sha1_check}" is_ok) + if(NOT is_ok) + hunter_internal_error( + "Sanity check failed (${cache_meta_dir}):" + " * '${archive_sha1}'" + " * '${archive_sha1_check}'" + ) + endif() endfunction() diff --git a/cmake/modules/hunter_set_config_location.cmake b/cmake/modules/hunter_set_config_location.cmake index 57c95ecc2..c0555bd72 100644 --- a/cmake/modules/hunter_set_config_location.cmake +++ b/cmake/modules/hunter_set_config_location.cmake @@ -5,12 +5,12 @@ cmake_minimum_required(VERSION 3.0) include(hunter_internal_error) include(hunter_status_print) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) include(hunter_user_error) function(hunter_set_config_location hunter_self result) - hunter_test_string_not_empty("${hunter_self}") - hunter_test_string_not_empty("${result}") + hunter_assert_not_empty_string("${hunter_self}") + hunter_assert_not_empty_string("${result}") if(HUNTER_GATE_GLOBAL) set( diff --git a/cmake/modules/hunter_setup_msvc.cmake b/cmake/modules/hunter_setup_msvc.cmake index 55ee842c7..78b498e7a 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,6 +42,8 @@ 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(REGEX MATCH "^191[0-9]$" _vs_15_2017 "${MSVC_VERSION}") + string(REGEX MATCH "^192[0-9]$" _vs_16_2019 "${MSVC_VERSION}") if(_vs_8_2005) set(HUNTER_MSVC_VERSION "8") @@ -60,6 +63,12 @@ macro(hunter_setup_msvc) elseif(_vs_14_2015) set(HUNTER_MSVC_VERSION "14") set(HUNTER_MSVC_YEAR "2015") + elseif(_vs_15_2017) + set(HUNTER_MSVC_VERSION "15") + set(HUNTER_MSVC_YEAR "2017") + elseif(_vs_16_2019) + set(HUNTER_MSVC_VERSION "16") + set(HUNTER_MSVC_YEAR "2019") else() hunter_internal_error("Unexpected MSVC_VERSION: '${MSVC_VERSION}'") endif() @@ -100,18 +109,61 @@ 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}'" + ) + hunter_status_debug( + "CMAKE_VS_MSBUILD_COMMAND: '${CMAKE_VS_MSBUILD_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 and CMAKE_VS_MSBUILD_COMMAND" ) + string(COMPARE EQUAL "${CMAKE_VS_DEVENV_COMMAND}" "" is_devenv_empty) + string(COMPARE EQUAL "${CMAKE_VS_MSBUILD_COMMAND}" "" is_msbuild_empty) + if(NOT is_devenv_empty AND IS_ABSOLUTE "${CMAKE_VS_DEVENV_COMMAND}") + get_filename_component(_hunter_vcvarsall_path + "${CMAKE_VS_DEVENV_COMMAND}" DIRECTORY + ) + set(_hunter_vcvarsall_path + "${_hunter_vcvarsall_path}/../../VC/Auxiliary/Build" + ) + elseif(NOT is_msbuild_empty AND IS_ABSOLUTE "${CMAKE_VS_MSBUILD_COMMAND}") + get_filename_component(_hunter_vcvarsall_path + "${CMAKE_VS_MSBUILD_COMMAND}" DIRECTORY + ) + set(_hunter_vcvarsall_path + "${_hunter_vcvarsall_path}/../../../VC/Auxiliary/Build" + ) + else() + hunter_fatal_error( + "Incorrect MSVC setup:" + " At least one of the following should be an absolute path" + " CMAKE_VS_DEVENV_COMMAND:(${CMAKE_VS_DEVENV_COMMAND})" + " CMAKE_VS_MSBUILD_COMMAND:(${CMAKE_VS_MSBUILD_COMMAND})" + ERROR_PAGE + error.vs.devenv + ) + endif() + 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_sleep_before_download.cmake b/cmake/modules/hunter_sleep_before_download.cmake index 7449ceaa3..348520fb1 100644 --- a/cmake/modules/hunter_sleep_before_download.cmake +++ b/cmake/modules/hunter_sleep_before_download.cmake @@ -3,10 +3,10 @@ include(hunter_internal_error) include(hunter_status_debug) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) function(hunter_sleep_before_download attempt) - hunter_test_string_not_empty("${attempt}") + hunter_assert_not_empty_string("${attempt}") if(attempt EQUAL 0) return() diff --git a/cmake/modules/hunter_step_into_unpacked_directory.cmake b/cmake/modules/hunter_step_into_unpacked_directory.cmake new file mode 100644 index 000000000..404e2a472 --- /dev/null +++ b/cmake/modules/hunter_step_into_unpacked_directory.cmake @@ -0,0 +1,18 @@ +# Copyright (c) 2018, Ruslan Baratov +# All rights reserved. + +# If unpacked archive has only one directory at the top then step into it. +# Same logic as for ExternalProject_Add: +# * https://github.com/Kitware/CMake/blob/1da3f3e916de5ac6e64b473575d02bb3d358fc76/Modules/ExternalProject.cmake#L1551-L1559 + +function(hunter_step_into_unpacked_directory unpacked_directory output) + file(GLOB contents "${unpacked_directory}/*") + list(REMOVE_ITEM contents "${unpacked_directory}/.DS_Store") + list(LENGTH contents n) + + if(n EQUAL "1" AND IS_DIRECTORY "${contents}") + set("${output}" "${contents}" PARENT_SCOPE) + else() + set("${output}" "${unpacked_directory}") + endif() +endfunction() diff --git a/cmake/modules/hunter_unpack_directory.cmake b/cmake/modules/hunter_unpack_directory.cmake index c49af2fd8..6ef29d870 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_assert_not_empty_string) -function(hunter_unpack_directory archive dest_dir) - file(MAKE_DIRECTORY "${dest_dir}") +function(hunter_unpack_directory cache_sha1) + hunter_assert_not_empty_string("${HUNTER_SELF}") + hunter_assert_not_empty_string("${HUNTER_CACHED_ROOT}") + hunter_assert_not_empty_string("${HUNTER_INSTALL_PREFIX}") + hunter_assert_not_empty_string("${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 -f \\\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/modules/hunter_upload_cache.cmake b/cmake/modules/hunter_upload_cache.cmake new file mode 100644 index 000000000..7b20c2071 --- /dev/null +++ b/cmake/modules/hunter_upload_cache.cmake @@ -0,0 +1,119 @@ +# Copyright (c) 2018, Ruslan Baratov +# All rights reserved. + +include(hunter_cache_server_password) +include(hunter_get_passwords_path) +include(hunter_http_password) +include(hunter_internal_error) +include(hunter_private_data_password) +include(hunter_assert_not_empty_string) +include(hunter_upload_password) +include(hunter_upload_to_custom_server) +include(hunter_user_error) + +function(hunter_upload_cache) + hunter_assert_not_empty_string("${HUNTER_CACHED_ROOT}") + hunter_assert_not_empty_string("${HUNTER_PACKAGE_BUILD_DIR}") + hunter_assert_not_empty_string("${HUNTER_SELF}") + + if(NOT HUNTER_RUN_UPLOAD) + return() + endif() + + hunter_status_debug("Uploading cache") + + hunter_get_passwords_path(pass_path) + + hunter_status_debug("Including file '${pass_path}'") + + # May use: + # * hunter_http_password + # * hunter_private_data_password + # * hunter_upload_password + # * hunter_cache_server_password + include("${pass_path}") + + string(COMPARE EQUAL "${HUNTER_UPLOAD_REPO_OWNER}" "" empty_repo_owner) + string(COMPARE EQUAL "${HUNTER_UPLOAD_REPO}" "" empty_repo) + string(COMPARE EQUAL "${HUNTER_UPLOAD_USERNAME}" "" empty_username) + string(COMPARE EQUAL "${HUNTER_UPLOAD_PASSWORD}" "" empty_password) + + string(COMPARE EQUAL "${HUNTER_UPLOAD_SERVER}" "" empty_server) + string(COMPARE EQUAL "${HUNTER_UPLOAD_SUB_SHA1_SUFFIX}" "" empty_sub_sha1_suffix) + string(COMPARE EQUAL "${HUNTER_UPLOAD_HTTPHEADER}" "" empty_httpheader) + + if( + empty_repo_owner + AND empty_repo + AND empty_username + AND empty_password + AND empty_server + AND empty_sub_sha1_suffix + AND empty_httpheader + ) + hunter_user_error( + "Upload parameters are empty, 'hunter_upload_password' is missing?" + ) + endif() + + if(empty_server) + if(empty_repo_owner) + hunter_user_error("Upload: REPO_OWNER is missing") + endif() + if(empty_repo) + hunter_user_error("Upload: REPO is missing") + endif() + if(empty_username) + hunter_user_error("Upload: USERNAME is missing") + endif() + if(empty_password) + hunter_user_error("Upload: PASSWORD is missing") + endif() + else() + hunter_upload_to_custom_server() + file(REMOVE_RECURSE "${HUNTER_PACKAGE_BUILD_DIR}") + return() + endif() + + # Run isolated script to aviod cross-compiling issues and + # other variables effects + execute_process( + COMMAND ${CMAKE_COMMAND} -P ${HUNTER_SELF}/scripts/find_python.cmake + RESULT_VARIABLE result + OUTPUT_VARIABLE python_path + ERROR_VARIABLE python_path + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + + if(result EQUAL "0") + hunter_status_debug("Upload using Python: '${python_path}'") + else() + hunter_user_error("Python not found (required for uploading)") + endif() + + set(upload_script "${HUNTER_SELF}/scripts/upload-cache-to-github.py") + if(NOT EXISTS "${upload_script}") + hunter_internal_error("Script not found: ${upload_script}") + endif() + + set(cache_directory "${HUNTER_CACHED_ROOT}/_Base/Cache") + + execute_process( + COMMAND + "${python_path}" + "${upload_script}" + --repo-owner "${HUNTER_UPLOAD_REPO_OWNER}" + --repo "${HUNTER_UPLOAD_REPO}" + --username "${HUNTER_UPLOAD_USERNAME}" + --password "${HUNTER_UPLOAD_PASSWORD}" + --cache-dir "${cache_directory}" + WORKING_DIRECTORY "${CELLAR_RAW_DIRECTORY}" + RESULT_VARIABLE result + ) + + file(REMOVE_RECURSE "${HUNTER_PACKAGE_BUILD_DIR}") + + if(NOT result EQUAL "0") + hunter_internal_error("Upload script failed") + endif() +endfunction() diff --git a/cmake/modules/hunter_upload_password.cmake b/cmake/modules/hunter_upload_password.cmake new file mode 100644 index 000000000..94bcf02e5 --- /dev/null +++ b/cmake/modules/hunter_upload_password.cmake @@ -0,0 +1,59 @@ +# Copyright (c) 2018, Ruslan Baratov +# All rights reserved. + +include(CMakeParseArguments) # cmake_parse_arguments + +include(hunter_user_error) + +function(hunter_upload_password) + set(opt SUB_SHA1_SUFFIX) + set(one REPO_OWNER REPO USERNAME PASSWORD SERVER) + set(multi HTTPHEADER) + + cmake_parse_arguments(x "${opt}" "${one}" "${multi}" "${ARGN}") + # -> x_SUB_SHA1_SUFFIX + # -> x_REPO_OWNER + # -> x_REPO + # -> x_USERNAME + # -> x_PASSWORD + # -> x_SERVER + # -> x_HTTPHEADER + + string(COMPARE NOTEQUAL "${x_UNPARSED_ARGUMENTS}" "" has_unparsed) + if(has_unparsed) + hunter_user_error( + "'hunter_upload_password' unparsed arguments: ${x_UNPARSED_ARGUMENTS}" + ) + endif() + + string(COMPARE NOTEQUAL "${x_SERVER}" "" has_server) + string(COMPARE NOTEQUAL "${x_REPO_OWNER}" "" has_repo_owner) + string(COMPARE NOTEQUAL "${x_REPO}" "" has_repo) + string(COMPARE NOTEQUAL "${x_HTTPHEADER}" "" has_httpheader) + + if(has_server) + # Not GitHub server + if(has_repo_owner) + hunter_user_error("Unexpected REPO_OWNER") + endif() + if(has_repo) + hunter_user_error("Unexpected REPO") + endif() + else() + # GitHub server + if(has_httpheader) + hunter_user_error("Unexpected HTTPHEADER") + endif() + if(x_SUB_SHA1_SUFFIX) + hunter_user_error("Unexpected SUB_SHA1_SUFFIX") + endif() + endif() + + set(HUNTER_UPLOAD_REPO_OWNER "${x_REPO_OWNER}" PARENT_SCOPE) + set(HUNTER_UPLOAD_REPO "${x_REPO}" PARENT_SCOPE) + set(HUNTER_UPLOAD_USERNAME "${x_USERNAME}" PARENT_SCOPE) + set(HUNTER_UPLOAD_PASSWORD "${x_PASSWORD}" PARENT_SCOPE) + set(HUNTER_UPLOAD_SERVER "${x_SERVER}" PARENT_SCOPE) + set(HUNTER_UPLOAD_SUB_SHA1_SUFFIX "${x_SUB_SHA1_SUFFIX}" PARENT_SCOPE) + set(HUNTER_UPLOAD_HTTPHEADER "${x_HTTPHEADER}" PARENT_SCOPE) +endfunction() diff --git a/cmake/modules/hunter_upload_single_file.cmake b/cmake/modules/hunter_upload_single_file.cmake new file mode 100644 index 000000000..1c2766464 --- /dev/null +++ b/cmake/modules/hunter_upload_single_file.cmake @@ -0,0 +1,91 @@ +# Copyright (c) 2018, Ruslan Baratov +# All rights reserved. + +include(hunter_internal_error) +include(hunter_sleep_before_download) +include(hunter_status_debug) + +function(hunter_upload_single_file filename) + hunter_assert_not_empty_string("${HUNTER_CACHED_ROOT}") + hunter_assert_not_empty_string("${HUNTER_UPLOAD_SERVER}") + + set(cache_root_dir "${HUNTER_CACHED_ROOT}/_Base/Cache") + if(NOT EXISTS ${cache_root_dir}) + hunter_internal_error("Not found: ${cache_root_dir}") + endif() + + set(full_path "${cache_root_dir}/${filename}") + if(NOT EXISTS ${full_path}) + hunter_internal_error("File not found: ${full_path}") + endif() + + set(upload_url "${HUNTER_UPLOAD_SERVER}/${filename}") + + if(HUNTER_UPLOAD_SUB_SHA1_SUFFIX) + string( + REGEX + REPLACE + "/cache\\.sha1$" + "/cache_sha1" + upload_url + "${upload_url}" + ) + endif() + + string(COMPARE EQUAL "${HUNTER_UPLOAD_USERNAME}" "" empty_username) + string(COMPARE EQUAL "${HUNTER_UPLOAD_PASSWORD}" "" empty_password) + + if(empty_username AND empty_password) + set(userpwd "") + else() + set(userpwd USERPWD "${HUNTER_UPLOAD_USERNAME}:${HUNTER_UPLOAD_PASSWORD}") + endif() + + string(COMPARE EQUAL "${HUNTER_UPLOAD_HTTPHEADER}" "" empty_httpheader) + if(empty_httpheader) + set(httpheader "") + else() + set(httpheader "") + foreach(header ${HUNTER_UPLOAD_HTTPHEADER}) + list(APPEND httpheader HTTPHEADER "${header}") + endforeach() + endif() + + file(SHA256 "${full_path}" sha256_value) + file(SHA1 "${full_path}" sha1_value) + file(MD5 "${full_path}" md5_value) + + list(APPEND httpheader HTTPHEADER "X-Checksum-Sha256: ${sha256_value}") + list(APPEND httpheader HTTPHEADER "X-Checksum-Sha1: ${sha1_value}") + list(APPEND httpheader HTTPHEADER "X-Checksum: ${md5_value}") + + set(total_retry 10) + foreach(x RANGE ${total_retry}) + hunter_status_debug("Uploading file (try #${x} of ${total_retry}):") + hunter_status_debug(" ${full_path}") + hunter_status_debug(" -> ${upload_url}") + + # right name is 'hunter_sleep_before_upload' + hunter_sleep_before_download("${x}") + + file( + UPLOAD "${full_path}" "${upload_url}" + STATUS status + ${userpwd} + ${httpheader} + ) + + list(GET status 0 error_code) + list(GET status 1 error_message) + + if(error_code EQUAL "0") + return() + endif() + + hunter_status_debug("Upload failed") + hunter_status_debug("Error code: ${error_code}") + hunter_status_debug("Error message: ${error_message}") + endforeach() + + hunter_internal_error("Upload failed") +endfunction() diff --git a/cmake/modules/hunter_upload_to_custom_server.cmake b/cmake/modules/hunter_upload_to_custom_server.cmake new file mode 100644 index 000000000..d98a1bbac --- /dev/null +++ b/cmake/modules/hunter_upload_to_custom_server.cmake @@ -0,0 +1,90 @@ +# Copyright (c) 2018, Ruslan Baratov +# All rights reserved. + +include(hunter_internal_error) +include(hunter_assert_not_empty_string) +include(hunter_upload_single_file) + +function(hunter_upload_to_custom_server) + hunter_assert_not_empty_string("${HUNTER_CACHED_ROOT}") + + set(cache_root_dir "${HUNTER_CACHED_ROOT}/_Base/Cache") + if(NOT EXISTS ${cache_root_dir}) + hunter_internal_error("Not found: ${cache_root_dir}") + endif() + + file( + GLOB_RECURSE + cache_done_list + RELATIVE + ${cache_root_dir} + "${cache_root_dir}/*/CACHE.DONE" + ) + + foreach(cache_done_file ${cache_done_list}) + get_filename_component(deps_id_dir ${cache_done_file} DIRECTORY) + get_filename_component(internal_deps_id_dir ${deps_id_dir} DIRECTORY) + get_filename_component(types_id_dir ${internal_deps_id_dir} DIRECTORY) + get_filename_component(args_id_dir ${types_id_dir} DIRECTORY) + get_filename_component(archive_id_dir ${args_id_dir} DIRECTORY) + get_filename_component(version_dir ${archive_id_dir} DIRECTORY) + get_filename_component(component_dir ${version_dir} DIRECTORY) + + get_filename_component(component_name ${component_dir} NAME) + if(component_name MATCHES "^__") + # We have component + get_filename_component(package_dir ${component_dir} DIRECTORY) + else() + # No component + set(package_dir ${component_dir}) + endif() + + get_filename_component(toolchain_id_dir ${package_dir} DIRECTORY) + get_filename_component(meta_dir ${toolchain_id_dir} DIRECTORY) + + string(COMPARE EQUAL "${meta_dir}" "meta" match) + if(NOT match) + hunter_internal_error("Unexpected 'meta' directory: '${meta_dir}'") + endif() + + set(from_server_path "${cache_root_dir}/${deps_id_dir}/from.server") + if(EXISTS "${from_server_path}") + hunter_status_debug("Skip. File present: ${from_server_path}") + continue() + endif() + + set(deps_info_path "${cache_root_dir}/${deps_id_dir}/deps.info") + if(NOT EXISTS "${deps_info_path}") + hunter_status_debug("Skip. File not found: ${deps_info_path}") + continue() + endif() + + set(cache_sha1_path "${cache_root_dir}/${deps_id_dir}/cache.sha1") + if(NOT EXISTS "${cache_sha1_path}") + hunter_status_debug("Skip. File not found: ${cache_sha1_path}") + continue() + endif() + + file(READ "${cache_sha1_path}" cache_sha1) + + set(raw_path "${cache_root_dir}/raw/${cache_sha1}.tar.bz2") + if(NOT EXISTS "${raw_path}") + hunter_status_debug("Skip. File not found: ${raw_path}") + continue() + endif() + + hunter_upload_single_file(${toolchain_id_dir}/toolchain.info) + hunter_upload_single_file(${args_id_dir}/args.cmake) + hunter_upload_single_file(${types_id_dir}/types.info) + hunter_upload_single_file(${internal_deps_id_dir}/internal_deps.id) + hunter_upload_single_file(${internal_deps_id_dir}/basic-deps.info) + hunter_upload_single_file(${internal_deps_id_dir}/basic-deps.DONE) + hunter_upload_single_file(${deps_id_dir}/cache.sha1) + hunter_upload_single_file(${deps_id_dir}/deps.info) + + hunter_upload_single_file(raw/${cache_sha1}.tar.bz2) + + hunter_upload_single_file(${deps_id_dir}/CACHE.DONE) + file(WRITE "${cache_root_dir}/${deps_id_dir}/from.server" "") + endforeach() +endfunction() diff --git a/cmake/modules/hunter_user_error.cmake b/cmake/modules/hunter_user_error.cmake index 8f89645b5..77d6a952a 100644 --- a/cmake/modules/hunter_user_error.cmake +++ b/cmake/modules/hunter_user_error.cmake @@ -4,5 +4,5 @@ include(hunter_fatal_error) function(hunter_user_error) - hunter_fatal_error(${ARGV} WIKI "error.incorrect.input.data") + hunter_fatal_error(${ARGV} ERROR_PAGE "error.incorrect.input.data") endfunction() diff --git a/cmake/modules/hunter_wiki.cmake b/cmake/modules/hunter_wiki.cmake deleted file mode 100644 index 24843ab23..000000000 --- a/cmake/modules/hunter_wiki.cmake +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright (c) 2014-2015, Ruslan Baratov -# All rights reserved. - -# Do not move to master - build schemes use this module but they not use master -set(HUNTER_WIKI "https://github.com/ruslo/hunter/wiki") - -function(hunter_wiki wiki_page) - message("------------------------------ WIKI -------------------------------") - message(" ${HUNTER_WIKI}/${wiki_page}") - message("-------------------------------------------------------------------") - message("") - message(FATAL_ERROR "") -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 000000000..caad82dc0 --- /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 000000000..37726c349 --- /dev/null +++ b/cmake/projects/Android-ARM-EABI-v7a-System-Image/hunter.cmake @@ -0,0 +1,68 @@ +# 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 + "16_r04" + URL + "https://dl.google.com/android/repository/sys-img/android/sysimg_armv7a-16_r04.zip" + SHA1 + 39c093ea755098f0ee79f607be7df9e54ba4943f +) + +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_add_version( + PACKAGE_NAME + Android-ARM-EABI-v7a-System-Image + VERSION + "22_r02" + URL + "https://dl.google.com/android/repository/sys-img/android/armeabi-v7a-22_r02.zip" + SHA1 + 2114ec015dbf3a16cbcb4f63e8a84a1b206a07a1 +) + +hunter_add_version( + PACKAGE_NAME + Android-ARM-EABI-v7a-System-Image + VERSION + "24_r07" + URL + "https://dl.google.com/android/repository/sys-img/android/armeabi-v7a-24_r07.zip" + SHA1 + 3454546b4eed2d6c3dd06d47757d6da9f4176033 +) + +hunter_pick_scheme(DEFAULT url_sha1_unpack) +hunter_download(PACKAGE_NAME Android-ARM-EABI-v7a-System-Image) diff --git a/cmake/projects/Android-ARM64-v8a-System-Image/hunter.cmake b/cmake/projects/Android-ARM64-v8a-System-Image/hunter.cmake new file mode 100644 index 000000000..69e15eb97 --- /dev/null +++ b/cmake/projects/Android-ARM64-v8a-System-Image/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2018, 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-ARM64-v8a-System-Image + VERSION + 24_r07 + URL + "https://dl.google.com/android/repository/sys-img/android/arm64-v8a-24_r07.zip" + SHA1 + e8ab2e49e4efe4b064232b33b5eeaded61437d7f +) + +hunter_pick_scheme(DEFAULT url_sha1_unpack) +hunter_download(PACKAGE_NAME Android-ARM64-v8a-System-Image) diff --git a/cmake/projects/Android-Apk/hunter.cmake b/cmake/projects/Android-Apk/hunter.cmake index 2925afd33..5a5bfb6f7 100644 --- a/cmake/projects/Android-Apk/hunter.cmake +++ b/cmake/projects/Android-Apk/hunter.cmake @@ -7,6 +7,72 @@ include(hunter_add_version) include(hunter_download) include(hunter_pick_scheme) +hunter_add_version( + PACKAGE_NAME + Android-Apk + VERSION + "1.1.13" + URL + "https://github.com/hunter-packages/android-apk/archive/v1.1.13.tar.gz" + SHA1 + cd1b0b410fdf0b1bb79c718f61b21c2f48b703f8 +) + +hunter_add_version( + PACKAGE_NAME + Android-Apk + VERSION + "1.1.12" + URL + "https://github.com/hunter-packages/android-apk/archive/v1.1.12.tar.gz" + SHA1 + 64b903c567506c530a3443bfdbd92576ccdc7c2a +) + +hunter_add_version( + PACKAGE_NAME + Android-Apk + VERSION + "1.1.11" + URL + "https://github.com/hunter-packages/android-apk/archive/v1.1.11.tar.gz" + SHA1 + d152a1a23b2852b61023538f8d3dc93a745cf654 +) + +hunter_add_version( + PACKAGE_NAME + Android-Apk + VERSION + "1.1.10" + URL + "https://github.com/hunter-packages/android-apk/archive/v1.1.10.tar.gz" + SHA1 + 955b827e19db021e8318d51b47f07fa651fe5974 +) + +hunter_add_version( + PACKAGE_NAME + Android-Apk + VERSION + "1.1.9" + URL + "https://github.com/hunter-packages/android-apk/archive/v1.1.9.tar.gz" + SHA1 + fdc1eedf86fbe1e4a43655f0c98f3a5228b8b9e6 +) + +hunter_add_version( + PACKAGE_NAME + Android-Apk + VERSION + "1.1.8" + URL + "https://github.com/hunter-packages/android-apk/archive/v1.1.8.tar.gz" + SHA1 + f5dc6d05d73d40fd97fc87a4e1ac9505bf08b6e4 +) + hunter_add_version( PACKAGE_NAME Android-Apk @@ -106,5 +172,16 @@ hunter_add_version( f3ef23bdbacdc4881b2aaeadf433c87fee28ff04 ) +hunter_add_version( + PACKAGE_NAME + Android-Apk + VERSION + "1.1.14" + URL + "https://github.com/hunter-packages/android-apk/archive/v1.1.14.tar.gz" + SHA1 + cd7c8b2c38cd4545fd069451bfa318160b22cc99 +) + hunter_pick_scheme(DEFAULT url_sha1_unpack) hunter_download(PACKAGE_NAME Android-Apk) diff --git a/cmake/projects/Android-Build-Tools/hunter.cmake b/cmake/projects/Android-Build-Tools/hunter.cmake index 755a808c2..4eebf0769 100755 --- a/cmake/projects/Android-Build-Tools/hunter.cmake +++ b/cmake/projects/Android-Build-Tools/hunter.cmake @@ -7,7 +7,20 @@ include(hunter_add_version) include(hunter_download) include(hunter_pick_scheme) +# https://dl.google.com/android/repository/repository-11.xml + if(CMAKE_HOST_APPLE) + hunter_add_version( + PACKAGE_NAME + Android-Build-Tools + VERSION + "27.0.3" + URL + "https://dl-ssl.google.com/android/repository/build-tools_r27.0.3-macosx.zip" + SHA1 + 61d9fb18790c68d66ff73bf1e7ad56bc1f1eef2d + ) + hunter_add_version( PACKAGE_NAME Android-Build-Tools @@ -41,6 +54,17 @@ if(CMAKE_HOST_APPLE) d84f5692fb44d60fc53e5b2507cebf9f24626902 ) elseif(CMAKE_HOST_UNIX) + hunter_add_version( + PACKAGE_NAME + Android-Build-Tools + VERSION + "27.0.3" + URL + "https://dl-ssl.google.com/android/repository/build-tools_r27.0.3-linux.zip" + SHA1 + d85e7a6320eddffe7eeace3437605079dac938ca + ) + hunter_add_version( PACKAGE_NAME Android-Build-Tools @@ -74,6 +98,17 @@ elseif(CMAKE_HOST_UNIX) f11618492b0d2270c332325d45d752d3656a9640 ) elseif(CMAKE_HOST_WIN32) + hunter_add_version( + PACKAGE_NAME + Android-Build-Tools + VERSION + "27.0.3" + URL + "https://dl-ssl.google.com/android/repository/build-tools_r27.0.3-windows.zip" + SHA1 + 0df61e11713a2838d2cc9a911219dddf5e6a2749 + ) + hunter_add_version( PACKAGE_NAME Android-Build-Tools diff --git a/cmake/projects/Android-Google-APIs-Intel-x86-Atom-System-Image/hunter.cmake b/cmake/projects/Android-Google-APIs-Intel-x86-Atom-System-Image/hunter.cmake index 1a294e136..42ec815f5 100755 --- a/cmake/projects/Android-Google-APIs-Intel-x86-Atom-System-Image/hunter.cmake +++ b/cmake/projects/Android-Google-APIs-Intel-x86-Atom-System-Image/hunter.cmake @@ -45,5 +45,27 @@ hunter_add_version( b6a979f63c72e88142ea449b906e443f986a12cf ) +hunter_add_version( + PACKAGE_NAME + Android-Google-APIs-Intel-x86-Atom-System-Image + VERSION + "22_r21" + URL + "https://dl.google.com/android/repository/sys-img/google_apis/x86-22_r21.zip" + SHA1 + bef3c76ecb61b7e1a8d483d83a7ca9852f47a7ab +) + +hunter_add_version( + PACKAGE_NAME + Android-Google-APIs-Intel-x86-Atom-System-Image + VERSION + "24_r20" + URL + "https://dl.google.com/android/repository/sys-img/google_apis/x86-24_r20.zip" + SHA1 + c86cadee4e835eef8246bede3269133d06f34571 +) + hunter_pick_scheme(DEFAULT url_sha1_unpack) hunter_download(PACKAGE_NAME Android-Google-APIs-Intel-x86-Atom-System-Image) diff --git a/cmake/projects/Android-Google-APIs/hunter.cmake b/cmake/projects/Android-Google-APIs/hunter.cmake index 9169bcabb..b29d48a78 100755 --- a/cmake/projects/Android-Google-APIs/hunter.cmake +++ b/cmake/projects/Android-Google-APIs/hunter.cmake @@ -56,5 +56,27 @@ hunter_add_version( ee6acf1b01020bfa8a8e24725dbc4478bee5e792 ) +hunter_add_version( + PACKAGE_NAME + Android-Google-APIs + VERSION + "22_r01" + URL + "https://dl.google.com/android/repository/google_apis-22_r01.zip" + SHA1 + 5def0f42160cba8acff51b9c0c7e8be313de84f5 +) + +hunter_add_version( + PACKAGE_NAME + Android-Google-APIs + VERSION + "24_r1" + URL + "https://dl.google.com/android/repository/google_apis-24_r1.zip" + SHA1 + 31361c2868f27343ee917fbd259c1463821b6145 +) + hunter_pick_scheme(DEFAULT url_sha1_unpack) hunter_download(PACKAGE_NAME Android-Google-APIs) diff --git a/cmake/projects/Android-Google-Repository/hunter.cmake b/cmake/projects/Android-Google-Repository/hunter.cmake index 880fc412f..a7c20f0e5 100755 --- a/cmake/projects/Android-Google-Repository/hunter.cmake +++ b/cmake/projects/Android-Google-Repository/hunter.cmake @@ -9,6 +9,28 @@ include(hunter_pick_scheme) # https://dl.google.com/android/repository/addon.xml +hunter_add_version( + PACKAGE_NAME + Android-Google-Repository + VERSION + "58" + URL + "https://dl.google.com/android/repository/google_m2repository_gms_v11_3_rc05_wear_2_0_5.zip" + SHA1 + 05086add9e3a0eb1b67111108d7757a4337c3f10 +) + +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-Intel-x86-Atom-System-Image/hunter.cmake b/cmake/projects/Android-Intel-x86-Atom-System-Image/hunter.cmake index 1a0780ab7..8e7902c02 100755 --- a/cmake/projects/Android-Intel-x86-Atom-System-Image/hunter.cmake +++ b/cmake/projects/Android-Intel-x86-Atom-System-Image/hunter.cmake @@ -20,6 +20,17 @@ hunter_add_version( 6c7bb51e41a16099bb1f2a3cc81fdb5aa053fc15 ) +hunter_add_version( + PACKAGE_NAME + Android-Intel-x86-Atom-System-Image + VERSION + "22_r06" + URL + "https://dl.google.com/android/repository/sys-img/android/x86-22_r06.zip" + SHA1 + e33e2a6cc3f1cc56b2019dbef3917d2eeb26f54e +) + hunter_add_version( PACKAGE_NAME Android-Intel-x86-Atom-System-Image @@ -31,6 +42,28 @@ hunter_add_version( a0b510c66769e84fa5e40515531be2d266a4247f ) +hunter_add_version( + PACKAGE_NAME + Android-Intel-x86-Atom-System-Image + VERSION + "21_r04" + URL + "https://dl.google.com/android/repository/sys-img/android/sysimg_x86-21_r04.zip" + SHA1 + 3b78ad294aa1cdefa4be663d4af6c80d920ec49e +) + +hunter_add_version( + PACKAGE_NAME + Android-Intel-x86-Atom-System-Image + VERSION + "21_r05" + URL + "https://dl.google.com/android/repository/sys-img/android/x86-21_r05.zip" + SHA1 + 00f0eb0a1003efe3316347f762e20a85d8749cff +) + hunter_add_version( PACKAGE_NAME Android-Intel-x86-Atom-System-Image @@ -53,5 +86,16 @@ hunter_add_version( 36c2a2e394bcb3290583ce09815eae7711d0b2c2 ) +hunter_add_version( + PACKAGE_NAME + Android-Intel-x86-Atom-System-Image + VERSION + "24_r08" + URL + "https://dl.google.com/android/repository/sys-img/android/x86-24_r08.zip" + SHA1 + c1cae7634b0216c0b5990f2c144eb8ca948e3511 +) + hunter_pick_scheme(DEFAULT url_sha1_unpack) hunter_download(PACKAGE_NAME Android-Intel-x86-Atom-System-Image) diff --git a/cmake/projects/Android-MIPS-System-Image/hunter.cmake b/cmake/projects/Android-MIPS-System-Image/hunter.cmake new file mode 100755 index 000000000..630858eb7 --- /dev/null +++ b/cmake/projects/Android-MIPS-System-Image/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2015-2018, 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-MIPS-System-Image + VERSION + "16_r04" + URL + "https://dl.google.com/android/repository/sys-img/android/sysimg_mips-16_r04.zip" + SHA1 + 67943c54fb3943943ffeb05fdd39c0b753681f6e +) + +hunter_pick_scheme(DEFAULT url_sha1_unpack) +hunter_download(PACKAGE_NAME Android-MIPS-System-Image) diff --git a/cmake/projects/Android-SDK-Platform-tools/hunter.cmake b/cmake/projects/Android-SDK-Platform-tools/hunter.cmake index fa909f552..82774938c 100755 --- a/cmake/projects/Android-SDK-Platform-tools/hunter.cmake +++ b/cmake/projects/Android-SDK-Platform-tools/hunter.cmake @@ -7,7 +7,44 @@ 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 +# https://dl.google.com/android/repository/repository-12.xml + if(CMAKE_HOST_APPLE) + hunter_add_version( + PACKAGE_NAME + Android-SDK-Platform-tools + VERSION + "r28.0.0" + URL + "http://dl-ssl.google.com/android/repository/platform-tools_r28.0.0-darwin.zip" + SHA1 + 18bd62818aef3ce91dec438121a9a7b836b23c9f + ) + + hunter_add_version( + PACKAGE_NAME + Android-SDK-Platform-tools + VERSION + "r27.0.1" + URL + "http://dl-ssl.google.com/android/repository/platform-tools_r27.0.1-darwin.zip" + SHA1 + d7b60f4022ee90e647af0c2ac605f2f99b4164c5 + ) + + 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 +100,39 @@ if(CMAKE_HOST_APPLE) 6675f9f583841972c5c5ef8d2c131e1209529fde ) elseif(CMAKE_HOST_UNIX) + hunter_add_version( + PACKAGE_NAME + Android-SDK-Platform-tools + VERSION + "r28.0.0" + URL + "http://dl-ssl.google.com/android/repository/platform-tools_r28.0.0-linux.zip" + SHA1 + f944e69bc96ad2984a7e19febb3f3569b216699f + ) + + hunter_add_version( + PACKAGE_NAME + Android-SDK-Platform-tools + VERSION + "r27.0.1" + URL + "http://dl-ssl.google.com/android/repository/platform-tools_r27.0.1-linux.zip" + SHA1 + ca04b0a50700ac988a3a5423fcd61904124ce423 + ) + + 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 +188,39 @@ elseif(CMAKE_HOST_UNIX) 2502ade68af9f6288c4dd7726796599e8d9a4337 ) elseif(CMAKE_HOST_WIN32) + hunter_add_version( + PACKAGE_NAME + Android-SDK-Platform-tools + VERSION + "r28.0.0" + URL + "http://dl-ssl.google.com/android/repository/platform-tools_r28.0.0-windows.zip" + SHA1 + 64e130b2c3bab7b000db52a39a2e72f648633f47 + ) + + hunter_add_version( + PACKAGE_NAME + Android-SDK-Platform-tools + VERSION + "r27.0.1" + URL + "http://dl-ssl.google.com/android/repository/platform-tools_r27.0.1-windows.zip" + SHA1 + 11505582e66ef81730cc5150a7566a3ca5c677b7 + ) + + 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-Platform/hunter.cmake b/cmake/projects/Android-SDK-Platform/hunter.cmake index 63d22cd83..9601c3639 100755 --- a/cmake/projects/Android-SDK-Platform/hunter.cmake +++ b/cmake/projects/Android-SDK-Platform/hunter.cmake @@ -64,5 +64,16 @@ hunter_add_version( 12a5ce6235a76bc30f62c26bda1b680e336abd07 ) +hunter_add_version( + PACKAGE_NAME + Android-SDK-Platform + VERSION + "24_r02" + URL + "http://dl-ssl.google.com/android/repository/platform-24_r02.zip" + SHA1 + 8912da3d4bfe7a9f28f0e5ce92d3a8dc96342aee +) + hunter_pick_scheme(DEFAULT url_sha1_unpack) hunter_download(PACKAGE_NAME Android-SDK-Platform) diff --git a/cmake/projects/Android-SDK-Tools/hunter.cmake b/cmake/projects/Android-SDK-Tools/hunter.cmake index 419d2ed52..213751b39 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 c324061b6..f1e7351f2 100644 --- a/cmake/projects/Android-SDK/hunter.cmake +++ b/cmake/projects/Android-SDK/hunter.cmake @@ -9,6 +9,28 @@ 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 + VERSION + "0.0.4" + URL + "https://github.com/hunter-packages/android-sdk/archive/v0.0.4.tar.gz" + SHA1 + 7bf6bdc6c6e03692a97d6e1f25f39705e92b4f10 +) + hunter_add_version( PACKAGE_NAME Android-SDK @@ -42,6 +64,17 @@ hunter_add_version( 3b151f3cb559dc2ae1d0df85155e9cae5a33958d ) +hunter_add_version( + PACKAGE_NAME + Android-SDK + VERSION + "0.0.6" + URL + "https://github.com/hunter-packages/android-sdk/archive/v0.0.6.tar.gz" + SHA1 + 8919cea855831de723c7966a2624cd9ac2d256ab +) + # This is unpack-like package. No need to install variants hunter_configuration_types(Android-SDK CONFIGURATION_TYPES Release) diff --git a/cmake/projects/Android-Support-Repository/hunter.cmake b/cmake/projects/Android-Support-Repository/hunter.cmake index c04d3a4bb..d5e651334 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/AngelScript/hunter.cmake b/cmake/projects/AngelScript/hunter.cmake new file mode 100644 index 000000000..66c9a1dc8 --- /dev/null +++ b/cmake/projects/AngelScript/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 + AngelScript + VERSION + 2.30-p0 + URL + "https://github.com/hunter-packages/AngelScript/archive/v2.30-p0.tar.gz" + SHA1 + 0323f68eb7d7c76d88c8d3193995bdf4cfff7f62 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(AngelScript) +hunter_download(PACKAGE_NAME AngelScript) diff --git a/cmake/projects/Assimp/hunter.cmake b/cmake/projects/Assimp/hunter.cmake index 3594d2f75..b6e894f9d 100644 --- a/cmake/projects/Assimp/hunter.cmake +++ b/cmake/projects/Assimp/hunter.cmake @@ -31,6 +31,28 @@ hunter_add_version( a3f46eb24bc48cacee9f21b1ea4f4a0e3122b847 ) +hunter_add_version( + PACKAGE_NAME + Assimp + VERSION + 3.2-p2 + URL + "https://github.com/hunter-packages/assimp/archive/v3.2-p2.tar.gz" + SHA1 + 7b745fc73c28073d7bdcaa18f994c39636c27776 +) + +hunter_add_version( + PACKAGE_NAME + Assimp + VERSION + 5.0.0-07779a7a + URL + "https://github.com/assimp/assimp/archive/07779a7ae1c88774a2c10adf5817ea84da81d971.zip" + SHA1 + eb8cf84437f6cd4e8efbda5839655e1e1c347c27 +) + hunter_cmake_args( Assimp CMAKE_ARGS @@ -38,6 +60,8 @@ hunter_cmake_args( ASSIMP_BUILD_SAMPLES=OFF ASSIMP_BUILD_TESTS=OFF ASSIMP_ENABLE_BOOST_WORKAROUND=OFF + ASSIMP_INSTALL_PDB=OFF + IGNORE_GIT_HASH=ON ) hunter_pick_scheme(DEFAULT url_sha1_cmake) diff --git a/cmake/projects/Avahi/schemes/url_sha1_avahi_autotools.cmake.in b/cmake/projects/Avahi/schemes/url_sha1_avahi_autotools.cmake.in index b4b309451..363aa5770 100644 --- a/cmake/projects/Avahi/schemes/url_sha1_avahi_autotools.cmake.in +++ b/cmake/projects/Avahi/schemes/url_sha1_avahi_autotools.cmake.in @@ -11,7 +11,7 @@ include("@HUNTER_SELF@/cmake/Hunter") include(hunter_autotools_project) include(hunter_report_broken_package) include(hunter_status_debug) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) hunter_status_debug("Scheme: url_sha1_avahi_autotools") @@ -20,14 +20,14 @@ if("@MSVC@") endif() # 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_BUILD_DIR@") -hunter_test_string_not_empty("@HUNTER_PACKAGE_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_BUILD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_INSTALL_PREFIX@") hunter_add_package(dbus) hunter_add_package(Expat) diff --git a/cmake/projects/BZip2/hunter.cmake b/cmake/projects/BZip2/hunter.cmake index 1b526d792..ca4119f2c 100644 --- a/cmake/projects/BZip2/hunter.cmake +++ b/cmake/projects/BZip2/hunter.cmake @@ -5,15 +5,11 @@ include(hunter_add_version) include(hunter_cacheable) +include(hunter_cmake_args) 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 +21,45 @@ 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_add_version( + PACKAGE_NAME + BZip2 + VERSION + "1.0.6-p4" + URL + "https://github.com/hunter-packages/bzip2/archive/v1.0.6-p4.tar.gz" + SHA1 + 11fb2b502a425ccc07142f869cce8b3bbae5f1ea +) + +hunter_cmake_args( + BZip2 + CMAKE_ARGS + BUILD_TESTING=OFF +) + 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 000000000..f04bf8f69 --- /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 8d027d55a..b8cd0b403 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 "4" + PACKAGE_INTERNAL_DEPS_ID "44" ) diff --git a/cmake/projects/Boost/chrono/hunter.cmake b/cmake/projects/Boost/chrono/hunter.cmake index 917ba64e9..41f356186 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 "4" + PACKAGE_INTERNAL_DEPS_ID "44" ) diff --git a/cmake/projects/Boost/context/hunter.cmake b/cmake/projects/Boost/context/hunter.cmake index 0f573c779..442f11c73 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 "4" + PACKAGE_INTERNAL_DEPS_ID "44" ) diff --git a/cmake/projects/Boost/contract/hunter.cmake b/cmake/projects/Boost/contract/hunter.cmake new file mode 100644 index 000000000..d8568188a --- /dev/null +++ b/cmake/projects/Boost/contract/hunter.cmake @@ -0,0 +1,22 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_download) +include(hunter_pick_scheme) + +hunter_pick_scheme( + DEFAULT + url_sha1_boost_library + IPHONEOS + url_sha1_boost_ios_library +) + +hunter_download( + PACKAGE_NAME + Boost + PACKAGE_COMPONENT + contract + PACKAGE_INTERNAL_DEPS_ID "44" +) diff --git a/cmake/projects/Boost/coroutine/hunter.cmake b/cmake/projects/Boost/coroutine/hunter.cmake index f90be68df..8ae4e47ff 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 "4" + PACKAGE_INTERNAL_DEPS_ID "44" ) diff --git a/cmake/projects/Boost/date_time/hunter.cmake b/cmake/projects/Boost/date_time/hunter.cmake index 302675f87..8ccdb5122 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 "4" + PACKAGE_INTERNAL_DEPS_ID "44" ) diff --git a/cmake/projects/Boost/exception/hunter.cmake b/cmake/projects/Boost/exception/hunter.cmake index 25b8debcf..cc1fc3235 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 "4" + PACKAGE_INTERNAL_DEPS_ID "44" ) diff --git a/cmake/projects/Boost/fiber/hunter.cmake b/cmake/projects/Boost/fiber/hunter.cmake new file mode 100644 index 000000000..0e6ef57c7 --- /dev/null +++ b/cmake/projects/Boost/fiber/hunter.cmake @@ -0,0 +1,22 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_download) +include(hunter_pick_scheme) + +hunter_pick_scheme( + DEFAULT + url_sha1_boost_library + IPHONEOS + url_sha1_boost_ios_library +) + +hunter_download( + PACKAGE_NAME + Boost + PACKAGE_COMPONENT + fiber + PACKAGE_INTERNAL_DEPS_ID "44" +) diff --git a/cmake/projects/Boost/filesystem/hunter.cmake b/cmake/projects/Boost/filesystem/hunter.cmake index 41bdbed85..882288be9 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 "4" + PACKAGE_INTERNAL_DEPS_ID "44" ) diff --git a/cmake/projects/Boost/generate.sh b/cmake/projects/Boost/generate.sh index a724f996a..7ed68e6b3 100755 --- a/cmake/projects/Boost/generate.sh +++ b/cmake/projects/Boost/generate.sh @@ -8,8 +8,10 @@ BOOST_LIBS=" chrono context coroutine + contract date_time exception + fiber filesystem graph graph_parallel @@ -24,6 +26,7 @@ BOOST_LIBS=" regex serialization signals + stacktrace system test thread diff --git a/cmake/projects/Boost/graph/hunter.cmake b/cmake/projects/Boost/graph/hunter.cmake index 0b65237ec..39cf31338 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 "4" + PACKAGE_INTERNAL_DEPS_ID "44" ) diff --git a/cmake/projects/Boost/graph_parallel/hunter.cmake b/cmake/projects/Boost/graph_parallel/hunter.cmake index ae996f308..92cd1a074 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 "4" + PACKAGE_INTERNAL_DEPS_ID "44" ) diff --git a/cmake/projects/Boost/hunter.cmake b/cmake/projects/Boost/hunter.cmake index 95de122d0..5457379f2 100644 --- a/cmake/projects/Boost/hunter.cmake +++ b/cmake/projects/Boost/hunter.cmake @@ -8,17 +8,177 @@ include(hunter_cacheable) include(hunter_cmake_args) include(hunter_download) include(hunter_pick_scheme) +include(hunter_check_toolchain_definition) # Disable searching in locations not specified by these hint variables. 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.1" + URL + "${_hunter_boost_base_url}/1.65.1/source/boost_1_65_1.tar.bz2" + SHA1 + 4a5b0c3c1b1b9a4d6cb6a6cc395e903e76f76720 +) + +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 +) + +hunter_add_version( + PACKAGE_NAME + Boost + VERSION + "1.66.0" + URL + "${_hunter_boost_base_url}/1.66.0/source/boost_1_66_0.7z" + SHA1 + 075d0b43980614054b1f1bafd189f863bba6600e +) + +hunter_add_version( + PACKAGE_NAME + Boost + VERSION + "1.66.0-p0" + URL + "https://github.com/hunter-packages/boost/releases/download/v1.66.0-p0/hunter-1.66.0.7z" + SHA1 + 8c9829ce5e8f0b2b582f8ee1a6103c037a154aa3 +) + +hunter_add_version( + PACKAGE_NAME + Boost + VERSION + "1.67.0" + URL + "${_hunter_boost_base_url}/1.67.0/source/boost_1_67_0.7z" + SHA1 + 64c278c23defe155e630a307ae2c0615348b14b3 +) + +hunter_add_version( + PACKAGE_NAME + Boost + VERSION + "1.67.0-p0" + URL + "https://github.com/hunter-packages/boost/archive/v1.67.0-p0.tar.gz" + SHA1 + e56a5fbafa31683047f92850e05735dfcde084aa +) + +hunter_add_version( + PACKAGE_NAME + Boost + VERSION + "1.67.0-p1" + URL + "https://github.com/hunter-packages/boost/releases/download/v1.67.0-p1/hunter-1.67.0.7z" + SHA1 + 26fcf19a79d013a318562435cef2829ea6bf29a4 +) + +hunter_add_version( + PACKAGE_NAME + Boost + VERSION + "1.68.0-p0" + URL + "https://github.com/hunter-packages/boost/releases/download/v1.68.0-p0/hunter-1.68.0.7z" + SHA1 + 3af972569d4b685145442445e51b3fcace342b31 +) + +hunter_add_version( + PACKAGE_NAME + Boost + VERSION + "1.68.0-p1" + URL + "https://github.com/hunter-packages/boost/archive/v1.68.0-p1.tar.gz" + SHA1 + 0bb10b0a0fdc196646c87e0143c0290baa32357d +) + +hunter_add_version( + PACKAGE_NAME + Boost + VERSION + "1.69.0-p0" + URL + "https://github.com/hunter-packages/boost/archive/v1.69.0-p0.tar.gz" + SHA1 + 2539b0751f77ff3efdf842775700fe5422c2adfb +) + +hunter_add_version( + PACKAGE_NAME + Boost + VERSION + "1.69.0-p1" + URL + "https://github.com/hunter-packages/boost/archive/v1.69.0-p1.tar.gz" + SHA1 + 7f3a890d698912516f45effb3c88a8b6f93ed2da +) + +hunter_add_version( + PACKAGE_NAME + Boost + VERSION + "1.70.0-p0" + URL + "https://github.com/hunter-packages/boost/archive/v1.70.0-p0.tar.gz" + SHA1 + e6bb97b5109c7c15ea459cf2b1a9d52cbf88a89e +) + +# 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 + Boost + VERSION + "1.63.0" + URL + "${_hunter_boost_base_url}/1.63.0/boost_1_63_0.tar.bz2" + SHA1 + 9f1dd4fa364a3e3156a77dc17aa562ef06404ff6 +) + hunter_add_version( PACKAGE_NAME Boost VERSION "1.62.0" URL - "https://downloads.sourceforge.net/project/boost/boost/1.62.0/boost_1_62_0.tar.bz2" + "${_hunter_boost_base_url}/1.62.0/boost_1_62_0.tar.bz2" SHA1 5fd97433c3f859d8cbab1eaed4156d3068ae3648 ) @@ -30,7 +190,7 @@ hunter_add_version( VERSION "1.61.0" URL - "https://downloads.sourceforge.net/project/boost/boost/1.61.0/boost_1_61_0.tar.bz2" + "${_hunter_boost_base_url}/1.61.0/boost_1_61_0.tar.bz2" SHA1 f84b1a1ce764108ec3c2b7bd7704cf8dfd3c9d01 ) @@ -229,6 +389,15 @@ hunter_add_version( 26a52840e9d12f829e3008589abf0a925ce88524 ) +if(MSVC) + hunter_check_toolchain_definition(NAME "_DLL" DEFINED _hunter_vs_md) + hunter_cmake_args( + Boost + CMAKE_ARGS + BOOST_BUILD_DYNAMIC_VSRUNTIME=${_hunter_vs_md} + ) +endif() + hunter_pick_scheme(DEFAULT url_sha1_boost) hunter_cacheable(Boost) -hunter_download(PACKAGE_NAME Boost PACKAGE_INTERNAL_DEPS_ID "4") +hunter_download(PACKAGE_NAME Boost PACKAGE_INTERNAL_DEPS_ID "44") diff --git a/cmake/projects/Boost/hunter.cmake.in b/cmake/projects/Boost/hunter.cmake.in index 512cb1731..1126870dd 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 "4" + PACKAGE_INTERNAL_DEPS_ID "44" ) diff --git a/cmake/projects/Boost/iostreams/hunter.cmake b/cmake/projects/Boost/iostreams/hunter.cmake index 544989256..a9f7066d3 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 "4" + PACKAGE_INTERNAL_DEPS_ID "44" ) diff --git a/cmake/projects/Boost/locale/hunter.cmake b/cmake/projects/Boost/locale/hunter.cmake index a0a01715e..c22067604 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 "4" + PACKAGE_INTERNAL_DEPS_ID "44" ) diff --git a/cmake/projects/Boost/log/hunter.cmake b/cmake/projects/Boost/log/hunter.cmake index 137038df6..3e8e6c850 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 "4" + PACKAGE_INTERNAL_DEPS_ID "44" ) diff --git a/cmake/projects/Boost/math/hunter.cmake b/cmake/projects/Boost/math/hunter.cmake index 312fe2c5b..d92615283 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 "4" + PACKAGE_INTERNAL_DEPS_ID "44" ) diff --git a/cmake/projects/Boost/mpi/hunter.cmake b/cmake/projects/Boost/mpi/hunter.cmake index dfbd98b59..b816ce1ec 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 "4" + PACKAGE_INTERNAL_DEPS_ID "44" ) diff --git a/cmake/projects/Boost/program_options/hunter.cmake b/cmake/projects/Boost/program_options/hunter.cmake index 425da91d8..4041470ed 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 "4" + PACKAGE_INTERNAL_DEPS_ID "44" ) diff --git a/cmake/projects/Boost/python/hunter.cmake b/cmake/projects/Boost/python/hunter.cmake index f50ced68a..307e93156 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 "4" + PACKAGE_INTERNAL_DEPS_ID "44" ) diff --git a/cmake/projects/Boost/random/hunter.cmake b/cmake/projects/Boost/random/hunter.cmake index 9f96c3b90..afd077f07 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 "4" + PACKAGE_INTERNAL_DEPS_ID "44" ) diff --git a/cmake/projects/Boost/regex/hunter.cmake b/cmake/projects/Boost/regex/hunter.cmake index 90659cf86..3cb3dba99 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 "4" + PACKAGE_INTERNAL_DEPS_ID "44" ) diff --git a/cmake/projects/Boost/schemes/url_sha1_boost.cmake.in b/cmake/projects/Boost/schemes/url_sha1_boost.cmake.in index 3481440a3..e426e89ed 100644 --- a/cmake/projects/Boost/schemes/url_sha1_boost.cmake.in +++ b/cmake/projects/Boost/schemes/url_sha1_boost.cmake.in @@ -10,72 +10,34 @@ include(ExternalProject) # ExternalProject_Add list(APPEND CMAKE_MODULE_PATH "@HUNTER_SELF@/cmake/modules") +include(hunter_get_boost_libs) include(hunter_install_boost_config) include(hunter_report_broken_package) include(hunter_status_debug) include(hunter_status_print) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) +include(hunter_user_error) +include(hunter_parse_boost_config_macros) hunter_status_debug("Scheme: url_sha1_boost") # 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_Boost_VERSION@") -hunter_test_string_not_empty("@HUNTER_PACKAGE_LICENSE_FILE@") -hunter_test_string_not_empty("@HUNTER_GLOBAL_SCRIPT_DIR@") - -if("@MSVC@") - hunter_test_string_not_empty("@HUNTER_MSVC_ARCH@") - 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(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() +hunter_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_BUILD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_Boost_VERSION@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_LICENSE_DIR@") +hunter_assert_not_empty_string("@HUNTER_GLOBAL_SCRIPT_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SCRIPT_DIR@") +hunter_assert_not_empty_string("@HUNTER_TLS_VERIFY@") + +# 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@") @@ -87,40 +49,60 @@ foreach(x ${boost_libs}) list(APPEND boost_list "--without-${x}") endforeach() -if("@MSVC@") - set(env_cmd "@HUNTER_MSVC_VCVARSALL@" "@HUNTER_MSVC_ARCH@") -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 - ) + if("@MSVC@") + set(HUNTER_MSVC_VCVARSALL "@HUNTER_MSVC_VCVARSALL@") + set(HUNTER_MSVC_ARCH "@HUNTER_MSVC_ARCH@") + set(HUNTER_PACKAGE_SOURCE_DIR "@HUNTER_PACKAGE_SOURCE_DIR@") + configure_file("@HUNTER_PACKAGE_SCRIPT_DIR@/patched_boostrap.bat.in" "@HUNTER_PACKAGE_DOWNLOAD_DIR@/patched_boostrap.bat") + set(patch_cmd "@CMAKE_COMMAND@" -E copy "@HUNTER_PACKAGE_DOWNLOAD_DIR@/patched_boostrap.bat" "@HUNTER_PACKAGE_SOURCE_DIR@/patched_boostrap.bat") + set(bootstrap_cmd "patched_boostrap.bat") else() - set(bootstrap_cmd "./bootstrap.sh") + set(patch_cmd "@CMAKE_COMMAND@" -E echo "Dummy patch command") + set(bootstrap_cmd "bootstrap.bat") endif() +else() + set(install_cmd "./b2") + set(bootstrap_cmd "./bootstrap.sh") + set(patch_cmd "@CMAKE_COMMAND@" -E echo "Dummy patch command") endif() -if("@MSVC@") - # Logging as Workaround for VS_UNICODE_OUTPUT issue: - # https://public.kitware.com/Bug/view.php?id=14266 - set(log_opts LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 LOG_DOWNLOAD 1) - get_filename_component(x "@HUNTER_PACKAGE_SOURCE_DIR@/.." ABSOLUTE) - hunter_status_print( - "For progress check log files in directory: ${x}" +string(COMPARE EQUAL "@CMAKE_CXX_COMPILER_ID@" "Clang" compiler_is_clang) + +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} ) +elseif(compiler_is_clang AND NOT CMAKE_CROSSCOMPILING) + list(APPEND bootstrap_cmd "--with-toolset=clang") +endif() + +if("@HUNTER_PACKAGE_LOG_BUILD@") + set(log_build 1) +else() + set(log_build 0) +endif() + +if("@HUNTER_PACKAGE_LOG_INSTALL@" OR "@HUNTER_SUPPRESS_LIST_OF_FILES@") + set(log_install 1) else() - set(log_opts "") + set(log_install 0) endif() +hunter_parse_boost_config_macros(BOOST_CONFIG_MACROS "@HUNTER_Boost_CMAKE_ARGS@") +configure_file( + "@HUNTER_GLOBAL_SCRIPT_DIR@/append-boost-config-macros.cmake.in" + "@HUNTER_PACKAGE_BUILD_DIR@/append-boost-config-macros.cmake" + @ONLY +) + ExternalProject_Add( "@HUNTER_EP_NAME@" URL @@ -129,13 +111,18 @@ ExternalProject_Add( SHA1=@HUNTER_PACKAGE_SHA1@ DOWNLOAD_DIR "@HUNTER_PACKAGE_DOWNLOAD_DIR@" + TLS_VERIFY + "@HUNTER_TLS_VERIFY@" SOURCE_DIR "@HUNTER_PACKAGE_SOURCE_DIR@" INSTALL_DIR "@HUNTER_PACKAGE_INSTALL_PREFIX@" # not used, just avoid creating Install/ empty directory + UPDATE_COMMAND + "@CMAKE_COMMAND@" -P + "@HUNTER_PACKAGE_BUILD_DIR@/append-boost-config-macros.cmake" CONFIGURE_COMMAND - ${env_cmd} + ${patch_cmd} COMMAND ${bootstrap_cmd} BUILD_COMMAND @@ -149,13 +136,22 @@ 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' "-Dsrcdir=@HUNTER_PACKAGE_SOURCE_DIR@" - "-Ddstfile=@HUNTER_PACKAGE_LICENSE_FILE@" + "-Ddstdir=@HUNTER_PACKAGE_LICENSE_DIR@" + -P + "@HUNTER_SELF@/scripts/try-copy-license.cmake" + COMMAND + "@CMAKE_COMMAND@" + "-Dinstalldir=@HUNTER_PACKAGE_INSTALL_PREFIX@" -P - "@HUNTER_GLOBAL_SCRIPT_DIR@/try-copy-license.cmake" - ${log_opts} + "@HUNTER_SELF@/scripts/clean-boost-configs.cmake" + LOG_CONFIGURE ${log_build} + LOG_BUILD ${log_build} + LOG_INSTALL ${log_install} ) # Forward some variables 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 6d92ef64c..5bb09a582 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,76 +11,47 @@ 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_assert_not_empty_string) include(hunter_unsetvar) +include(hunter_get_boost_libs) +include(hunter_parse_boost_config_macros) hunter_status_debug("Scheme: url_sha1_boost_ios_library") # 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_BUILD_DIR@") -hunter_test_string_not_empty("@HUNTER_PACKAGE_INSTALL_PREFIX@") -hunter_test_string_not_empty("@HUNTER_PACKAGE_COMPONENT@") -hunter_test_string_not_empty("@HUNTER_GLOBAL_SCRIPT_DIR@") -hunter_test_string_not_empty("@HUNTER_PACKAGE_SCRIPT_DIR@") +hunter_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_BUILD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_COMPONENT@") +hunter_assert_not_empty_string("@HUNTER_GLOBAL_SCRIPT_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SCRIPT_DIR@") +hunter_assert_not_empty_string("@HUNTER_TLS_VERIFY@") # Note: support for single architecture/native iOS builds (i.e., arm64) -hunter_test_string_not_empty("@IPHONESIMULATOR_ARCHS@@IPHONEOS_ARCHS@") -hunter_test_string_not_empty("@IPHONESIMULATOR_ROOT@") -hunter_test_string_not_empty("@IPHONEOS_ROOT@") -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(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() +hunter_assert_not_empty_string("@IPHONESIMULATOR_ARCHS@@IPHONEOS_ARCHS@") +hunter_assert_not_empty_string("@IPHONESIMULATOR_ROOT@") +hunter_assert_not_empty_string("@IPHONEOS_ROOT@") +hunter_assert_not_empty_string("@IPHONEOS_SDK_ROOT@") +hunter_assert_not_empty_string("@IPHONESIMULATOR_SDK_ROOT@") +hunter_assert_not_empty_string("@HUNTER_Boost_VERSION@") + +# get list of boost components for given version +hunter_get_boost_libs(VERSION "@HUNTER_Boost_VERSION@" LIBS boost_libs) + +if("@HUNTER_Boost_VERSION@" VERSION_EQUAL 1.66.0) + set(fatlib_script "@HUNTER_PACKAGE_SCRIPT_DIR@/create-boost-1-66-ios-fatlib.sh") +else() + set(fatlib_script "@HUNTER_PACKAGE_SCRIPT_DIR@/create-boost-ios-fatlib.sh") +endif() set(libfound NO) foreach(x ${boost_libs}) @@ -106,12 +77,15 @@ foreach(x @IPHONEOS_ARCHS@) # First goes to instruction-set option; # arm64 is not supported: # * https://svn.boost.org/trac/boost/ticket/10910 + # NOTE: + # Being in instruction-set is not enough, should be + # mentioned explicitly in C++ flags too (Boost 1.66) set(arm_instruction_set "${x}") set(is_first NO) - else() - # others go to the C++ flags directly - set(iphoneos_archs "${iphoneos_archs} -arch ${x}") endif() + + set(iphoneos_archs "${iphoneos_archs} -arch ${x}") + # Has at least one iPhoneOS architecture to build set(has_iphoneos TRUE) endforeach() @@ -145,6 +119,9 @@ file( ";" ) +file(READ ${boost_user_jam} boost_user_jam_content) +hunter_status_debug("boost.user.jam content:\n${boost_user_jam_content}") + set( build_opts -a @@ -156,6 +133,10 @@ set( --user-config="${boost_user_jam}" ) +set(BOOST_VERSION "@HUNTER_Boost_VERSION@") + +# Use: +# * BOOST_VERSION hunter_boost_component_b2_args( "@HUNTER_PACKAGE_COMPONENT@" "@HUNTER_Boost_CMAKE_ARGS@" @@ -164,13 +145,20 @@ 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() string(COMPARE NOTEQUAL "@HUNTER_JOBS_OPTION@" "" have_jobs) if(have_jobs) - list(APPEND build_opts "-j" "@HUNTER_JOBS_OPTION@") + if("@HUNTER_JOBS_OPTION@" GREATER "256") + list(APPEND build_opts "-j" 256) + else() + list(APPEND build_opts "-j" "@HUNTER_JOBS_OPTION@") + endif() endif() set( @@ -212,6 +200,8 @@ if(has_iphoneos) SHA1=@HUNTER_PACKAGE_SHA1@ DOWNLOAD_DIR "@HUNTER_PACKAGE_DOWNLOAD_DIR@" + TLS_VERIFY + "@HUNTER_TLS_VERIFY@" SOURCE_DIR "@HUNTER_PACKAGE_SOURCE_DIR@" INSTALL_DIR @@ -238,6 +228,8 @@ else() SHA1=@HUNTER_PACKAGE_SHA1@ DOWNLOAD_DIR "@HUNTER_PACKAGE_DOWNLOAD_DIR@" + TLS_VERIFY + "@HUNTER_TLS_VERIFY@" SOURCE_DIR "@HUNTER_PACKAGE_SOURCE_DIR@" INSTALL_DIR @@ -261,6 +253,8 @@ if(has_isim) "" DOWNLOAD_DIR "@HUNTER_PACKAGE_DOWNLOAD_DIR@" + TLS_VERIFY + "@HUNTER_TLS_VERIFY@" SOURCE_DIR "@HUNTER_PACKAGE_SOURCE_DIR@" INSTALL_DIR @@ -287,6 +281,8 @@ else() SHA1=@HUNTER_PACKAGE_SHA1@ DOWNLOAD_DIR "@HUNTER_PACKAGE_DOWNLOAD_DIR@" + TLS_VERIFY + "@HUNTER_TLS_VERIFY@" SOURCE_DIR "@HUNTER_PACKAGE_SOURCE_DIR@" INSTALL_DIR @@ -320,7 +316,7 @@ if(log_setup_target) set( extra_lib_command COMMAND - "@HUNTER_PACKAGE_SCRIPT_DIR@/create-boost-ios-fatlib.sh" + ${fatlib_script} "@HUNTER_PACKAGE_SOURCE_DIR@" "log_setup" "@HUNTER_PACKAGE_COMPONENT@" @@ -330,6 +326,13 @@ else() set(extra_lib_command "") endif() +hunter_parse_boost_config_macros(BOOST_CONFIG_MACROS "@HUNTER_Boost_CMAKE_ARGS@") +configure_file( + "@HUNTER_GLOBAL_SCRIPT_DIR@/append-boost-config-macros.cmake.in" + "@HUNTER_PACKAGE_BUILD_DIR@/append-boost-config-macros.cmake" + @ONLY +) + ExternalProject_Add( "@HUNTER_EP_NAME@-ios_universal" DEPENDS @@ -337,6 +340,8 @@ ExternalProject_Add( "@HUNTER_EP_NAME@-ios_sim" DOWNLOAD_COMMAND "" + TLS_VERIFY + "@HUNTER_TLS_VERIFY@" DOWNLOAD_DIR "@HUNTER_PACKAGE_DOWNLOAD_DIR@" SOURCE_DIR @@ -344,6 +349,9 @@ ExternalProject_Add( INSTALL_DIR "@HUNTER_PACKAGE_INSTALL_PREFIX@" # not used, just avoid creating Install/ empty directory + UPDATE_COMMAND + "@CMAKE_COMMAND@" -P + "@HUNTER_PACKAGE_BUILD_DIR@/append-boost-config-macros.cmake" CONFIGURE_COMMAND "" BUILD_COMMAND @@ -351,7 +359,7 @@ ExternalProject_Add( INSTALL_COMMAND "${CMAKE_COMMAND}" -E make_directory "@HUNTER_PACKAGE_INSTALL_PREFIX@/lib" COMMAND - "@HUNTER_PACKAGE_SCRIPT_DIR@/create-boost-ios-fatlib.sh" + ${fatlib_script} "@HUNTER_PACKAGE_SOURCE_DIR@" "${LIBNAME}" "@HUNTER_PACKAGE_COMPONENT@" 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 362278ea2..e9da82987 100644 --- a/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in +++ b/cmake/projects/Boost/schemes/url_sha1_boost_library.cmake.in @@ -13,74 +13,37 @@ list(APPEND CMAKE_MODULE_PATH "@HUNTER_SELF@/cmake/modules") include(CheckSymbolExists) # check_symbol_exists include(hunter_boost_component_b2_args) +include(hunter_dump_cmake_flags) include(hunter_fatal_error) +include(hunter_get_boost_libs) 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_assert_not_empty_string) +include(hunter_user_error) +include(hunter_parse_boost_config_macros) +include(hunter_parse_cmake_args_for_keyword) hunter_status_debug("Scheme: url_sha1_boost_library") # Check preconditions -hunter_test_string_not_empty("@HUNTER_SELF@") -hunter_test_string_not_empty("@HUNTER_EP_NAME@") -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_BUILD_DIR@") -hunter_test_string_not_empty("@HUNTER_PACKAGE_INSTALL_PREFIX@") -hunter_test_string_not_empty("@HUNTER_PACKAGE_COMPONENT@") -hunter_test_string_not_empty("@CMAKE_CXX_COMPILER@") -hunter_test_string_not_empty("@CMAKE_CXX_COMPILER_ID@") -hunter_test_string_not_empty("@HUNTER_Boost_VERSION@") -hunter_test_string_not_empty("@HUNTER_PACKAGE_SCRIPT_DIR@") - -if("@MSVC@") - hunter_test_string_not_empty("@HUNTER_MSVC_ARCH@") - 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(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() +hunter_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_BUILD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_COMPONENT@") +hunter_assert_not_empty_string("@CMAKE_CXX_COMPILER@") +hunter_assert_not_empty_string("@CMAKE_CXX_COMPILER_ID@") +hunter_assert_not_empty_string("@HUNTER_Boost_VERSION@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SCRIPT_DIR@") +hunter_assert_not_empty_string("@HUNTER_TLS_VERIFY@") + +# 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}) @@ -96,12 +59,20 @@ endif() string(COMPARE EQUAL "@CMAKE_CXX_COMPILER_ID@" "Clang" compiler_is_clang) +set(use_cmake_archiver TRUE) if("@ANDROID@") set(toolset_name "gcc") set(toolset_version "ndk") elseif("@APPLE@") set(toolset_name "darwin") set(toolset_version "") + + # Using CMAKE_AR on OSX leads to error (b2 use 'libtool'): + # * https://travis-ci.org/ingenue/hunter/jobs/204617507 + set(use_cmake_archiver FALSE) +elseif("@QNX@") + set(toolset_name "qcc") + set(toolset_version "") elseif("@CMAKE_COMPILER_IS_GNUCXX@") set(toolset_name "gcc") set(toolset_version "") @@ -111,10 +82,17 @@ 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") + hunter_fatal_error("TODO: set toolset for boost" ERROR_PAGE "error.boost.toolset") endif() +hunter_dump_cmake_flags() +# -> CMAKE_C_FLAGS +# -> CMAKE_CXX_FLAGS + if("@ANDROID@") get_directory_property(defs COMPILE_DEFINITIONS) foreach(def ${defs}) @@ -130,16 +108,16 @@ if("@ANDROID@") endforeach() endif() -if("@MSVC@") - set(env_cmd "@HUNTER_MSVC_VCVARSALL@" "@HUNTER_MSVC_ARCH@") -else() - # Workaround for: http://public.kitware.com/Bug/view.php?id=15567 - set(env_cmd "@CMAKE_COMMAND@" -E echo "configure") -endif() - if("@MSVC@") set(boost_compiler "@CMAKE_CXX_COMPILER@") - string(REPLACE "/" "\\" boost_compiler "${boost_compiler}") + + # Note: + # - '/' will not work + # - single '\' lead to bug + # + # See issue: + # - https://github.com/boostorg/build/issues/426#issuecomment-482564740 + string(REPLACE "/" "\\\\" boost_compiler "${boost_compiler}") else() set(boost_compiler "@CMAKE_CXX_COMPILER@") endif() @@ -159,7 +137,7 @@ if(is_mpi) "MPI is required. Please install it. For example MS-MPI: " "http://msdn.microsoft.com/en-us/library/bb524831%28v=vs.85%29.aspx" ) - hunter_fatal_error("MPI is required" WIKI "error.boost.mpi.on.windows") + hunter_fatal_error("MPI is required" ERROR_PAGE "error.boost.mpi.on.windows") endif() get_filename_component(MPI_DIR "${MPI_CXX_INCLUDE_PATH}/.." ABSOLUTE) string(REPLACE "/" "\\\\" MPI_DIR "${MPI_DIR}") @@ -188,6 +166,16 @@ else() set(copy_mpi_command "") endif() +set(BOOST_ALL_DYN_LINK "") +if(BUILD_SHARED_LIBS) #if using shared libs overide boost config + set(BOOST_BUILD_STATIC OFF) + if("@MSVC@") + set(BOOST_ALL_DYN_LINK ON) + endif() +else() + set(BOOST_BUILD_STATIC ON) +endif() + if("@MSVC@") # Disable auto-linking set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /DBOOST_ALL_NO_LIB=1") @@ -205,7 +193,16 @@ if(have_osx_sysroot) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isysroot @CMAKE_OSX_SYSROOT@") endif() -set(link_opts link=static) +if(BOOST_BUILD_STATIC) + set(link_opts link=static) + if("@MSVC@" AND NOT BOOST_BUILD_DYNAMIC_VSRUNTIME) + list(APPEND link_opts "runtime-link=static") + endif() +else() + set(link_opts link=shared) +endif() + +# Modify Boost user jam file set(toolset_full_name ${toolset_name}) string(COMPARE NOTEQUAL "${toolset_version}" "" has_toolset_version) @@ -225,7 +222,15 @@ 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() +set(BOOST_VERSION "@HUNTER_Boost_VERSION@") + +# Use: +# * BOOST_VERSION hunter_boost_component_b2_args( "@HUNTER_PACKAGE_COMPONENT@" "@HUNTER_Boost_CMAKE_ARGS@" @@ -256,19 +261,34 @@ else() ) endif() -file( - APPEND - ${boost_user_jam} - " : \"${CMAKE_AR}\"\n" -) +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} + " : \"${CMAKE_AR}\"\n" + " \"${CMAKE_RANLIB}\"\n" + ) +endif() if(MSVC) # See 'boost_compiler' section + + # Note: Flags should be quoted: + # - https://github.com/boostorg/build/issues/426#issuecomment-482564740 + foreach(cxx_flag ${cxx_flags_list}) file( APPEND ${boost_user_jam} - " ${cxx_flag}\n" + " \"${cxx_flag}\"\n" ) endforeach() endif() @@ -280,34 +300,117 @@ file( "${using_mpi}\n" ) +# handle requested python version if such is specified +hunter_parse_cmake_args_for_keyword( + CMAKE_ARGS "@HUNTER_Boost_CMAKE_ARGS@" + KEYWORD PYTHON_VERSION + OUTPUT python_version +) + +# set up paths for python in boost.user.jam +if(NOT python_version STREQUAL "") + find_package(PythonInterp ${python_version} EXACT QUIET) + if(NOT PYTHONINTERP_FOUND) + hunter_user_error("Python Interpreter for Python version ${python_version} not found.") + endif() + set(python_executable ${PYTHON_EXECUTABLE}) + find_package(PythonLibs ${python_version} EXACT QUIET) + if(NOT PYTHONLIBS_FOUND) + hunter_user_error("Python runtime library directory for Python version ${python_version} not found.") + endif() + # get the main Python include directory containing pyconfig.h + list(LENGTH PYTHON_INCLUDE_DIRS python_include_dir_list_length) + if(python_include_dir_list_length EQUAL 1) + set(python_include_directory "${PYTHON_INCLUDE_DIRS}") + else() + list(GET PYTHON_INCLUDE_DIRS 0 python_include_directory) + endif() + # get directory of optimized library + list(LENGTH PYTHON_LIBRARIES python_libraries_list_length) + if(python_libraries_list_length EQUAL 1) + set(python_optimized_library_path "${PYTHON_LIBRARIES}") + else() + list(GET PYTHON_LIBRARIES 1 python_optimized_library_path) + endif() + get_filename_component(python_library_directory "${python_optimized_library_path}" DIRECTORY) + if("@MSVC@") + string(REPLACE "/" "\\\\" python_executable "${python_executable}") + string(REPLACE "/" "\\\\" python_include_directory "${python_include_directory}") + string(REPLACE "/" "\\\\" python_library_directory "${python_library_directory}") + endif() + file( + APPEND ${boost_user_jam} + "using python : ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} : \"${python_executable}\" : \"${python_include_directory}\" : \"${python_library_directory}\" ;\n" + ) +endif() + +# Handle ./b2 build options + list(APPEND build_opts ${b2_component_opts}) if(CMAKE_EXE_LINKER_FLAGS) list(APPEND build_opts "linkflags=${CMAKE_EXE_LINKER_FLAGS}") endif() -string(COMPARE EQUAL "@HUNTER_MSVC_ARCH@" "amd64" is_x64) -if("@MSVC@" AND is_x64) - list(APPEND build_opts "address-model=64") +if("@ANDROID@") + if("@CMAKE_ANDROID_ARCH@" MATCHES "^(arm|mips|x86)$") + list(APPEND build_opts "address-model=32") + else() + list(APPEND build_opts "address-model=64") + endif() +elseif("@MSVC@") + string(COMPARE EQUAL "@HUNTER_MSVC_ARCH@" "x86" is_x86) + string(COMPARE EQUAL "@HUNTER_MSVC_ARCH@" "amd64" is_x64) + if(is_x86) + list(APPEND build_opts "address-model=32") + elseif(is_x64) + list(APPEND build_opts "address-model=64") + endif() endif() string(COMPARE NOTEQUAL "@HUNTER_JOBS_OPTION@" "" have_jobs) if(have_jobs) - list(APPEND build_opts "-j" "@HUNTER_JOBS_OPTION@") + if("@HUNTER_JOBS_OPTION@" GREATER "256") + list(APPEND build_opts "-j" 256) + else() + list(APPEND build_opts "-j" "@HUNTER_JOBS_OPTION@") + endif() endif() if(@HUNTER_STATUS_DEBUG@) set(verbose_output "-d+2 --debug-configuration") endif() -if("@MSVC@" OR "@MINGW@") - set(bootstrap_cmd "bootstrap.bat") +if(CMAKE_HOST_WIN32) set(b2_cmd "b2") + if("@MSVC@") + set(HUNTER_MSVC_VCVARSALL "@HUNTER_MSVC_VCVARSALL@") + set(HUNTER_MSVC_ARCH "@HUNTER_MSVC_ARCH@") + set(HUNTER_PACKAGE_SOURCE_DIR "@HUNTER_PACKAGE_SOURCE_DIR@") + configure_file("@HUNTER_PACKAGE_SCRIPT_DIR@/patched_boostrap.bat.in" "@HUNTER_PACKAGE_DOWNLOAD_DIR@/patched_boostrap.bat") + set(patch_cmd "@CMAKE_COMMAND@" -E copy "@HUNTER_PACKAGE_DOWNLOAD_DIR@/patched_boostrap.bat" "@HUNTER_PACKAGE_SOURCE_DIR@/patched_boostrap.bat") + set(bootstrap_cmd "patched_boostrap.bat") + else() + set(patch_cmd "@CMAKE_COMMAND@" -E echo "Dummy patch command") + set(bootstrap_cmd "bootstrap.bat") + endif() else() - set(bootstrap_cmd "./bootstrap.sh") set(b2_cmd "./b2") + set(bootstrap_cmd "./bootstrap.sh") + set(patch_cmd "@CMAKE_COMMAND@" -E echo "Dummy patch command") +endif() + +if(compiler_is_clang AND NOT CMAKE_CROSSCOMPILING) + list(APPEND bootstrap_cmd "--with-toolset=clang") +endif() + +if("@MINGW@") + list(APPEND bootstrap_cmd "gcc") endif() +if("@ANDROID@") + list(APPEND build_opts target-os=android) +endif() if(HUNTER_STATUS_DEBUG) file(READ "${boost_user_jam}" USER_JAM_CONTENT) @@ -322,18 +425,25 @@ if(HUNTER_STATUS_DEBUG) hunter_status_debug("------") endif() -if("@MSVC@") - # Logging as Workaround for VS_UNICODE_OUTPUT issue: - # https://public.kitware.com/Bug/view.php?id=14266 - set(log_opts LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 LOG_DOWNLOAD 1) - get_filename_component(x "@HUNTER_PACKAGE_SOURCE_DIR@/.." ABSOLUTE) - hunter_status_print( - "For progress check log files in directory: ${x}" - ) +if("@HUNTER_PACKAGE_LOG_BUILD@") + set(log_build 1) else() - set(log_opts "") + set(log_build 0) endif() +if("@HUNTER_PACKAGE_LOG_INSTALL@" OR "@HUNTER_SUPPRESS_LIST_OF_FILES@") + set(log_install 1) +else() + set(log_install 0) +endif() + +hunter_parse_boost_config_macros(BOOST_CONFIG_MACROS "@HUNTER_Boost_CMAKE_ARGS@") +configure_file( + "@HUNTER_GLOBAL_SCRIPT_DIR@/append-boost-config-macros.cmake.in" + "@HUNTER_PACKAGE_BUILD_DIR@/append-boost-config-macros.cmake" + @ONLY +) + ExternalProject_Add( "@HUNTER_EP_NAME@" URL @@ -342,13 +452,18 @@ ExternalProject_Add( SHA1=@HUNTER_PACKAGE_SHA1@ DOWNLOAD_DIR "@HUNTER_PACKAGE_DOWNLOAD_DIR@" + TLS_VERIFY + "@HUNTER_TLS_VERIFY@" SOURCE_DIR "@HUNTER_PACKAGE_SOURCE_DIR@" INSTALL_DIR "@HUNTER_PACKAGE_INSTALL_PREFIX@" # not used, just avoid creating Install/ empty directory + UPDATE_COMMAND + "@CMAKE_COMMAND@" -P + "@HUNTER_PACKAGE_BUILD_DIR@/append-boost-config-macros.cmake" CONFIGURE_COMMAND - ${env_cmd} + ${patch_cmd} ${copy_mpi_command} COMMAND ${bootstrap_cmd} @@ -356,6 +471,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 @@ -364,7 +480,10 @@ ExternalProject_Add( ${build_opts} stage # install only libraries, headers installed in `url_sha1_boost` "--stagedir=@HUNTER_PACKAGE_INSTALL_PREFIX@" - ${log_opts} + --ignore-site-config # Ignore Gentoo specific optimization "none" in site config that only the patched bjam of Gentoo can understand. + LOG_CONFIGURE ${log_build} + LOG_BUILD ${log_build} + LOG_INSTALL ${log_install} ) # Forward some variables diff --git a/cmake/projects/Boost/scripts/create-boost-1-66-ios-fatlib.sh b/cmake/projects/Boost/scripts/create-boost-1-66-ios-fatlib.sh new file mode 100755 index 000000000..933c7fa0c --- /dev/null +++ b/cmake/projects/Boost/scripts/create-boost-1-66-ios-fatlib.sh @@ -0,0 +1,67 @@ +#!/bin/bash + +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +[ "$#" == "4" ] || { echo "usage: $0 "; exit 1; } + +BUILD_DIR="$1" +LIBNAME="$2" +DIRNAME="$3" +INSTALL_DIR="$4" + +COMMON_DIR="${BUILD_DIR}/bin.v2/libs/${DIRNAME}/build" + +IPHONE_DEBUG=`find "${COMMON_DIR}/darwin-gnu-iphoneos/debug" -name "libboost_${LIBNAME}[^_]*.a"` +IPHONE_RELEASE=`find "${COMMON_DIR}/darwin-gnu-iphoneos/release" -name "libboost_${LIBNAME}[^_]*.a"` + +SIM_DEBUG=`find "${COMMON_DIR}/darwin-gnu-iphonesimulator/debug" -name "libboost_${LIBNAME}[^_]*.a"` +SIM_RELEASE=`find "${COMMON_DIR}/darwin-gnu-iphonesimulator/release" -name "libboost_${LIBNAME}[^_]*.a"` + +echo "-- [iOS universal] IPHONE_DEBUG: $IPHONE_DEBUG" +echo "-- [iOS universal] IPHONE_RELEASE: $IPHONE_RELEASE" +echo "-- [iOS universal] ISIM_DEBUG: $SIM_DEBUG" +echo "-- [iOS universal] ISIM_RELEASE: $SIM_RELEASE" + +if [[ -f "${SIM_DEBUG}" ]] +then + DEBUG=`basename ${SIM_DEBUG}` +else + DEBUG=`basename ${IPHONE_DEBUG}` +fi + +if [[ -f "${SIM_RELEASE}" ]] +then + RELEASE=`basename ${SIM_RELEASE}` +else + RELEASE=`basename ${IPHONE_RELEASE}` +fi + +function lipo_create { + iphone=$1 + sim=$2 + dst=$3 + + if [[ -f "${iphone}" || -f "${sim}" ]] + then + if [[ -f "${iphone}" && -f "${sim}" ]] + then + lipo -create "${iphone}" "${sim}" -o "${dst}" + else + if [[ -f "${iphone}" ]] + then + cp "${iphone}" "${dst}" + fi + if [[ -f "${sim}" ]] + then + cp "${sim}" "${dst}" + fi + fi + fi + +} + +lipo_create "${IPHONE_DEBUG}" "${SIM_DEBUG}" "${INSTALL_DIR}/${DEBUG}" +lipo_create "${IPHONE_RELEASE}" "${SIM_RELEASE}" "${INSTALL_DIR}/${RELEASE}" + +echo "-- [iOS universal] Done: ${INSTALL_DIR}/{${DEBUG}, ${RELEASE}}" diff --git a/cmake/projects/Boost/scripts/patched_boostrap.bat.in b/cmake/projects/Boost/scripts/patched_boostrap.bat.in new file mode 100644 index 000000000..6af80ac93 --- /dev/null +++ b/cmake/projects/Boost/scripts/patched_boostrap.bat.in @@ -0,0 +1,6 @@ +call "@HUNTER_MSVC_VCVARSALL@" @HUNTER_MSVC_ARCH@ +REM The /d flag is required because vcvarsall.bat changes the current drive +REM If the hunter cache is located on a different drive to vcvarsall.bat the +REM cd command will fail. https://technet.microsoft.com/en-gb/library/bb490875.aspx +cd /d @HUNTER_PACKAGE_SOURCE_DIR@ +bootstrap.bat diff --git a/cmake/projects/Boost/serialization/hunter.cmake b/cmake/projects/Boost/serialization/hunter.cmake index fb3baf590..d29b8681c 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 "4" + PACKAGE_INTERNAL_DEPS_ID "44" ) diff --git a/cmake/projects/Boost/signals/hunter.cmake b/cmake/projects/Boost/signals/hunter.cmake index f2db0667f..c2ab2e4b1 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 "4" + PACKAGE_INTERNAL_DEPS_ID "44" ) diff --git a/cmake/projects/Boost/stacktrace/hunter.cmake b/cmake/projects/Boost/stacktrace/hunter.cmake new file mode 100644 index 000000000..087d04403 --- /dev/null +++ b/cmake/projects/Boost/stacktrace/hunter.cmake @@ -0,0 +1,22 @@ +# Copyright (c) 2013, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_download) +include(hunter_pick_scheme) + +hunter_pick_scheme( + DEFAULT + url_sha1_boost_library + IPHONEOS + url_sha1_boost_ios_library +) + +hunter_download( + PACKAGE_NAME + Boost + PACKAGE_COMPONENT + stacktrace + PACKAGE_INTERNAL_DEPS_ID "44" +) diff --git a/cmake/projects/Boost/system/hunter.cmake b/cmake/projects/Boost/system/hunter.cmake index 3a7970871..459be338f 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 "4" + PACKAGE_INTERNAL_DEPS_ID "44" ) diff --git a/cmake/projects/Boost/test/hunter.cmake b/cmake/projects/Boost/test/hunter.cmake index df786085a..5f8af9b38 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 "4" + PACKAGE_INTERNAL_DEPS_ID "44" ) diff --git a/cmake/projects/Boost/thread/hunter.cmake b/cmake/projects/Boost/thread/hunter.cmake index c0d56edaa..600b3e313 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 "4" + PACKAGE_INTERNAL_DEPS_ID "44" ) diff --git a/cmake/projects/Boost/timer/hunter.cmake b/cmake/projects/Boost/timer/hunter.cmake index 005b9a25e..a44b11052 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 "4" + PACKAGE_INTERNAL_DEPS_ID "44" ) diff --git a/cmake/projects/Boost/wave/hunter.cmake b/cmake/projects/Boost/wave/hunter.cmake index 6d8c5bca1..1421b6347 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 "4" + PACKAGE_INTERNAL_DEPS_ID "44" ) diff --git a/cmake/projects/BoringSSL/hunter.cmake b/cmake/projects/BoringSSL/hunter.cmake new file mode 100644 index 000000000..f6288df18 --- /dev/null +++ b/cmake/projects/BoringSSL/hunter.cmake @@ -0,0 +1,41 @@ +# 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 + BoringSSL + VERSION + 1.0.0 + URL + "https://github.com/hunter-packages/boringssl/archive/v1.0.0.tar.gz" + SHA1 + caa7cd122960c9427bda30db5020b9058cb1ed0a + ) + +hunter_add_version( + PACKAGE_NAME + BoringSSL + VERSION + 0.0.0-0f5ecd3a8-p0 + URL + "https://github.com/hunter-packages/boringssl/archive/v0.0.0-0f5ecd3a8-p0.tar.gz" + SHA1 + fee17b226c3132edc44711365eb5ea023c55bb1d + ) + +if(MSVC) + hunter_cmake_args(BoringSSL CMAKE_ARGS OPENSSL_NO_ASM=YES) +endif() + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(BoringSSL) +hunter_download(PACKAGE_NAME BoringSSL) diff --git a/cmake/projects/Box2D/hunter.cmake b/cmake/projects/Box2D/hunter.cmake new file mode 100644 index 000000000..4b832c1e0 --- /dev/null +++ b/cmake/projects/Box2D/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 + Box2D + VERSION + 2.3.1-p0 + URL + "https://github.com/hunter-packages/Box2D/archive/v2.3.1-p0.tar.gz" + SHA1 + 5e34dad2674c65d5c79d2a23abcd881da1af90b9 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(Box2D) +hunter_download(PACKAGE_NAME Box2D) diff --git a/cmake/projects/CLI11/hunter.cmake b/cmake/projects/CLI11/hunter.cmake new file mode 100644 index 000000000..3ee18f563 --- /dev/null +++ b/cmake/projects/CLI11/hunter.cmake @@ -0,0 +1,112 @@ +# Copyright (c) 2018, 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 + CLI11 + VERSION + 1.5.3 + URL + "https://github.com/CLIUtils/CLI11/archive/v1.5.3.tar.gz" + SHA1 + 00c982a7e6819524acda111515ea02308e93a92f + ) + +hunter_add_version( + PACKAGE_NAME + CLI11 + VERSION + 1.5.4 + URL + "https://github.com/CLIUtils/CLI11/archive/v1.5.4.tar.gz" + SHA1 + 94c6860aaa13b16c47e939194a2cdd26e869256c + ) + +hunter_add_version( + PACKAGE_NAME + CLI11 + VERSION + 1.6.0 + URL + "https://github.com/CLIUtils/CLI11/archive/v1.6.0.tar.gz" + SHA1 + f49b36ca4707dc89cb2bd03fc4f7558e30417afc + ) + + +hunter_add_version( + PACKAGE_NAME + CLI11 + VERSION + 1.6.1 + URL + "https://github.com/CLIUtils/CLI11/archive/v1.6.1.tar.gz" + SHA1 + 4d900c543cc73b80bc31da20998b2d516d67e0ae +) + +hunter_add_version( + PACKAGE_NAME + CLI11 + VERSION + 1.6.2 + URL + "https://github.com/CLIUtils/CLI11/archive/v1.6.2.tar.gz" + SHA1 + a2012510cb565f17c76c1b1c0e4a7bc80fbccb33 +) + +hunter_add_version( + PACKAGE_NAME + CLI11 + VERSION + 1.7.0 + URL + "https://github.com/CLIUtils/CLI11/archive/v1.7.0.tar.gz" + SHA1 + 223a3c3dff2ccbb37e9caafb3f6308fc32564060 +) + +hunter_add_version( + PACKAGE_NAME + CLI11 + VERSION + 1.7.1 + URL + "https://github.com/CLIUtils/CLI11/archive/v1.7.1.tar.gz" + SHA1 + 05b6b47b58201e00db8346a9ad4df172014a4a04 + +) + +hunter_add_version( + PACKAGE_NAME + CLI11 + VERSION + 1.8.0 + URL + "https://github.com/CLIUtils/CLI11/archive/v1.8.0.tar.gz" + SHA1 + c21bdd4ca965931c9c36dadd15f74209ec1b9bca +) + +hunter_cmake_args( + CLI11 + CMAKE_ARGS + CLI11_TESTING=OFF + CLI11_EXAMPLES=OFF + CLI11_SINGLE_FILE=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(CLI11) +hunter_download(PACKAGE_NAME CLI11) diff --git a/cmake/projects/CURL/hunter.cmake b/cmake/projects/CURL/hunter.cmake index 37803e06a..0b8aecf88 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,7 +21,99 @@ 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 +) + +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 +) + +hunter_add_version( + PACKAGE_NAME + CURL + VERSION + "7.49.1-DEV-v9" + URL + "https://github.com/hunter-packages/curl/archive/hunter-7.49.1-v9.tar.gz" + SHA1 + 4d4cb6e5faebfceaafa152bb3572c4760f1745cf +) + +hunter_add_version( + PACKAGE_NAME + CURL + VERSION + "7.59.0-p0" + URL + "https://github.com/hunter-packages/curl/archive/v7.59.0-p0.tar.gz" + SHA1 + 55c76e06ec28c5641cd5c2f9d1b6666d25362c5b +) + +hunter_add_version( + PACKAGE_NAME + CURL + VERSION + "7.59.0-p1" + URL + "https://github.com/hunter-packages/curl/archive/v7.59.0-p1.tar.gz" + SHA1 + 7d8190ad978591d621db1066b96f90722d68a00d +) +hunter_add_version( + PACKAGE_NAME + CURL + VERSION + "7.60.0-p0" + URL + "https://github.com/hunter-packages/curl/archive/v7.60.0-p0.tar.gz" + SHA1 + 53b5065094322323ed38840012eee42c5d4d1640 +) + +hunter_add_version( + PACKAGE_NAME + CURL + VERSION + "7.60.0-p2" + URL + "https://github.com/hunter-packages/curl/archive/v7.60.0-p2.tar.gz" + SHA1 + c15efe3c6c77c5f5d5b098b73d31cc3fbbc0d2fc +) + +if (ANDROID OR IOS OR RASPBERRY_PI OR OPENWRT) + set(_curl_cmake_args + HAVE_FSETXATTR_5=0 + HAVE_FSETXATTR_5__TRYRUN_OUTPUT="" + HAVE_FSETXATTR_6=0 + HAVE_FSETXATTR_6__TRYRUN_OUTPUT="" + HAVE_GLIBC_STRERROR_R=1 + HAVE_GLIBC_STRERROR_R__TRYRUN_OUTPUT="" + HAVE_POLL_FINE_EXITCODE=0 + HAVE_POLL_FINE_EXITCODE__TRYRUN_OUTPUT="" + HAVE_POSIX_STRERROR_R=0 + HAVE_POSIX_STRERROR_R__TRYRUN_OUTPUT="" + ) +else() + set(_curl_cmake_args "") +endif() hunter_cmake_args( CURL @@ -35,11 +122,10 @@ hunter_cmake_args( BUILD_CURL_EXE=OFF CMAKE_USE_OPENSSL=ON CMAKE_USE_LIBSSH2=OFF - ) - - + BUILD_TESTING=OFF + ${_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 000000000..44b512bcf --- /dev/null +++ b/cmake/projects/CapnProto/hunter.cmake @@ -0,0 +1,34 @@ +# !!! 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.7.0" + URL "https://capnproto.org/capnproto-c++-0.7.0.tar.gz" + SHA1 348f5af790c65927480106e1143c9c9554cf2443 +) + +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 new file mode 100644 index 000000000..fb7849039 --- /dev/null +++ b/cmake/projects/Catch/hunter.cmake @@ -0,0 +1,119 @@ +# Copyright (c) 2016 Alexey Ulyanov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_pick_scheme) +include(hunter_cacheable) +include(hunter_download) +include(hunter_cmake_args) + +hunter_add_version( + PACKAGE_NAME + Catch + VERSION + "2.9.1" + URL + "https://github.com/catchorg/Catch2/archive/v2.9.1.tar.gz" + SHA1 + caf84ac93f6b624b9583bc9712feb3fba9417c68 +) + +hunter_add_version( + PACKAGE_NAME + Catch + VERSION + "2.7.0" + URL + "https://github.com/catchorg/Catch2/archive/v2.7.0.tar.gz" + SHA1 + 6df37d5b64a71b840a6a9d8c79c3705aa8a3f56e +) + +hunter_add_version( + PACKAGE_NAME + Catch + VERSION + "2.6.0" + URL + "https://github.com/catchorg/Catch2/archive/v2.6.0.tar.gz" + SHA1 + e32263de5489cfaf57d1a059f1f901312b81f7d1 +) + +hunter_add_version( + PACKAGE_NAME + Catch + VERSION + "2.5.0" + URL + "https://github.com/catchorg/Catch2/archive/v2.5.0.tar.gz" + SHA1 + 55fa742c9d2b6890da7060ca8c58693e7c8929fb +) + +hunter_add_version( + PACKAGE_NAME + Catch + VERSION + "2.2.2" + URL + "https://github.com/catchorg/Catch2/archive/v2.2.2.tar.gz" + SHA1 + 834fcbf7be9c5c06fc1253ebbfdd290fa5983d9e +) + +hunter_add_version( + PACKAGE_NAME + Catch + VERSION + "2.2.1" + URL + "https://github.com/catchorg/Catch2/archive/v2.2.1.tar.gz" + SHA1 + effa701a5120f191417823b60e06e0148dd589b3 +) + +hunter_add_version( + PACKAGE_NAME + Catch + VERSION + "2.0.1" + URL + "https://github.com/hunter-packages/Catch/archive/v2.0.1-p0.tar.gz" + SHA1 + fbfa84ce24b33386f80fe34bc855455de8b8e45e +) + +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 + VERSION + "1.5.9" + URL + "https://github.com/hunter-packages/Catch/releases/download/v1.5.9-hunter/v1.5.9-hunter.tar.gz" + SHA1 + 737cb1c98fedccceb95e7bfd385e5dea0ad5d047 +) + +hunter_cmake_args( + Catch + CMAKE_ARGS + NO_SELFTEST=TRUE CATCH_BUILD_TESTING=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(Catch) +hunter_download(PACKAGE_NAME Catch) diff --git a/cmake/projects/Clang/hunter.cmake b/cmake/projects/Clang/hunter.cmake index fd07fd2fe..1d699f86c 100644 --- a/cmake/projects/Clang/hunter.cmake +++ b/cmake/projects/Clang/hunter.cmake @@ -7,6 +7,39 @@ include(hunter_add_version) include(hunter_download) include(hunter_pick_scheme) +hunter_add_version( + PACKAGE_NAME + Clang + VERSION + "6.0.1-p0" + URL + "https://github.com/hunter-packages/clang/archive/v6.0.1-p0.tar.gz" + SHA1 + b74a5f7b4fe4308d3c67413d2826aa3adf44411a +) + +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 ff4544e3f..2ff62e291 100644 --- a/cmake/projects/ClangToolsExtra/hunter.cmake +++ b/cmake/projects/ClangToolsExtra/hunter.cmake @@ -7,6 +7,28 @@ include(hunter_add_version) include(hunter_download) include(hunter_pick_scheme) +hunter_add_version( + PACKAGE_NAME + ClangToolsExtra + VERSION + "6.0.1" + URL + "http://llvm.org/releases/6.0.1/clang-tools-extra-6.0.1.src.tar.xz" + SHA1 + 0e4077e46dba66f9db17eb55b1e913b44cb19fd3 +) + +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/CppNetlibUri/hunter.cmake b/cmake/projects/CppNetlibUri/hunter.cmake index d5f1d389a..bced551dd 100644 --- a/cmake/projects/CppNetlibUri/hunter.cmake +++ b/cmake/projects/CppNetlibUri/hunter.cmake @@ -7,6 +7,17 @@ include(hunter_add_version) include(hunter_download) include(hunter_pick_scheme) +hunter_add_version( + PACKAGE_NAME + CppNetlibUri + VERSION + "1.0.5-hunter" + URL + "https://github.com/hunter-packages/uri/archive/v1.0.5-hunter.tar.gz" + SHA1 + b61a81998e7636bc3d80668e6629b3844bb4a28a +) + hunter_add_version( PACKAGE_NAME CppNetlibUri diff --git a/cmake/projects/CreateLaunchers/hunter.cmake b/cmake/projects/CreateLaunchers/hunter.cmake new file mode 100644 index 000000000..a0f5be44b --- /dev/null +++ b/cmake/projects/CreateLaunchers/hunter.cmake @@ -0,0 +1,46 @@ +# Copyright (c) 2013-2018, 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 + CreateLaunchers + VERSION + "0.2.1" + URL + "https://github.com/caseymcc/CreateLaunchers/archive/0.2.1.tar.gz" + SHA1 + e330f0c8a7562f23eb323c36c2ce9417a88686ea +) + +hunter_add_version( + PACKAGE_NAME + CreateLaunchers + VERSION + "0.2.0" + URL + "https://github.com/caseymcc/CreateLaunchers/archive/0.2.0.tar.gz" + SHA1 + c09496f49eb6557f91cd0f927d61bf901f38240d +) + +hunter_add_version( + PACKAGE_NAME + CreateLaunchers + VERSION + "0.1.0" + URL + "https://github.com/caseymcc/CreateLaunchers/archive/0.1.0.tar.gz" + SHA1 + f0769de3d5968d1308ee9c9a566f0619a94a288a +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(CreateLaunchers) +hunter_download(PACKAGE_NAME CreateLaunchers) diff --git a/cmake/projects/Eigen/hunter.cmake b/cmake/projects/Eigen/hunter.cmake index 0b3661a84..6260018b6 100644 --- a/cmake/projects/Eigen/hunter.cmake +++ b/cmake/projects/Eigen/hunter.cmake @@ -17,25 +17,147 @@ hunter_add_version( PACKAGE_NAME Eigen VERSION - "3.2.4-p0" + "3.3.7" URL - "https://github.com/hunter-packages/eigen/archive/v3.2.4-p0.tar.gz" + "https://github.com/eigenteam/eigen-git-mirror/archive/3.3.7.tar.gz" SHA1 - 6fd638939dfd3a3be1cf0ea920160591ed60f76d + 3a299537e429a3a11e4038616b867d004014f262 ) hunter_add_version( PACKAGE_NAME Eigen VERSION - "3.2.4" + "3.3.6" URL - "https://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz" + "https://github.com/eigenteam/eigen-git-mirror/archive/3.3.6.tar.gz" SHA1 - b826f665bdfe31784795eef79c75540db71ab702 + 328824ffd5487f989e27326133d2d9106acc4fdd ) -hunter_cmake_args(Eigen CMAKE_ARGS EIGEN_ENABLE_TESTING=OFF) +hunter_add_version( + PACKAGE_NAME + Eigen + VERSION + "3.3.5" + URL + "https://github.com/eigenteam/eigen-git-mirror/archive/3.3.5.tar.gz" + SHA1 + c1801a3b37c7fd734c756b9dce4d00a3cd685b7a +) + +hunter_add_version( + PACKAGE_NAME + Eigen + VERSION + "3.3.4-p1" + URL + "https://github.com/hunter-packages/eigen/archive/v3.3.4-p1.tar.gz" + SHA1 + f7f21eed71df17707c7c25eb17e25f844b2d63a2 +) + +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 + VERSION + "3.3.1-p3" + URL + "https://github.com/hunter-packages/eigen/archive/v3.3.1-p3.tar.gz" + SHA1 + 874fc1fb141f9fcd8537b4384c04b4e67ab3821f +) + +hunter_add_version( + PACKAGE_NAME + Eigen + VERSION + "3.3.1-p2" + URL + "https://github.com/hunter-packages/eigen/archive/v3.3.1-p2.tar.gz" + SHA1 + 0a15d912c3002bfb42e739235cfd650ab74bb5a6 +) + +hunter_add_version( + PACKAGE_NAME + Eigen + VERSION + "3.3.1-p4" + URL + "https://github.com/hunter-packages/eigen/archive/v3.3.1-p4.tar.gz" + SHA1 + 3ea6a95fb3b1b82c9a9c75fb50f5c87f7e0c9b1a +) + +hunter_add_version( + PACKAGE_NAME + Eigen + VERSION + "v0.0.0-429aa5254200-p1" + URL + "https://github.com/hunter-packages/eigen/archive/hunter-429aa5254200-p1.tar.gz" + SHA1 + 1229c01ecdf7388329233bd6a3f837307f80f569 +) + +hunter_add_version( + PACKAGE_NAME + Eigen + VERSION + "v0.0.0-429aa5254200-p0" + URL + "https://github.com/hunter-packages/eigen/archive/hunter-429aa5254200-p0.tar.gz" + SHA1 + 89e7e4419142f7a06fc59183f61c1f9333f2633b +) + +set(_android_args) +if(ANDROID) + set(_android_args EIGEN_DISABLE_CXX11_MATH=YES) +endif() + +# disable Eigen tests. Testcreation tries to find package 'Boost' +hunter_cmake_args( + Eigen + CMAKE_ARGS + BUILD_TESTING=OFF + HUNTER_INSTALL_LICENSE_FILES=COPYING.MPL2 + ${_android_args} +) # Pick a download scheme hunter_pick_scheme(DEFAULT url_sha1_cmake) diff --git a/cmake/projects/EnumGroup/hunter.cmake b/cmake/projects/EnumGroup/hunter.cmake new file mode 100644 index 000000000..a2f650f04 --- /dev/null +++ b/cmake/projects/EnumGroup/hunter.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2016-2018, 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) +include(hunter_cmake_args) + +hunter_add_version( + PACKAGE_NAME + EnumGroup + VERSION + 0.0.1 + URL + "https://github.com/Person-93/EnumGroup/archive/0.0.1.tar.gz" + SHA1 + e842e9c81865db3006e1b457b5bedea401ae5734 +) + +hunter_cmake_args( + EnumGroup + CMAKE_ARGS + ENUM_GROUP_WITH_TESTS=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(EnumGroup) +hunter_download(PACKAGE_NAME EnumGroup) diff --git a/cmake/projects/FP16/hunter.cmake b/cmake/projects/FP16/hunter.cmake new file mode 100644 index 000000000..ca310b985 --- /dev/null +++ b/cmake/projects/FP16/hunter.cmake @@ -0,0 +1,27 @@ +# Copyright (c) 2016-2019, 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) +include(hunter_cmake_args) + +hunter_add_version( + PACKAGE_NAME + FP16 + VERSION + 0.0.0-febbb1c-p0 + URL + "https://github.com/hunter-packages/FP16/archive/v0.0.0-febbb1c-p0.tar.gz" + SHA1 + 86a7e35a2193e60440ea152628ade89eff4cd0cd +) + +hunter_cmake_args(FP16 CMAKE_ARGS FP16_BUILD_BENCHMARKS=OFF FP16_BUILD_TESTS=OFF) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(FP16) +hunter_download(PACKAGE_NAME FP16) diff --git a/cmake/projects/FakeIt/hunter.cmake b/cmake/projects/FakeIt/hunter.cmake new file mode 100644 index 000000000..90a276f7e --- /dev/null +++ b/cmake/projects/FakeIt/hunter.cmake @@ -0,0 +1,21 @@ +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_pick_scheme) +include(hunter_cacheable) +include(hunter_download) + +hunter_add_version( + PACKAGE_NAME + FakeIt + VERSION + "2.0.3" + URL + "https://github.com/hunter-packages/FakeIt/archive/2.0.3-hunter.tar.gz" + SHA1 + 9ac096c5d990bc8b8d8d8b0ac6b4902c21928a22 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(FakeIt) +hunter_download(PACKAGE_NAME FakeIt) diff --git a/cmake/projects/Fruit/hunter.cmake b/cmake/projects/Fruit/hunter.cmake new file mode 100644 index 000000000..4cbe9d2e2 --- /dev/null +++ b/cmake/projects/Fruit/hunter.cmake @@ -0,0 +1,32 @@ +# cmake/projects/Fruit/hunter.cmake + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_cmake_args) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME + Fruit + VERSION + "3.1.1-p0" + URL + "https://github.com/hunter-packages/fruit/archive/v3.1.1-p0.tar.gz" + SHA1 + f406060a51ee80e14fc34ba9242a230182ac2b12 +) + +hunter_cmake_args( + Fruit + CMAKE_ARGS + FRUIT_USES_BOOST=OFF + FRUIT_BUILD_TESTS=OFF + FRUIT_BUILD_EXAMPLES=OFF + FRUIT_BUILD_EXTRAS=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) + +hunter_cacheable(Fruit) +hunter_download(PACKAGE_NAME Fruit) diff --git a/cmake/projects/FunctionalPlus/hunter.cmake b/cmake/projects/FunctionalPlus/hunter.cmake new file mode 100644 index 000000000..a0a0dfd13 --- /dev/null +++ b/cmake/projects/FunctionalPlus/hunter.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2013-2018, Ruslan Baratov +# Copyright (c) 2018, David Hirvonen +# 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) + +hunter_add_version( + PACKAGE_NAME FunctionalPlus + VERSION 0.2-p0 + URL "https://github.com/Dobiasd/FunctionalPlus/archive/0.2.tar.gz" + SHA1 d637860643bb0199a8b558f3d55460de2c88fb50 + ) + +hunter_cmake_args( + FunctionalPlus + CMAKE_ARGS + FPLUS_USE_TOOLCHAIN=ON + FPLUS_BUILD_EXAMPLES=OFF + FPLUS_BUILD_UNITTEST=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(FunctionalPlus) +hunter_download(PACKAGE_NAME FunctionalPlus) diff --git a/cmake/projects/GPUImage/hunter.cmake b/cmake/projects/GPUImage/hunter.cmake index c7ab681ae..f43a3740a 100644 --- a/cmake/projects/GPUImage/hunter.cmake +++ b/cmake/projects/GPUImage/hunter.cmake @@ -17,10 +17,10 @@ hunter_add_version( URL "https://github.com/hunter-packages/GPUImage/archive/v0.1.6-p5.tar.gz" SHA1 - 463564d96442c214d21faa28a3ca229962ca086c - ) + 69a287016c57ca02012faf973e2eabda4ec87123 +) - hunter_add_version( +hunter_add_version( PACKAGE_NAME GPUImage VERSION @@ -28,8 +28,19 @@ hunter_add_version( URL "https://github.com/headupinclouds/GPUImage/archive/v0.1.6-p6.tar.gz" SHA1 - 230f9f9ba0fe1cce96827ea0cfc944b6df05ec34 - ) + 230f9f9ba0fe1cce96827ea0cfc944b6df05ec34 +) + +hunter_add_version( + PACKAGE_NAME + GPUImage + VERSION + "0.1.6-p9" + URL + "https://github.com/hunter-packages/GPUImage/archive/v0.1.6-p9.tar.gz" + SHA1 + ab3b4785d5767031d545e65ebe12a0910b5ef6b2 +) hunter_cmake_args( GPUImage diff --git a/cmake/projects/GTest/hunter.cmake b/cmake/projects/GTest/hunter.cmake index cc97961d5..b49083b5d 100644 --- a/cmake/projects/GTest/hunter.cmake +++ b/cmake/projects/GTest/hunter.cmake @@ -7,6 +7,7 @@ include(hunter_add_version) include(hunter_cacheable) include(hunter_download) include(hunter_pick_scheme) +include(hunter_cmake_args) hunter_add_version( PACKAGE_NAME @@ -145,12 +146,99 @@ hunter_add_version( GTest VERSION 1.8.0-hunter-p2 - URL + URL "https://github.com/hunter-packages/googletest/archive/1.8.0-hunter-p2.tar.gz" SHA1 93148cb8850abe78b76ed87158fdb6b9c48e38c4 ) +hunter_add_version( + PACKAGE_NAME + GTest + VERSION + 1.8.0-hunter-p5 + URL https://github.com/hunter-packages/googletest/archive/1.8.0-hunter-p5.tar.gz + SHA1 3325aa4fc8b30e665c9f73a60f19387b7db36f85 +) + +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 +) + +hunter_add_version( + PACKAGE_NAME + GTest + VERSION + 1.8.0-hunter-p8 + URL + "https://github.com/hunter-packages/googletest/archive/1.8.0-hunter-p8.tar.gz" + SHA1 + 1cdd396b20c8d29f7ea08baaa49673b1c261f545 +) + +hunter_add_version( + PACKAGE_NAME + GTest + VERSION + 1.8.0-hunter-p9 + URL + "https://github.com/hunter-packages/googletest/archive/1.8.0-hunter-p9.tar.gz" + SHA1 + a345f16cb610e0b5dfa7778dc2852b784cfede5b +) + +hunter_add_version( + PACKAGE_NAME + GTest + VERSION + 1.8.0-hunter-p10 + URL + "https://github.com/hunter-packages/googletest/archive/1.8.0-hunter-p10.tar.gz" + SHA1 + 1d92c9f51af756410843b13f8c4e4df09e235394 +) + +hunter_add_version( + PACKAGE_NAME + GTest + VERSION + "1.8.0-hunter-p11" + URL + "https://github.com/hunter-packages/googletest/archive/1.8.0-hunter-p11.tar.gz" + SHA1 + 76c6aec038f7d7258bf5c4f45c4817b34039d285 +) + +if(HUNTER_GTest_VERSION VERSION_LESS 1.8.0) + set(_gtest_license "LICENSE") +else() + set(_gtest_license "googletest/LICENSE") +endif() + +hunter_cmake_args( + GTest + CMAKE_ARGS + HUNTER_INSTALL_LICENSE_FILES=${_gtest_license} +) + hunter_pick_scheme(DEFAULT url_sha1_cmake) hunter_cacheable(GTest) hunter_download(PACKAGE_NAME GTest PACKAGE_INTERNAL_DEPS_ID 1) diff --git a/cmake/projects/HalideIR/hunter.cmake b/cmake/projects/HalideIR/hunter.cmake new file mode 100644 index 000000000..76f0d3d4f --- /dev/null +++ b/cmake/projects/HalideIR/hunter.cmake @@ -0,0 +1,46 @@ +# Copyright (c) 2016-2018, 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 + HalideIR + VERSION + 0.0-2f3ecdf-p0 + URL + "https://github.com/hunter-packages/HalideIR/archive/v0.0-2f3ecdf-p0.tar.gz" + SHA1 + 1f1dfb75eb296ad874aac67cf5b604ddfbe944a1 +) + +hunter_add_version( + PACKAGE_NAME + HalideIR + VERSION + 0.0-b257a92-p1 + URL + "https://github.com/hunter-packages/HalideIR/archive/v0.0-b257a92-p1.tar.gz" + SHA1 + 3b527b4e9d07e194f2143ce14563f69dc6a4db93 +) + +hunter_add_version( + PACKAGE_NAME + HalideIR + VERSION + 0.0-32057b5-p0 + URL + "https://github.com/hunter-packages/HalideIR/archive/v0.0-32057b5-p0.tar.gz" + SHA1 + f1becfb86a2e59e40094a74b200f5d2e374676de +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(HalideIR) +hunter_download(PACKAGE_NAME HalideIR) diff --git a/cmake/projects/HastyNoise/hunter.cmake b/cmake/projects/HastyNoise/hunter.cmake new file mode 100644 index 000000000..5996eef3d --- /dev/null +++ b/cmake/projects/HastyNoise/hunter.cmake @@ -0,0 +1,53 @@ +# !!! 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 + HastyNoise + VERSION + "0.8.2" + URL + "https://github.com/caseymcc/HastyNoise/archive/0.8.2.tar.gz" + SHA1 + 563bd6d8e5cd7fd37ec4a52fd4c12e7bf722685b +) + +hunter_add_version( + PACKAGE_NAME + HastyNoise + VERSION + "0.8.1" + URL + "https://github.com/caseymcc/HastyNoise/archive/0.8.1.tar.gz" + SHA1 + 355f1ef9446d9942e327859e90a141401ce194c7 +) + +hunter_add_version( + PACKAGE_NAME + HastyNoise + VERSION + "0.8.0" + URL + "https://github.com/caseymcc/HastyNoise/archive/0.8.0.tar.gz" + SHA1 + f4e9fd3fb2b53eeb10d6c7705d34eac7c7493059 +) + +hunter_cmake_args( + HastyNoise + CMAKE_ARGS + HN_PREVIEW_APP=OFF +) + +# Pick a download scheme +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(HastyNoise) +hunter_download(PACKAGE_NAME HastyNoise) diff --git a/cmake/projects/ICU/hunter.cmake b/cmake/projects/ICU/hunter.cmake new file mode 100644 index 000000000..695ff7fb7 --- /dev/null +++ b/cmake/projects/ICU/hunter.cmake @@ -0,0 +1,112 @@ +# Copyright (c) 2016-2018, 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 + ICU + VERSION + 55.1-p1 + URL + "https://github.com/hunter-packages/icu/archive/v55.1-p1.tar.gz" + SHA1 + 605defbeb77697dc59edff6bcfcd37ce89e43457 +) + +hunter_add_version( + PACKAGE_NAME + ICU + VERSION + 55.1-p2 + URL + "https://github.com/hunter-packages/icu/archive/v55.1-p2.tar.gz" + SHA1 + fe7aef7858fbd3bcc951ebb1e427d20d03c7cbde +) + +hunter_add_version( + PACKAGE_NAME + ICU + VERSION + 55.1-p3 + URL + "https://github.com/hunter-packages/icu/archive/v55.1-p3.tar.gz" + SHA1 + 0e9f4d37b1601a0a2947fe3abb7d6945df9e5ea4 +) + +hunter_add_version( + PACKAGE_NAME + ICU + VERSION + 55.1-p4 + URL + "https://github.com/hunter-packages/icu/archive/v55.1-p4.tar.gz" + SHA1 + 4c14de025043ef43b0d8418b87fe6b25a31c6aa7 +) + +hunter_add_version( + PACKAGE_NAME + ICU + VERSION + 63.1-p1 + URL + "https://github.com/hunter-packages/icu/archive/v63.1-p1.tar.gz" + SHA1 + 581d4ff13168ecb6eab5cdf559df8cba3d93a778 +) + +hunter_add_version( + PACKAGE_NAME + ICU + VERSION + 63.1-p2 + URL + "https://github.com/hunter-packages/icu/archive/v63.1-p2.tar.gz" + SHA1 + 562740c5ab644d8334b20974e73b372625f99c2e +) + +hunter_add_version( + PACKAGE_NAME + ICU + VERSION + 63.1-p3 + URL + "https://github.com/hunter-packages/icu/archive/v63.1-p3.tar.gz" + SHA1 + 6192cef73b0f15c0f4d93a8a3deffeaeb562a65e +) + +hunter_add_version( + PACKAGE_NAME + ICU + VERSION + 63.1-p4 + URL + "https://github.com/hunter-packages/icu/archive/v63.1-p4.tar.gz" + SHA1 + eead3c1c8f8ec00cb224a50a8895e0333c6c65a8 +) + +hunter_add_version( + PACKAGE_NAME + ICU + VERSION + 63.1-p5 + URL + "https://github.com/hunter-packages/icu/archive/v63.1-p5.tar.gz" + SHA1 + 506109ef6fa0c3105be64bcebb5bd9e3fba1a24f +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(ICU) +hunter_download(PACKAGE_NAME ICU) diff --git a/cmake/projects/IF97/hunter.cmake b/cmake/projects/IF97/hunter.cmake new file mode 100644 index 000000000..70b7154eb --- /dev/null +++ b/cmake/projects/IF97/hunter.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2016-2017, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cmake_args) +include(hunter_pick_scheme) +include(hunter_cacheable) +include(hunter_download) + +hunter_add_version( + PACKAGE_NAME + IF97 + VERSION + 2.1.2 + URL + "https://github.com/CoolProp/IF97/archive/v2.1.2.tar.gz" + SHA1 + 84d7a541d7aee33c708b25499c82e12cf68f63f1 +) + +hunter_cmake_args( + IF97 + CMAKE_ARGS + IF97_CMAKE_MODULE=ON +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(IF97) +hunter_download(PACKAGE_NAME IF97) diff --git a/cmake/projects/Jpeg/hunter.cmake b/cmake/projects/Jpeg/hunter.cmake index d94818fda..abdf1cc8c 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 @@ -30,6 +41,17 @@ hunter_add_version( 70769f349fdf346851f2e7fc4c5f603cd8960ae4 ) +hunter_add_version( + PACKAGE_NAME + Jpeg + VERSION + "9c-p0" + URL + "https://github.com/hunter-packages/jpeg/archive/v9c-p0.tar.gz" + SHA1 + 42ff243ae28bdda5b4df5c47fb727272a534dc94 +) + hunter_pick_scheme(DEFAULT url_sha1_cmake) hunter_cacheable(Jpeg) hunter_download(PACKAGE_NAME Jpeg) diff --git a/cmake/projects/LAPACK/hunter-msvc.cmake b/cmake/projects/LAPACK/hunter-msvc.cmake new file mode 100644 index 000000000..066bd44e0 --- /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 000000000..7ccaf220e --- /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 000000000..66476814e --- /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 a92b0f0eb..a3bde354d 100644 --- a/cmake/projects/LLVM/hunter.cmake +++ b/cmake/projects/LLVM/hunter.cmake @@ -1,18 +1,48 @@ -# 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 + "6.0.1-p0" + URL + "https://github.com/hunter-packages/llvm/archive/v6.0.1-p0.tar.gz" + SHA1 + 0942eedb9f349f3de7c483600de026192cc9e3ee +) + +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 +91,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 +99,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 +107,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 dd751ccf2..5aba84e4f 100644 --- a/cmake/projects/LLVMCompilerRT/hunter.cmake +++ b/cmake/projects/LLVMCompilerRT/hunter.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2014, Ruslan Baratov +# Copyright (c) 2014-2018, Ruslan Baratov # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -7,6 +7,28 @@ include(hunter_add_version) include(hunter_download) include(hunter_pick_scheme) +hunter_add_version( + PACKAGE_NAME + LLVMCompilerRT + VERSION + "6.0.1" + URL + "http://releases.llvm.org/6.0.1/compiler-rt-6.0.1.src.tar.xz" + SHA1 + 4a61bd09f31d3079e921205bb93fb7d05a95946b +) + +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/Leathers/hunter.cmake b/cmake/projects/Leathers/hunter.cmake index 0f3e6203e..10f51c1d8 100644 --- a/cmake/projects/Leathers/hunter.cmake +++ b/cmake/projects/Leathers/hunter.cmake @@ -3,8 +3,8 @@ # !!! DO NOT PLACE HEADER GUARDS HERE !!! -include(hunter_add_package) include(hunter_add_version) +include(hunter_cacheable) include(hunter_download) include(hunter_pick_scheme) @@ -74,5 +74,17 @@ hunter_add_version( 390df257a5b22087c96f67a08b52902e7dea1bc2 ) +hunter_add_version( + PACKAGE_NAME + Leathers + VERSION + "0.1.8" + URL + "https://github.com/ruslo/leathers/archive/v0.1.8.tar.gz" + SHA1 + 04800eba37499e5a14532ccaff239911adff3a6c +) + +hunter_cacheable(Leathers) hunter_pick_scheme(DEFAULT url_sha1_cmake) hunter_download(PACKAGE_NAME Leathers) diff --git a/cmake/projects/Leptonica/hunter.cmake b/cmake/projects/Leptonica/hunter.cmake new file mode 100644 index 000000000..0e2047d9a --- /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/LibCDS/hunter.cmake b/cmake/projects/LibCDS/hunter.cmake new file mode 100644 index 000000000..0397f169b --- /dev/null +++ b/cmake/projects/LibCDS/hunter.cmake @@ -0,0 +1,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 LibCDS + VERSION "2.3.1" + URL "https://github.com/hunter-packages/libcds/archive/v2.3.1-p0.tar.gz" + SHA1 "86cc0d2d57075830feaaa1c6e1200e970b96f9f8") + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(LibCDS) +hunter_download(PACKAGE_NAME LibCDS) diff --git a/cmake/projects/Libevent/hunter.cmake b/cmake/projects/Libevent/hunter.cmake new file mode 100644 index 000000000..755cff41f --- /dev/null +++ b/cmake/projects/Libevent/hunter.cmake @@ -0,0 +1,35 @@ +# !!! 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 Libevent + VERSION "2.1.8" + URL "https://github.com/hunter-packages/libevent/archive/v2.1.8-p2.tar.gz" + SHA1 "492abb962dad3071f34bbe4975e28768fd29edf0") + +hunter_add_version( + PACKAGE_NAME Libevent + VERSION "2.1.8-p3" + URL "https://github.com/hunter-packages/libevent/archive/v2.1.8-p3.tar.gz" + SHA1 "c6a1b1ffe52d73d9cf5c6ed2088708f8e6a093fe") + +hunter_add_version( + PACKAGE_NAME Libevent + VERSION "2.1.8-p4" + URL "https://github.com/hunter-packages/libevent/archive/v2.1.8-p4.tar.gz" + SHA1 "a969958d9064c44338d78b097975a14c46501c03") + +hunter_cmake_args(Libevent CMAKE_ARGS + EVENT__DISABLE_TESTS=ON + EVENT__DISABLE_SAMPLES=ON + EVENT__DISABLE_REGRESS=ON + EVENT__DISABLE_BENCHMARK=ON) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(Libevent) +hunter_download(PACKAGE_NAME Libevent) diff --git a/cmake/projects/Libssh2/hunter.cmake b/cmake/projects/Libssh2/hunter.cmake index a9fdc0dd7..8bb528877 100644 --- a/cmake/projects/Libssh2/hunter.cmake +++ b/cmake/projects/Libssh2/hunter.cmake @@ -4,6 +4,7 @@ # !!! DO NOT PLACE HEADER GUARDS HERE !!! include(hunter_add_version) +include(hunter_cacheable) include(hunter_cmake_args) include(hunter_download) include(hunter_pick_scheme) @@ -14,9 +15,9 @@ hunter_add_version( VERSION "1.7.0" URL - "https://github.com/hunter-packages/libssh2/archive/libssh2-1.7.0-hunter-2.tar.gz" + "https://github.com/hunter-packages/libssh2/archive/libssh2-1.7.0-hunter-4.tar.gz" SHA1 - 284191652e208daf34018e7938e6ee6db9f99931 + 7e69321f9d09d53ecb367fc571ef303d0986147e ) hunter_add_version( @@ -50,4 +51,5 @@ hunter_cmake_args( ) hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(Libssh2) hunter_download(PACKAGE_NAME Libssh2) diff --git a/cmake/projects/LodePNG/hunter.cmake b/cmake/projects/LodePNG/hunter.cmake new file mode 100644 index 000000000..42d4b0d0e --- /dev/null +++ b/cmake/projects/LodePNG/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2018, 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 + LodePNG + VERSION + "0.0.0-p1" + URL + "https://github.com/hunter-packages/lodepng/archive/v0.0.0-p1.tar.gz" + SHA1 + 315129891c5ea6c922ed98398c853a7a83a3c662 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(LodePNG) +hunter_download(PACKAGE_NAME LodePNG) diff --git a/cmake/projects/Lua/hunter.cmake b/cmake/projects/Lua/hunter.cmake index d8cc6be30..d44fb23ab 100644 --- a/cmake/projects/Lua/hunter.cmake +++ b/cmake/projects/Lua/hunter.cmake @@ -19,7 +19,65 @@ hunter_add_version( 0697a2fa7fc657aac91e0a31f9f7709aebf1e3db ) -hunter_configuration_types(Lua CONFIGURATION_TYPES Release) +hunter_add_version( + PACKAGE_NAME + Lua + VERSION + "5.3.2-p2" + URL + "https://github.com/hunter-packages/lua/archive/v5.3.2-p2.tar.gz" + SHA1 + 6512fca43e01209f6e69803558d346ea767e52fc +) + +# NOTE: Test '5.1.*' version with 'toluapp' package (!) +hunter_add_version( + PACKAGE_NAME + Lua + VERSION + "5.1.5-p0" + URL + "https://github.com/hunter-packages/lua/archive/v5.1.5-p0.tar.gz" + SHA1 + 70005ecaca16c155e684d966fc3e2b6ce8a70d6f +) + +# NOTE: Test '5.1.*' version with 'toluapp' package (!) +hunter_add_version( + PACKAGE_NAME + Lua + VERSION + "5.1.5-p1" + URL + "https://github.com/hunter-packages/lua/archive/v5.1.5-p1.tar.gz" + SHA1 + 5387f5408ce189b2b34741ab4b28c0936b6bcbe3 +) + +# NOTE: Test '5.1.*' version with 'toluapp' package (!) +hunter_add_version( + PACKAGE_NAME + Lua + VERSION + "5.1.5-p2" + URL + "https://github.com/hunter-packages/lua/archive/v5.1.5-p2.tar.gz" + SHA1 + cc804e53073686f31f59629dbc964538c60be521 +) + +# NOTE: Test '5.1.*' version with 'toluapp' package (!) +hunter_add_version( + PACKAGE_NAME + Lua + VERSION + "5.1.5-p3" + URL + "https://github.com/hunter-packages/lua/archive/v5.1.5-p3.tar.gz" + SHA1 + 9732277f78be6be26633f3cd8e3f810d8431ed51 +) + hunter_cacheable(Lua) hunter_pick_scheme(DEFAULT url_sha1_cmake) hunter_download(PACKAGE_NAME Lua) diff --git a/cmake/projects/MathFu/hunter.cmake b/cmake/projects/MathFu/hunter.cmake new file mode 100644 index 000000000..6c866075d --- /dev/null +++ b/cmake/projects/MathFu/hunter.cmake @@ -0,0 +1,32 @@ +# Copyright (c) 2016-2018, 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 + MathFu + VERSION + 1.1.0-p0 + URL + "https://github.com/hunter-packages/mathfu/archive/v1.1.0-p0.tar.gz" + SHA1 + 8ab4c19240e65e406ec2fcb8c6886d9030ca9d83 +) + +hunter_cmake_args( + MathFu + CMAKE_ARGS + mathfu_build_benchmarks=OFF + mathfu_build_tests=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(MathFu) +hunter_download(PACKAGE_NAME MathFu) diff --git a/cmake/projects/Microsoft.GSL/hunter.cmake b/cmake/projects/Microsoft.GSL/hunter.cmake new file mode 100644 index 000000000..38f6037d9 --- /dev/null +++ b/cmake/projects/Microsoft.GSL/hunter.cmake @@ -0,0 +1,53 @@ +# Copyright (c) 2016-2018, 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 + Microsoft.GSL + VERSION + 1.0.0-p0 + URL + "https://github.com/hunter-packages/Microsoft.GSL/archive/v1.0.0-p0.tar.gz" + SHA1 + 3cc3b9f2f7e5cde7827b8793ab6b4a8717511c9a +) + +hunter_add_version( + PACKAGE_NAME + Microsoft.GSL + VERSION + 1.0.0-p1 + URL + "https://github.com/hunter-packages/Microsoft.GSL/archive/v1.0.0-p1.tar.gz" + SHA1 + d38a9e318a1ad1d96d169cd91f0909f1dc85e0d7 +) + +hunter_add_version( + PACKAGE_NAME + Microsoft.GSL + VERSION + 2.0.0-p0 + URL + "https://github.com/hunter-packages/Microsoft.GSL/archive/v2.0.0-p0.tar.gz" + SHA1 + a94c9c1e41edf787a1c080b7cab8f2f4217dbc4b +) + +hunter_cmake_args( + Microsoft.GSL + CMAKE_ARGS + GSL_TEST=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(Microsoft.GSL) +hunter_download(PACKAGE_NAME Microsoft.GSL) diff --git a/cmake/projects/MySQL-client/hunter.cmake b/cmake/projects/MySQL-client/hunter.cmake index 1ae26edf6..a4386be55 100644 --- a/cmake/projects/MySQL-client/hunter.cmake +++ b/cmake/projects/MySQL-client/hunter.cmake @@ -19,10 +19,42 @@ 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 +) + +hunter_add_version( + PACKAGE_NAME + MySQL-client + VERSION + "6.1.9-p1" + URL + "https://github.com/hunter-packages/mysql-client/archive/v1.6.9-p1.tar.gz" + SHA1 + 8c9d00495194955529e4b1074d5bafba9e0882a1 +) + +# 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 000000000..9cd7cbf18 --- /dev/null +++ b/cmake/projects/NASM/hunter.cmake @@ -0,0 +1,48 @@ +# 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 PACKAGE_INTERNAL_DEPS_ID "1") 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 000000000..d44af3ff6 --- /dev/null +++ b/cmake/projects/NASM/schemes/url_sha1_nasm_windows.cmake.in @@ -0,0 +1,68 @@ +# 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_assert_not_empty_string) + +hunter_status_debug("Scheme: url_sha1_nasm_windows") + +# Check preconditions +hunter_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_MSVC_ARCH@") +hunter_assert_not_empty_string("@HUNTER_MSVC_VCVARSALL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_LICENSE_DIR@") +hunter_assert_not_empty_string("@HUNTER_TLS_VERIFY@") + +ExternalProject_Add( + "@HUNTER_EP_NAME@" + URL + "@HUNTER_PACKAGE_URL@" + URL_HASH + SHA1=@HUNTER_PACKAGE_SHA1@ + DOWNLOAD_DIR + "@HUNTER_PACKAGE_DOWNLOAD_DIR@" + TLS_VERIFY + "@HUNTER_TLS_VERIFY@" + 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/NLopt/hunter.cmake b/cmake/projects/NLopt/hunter.cmake new file mode 100644 index 000000000..9c4c3a93d --- /dev/null +++ b/cmake/projects/NLopt/hunter.cmake @@ -0,0 +1,36 @@ +# Copyright (c) 2016-2018, 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) +include(hunter_cmake_args) + +hunter_add_version( + PACKAGE_NAME + NLopt + VERSION + 2.5.0-p0 + URL + "https://github.com/hunter-packages/nlopt/archive/v2.5.0-p0.tar.gz" + SHA1 + 30838bcdc191b6dae8af1d0e8f704fe51a0ad3ef +) + +hunter_cmake_args(NLopt CMAKE_ARGS + NLOPT_CXX=OFF + NLOPT_PYTHON=OFF + NLOPT_OCTAVE=OFF + NLOPT_MATLAB=OFF + NLOPT_GUILE=OFF + NLOPT_SWIG=OFF + NLOPT_TESTS=OFF + NLOPT_LINK_PYTHON=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(NLopt) +hunter_download(PACKAGE_NAME NLopt) diff --git a/cmake/projects/ONNX/hunter.cmake b/cmake/projects/ONNX/hunter.cmake new file mode 100644 index 000000000..9d825d8c4 --- /dev/null +++ b/cmake/projects/ONNX/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 + ONNX + VERSION + 1.4.1-p0 + URL + "https://github.com/hunter-packages/onnx/archive/v1.4.1-p0.tar.gz" + SHA1 + 70032d6e55c61a6716203cbf44a5773318d2f86e +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(ONNX) +hunter_download(PACKAGE_NAME ONNX) diff --git a/cmake/projects/OpenAL/hunter.cmake b/cmake/projects/OpenAL/hunter.cmake new file mode 100644 index 000000000..be6b31b0c --- /dev/null +++ b/cmake/projects/OpenAL/hunter.cmake @@ -0,0 +1,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 OpenAL + VERSION "1.18.2" + URL "https://github.com/kcat/openal-soft/archive/openal-soft-1.18.2.tar.gz" + SHA1 "f819c6720c4beead7653ebc35fbb2c287a8970fc") + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(OpenAL) +hunter_download(PACKAGE_NAME OpenAL) diff --git a/cmake/projects/OpenBLAS/hunter.cmake b/cmake/projects/OpenBLAS/hunter.cmake index 02804e7e7..eb7b87021 100644 --- a/cmake/projects/OpenBLAS/hunter.cmake +++ b/cmake/projects/OpenBLAS/hunter.cmake @@ -7,8 +7,54 @@ include(hunter_add_version) include(hunter_cacheable) include(hunter_configuration_types) include(hunter_pick_scheme) +include(hunter_cmake_args) include(hunter_download) + +hunter_add_version( + PACKAGE_NAME + OpenBLAS + VERSION + 0.3.3 + URL + "https://github.com/xianyi/OpenBLAS/archive/v0.3.3.tar.gz" + SHA1 + bff159c528c1a860cee4976114d224da32d302a2 +) + +hunter_add_version( + PACKAGE_NAME + OpenBLAS + VERSION + 0.3.1-p0 + URL + "https://github.com/hunter-packages/OpenBLAS/archive/v0.3.1-p0.tar.gz" + SHA1 + b525caa851e9cfb9e1756e42c8b4ee4877e98b9f +) + +hunter_add_version( + PACKAGE_NAME + OpenBLAS + VERSION + 0.3.0-p2 + URL + "https://github.com/hunter-packages/OpenBLAS/archive/v0.3.0-p2.tar.gz" + SHA1 + 15875c6968eef0af7871d3cf91224570fece40cf +) + +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 +67,25 @@ hunter_add_version( ) hunter_configuration_types(OpenBLAS CONFIGURATION_TYPES Release) -hunter_pick_scheme(DEFAULT OpenBLAS) +if(HUNTER_OpenBLAS_VERSION VERSION_LESS 0.3.1) + hunter_pick_scheme(DEFAULT OpenBLAS) + set( + _openblas_unrelocatable_text_files + PACKAGE_UNRELOCATABLE_TEXT_FILES + "lib/cmake/openblas/OpenBLASConfig.cmake" + ) +else() + hunter_cmake_args( + OpenBLAS + CMAKE_ARGS + NOFORTRAN=1 + ) + hunter_pick_scheme(DEFAULT url_sha1_cmake) + set(_openblas_unrelocatable_text_files "") +endif() hunter_cacheable(OpenBLAS) hunter_download( PACKAGE_NAME OpenBLAS - PACKAGE_UNRELOCATABLE_TEXT_FILES - "lib/cmake/openblas/OpenBLASConfig.cmake" + PACKAGE_INTERNAL_DEPS_ID "2" + ${_openblas_unrelocatable_text_files} ) diff --git a/cmake/projects/OpenBLAS/schemes/OpenBLAS.cmake.in b/cmake/projects/OpenBLAS/schemes/OpenBLAS.cmake.in index 8218ddc2c..a1cb41af5 100644 --- a/cmake/projects/OpenBLAS/schemes/OpenBLAS.cmake.in +++ b/cmake/projects/OpenBLAS/schemes/OpenBLAS.cmake.in @@ -8,26 +8,28 @@ include(ExternalProject) # ExternalProject_Add include("@HUNTER_SELF@/cmake/Hunter") -include(hunter_fatal_error) include(hunter_status_debug) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) include(hunter_user_error) +include(hunter_dump_cmake_flags) hunter_status_debug("Scheme: OpenBLAS") if("@MSVC@") - hunter_fatal_error("Not supported with Visual Studio") + hunter_user_error("Not supported with Visual Studio") endif() # 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_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_CONFIGURATION_TYPES@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_LICENSE_DIR@") +hunter_assert_not_empty_string("@HUNTER_TLS_VERIFY@") set(cfg_types "@HUNTER_PACKAGE_CONFIGURATION_TYPES@") @@ -41,6 +43,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 +52,44 @@ else() set(lib_type "") endif() +set(compiler_arg "@CMAKE_C_COMPILER@") + + +if(CMAKE_CROSSCOMPILING OR ANDROID) + # 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 @@ -57,6 +98,8 @@ ExternalProject_Add( SHA1=@HUNTER_PACKAGE_SHA1@ DOWNLOAD_DIR "@HUNTER_PACKAGE_DOWNLOAD_DIR@" + TLS_VERIFY + "@HUNTER_TLS_VERIFY@" SOURCE_DIR "@HUNTER_PACKAGE_SOURCE_DIR@" INSTALL_DIR @@ -65,15 +108,16 @@ 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' "-Dsrcdir=@HUNTER_PACKAGE_SOURCE_DIR@" - "-Ddstfile=@HUNTER_PACKAGE_LICENSE_FILE@" + "-Ddstdir=@HUNTER_PACKAGE_LICENSE_DIR@" -P - "@HUNTER_GLOBAL_SCRIPT_DIR@/try-copy-license.cmake" + "@HUNTER_SELF@/scripts/try-copy-license.cmake" ) diff --git a/cmake/projects/OpenCL-cpp/hunter.cmake b/cmake/projects/OpenCL-cpp/hunter.cmake new file mode 100644 index 000000000..c0fc35d4a --- /dev/null +++ b/cmake/projects/OpenCL-cpp/hunter.cmake @@ -0,0 +1,33 @@ +# !!! 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 + OpenCL-cpp + VERSION + "2.0.10-p0" + URL + "https://github.com/hunter-packages/OpenCL-CLHPP/archive/2.0.10-p0.tar.gz" + SHA1 + 78a41a5b5e40b9e1cdfb794df446fb4d05edfe42 +) + +hunter_cmake_args( + OpenCL-cpp + CMAKE_ARGS + BUILD_DOCS=OFF + BUILD_EXAMPLES=OFF + BUILD_TESTS=OFF +) + +# Pick a download scheme +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(OpenCL-cpp) +hunter_download(PACKAGE_NAME OpenCL-cpp) diff --git a/cmake/projects/OpenCL/hunter.cmake b/cmake/projects/OpenCL/hunter.cmake new file mode 100644 index 000000000..d6a0632fb --- /dev/null +++ b/cmake/projects/OpenCL/hunter.cmake @@ -0,0 +1,43 @@ +# !!! 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 + 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 + VERSION + "2.1-p0" + URL + "https://github.com/hunter-packages/OpenCL-ICD-Loader/archive/2.1-p0.tar.gz" + SHA1 + 1cb4fed5bc4d0e1583c07e02f43daccab12eb99a +) + + +hunter_cmake_args( + OpenCL + CMAKE_ARGS + OPENCL_TESTS=OFF +) + +# Pick a download scheme +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(OpenCL) +hunter_download(PACKAGE_NAME OpenCL) diff --git a/cmake/projects/OpenCV-Extra/hunter.cmake b/cmake/projects/OpenCV-Extra/hunter.cmake index d7b2a73ba..93161a4e8 100644 --- a/cmake/projects/OpenCV-Extra/hunter.cmake +++ b/cmake/projects/OpenCV-Extra/hunter.cmake @@ -7,6 +7,105 @@ include(hunter_add_version) include(hunter_download) include(hunter_pick_scheme) +hunter_add_version( + PACKAGE_NAME + OpenCV-Extra + VERSION + "4.0.0" + URL + "https://github.com/opencv/opencv_contrib/archive/4.0.0.tar.gz" + SHA1 + 4c10c8cb288a320b47ec7e87a0fdcf5a8df0f49d +) + +hunter_add_version( + PACKAGE_NAME + OpenCV-Extra + VERSION + "3.4.6" + URL + "https://github.com/opencv/opencv_contrib/archive/3.4.6.tar.gz" + SHA1 + f87e11ac00550529853f19871429d062ef446c35 +) + +hunter_add_version( + PACKAGE_NAME + OpenCV-Extra + VERSION + "3.4.3" + URL + "https://github.com/opencv/opencv_contrib/archive/3.4.3.tar.gz" + SHA1 + 2c70868a9c2accae23e8f382885d3e4f97030978 +) + +hunter_add_version( + PACKAGE_NAME + OpenCV-Extra + VERSION + "3.4.2" + URL + "https://github.com/opencv/opencv_contrib/archive/3.4.2.tar.gz" + SHA1 + 34dcdd3a77f24271d5615837a2e253af1922c1ea +) + +hunter_add_version( + PACKAGE_NAME + OpenCV-Extra + VERSION + "3.4.1" + URL + "https://github.com/opencv/opencv_contrib/archive/3.4.1.tar.gz" + SHA1 + 638d6f0e0afe0fef511c0889c766f3350457ca94 +) + +hunter_add_version( + PACKAGE_NAME + OpenCV-Extra + VERSION + "3.4.0" + URL + "https://github.com/opencv/opencv_contrib/archive/3.4.0.tar.gz" + SHA1 + e7ba971a30fe85e87de606d8cdf3b3bf4cc3da14 +) + +hunter_add_version( + PACKAGE_NAME + OpenCV-Extra + VERSION + "3.3.1" + URL + "https://github.com/opencv/opencv_contrib/archive/3.3.1.tar.gz" + SHA1 + 3c9167e14af097762f1d689355929c964260ada1 +) + +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 d2870d8af..ad0c05051 100644 --- a/cmake/projects/OpenCV/hunter.cmake +++ b/cmake/projects/OpenCV/hunter.cmake @@ -12,6 +12,203 @@ include(hunter_download) include(hunter_pick_scheme) # List of versions here... +hunter_add_version( + PACKAGE_NAME + OpenCV + VERSION + "4.0.0-p3" + URL + "https://github.com/hunter-packages/opencv/archive/v4.0.0-p3.tar.gz" + SHA1 + f28f59b2fcd96f2b95fb8501be043662b20d3d55 +) + +hunter_add_version( + PACKAGE_NAME + OpenCV + VERSION + "4.0.0-p2" + URL + "https://github.com/hunter-packages/opencv/archive/v4.0.0-p2.tar.gz" + SHA1 + 936414fd01ead11f6dd9b360cd477ab278eeaac6 +) + +hunter_add_version( + PACKAGE_NAME + OpenCV + VERSION + "4.0.0-p0" + URL + "https://github.com/hunter-packages/opencv/archive/v4.0.0-p0.tar.gz" + SHA1 + 90680ea3b971c2323e0049c48fa7867a1fd9f3fe +) + +hunter_add_version( + PACKAGE_NAME + OpenCV + VERSION + "3.4.6-p0" + URL + "https://github.com/hunter-packages/opencv/archive/v3.4.6-p0.tar.gz" + SHA1 + 70f4da99e5d824c463848d4df8667d5d705af141 +) + +hunter_add_version( + PACKAGE_NAME + OpenCV + VERSION + "3.4.3-p4" + URL + "https://github.com/hunter-packages/opencv/archive/v3.4.3-p4.tar.gz" + SHA1 + f1af13fd24cdb433240b1046b5e1391bb19ee748 +) + +hunter_add_version( + PACKAGE_NAME + OpenCV + VERSION + "3.4.3-p2" + URL + "https://github.com/hunter-packages/opencv/archive/v3.4.3-p2.tar.gz" + SHA1 + 9006574a1a777329fbbdd95c3835f0b3e64c59b6 +) + +hunter_add_version( + PACKAGE_NAME + OpenCV + VERSION + "3.4.3-p1" + URL + "https://github.com/hunter-packages/opencv/archive/v3.4.3-p1.tar.gz" + SHA1 + 3589a7f19fdaef200091231c4255c5e5bb70b217 +) + +hunter_add_version( + PACKAGE_NAME + OpenCV + VERSION + "3.4.1-p1" + URL + "https://github.com/hunter-packages/opencv/archive/v3.4.1-p1.tar.gz" + SHA1 + a3f4f0a29e14eb3ff4ebf834f5505ff63b384332 +) + +hunter_add_version( + PACKAGE_NAME + OpenCV + VERSION + "3.4.1-p0" + URL + "https://github.com/hunter-packages/opencv/archive/v3.4.1-p0.tar.gz" + SHA1 + cae0b9c141ca372629f65d09a780e820ea87ae49 +) + +hunter_add_version( + PACKAGE_NAME + OpenCV + VERSION + "3.4.0-p0" + URL + "https://github.com/hunter-packages/opencv/archive/v3.4.0-p0.tar.gz" + SHA1 + f4c4e8711cfe6b1aec5178dfeb3cd503fd24c9a8 +) + +hunter_add_version( + PACKAGE_NAME + OpenCV + VERSION + "3.3.1-p1" + URL + "https://github.com/hunter-packages/opencv/archive/v3.3.1-p1.tar.gz" + SHA1 + 2efff02ce7f3be1454dc2c41d536124a4a6ee048 +) + +hunter_add_version( + PACKAGE_NAME + OpenCV + VERSION + "3.3.1-p0" + URL + "https://github.com/hunter-packages/opencv/archive/v3.3.1-p0.tar.gz" + SHA1 + cca79df3db45c1a1d8da3a4952d04d69c1710508 +) + +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 + ea8f612eea55dfa6d2f3669d5e9eb4240417444b +) + +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 + VERSION + "3.2.0-p0" + URL + "https://github.com/hunter-packages/opencv/releases/download/v3.2.0-p0/v3.2.0-p0.tar.gz" + SHA1 + 901f98202eb12dc2e1cc7f008204a9fb98ea0b13 +) + +hunter_add_version( + PACKAGE_NAME + OpenCV + VERSION + "3.1.0-p3" + URL + "https://github.com/hunter-packages/opencv/archive/v3.1.0-p3.tar.gz" + SHA1 + d1f235600e454bcc3ce7d746b6b706e89ed81acc +) hunter_add_version( PACKAGE_NAME @@ -44,8 +241,63 @@ hunter_add_version( "https://github.com/hunter-packages/opencv/archive/3.1.0-p0.tar.gz" SHA1 ab503105ce7e5415fc77cf44de0b276008be624f + ) + +hunter_add_version( + PACKAGE_NAME + OpenCV + VERSION + "3.0.0-p11" + URL + "https://github.com/hunter-packages/opencv/releases/download/v3.0.0-p11/v3.0.0-p11.tar.gz" + SHA1 + 3fa05fadc5c2b5e02ada00ccb7752ede660699ab ) +hunter_add_version( + PACKAGE_NAME + OpenCV + VERSION + "3.0.0-p10" + URL + "https://github.com/hunter-packages/opencv/archive/v3.0.0-p10.tar.gz" + SHA1 + 90bb9721231693b5999619aece8453b0710181d3 +) + +hunter_add_version( + PACKAGE_NAME + OpenCV + VERSION + "3.0.0-p9" + URL + "https://github.com/hunter-packages/opencv/archive/v3.0.0-p9.tar.gz" + SHA1 + b41a71206d0963dcdf934ecf8f0d7ff299c4b57c +) + +hunter_add_version( + PACKAGE_NAME + OpenCV + VERSION + "3.0.0-p8" + URL + "https://github.com/hunter-packages/opencv/archive/v3.0.0-p8.tar.gz" + SHA1 + 8cff7617f0b2a4e59c8a6b0016207476c30ba7e8 +) + +hunter_add_version( + PACKAGE_NAME + OpenCV + VERSION + "3.0.0-p7" + URL + "https://github.com/hunter-packages/opencv/archive/v3.0.0-p7.tar.gz" + SHA1 + c1e6e32b146a4a19642bcd3ad7e36b4ddcd13ec3 + ) + hunter_add_version( PACKAGE_NAME OpenCV @@ -189,18 +441,18 @@ hunter_add_version( a0c2d5944364fc4f26b6160b33c03082b1fa08c1 ) -string(COMPARE EQUAL "${CMAKE_OSX_SYSROOT}" "iphoneos" _is_ios) - -if(_is_ios) - set(_ios_args ENABLE_NEON=ON) +if(ANDROID) + # This feature doesn't work with new CMake 3.7+ toolchains + set(_android_args ENABLE_PRECOMPILED_HEADERS=OFF) else() - set(_ios_args "") + set(_android_args "") endif() hunter_cmake_args( OpenCV CMAKE_ARGS BUILD_ANDROID_EXAMPLES=OFF + BUILD_JAVA=OFF BUILD_DOCS=OFF BUILD_EXAMPLES=OFF BUILD_PERF_TESTS=OFF @@ -208,16 +460,27 @@ hunter_cmake_args( BUILD_opencv_apps=OFF INSTALL_PYTHON_EXAMPLES=OFF BUILD_WITH_STATIC_CRT=OFF # Fix https://github.com/ruslo/hunter/issues/177 - ${_ios_args} + ${_android_args} # Find packages in Hunter (instead of building from OpenCV sources) BUILD_ZLIB=OFF BUILD_TIFF=OFF BUILD_PNG=OFF BUILD_JPEG=OFF + BUILD_JASPER=OFF + BUILD_WEBP=OFF # This stuff will build shared libraries. Build with PIC required for dependencies. 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 + # Fix for https://travis-ci.org/xsacha/hunter/jobs/347083573 + BUILD_opencv_dnn=OFF + # Fix for https://travis-ci.org/ingenue/hunter/builds/452039597 + WITH_OPENEXR=OFF + WITH_FFMPEG=OFF ) # Pick a download scheme @@ -230,4 +493,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 000000000..d70440dc0 --- /dev/null +++ b/cmake/projects/OpenNMTTokenizer/hunter.cmake @@ -0,0 +1,60 @@ +# 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_add_version( + PACKAGE_NAME + OpenNMTTokenizer + VERSION + 1.11.0-p0 + URL + "https://github.com/hunter-packages/OpenNMT-Tokenizer/archive/v1.11.0-p0.tar.gz" + SHA1 + 1dc732b6c4d3a2e9e7c9b75e753fbc02680e8b17 +) + +hunter_add_version( + PACKAGE_NAME + OpenNMTTokenizer + VERSION + 1.11.0-p1 + URL + "https://github.com/hunter-packages/OpenNMT-Tokenizer/archive/v1.11.0-p1.tar.gz" + SHA1 + 0d557399a8e31ffa2208ad41c2a6c2bd38b3e9d4 +) + +hunter_cmake_args(OpenNMTTokenizer CMAKE_ARGS LIB_ONLY=YES WITH_ICU=YES) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(OpenNMTTokenizer) +hunter_download(PACKAGE_NAME OpenNMTTokenizer) diff --git a/cmake/projects/OpenSSL/ep-stages/configure.cmake.in b/cmake/projects/OpenSSL/ep-stages/configure.cmake.in new file mode 100644 index 000000000..da8558f47 --- /dev/null +++ b/cmake/projects/OpenSSL/ep-stages/configure.cmake.in @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 3.2) + +if(NOT "@NASM_ROOT@" STREQUAL "") + set(ENV{PATH} "@NASM_ROOT@/bin;$ENV{PATH}") +endif() + +if("@openssl_install_dir@" STREQUAL "") + message(FATAL_ERROR "openssl_install_dir is empty") +endif() + +execute_process(COMMAND + perl Configure @arch@ @opt@ "--prefix=@openssl_install_dir@" RESULT_VARIABLE result) + +if(NOT result EQUAL 0) + message(FATAL_ERROR "OpenSSL configure failed: ${result}") +endif() + +execute_process(COMMAND + "ms\\@do_ms@" RESULT_VARIABLE result) + +if(NOT result EQUAL 0) + message(FATAL_ERROR "OpenSSL do_ms failed: ${result}") +endif() diff --git a/cmake/projects/OpenSSL/ep-stages/configure_1_1_plus.cmake.in b/cmake/projects/OpenSSL/ep-stages/configure_1_1_plus.cmake.in new file mode 100644 index 000000000..d49e53327 --- /dev/null +++ b/cmake/projects/OpenSSL/ep-stages/configure_1_1_plus.cmake.in @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.2) + +if(NOT "@NASM_ROOT@" STREQUAL "") + set(ENV{PATH} "@NASM_ROOT@/bin;$ENV{PATH}") +endif() + +if("@openssl_install_dir@" STREQUAL "") + message(FATAL_ERROR "openssl_install_dir is empty") +endif() + +if("@openssl_dir@" STREQUAL "") + message(FATAL_ERROR "openssl_dir is empty") +endif() + +execute_process(COMMAND + perl Configure @arch@ @opt@ @shared@ "--prefix=@openssl_install_dir@" "--openssldir=@openssl_dir@" RESULT_VARIABLE result) + +if(NOT result EQUAL 0) + message(FATAL_ERROR "OpenSSL configure failed: ${result}") +endif() + +execute_process(COMMAND + nmake RESULT_VARIABLE result) + +if(NOT result EQUAL 0) + message(FATAL_ERROR "OpenSSL nmake failed: ${result}") +endif() diff --git a/cmake/projects/OpenSSL/hunter.cmake b/cmake/projects/OpenSSL/hunter.cmake index f9c4aad53..b889b42ec 100755 --- a/cmake/projects/OpenSSL/hunter.cmake +++ b/cmake/projects/OpenSSL/hunter.cmake @@ -5,9 +5,55 @@ include(hunter_add_version) include(hunter_cacheable) +include(hunter_check_toolchain_definition) +include(hunter_cmake_args) include(hunter_download) include(hunter_pick_scheme) +hunter_add_version( + PACKAGE_NAME + OpenSSL + VERSION + "1.1.1" + URL + "https://github.com/openssl/openssl/archive/OpenSSL_1_1_1.tar.gz" + SHA1 + ac1f780b1932d9eed79787b388095ebeebddd148 +) + +hunter_add_version( + PACKAGE_NAME + OpenSSL + VERSION + "1.1.1a" + URL + "https://github.com/openssl/openssl/archive/OpenSSL_1_1_1a.tar.gz" + SHA1 + 0a7d7382e3e608fc037d4955a0ddad224acc1fc8 +) + +hunter_add_version( + PACKAGE_NAME + OpenSSL + VERSION + "1.1.1b" + URL + "https://github.com/openssl/openssl/archive/OpenSSL_1_1_1b.tar.gz" + SHA1 + 1b09930a6099c6c8fa15dd6c6842e134e65e0a31 +) + +hunter_add_version( + PACKAGE_NAME + OpenSSL + VERSION + "1.1.1c" + URL + "https://github.com/openssl/openssl/archive/OpenSSL_1_1_1c.tar.gz" + SHA1 + eb59b090bd757e30b676fb5e80c25ddb5a2f9511 +) + hunter_add_version( PACKAGE_NAME OpenSSL @@ -41,6 +87,171 @@ 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.1.0g" + URL + "https://github.com/openssl/openssl/archive/OpenSSL_1_1_0g.tar.gz" + SHA1 + 07a8861dfb51d3ba983668f0f8daeac49bf3dbc3 +) + +hunter_add_version( + PACKAGE_NAME + OpenSSL + VERSION + "1.1.0h" + URL + "https://github.com/openssl/openssl/archive/OpenSSL_1_1_0h.tar.gz" + SHA1 + 2168c88516556332ebaf7c31791132025a093c2b +) + +hunter_add_version( + PACKAGE_NAME + OpenSSL + VERSION + "1.1.0i" + URL + "https://github.com/openssl/openssl/archive/OpenSSL_1_1_0i.tar.gz" + SHA1 + f1748778e06f41e41e9585fd8815339867f22d30 +) + +hunter_add_version( + PACKAGE_NAME + OpenSSL + VERSION + "1.1.0j" + URL + "https://github.com/openssl/openssl/archive/OpenSSL_1_1_0j.tar.gz" + SHA1 + 489c7a35a4ee2ab06006b2ee26791445b67293a4 +) + +hunter_add_version( + PACKAGE_NAME + OpenSSL + VERSION + "1.1.0k" + URL + "https://github.com/openssl/openssl/archive/OpenSSL_1_1_0k.tar.gz" + SHA1 + 0a753deaa01df3a231759f3ed01fb0b8e14b5d59 +) + +hunter_add_version( + PACKAGE_NAME + OpenSSL + VERSION + "1.0.2s" + URL + "https://github.com/openssl/openssl/archive/OpenSSL_1_0_2s.tar.gz" + SHA1 + d3439055ac91862f69089e394f2d29832653de4d +) + +hunter_add_version( + PACKAGE_NAME + OpenSSL + VERSION + "1.0.2r" + URL + "https://github.com/openssl/openssl/archive/OpenSSL_1_0_2r.tar.gz" + SHA1 + d4933f2974572edffa395cf9f90e6485652dc3a5 +) + +hunter_add_version( + PACKAGE_NAME + OpenSSL + VERSION + "1.0.2q" + URL + "https://github.com/openssl/openssl/archive/OpenSSL_1_0_2q.tar.gz" + SHA1 + d9d0876c1d3a06896308b0e0bf67a85c3dd87258 +) + +hunter_add_version( + PACKAGE_NAME + OpenSSL + VERSION + "1.0.2p" + URL + "https://github.com/openssl/openssl/archive/OpenSSL_1_0_2p.tar.gz" + SHA1 + 0c86f89bc272f204919230e7220c070ac486b9e6 +) + +hunter_add_version( + PACKAGE_NAME + OpenSSL + VERSION + "1.0.2o" + URL + "https://github.com/openssl/openssl/archive/OpenSSL_1_0_2o.tar.gz" + SHA1 + ec7ad3650206f1045d48f2fe9ed4ad93a1228ec5 +) + +hunter_add_version( + PACKAGE_NAME + OpenSSL + VERSION + "1.0.2n" + URL + "https://github.com/openssl/openssl/archive/OpenSSL_1_0_2n.tar.gz" + SHA1 + 6d507bb849c8156f14c2b6f3e269a5e782ff6b82 +) + +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 @@ -118,6 +329,28 @@ hunter_add_version( a233de65e91dc176f4e34be03899ae00eb1dd029 ) +hunter_add_version( + PACKAGE_NAME + OpenSSL + VERSION + "1.0.2m" + URL + "https://github.com/openssl/openssl/archive/OpenSSL_1_0_2m.tar.gz" + SHA1 + f0af7e246a677fd52945e5438eb11ce0de391a4c +) + +hunter_add_version( + PACKAGE_NAME + OpenSSL + VERSION + "1.0.2o" + URL + "https://github.com/openssl/openssl/archive/OpenSSL_1_0_2o.tar.gz" + SHA1 + ec7ad3650206f1045d48f2fe9ed4ad93a1228ec5 +) + hunter_add_version( PACKAGE_NAME OpenSSL @@ -250,17 +483,30 @@ 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() hunter_pick_scheme(DEFAULT url_sha1_openssl_windows_1_1_plus) endif() -elseif(IOS) - hunter_pick_scheme(DEFAULT url_sha1_openssl_ios) +elseif(APPLE) + if(IOS) + hunter_pick_scheme(DEFAULT url_sha1_openssl_ios) + else() + hunter_pick_scheme(DEFAULT url_sha1_openssl_macos) + endif() 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 2) +hunter_download(PACKAGE_NAME OpenSSL PACKAGE_INTERNAL_DEPS_ID "29") diff --git a/cmake/projects/OpenSSL/schemes/url_sha1_openssl.cmake.in b/cmake/projects/OpenSSL/schemes/url_sha1_openssl.cmake.in index 910521a94..09cc4c5c3 100644 --- a/cmake/projects/OpenSSL/schemes/url_sha1_openssl.cmake.in +++ b/cmake/projects/OpenSSL/schemes/url_sha1_openssl.cmake.in @@ -10,31 +10,111 @@ 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_assert_not_empty_string) +include(hunter_user_error) hunter_status_debug("Scheme: url_sha1_openssl") # 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_LICENSE_FILE@") -hunter_test_string_not_empty("@HUNTER_GLOBAL_SCRIPT_DIR@") - -if(APPLE) - set(configure_command "./Configure") - set(configure_opts "darwin64-x86_64-cc") +hunter_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_LICENSE_DIR@") +hunter_assert_not_empty_string("@HUNTER_GLOBAL_SCRIPT_DIR@") +hunter_assert_not_empty_string("@HUNTER_TLS_VERIFY@") + +if(ANDROID OR RASPBERRY_PI OR OPENWRT) + # -> 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() +set(skip_includes SKIP_INCLUDES) +if(ANDROID) + set(skip_includes "") +endif() + +hunter_dump_cmake_flags(${skip_includes}) +# -> CMAKE_CXX_FLAGS +# -> CMAKE_C_FLAGS + +if(ANDROID) + string(COMPARE EQUAL "${CMAKE_ANDROID_ARCH}" "" _has_old_cmake) + string(COMPARE EQUAL "${ANDROID_ARCH_NAME}" "" _has_unexpected_toolchain) + if (NOT _has_old_cmake) + set(ANDROID_SSL_ARCH "${CMAKE_ANDROID_ARCH}") + elseif(NOT _has_unexpected_toolchain) + set(ANDROID_SSL_ARCH "${ANDROID_ARCH_NAME}") + else() + hunter_user_error("Could not find android architecture. Please set ANDROID_ARCH_NAME in your toolchain or use CMake 3.7+") + endif() + + # 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() + + # On Android '--sysroot' differs for compile and linker. + # With the '-l*' trick we can pass needed '--sysroot' to linker but not to + # compiler. + # + # Tested: + # * android-ndk-r16b-api-21-armeabi-v7a-neon-clang-libcxx + # * android-ndk-r17-api-24-arm64-v8a-clang-libcxx14 + # * android-ndk-r18-api-24-arm64-v8a-clang-libcxx14 + list(APPEND configure_opts "-latomic ${CMAKE_EXE_LINKER_FLAGS}") +elseif(RASPBERRY_PI) + set(configure_opts "linux-generic32") +elseif(OPENWRT) + set(configure_opts "linux-generic32" "no-async") +endif() + +string(REGEX REPLACE "^ " "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + # Pass C compiler through -set(configure_command CC=${CMAKE_C_COMPILER} ${configure_command}) +set(configure_command + MACHINE=${CMAKE_SYSTEM_PROCESSOR} + CC=${CMAKE_C_COMPILER} + ${configure_command}) # Pass C flags through set(configure_opts ${configure_opts} ${CMAKE_C_FLAGS}) @@ -45,7 +125,16 @@ 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}) + +hunter_status_debug("Configure command: ${configure_command}") +hunter_status_debug("Configure options: ${configure_opts}") ExternalProject_Add( "@HUNTER_EP_NAME@" @@ -55,6 +144,8 @@ ExternalProject_Add( SHA1=@HUNTER_PACKAGE_SHA1@ DOWNLOAD_DIR "@HUNTER_PACKAGE_DOWNLOAD_DIR@" + TLS_VERIFY + "@HUNTER_TLS_VERIFY@" SOURCE_DIR "@HUNTER_PACKAGE_SOURCE_DIR@" INSTALL_DIR @@ -74,8 +165,9 @@ ExternalProject_Add( # * https://github.com/openssl/openssl/issues/57 COMMAND # Copy license files "@CMAKE_COMMAND@" + "-C@HUNTER_ARGS_FILE@" # for 'HUNTER_INSTALL_LICENSE_FILES' "-Dsrcdir=@HUNTER_PACKAGE_SOURCE_DIR@" - "-Ddstfile=@HUNTER_PACKAGE_LICENSE_FILE@" + "-Ddstdir=@HUNTER_PACKAGE_LICENSE_DIR@" -P - "@HUNTER_GLOBAL_SCRIPT_DIR@/try-copy-license.cmake" + "@HUNTER_SELF@/scripts/try-copy-license.cmake" ) 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 60e381c8c..9e6fc1a02 100644 --- a/cmake/projects/OpenSSL/schemes/url_sha1_openssl_ios.cmake.in +++ b/cmake/projects/OpenSSL/schemes/url_sha1_openssl_ios.cmake.in @@ -10,32 +10,44 @@ 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_assert_not_empty_string) include(hunter_unsetvar) hunter_status_debug("Scheme: url_sha1_openssl_ios") # 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_LICENSE_FILE@") -hunter_test_string_not_empty("@HUNTER_GLOBAL_SCRIPT_DIR@") +hunter_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_LICENSE_DIR@") +hunter_assert_not_empty_string("@HUNTER_GLOBAL_SCRIPT_DIR@") +hunter_assert_not_empty_string("@HUNTER_TLS_VERIFY@") # Note: support for single architecture/native iOS builds (i.e., arm64) -hunter_test_string_not_empty("@IPHONEOS_ARCHS@@IPHONESIMULATOR_ARCHS@") -hunter_test_string_not_empty("@IOS_SDK_VERSION@") -hunter_test_string_not_empty("@IPHONESIMULATOR_ROOT@") -hunter_test_string_not_empty("@IPHONEOS_ROOT@") +hunter_assert_not_empty_string("@IPHONEOS_ARCHS@@IPHONESIMULATOR_ARCHS@") +hunter_assert_not_empty_string("@IOS_SDK_VERSION@") +hunter_assert_not_empty_string("@IPHONESIMULATOR_ROOT@") +hunter_assert_not_empty_string("@IPHONEOS_ROOT@") + +hunter_dump_cmake_flags(SKIP_INCLUDES) +# -> CMAKE_CXX_FLAGS +# -> CMAKE_C_FLAGS + +string(REGEX REPLACE "^ " "" CMAKE_C_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 @@ -56,6 +68,8 @@ ExternalProject_Add( "" DOWNLOAD_DIR "@HUNTER_PACKAGE_DOWNLOAD_DIR@" + TLS_VERIFY + "@HUNTER_TLS_VERIFY@" SOURCE_DIR "@HUNTER_PACKAGE_SOURCE_DIR@/ios_universal" INSTALL_DIR @@ -77,23 +91,15 @@ ExternalProject_Add( ${crypto_input_libraries} -o "@HUNTER_PACKAGE_INSTALL_PREFIX@/lib/libcrypto.a" - COMMAND # Copy license files - "@CMAKE_COMMAND@" - "-Dsrcdir=@HUNTER_PACKAGE_SOURCE_DIR@" - "-Ddstfile=@HUNTER_PACKAGE_LICENSE_FILE@" - -P - "@HUNTER_GLOBAL_SCRIPT_DIR@/try-copy-license.cmake" ) 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() @@ -115,6 +121,8 @@ foreach(variant @IPHONEOS_ARCHS@ @IPHONESIMULATOR_ARCHS@) SHA1=@HUNTER_PACKAGE_SHA1@ DOWNLOAD_DIR "@HUNTER_PACKAGE_DOWNLOAD_DIR@" + TLS_VERIFY + "@HUNTER_TLS_VERIFY@" SOURCE_DIR "@HUNTER_PACKAGE_SOURCE_DIR@/${variant}" INSTALL_DIR @@ -122,12 +130,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" && @@ -140,6 +146,13 @@ foreach(variant @IPHONEOS_ARCHS@ @IPHONESIMULATOR_ARCHS@) make install_sw # installed libraries will be rewrited, # other files are equal + COMMAND # Copy license files + "@CMAKE_COMMAND@" + "-C@HUNTER_ARGS_FILE@" # for 'HUNTER_INSTALL_LICENSE_FILES' + "-Dsrcdir=@HUNTER_PACKAGE_SOURCE_DIR@/${variant}" + "-Ddstdir=@HUNTER_PACKAGE_LICENSE_DIR@" + -P + "@HUNTER_SELF@/scripts/try-copy-license.cmake" ) add_dependencies( diff --git a/cmake/projects/OpenSSL/schemes/url_sha1_openssl_macos.cmake.in b/cmake/projects/OpenSSL/schemes/url_sha1_openssl_macos.cmake.in new file mode 100644 index 000000000..2f79aa2e4 --- /dev/null +++ b/cmake/projects/OpenSSL/schemes/url_sha1_openssl_macos.cmake.in @@ -0,0 +1,209 @@ +# Copyright (c) 2013, 2015 Ruslan Baratov +# All rights reserved. + +cmake_minimum_required(VERSION 3.0) +project(Hunter) + +include(ExternalProject) # ExternalProject_Add + +# Scheme for download and install OpenSSL macOS universal library + +list(APPEND CMAKE_MODULE_PATH "@HUNTER_SELF@/cmake/modules") + +include(hunter_dump_cmake_flags) +include(hunter_status_debug) +include(hunter_assert_not_empty_string) +include(hunter_unsetvar) +include(hunter_user_error) + +hunter_status_debug("Scheme: url_sha1_openssl_macos") + +# Check preconditions +hunter_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_LICENSE_DIR@") +hunter_assert_not_empty_string("@HUNTER_GLOBAL_SCRIPT_DIR@") +hunter_assert_not_empty_string("@HUNTER_TLS_VERIFY@") + +# Supported macOS architectures: +# i386, x86_64, ppc, ppc64 +set(configure_command "./Configure") +set(configure_architectures @CMAKE_OSX_ARCHITECTURES@) + +if(NOT configure_architectures) + hunter_status_debug("Using default macOS architecture: x86_64") + set(configure_architectures "x86_64") +endif() + +# OpenSSL appends the version number differently by version +if("@HUNTER_OpenSSL_VERSION@" VERSION_LESS "1.0") + string(REGEX MATCH "^[0-9\\.]+" shared_library_version_extension "@HUNTER_OpenSSL_VERSION@") +else() + string(REGEX MATCH "^[0-9]\\.[0-9]" shared_library_version_extension "@HUNTER_OpenSSL_VERSION@") + if("@HUNTER_OpenSSL_VERSION@" VERSION_LESS "1.1") + set(shared_library_version_extension "${shared_library_version_extension}.0") + endif() +endif() + +if(BUILD_SHARED_LIBS) + set(libsuffix ".${shared_library_version_extension}.dylib") + set(shared_flag shared) +else() + set(libsuffix ".a") + set(shared_flag no-shared) +endif() + +hunter_unsetvar(ssl_libraries) +hunter_unsetvar(crypto_libraries) +foreach(arch ${configure_architectures}) + list(APPEND ssl_libraries "@HUNTER_PACKAGE_SOURCE_DIR@/${arch}/libssl${libsuffix}") + list(APPEND crypto_libraries "@HUNTER_PACKAGE_SOURCE_DIR@/${arch}/libcrypto${libsuffix}") +endforeach() + +# Skip position independent code flags for macOS +hunter_dump_cmake_flags(SKIP_INCLUDES SKIP_PIC) +# -> CMAKE_CXX_FLAGS +# -> CMAKE_C_FLAGS + +string(REGEX REPLACE "^ " "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + +# Pass C compiler through +set(configure_command + MACHINE=${CMAKE_SYSTEM_PROCESSOR} + CC=${CMAKE_C_COMPILER} + ${configure_command}) + +# Pass C flags through +set(configure_opts ${CMAKE_C_FLAGS}) + +# Add clear-all to commands +set(configure_command . "@HUNTER_GLOBAL_SCRIPT_DIR@/clear-all.sh" && "${configure_command}") +set(build_command . "@HUNTER_GLOBAL_SCRIPT_DIR@/clear-all.sh" && make) + +# Configuration options +set(configure_opts ${configure_opts} threads ${shared_flag}) + +hunter_status_debug("Configure command: ${configure_command}") +hunter_status_debug("Configure architectures: ${configure_architectures}") +hunter_status_debug("Configure options: ${configure_opts}") + +if(BUILD_SHARED_LIBS) + set( + extra_install_commands + # Fix shared library paths + COMMAND + install_name_tool + -id + "@loader_path/../lib/libssl${libsuffix}" + "@HUNTER_PACKAGE_INSTALL_PREFIX@/lib/libssl${libsuffix}" + COMMAND + install_name_tool + -change + "@HUNTER_PACKAGE_INSTALL_PREFIX@/lib/libcrypto${libsuffix}" + "@loader_path/../lib/libcrypto${libsuffix}" + "@HUNTER_PACKAGE_INSTALL_PREFIX@/lib/libssl${libsuffix}" + COMMAND + install_name_tool + -id + "@loader_path/../lib/libcrypto${libsuffix}" + "@HUNTER_PACKAGE_INSTALL_PREFIX@/lib/libcrypto${libsuffix}" + ) +else() + set(extra_install_commands "") +endif() + +# fuse all libraries with 'lipo' +list(GET configure_architectures 0 first_architecture) +ExternalProject_Add( + "@HUNTER_EP_NAME@-macos_universal" + DOWNLOAD_COMMAND + "@CMAKE_COMMAND@" -E echo "Dummy download command" + DOWNLOAD_DIR + "@HUNTER_PACKAGE_DOWNLOAD_DIR@" + TLS_VERIFY + "@HUNTER_TLS_VERIFY@" + SOURCE_DIR + "@HUNTER_PACKAGE_SOURCE_DIR@/macos_universal" + INSTALL_DIR + "@HUNTER_PACKAGE_INSTALL_PREFIX@" + # not used, just avoid creating Install/ empty directory + CONFIGURE_COMMAND + "@CMAKE_COMMAND@" -E echo "Dummy configure command" + BUILD_COMMAND + "@CMAKE_COMMAND@" -E echo "Dummy build command" + INSTALL_COMMAND + lipo + -create + ${ssl_libraries} + -o + "@HUNTER_PACKAGE_INSTALL_PREFIX@/lib/libssl${libsuffix}" + COMMAND + lipo + -create + ${crypto_libraries} + -o + "@HUNTER_PACKAGE_INSTALL_PREFIX@/lib/libcrypto${libsuffix}" + # Extra commands + ${extra_install_commands} + COMMAND # Copy license files + "@CMAKE_COMMAND@" + "-C@HUNTER_ARGS_FILE@" # for 'HUNTER_INSTALL_LICENSE_FILES' + "-Dsrcdir=@HUNTER_PACKAGE_SOURCE_DIR@/${first_architecture}" + "-Ddstdir=@HUNTER_PACKAGE_LICENSE_DIR@" + -P + "@HUNTER_SELF@/scripts/try-copy-license.cmake" +) + +foreach(arch ${configure_architectures}) + if("${arch}" STREQUAL "x86_64") + set(configure_arch "darwin64-x86_64-cc") + elseif("${arch}" STREQUAL "ppc64") + set(configure_arch "darwin64-ppc-cc") + elseif("${arch}" STREQUAL "i386") + set(configure_arch "darwin-i386-cc") + elseif("${arch}" STREQUAL "ppc") + set(configure_arch "darwin-ppc-cc") + else() + hunter_user_error("Could not find the macOS architecture ${arch}. Please update the CMAKE_OSX_ARCHITECTURES option in your toolchain.") + endif() + + ExternalProject_Add( + "@HUNTER_EP_NAME@-${arch}" + URL + @HUNTER_PACKAGE_URL@ + URL_HASH + SHA1=@HUNTER_PACKAGE_SHA1@ + DOWNLOAD_DIR + "@HUNTER_PACKAGE_DOWNLOAD_DIR@" + TLS_VERIFY + "@HUNTER_TLS_VERIFY@" + SOURCE_DIR + "@HUNTER_PACKAGE_SOURCE_DIR@/${arch}" + INSTALL_DIR + "@HUNTER_PACKAGE_INSTALL_PREFIX@" + # not used, just avoid creating Install/ empty directory + CONFIGURE_COMMAND + "${configure_command}" + "${configure_arch}" + "${configure_opts}" + "--prefix=@HUNTER_PACKAGE_INSTALL_PREFIX@" + BUILD_COMMAND + "${build_command}" + BUILD_IN_SOURCE + 1 + INSTALL_COMMAND + make install_sw + # installed libraries will be rewrited, + # other files are equal + ) + + add_dependencies( + "@HUNTER_EP_NAME@-macos_universal" + "@HUNTER_EP_NAME@-${arch}" + ) +endforeach() diff --git a/cmake/projects/OpenSSL/schemes/url_sha1_openssl_windows.cmake.in b/cmake/projects/OpenSSL/schemes/url_sha1_openssl_windows.cmake.in index f1f0de02e..81624eecb 100644 --- a/cmake/projects/OpenSSL/schemes/url_sha1_openssl_windows.cmake.in +++ b/cmake/projects/OpenSSL/schemes/url_sha1_openssl_windows.cmake.in @@ -6,6 +6,8 @@ project(Hunter) include(ExternalProject) # ExternalProject_Add +include("@HUNTER_SELF@/cmake/Hunter") + # Scheme for download and install OpenSSL library for Windows list(APPEND CMAKE_MODULE_PATH "@HUNTER_SELF@/cmake/modules") @@ -13,22 +15,23 @@ list(APPEND CMAKE_MODULE_PATH "@HUNTER_SELF@/cmake/modules") include(hunter_fatal_error) include(hunter_internal_error) include(hunter_status_debug) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) hunter_status_debug("Scheme: url_sha1_openssl_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_FILE@") -hunter_test_string_not_empty("@HUNTER_GLOBAL_SCRIPT_DIR@") +hunter_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_MSVC_ARCH@") +hunter_assert_not_empty_string("@HUNTER_MSVC_VCVARSALL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_LICENSE_DIR@") +hunter_assert_not_empty_string("@HUNTER_GLOBAL_SCRIPT_DIR@") +hunter_assert_not_empty_string("@HUNTER_TLS_VERIFY@") # `find_package(Perl)` is not suitable because `perl` from # cygwin directory can be found @@ -52,19 +55,27 @@ if(NOT "${PERL_VERSION}" EQUAL 0) hunter_fatal_error( "OpenSSL: perl not found" - WIKI "error.openssl.perl.not.found" + ERROR_PAGE "error.openssl.perl.not.found" ) endif() string(COMPARE EQUAL "@HUNTER_MSVC_ARCH@" "amd64" is_amd64) if(is_amd64) - set(opt "VC-WIN64A") + set(arch "VC-WIN64A") set(do_ms do_win64a.bat) else() - set(opt "VC-WIN32") + set(arch "VC-WIN32") set(do_ms do_ms.bat) endif() +if(ASM_SUPPORT) + hunter_add_package(NASM) # set NASM_ROOT + set(opt "") +else() + set(NASM_ROOT "") + set(opt "no-asm") +endif() + if("@MSVC@") # Logging as Workaround for VS_UNICODE_OUTPUT issue: # https://public.kitware.com/Bug/view.php?id=14266 @@ -73,6 +84,25 @@ else() set(log_opts "") endif() +if(BUILD_SHARED_LIBS) + set(nt_makefile "ms\\ntdll.mak") +else() + set(nt_makefile "ms\\nt.mak") +endif() + +set(openssl_install_dir "@HUNTER_PACKAGE_INSTALL_PREFIX@") + +# Used variables: +# * openssl_install_dir +# * arch +# * opt +# * NASM_ROOT +# * do_ms +configure_file( + "@HUNTER_PACKAGE_SETUP_DIR@/ep-stages/configure.cmake.in" + "@HUNTER_PACKAGE_BUILD_DIR@/configure.cmake" + @ONLY) + ExternalProject_Add( "@HUNTER_EP_NAME@" URL @@ -81,6 +111,8 @@ ExternalProject_Add( SHA1=@HUNTER_PACKAGE_SHA1@ DOWNLOAD_DIR "@HUNTER_PACKAGE_DOWNLOAD_DIR@" + TLS_VERIFY + "@HUNTER_TLS_VERIFY@" SOURCE_DIR "@HUNTER_PACKAGE_SOURCE_DIR@" INSTALL_DIR @@ -89,21 +121,20 @@ ExternalProject_Add( CONFIGURE_COMMAND "@HUNTER_MSVC_VCVARSALL@" "@HUNTER_MSVC_ARCH@" COMMAND - perl Configure "${opt}" no-asm "--prefix=@HUNTER_PACKAGE_INSTALL_PREFIX@" - COMMAND - "ms\\${do_ms}" + "@CMAKE_COMMAND@" -P "@HUNTER_PACKAGE_BUILD_DIR@/configure.cmake" BUILD_COMMAND - nmake -f "ms\\nt.mak" + nmake -f "${nt_makefile}" BUILD_IN_SOURCE 1 INSTALL_COMMAND COMMAND - nmake -f "ms\\nt.mak" install + nmake -f "${nt_makefile}" install COMMAND # Copy license files "@CMAKE_COMMAND@" + "-C@HUNTER_ARGS_FILE@" # for 'HUNTER_INSTALL_LICENSE_FILES' "-Dsrcdir=@HUNTER_PACKAGE_SOURCE_DIR@" - "-Ddstfile=@HUNTER_PACKAGE_LICENSE_FILE@" + "-Ddstdir=@HUNTER_PACKAGE_LICENSE_DIR@" -P - "@HUNTER_GLOBAL_SCRIPT_DIR@/try-copy-license.cmake" + "@HUNTER_SELF@/scripts/try-copy-license.cmake" ${log_opts} ) diff --git a/cmake/projects/OpenSSL/schemes/url_sha1_openssl_windows_1_1_plus.cmake.in b/cmake/projects/OpenSSL/schemes/url_sha1_openssl_windows_1_1_plus.cmake.in index 05432a880..88e58cc8a 100644 --- a/cmake/projects/OpenSSL/schemes/url_sha1_openssl_windows_1_1_plus.cmake.in +++ b/cmake/projects/OpenSSL/schemes/url_sha1_openssl_windows_1_1_plus.cmake.in @@ -6,6 +6,8 @@ project(Hunter) include(ExternalProject) # ExternalProject_Add +include("@HUNTER_SELF@/cmake/Hunter") + # Scheme for download and install OpenSSL library for Windows list(APPEND CMAKE_MODULE_PATH "@HUNTER_SELF@/cmake/modules") @@ -13,22 +15,23 @@ list(APPEND CMAKE_MODULE_PATH "@HUNTER_SELF@/cmake/modules") include(hunter_fatal_error) include(hunter_internal_error) include(hunter_status_debug) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) hunter_status_debug("Scheme: url_sha1_openssl_windows_1_1_plus") # 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_FILE@") -hunter_test_string_not_empty("@HUNTER_GLOBAL_SCRIPT_DIR@") +hunter_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_MSVC_ARCH@") +hunter_assert_not_empty_string("@HUNTER_MSVC_VCVARSALL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_LICENSE_DIR@") +hunter_assert_not_empty_string("@HUNTER_GLOBAL_SCRIPT_DIR@") +hunter_assert_not_empty_string("@HUNTER_TLS_VERIFY@") # `find_package(Perl)` is not suitable because `perl` from # cygwin directory can be found @@ -52,15 +55,23 @@ if(NOT "${PERL_VERSION}" EQUAL 0) hunter_fatal_error( "OpenSSL: perl not found" - WIKI "error.openssl.perl.not.found" + ERROR_PAGE "error.openssl.perl.not.found" ) endif() string(COMPARE EQUAL "@HUNTER_MSVC_ARCH@" "amd64" is_amd64) if(is_amd64) - set(opt "VC-WIN64A") + set(arch "VC-WIN64A") +else() + set(arch "VC-WIN32") +endif() + +if(ASM_SUPPORT) + hunter_add_package(NASM) # set NASM_ROOT + set(opt "") else() - set(opt "VC-WIN32") + set(NASM_ROOT "") + set(opt "no-asm") endif() if("@MSVC@") @@ -71,6 +82,29 @@ else() set(log_opts "") endif() +if (BUILD_SHARED_LIBS) + set(shared "shared") +else() + set(shared "no-shared") +endif() + +set(openssl_dir "@HUNTER_PACKAGE_INSTALL_PREFIX@/ssl") +set(openssl_install_dir "@HUNTER_PACKAGE_INSTALL_PREFIX@") + +# Used variables: +# * openssl_dir +# * openssl_install_dir +# * arch +# * opt +# * shared +# * NASM_ROOT +configure_file( + "@HUNTER_PACKAGE_SETUP_DIR@/ep-stages/configure_1_1_plus.cmake.in" + "@HUNTER_PACKAGE_BUILD_DIR@/configure_1_1_plus.cmake" + @ONLY) + +file(MAKE_DIRECTORY "${openssl_dir}") + ExternalProject_Add( "@HUNTER_EP_NAME@" URL @@ -79,6 +113,8 @@ ExternalProject_Add( SHA1=@HUNTER_PACKAGE_SHA1@ DOWNLOAD_DIR "@HUNTER_PACKAGE_DOWNLOAD_DIR@" + TLS_VERIFY + "@HUNTER_TLS_VERIFY@" SOURCE_DIR "@HUNTER_PACKAGE_SOURCE_DIR@" INSTALL_DIR @@ -87,19 +123,19 @@ ExternalProject_Add( CONFIGURE_COMMAND "@HUNTER_MSVC_VCVARSALL@" "@HUNTER_MSVC_ARCH@" COMMAND - perl Configure "${opt}" "--prefix=@HUNTER_PACKAGE_INSTALL_PREFIX@" + "@CMAKE_COMMAND@" -P "@HUNTER_PACKAGE_BUILD_DIR@/configure_1_1_plus.cmake" COMMAND - nmake + nmake install + BUILD_COMMAND + "@CMAKE_COMMAND@" -E echo "Dummy build step" BUILD_IN_SOURCE 1 INSTALL_COMMAND - COMMAND - nmake install - COMMAND # Copy license files "@CMAKE_COMMAND@" + "-C@HUNTER_ARGS_FILE@" # for 'HUNTER_INSTALL_LICENSE_FILES' "-Dsrcdir=@HUNTER_PACKAGE_SOURCE_DIR@" - "-Ddstfile=@HUNTER_PACKAGE_LICENSE_FILE@" + "-Ddstdir=@HUNTER_PACKAGE_LICENSE_DIR@" -P - "@HUNTER_GLOBAL_SCRIPT_DIR@/try-copy-license.cmake" + "@HUNTER_SELF@/scripts/try-copy-license.cmake" ${log_opts} ) diff --git a/cmake/projects/OpenSceneGraph/hunter.cmake b/cmake/projects/OpenSceneGraph/hunter.cmake new file mode 100644 index 000000000..8cd913c83 --- /dev/null +++ b/cmake/projects/OpenSceneGraph/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2018, 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 + OpenSceneGraph + VERSION + "3.6.3-p0" + URL + "https://github.com/hunter-packages/OpenSceneGraph/archive/v3.6.3-p0.tar.gz" + SHA1 + 0c9eab9364fa1d2d0451c565650851a167f02fe4 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(OpenSceneGraph) +hunter_download(PACKAGE_NAME OpenSceneGraph) diff --git a/cmake/projects/PNG/hunter.cmake b/cmake/projects/PNG/hunter.cmake index 509ed62f2..fe245065c 100644 --- a/cmake/projects/PNG/hunter.cmake +++ b/cmake/projects/PNG/hunter.cmake @@ -10,6 +10,17 @@ include(hunter_cmake_args) include(hunter_download) include(hunter_pick_scheme) +hunter_add_version( + PACKAGE_NAME + PNG + VERSION + "1.6.26-p1" + URL + "https://github.com/hunter-packages/libpng/archive/v1.6.26-p1.tar.gz" + SHA1 + 10557d64fc577e4013c80c6305d6af2872c60bdb +) + hunter_add_version( PACKAGE_NAME PNG @@ -32,6 +43,61 @@ hunter_add_version( 3e083ca37efc461704d9af256cdf2231cae6ee9d ) +hunter_add_version( + PACKAGE_NAME + PNG + VERSION + "1.6.26-p2" + URL + "https://github.com/hunter-packages/libpng/archive/v1.6.26-p2.tar.gz" + SHA1 + 92cdda7e88239633257c5534b42445bc24a176e7 +) + +hunter_add_version( + PACKAGE_NAME + PNG + VERSION + "1.6.26-p3" + URL + "https://github.com/hunter-packages/libpng/archive/v1.6.26-p3.tar.gz" + SHA1 + fcaaae43f0950ca362b487a793159c786b264346 +) + +hunter_add_version( + PACKAGE_NAME + PNG + VERSION + "1.6.26-p4" + URL + "https://github.com/hunter-packages/libpng/archive/v1.6.26-p4.tar.gz" + SHA1 + a6ac9a2e7c5f23b062c252466ae448cae9e771b3 +) + +hunter_add_version( + PACKAGE_NAME + PNG + VERSION + "1.6.26-p5" + URL + "https://github.com/hunter-packages/libpng/archive/v1.6.26-p5.tar.gz" + SHA1 + fbf7c49f144a32567a1b63cb658a2a4584a091fa +) + +hunter_add_version( + PACKAGE_NAME + PNG + VERSION + "1.6.26-p6" + URL + "https://github.com/hunter-packages/libpng/archive/v1.6.26-p6.tar.gz" + SHA1 + dee61a3f48ed2d436a4e7fb8cdaf3cabaa3e604e +) + hunter_cmake_args(PNG CMAKE_ARGS PNG_TESTS=OFF) hunter_pick_scheme(DEFAULT url_sha1_cmake) diff --git a/cmake/projects/PROJ4/hunter.cmake b/cmake/projects/PROJ4/hunter.cmake new file mode 100644 index 000000000..e9ee30219 --- /dev/null +++ b/cmake/projects/PROJ4/hunter.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2016-2018, 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) +include(hunter_cmake_args) + +hunter_add_version( + PACKAGE_NAME + PROJ4 + VERSION + 5.0.0 + URL + "https://github.com/OSGeo/proj.4/releases/download/5.0.1/proj-5.0.1.tar.gz" + SHA1 + 4ADD83369C6F29637D806D51CDCA7378181E53FF +) + +hunter_cmake_args( + PROJ4 + CMAKE_ARGS + BUILD_TESTING=OFF + PROJ4_TESTS=OFF + BUILD_CCT=OFF + BUILD_CS2CS=OFF + BUILD_GEOD=OFF + BUILD_GIE=OFF + BUILD_NAD2BIN=OFF + BUILD_PROJ=OFF + + INCLUDEDIR=include + LIBDIR=lib + CMAKECONFIGDIR=lib/cmake/PROJ4 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(PROJ4) +hunter_download(PACKAGE_NAME PROJ4) diff --git a/cmake/projects/PhysUnits/hunter.cmake b/cmake/projects/PhysUnits/hunter.cmake new file mode 100644 index 000000000..21e75d740 --- /dev/null +++ b/cmake/projects/PhysUnits/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2018, 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 + PhysUnits + VERSION + 1.1.0-p0 + URL + "https://github.com/martinmoene/PhysUnits-CT-Cpp11/archive/12eafc669d0710b02536dcd8d2f96ae6bc69601b.tar.gz" + SHA1 + 14064acf4a04c08150ca9749e0e52b6bb8ee9cbc +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(PhysUnits) +hunter_download(PACKAGE_NAME PhysUnits) diff --git a/cmake/projects/PocoCpp/hunter.cmake b/cmake/projects/PocoCpp/hunter.cmake index 26f75b205..302a60717 100644 --- a/cmake/projects/PocoCpp/hunter.cmake +++ b/cmake/projects/PocoCpp/hunter.cmake @@ -4,6 +4,50 @@ include(hunter_pick_scheme) include(hunter_cacheable) include(hunter_download) +hunter_add_version( + PACKAGE_NAME + PocoCpp + VERSION + 1.7.9-p1 + URL + "https://github.com/hunter-packages/poco/archive/v1.7.9-p1.zip" + SHA1 + 28adb9a84af3000dde5525c14e906f5f5ea095f3 +) + +hunter_add_version( + PACKAGE_NAME + PocoCpp + VERSION + 1.7.9-p0 + URL + "https://github.com/hunter-packages/poco/archive/v1.7.9-p0.zip" + SHA1 + 1ad6193edd0dbd67c351af7458b464252baf5bb3 +) + +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 + VERSION + 1.7.6-p0 + URL + "https://github.com/hunter-packages/poco/archive/v1.7.6-p0.zip" + SHA1 + a4b577d4fd6907c87d20dff31fa5caf4bd94bc89 +) + hunter_add_version( PACKAGE_NAME PocoCpp diff --git a/cmake/projects/PostgreSQL/hunter.cmake b/cmake/projects/PostgreSQL/hunter.cmake index 772416395..d9d911cfa 100644 --- a/cmake/projects/PostgreSQL/hunter.cmake +++ b/cmake/projects/PostgreSQL/hunter.cmake @@ -8,6 +8,29 @@ 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 + "10.0.0" + URL + "https://github.com/hunter-packages/PostgreSQL/archive/PostgreSQL-10.0.0.tar.gz" + SHA1 + d35d4e958509460347f39f0ba542a17eb2228f3c +) + +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 @@ -20,10 +43,20 @@ hunter_add_version( b82ddcee4644ef42f3a69ee93916afa448d178c4 ) +if (ANDROID OR IOS) + hunter_cmake_args( + PostgreSQL + CMAKE_ARGS + EXTRA_FLAGS=--without-readline + ) +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 "2" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/libecpg.pc" "lib/pkgconfig/libecpg_compat.pc" @@ -31,4 +64,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 6ac16b4ca..27cd46675 100644 --- a/cmake/projects/Protobuf/hunter.cmake +++ b/cmake/projects/Protobuf/hunter.cmake @@ -6,6 +6,17 @@ include(hunter_cmake_args) include(hunter_download) include(hunter_pick_scheme) +hunter_add_version( + PACKAGE_NAME + Protobuf + VERSION + "2.4.1-p0" + URL + "https://github.com/hunter-packages/protobuf/archive/v2.4.1-p0.tar.gz" + SHA1 + c57c846131f804622057d83bf44144c179613e44 +) + hunter_add_version( PACKAGE_NAME Protobuf @@ -14,7 +25,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 +36,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 +47,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 +58,77 @@ hunter_add_version( URL "https://github.com/hunter-packages/protobuf/archive/v3.0.0-beta-2-hunter-2.tar.gz" SHA1 - dbae4995254f351918d0462b308b561dbab71b3f + f91766a391284b7ccd192fa36bc3f09449b3c202 +) + +hunter_add_version( + PACKAGE_NAME + Protobuf + VERSION + "3.1.0" + URL + "https://github.com/hunter-packages/protobuf/archive/v3.1.0-hunter-4.tar.gz" + SHA1 + 8f58f2cbe6d3fae61451a5e29b703686fe4bc9d6 +) + +hunter_add_version( + PACKAGE_NAME + Protobuf + VERSION + "3.3.0" + URL + "https://github.com/hunter-packages/protobuf/archive/v3.3.0-hunter-1.tar.gz" + SHA1 + 8815a6be8188b2d6c8002924e752018b64658748 +) + +hunter_add_version( + PACKAGE_NAME + Protobuf + VERSION + "3.5.2-p0" + URL + "https://github.com/hunter-packages/protobuf/archive/v3.5.2-p0.tar.gz" + SHA1 + 0c1eacb460266dea7cd18c2009642fa192c15b70 +) + +hunter_add_version( + PACKAGE_NAME + Protobuf + VERSION + "3.6.1.3-p0" + URL + "https://github.com/hunter-packages/protobuf/archive/v3.6.1.3-p0.tar.gz" + SHA1 + 5f32dcd70bed20e42cecc53058b8502298c6680a +) + +hunter_add_version( + PACKAGE_NAME + Protobuf + VERSION + "3.6.1.3-p1" + URL + "https://github.com/hunter-packages/protobuf/archive/v3.6.1.3-p1.tar.gz" + SHA1 + 120e15e1cc49b3fcc4fc89503ccc1346c9978362 +) + +hunter_add_version( + PACKAGE_NAME + Protobuf + VERSION + "3.7.1-p0" + URL + "https://github.com/hunter-packages/protobuf/archive/v3.7.1-p0.tar.gz" + SHA1 + 6bfa8d5525039efdf63f40277b20d8d5852c89bf +) + +string( + COMPARE EQUAL "${CMAKE_SYSTEM_NAME}" "WindowsStore" _hunter_windows_store ) if(ANDROID OR IOS) @@ -56,13 +137,22 @@ if(ANDROID OR IOS) CMAKE_ARGS protobuf_BUILD_TESTS=OFF protobuf_BUILD_PROTOC=OFF + protobuf_BUILD_PROTOC_BINARIES=OFF + ) +elseif(_hunter_windows_store) + hunter_cmake_args( + Protobuf + CMAKE_ARGS + protobuf_BUILD_TESTS=OFF + protobuf_BUILD_PROTOC=OFF + protobuf_MSVC_STATIC_RUNTIME=OFF # Do not force static runtime ) elseif(MSVC) hunter_cmake_args( Protobuf CMAKE_ARGS protobuf_BUILD_TESTS=OFF - protobuf_MSVC_STATIC_RUNTIME=OFF # Do not forece static runtime + protobuf_MSVC_STATIC_RUNTIME=OFF # Do not force static runtime ) else() hunter_cmake_args( @@ -71,6 +161,7 @@ else() protobuf_BUILD_TESTS=OFF ) endif() + hunter_pick_scheme(DEFAULT url_sha1_cmake) hunter_cacheable(Protobuf) hunter_download(PACKAGE_NAME Protobuf) diff --git a/cmake/projects/Qt/ep-stages/qt-build.cmake.in b/cmake/projects/Qt/ep-stages/qt-build.cmake.in index d4bf430cb..404373afe 100644 --- a/cmake/projects/Qt/ep-stages/qt-build.cmake.in +++ b/cmake/projects/Qt/ep-stages/qt-build.cmake.in @@ -7,6 +7,11 @@ if(is_empty) message(FATAL_ERROR "hunter_self is empty") endif() +string(COMPARE EQUAL "@global_install_dir@" "" is_empty) +if(is_empty) + message(FATAL_ERROR "global_install_dir is empty") +endif() + if("@MSVC@") set(build_command nmake) elseif("@MINGW@") @@ -21,6 +26,15 @@ if("@ANDROID@") set(ENV{ANDROID_API_VERSION} "@ANDROID_API_VERSION@") endif() +# QtMultimedia can run more checks +if("@HUNTER_QT_OS_IS_LINUX@") + set(x "@global_install_dir@/share/pkgconfig") + set(y "@global_install_dir@/lib/pkgconfig") + set(ENV{PKG_CONFIG_PATH} "${x}:${y}") + + set(ENV{LD_LIBRARY_PATH} "@global_install_dir@/lib") +endif() + execute_process(COMMAND ${build_command} @build_opts@ RESULT_VARIABLE result) if(NOT result EQUAL 0) diff --git a/cmake/projects/Qt/ep-stages/qt-configure.cmake.in b/cmake/projects/Qt/ep-stages/qt-configure.cmake.in index 87dab9928..d0cee4cab 100644 --- a/cmake/projects/Qt/ep-stages/qt-configure.cmake.in +++ b/cmake/projects/Qt/ep-stages/qt-configure.cmake.in @@ -49,6 +49,8 @@ if("@HUNTER_QT_OS_IS_LINUX@") set(x "@global_install_dir@/share/pkgconfig") set(y "@global_install_dir@/lib/pkgconfig") set(ENV{PKG_CONFIG_PATH} "${x}:${y}") + + set(ENV{LD_LIBRARY_PATH} "@global_install_dir@/lib") endif() list(APPEND CMAKE_MODULE_PATH "@hunter_self@/cmake/modules") @@ -137,6 +139,16 @@ if("@IOS@") set(output_content "${output_content}\n${output}") endforeach() + string(COMPARE EQUAL "@CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM@" "" is_empty) + if(NOT is_empty) + # https://bugreports.qt.io/browse/QTCREATORBUG-16968?focusedCommentId=333849&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-333849 + set(team "HUNTER_DEVELOPMENT_TEAM.value = @CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM@") + set(team "${team}\nHUNTER_DEVELOPMENT_TEAM.name = DEVELOPMENT_TEAM") + set(team "${team}\nQMAKE_MAC_XCODE_SETTINGS += HUNTER_DEVELOPMENT_TEAM") + + set(output_content "${output_content}\n${team}") + endif() + file(WRITE "${conf_path}" "${output_content}\n") endif() @@ -292,7 +304,13 @@ if("@HUNTER_QT_OS_IS_LINUX@") set(output_content "${output_content}\n${output}") endforeach() - file(WRITE "${conf_path}" "${output_content}\n") + if("@HUNTER_Qt_VERSION@" VERSION_LESS "5.12") + file(WRITE "${conf_path}" "${output_content}\n") + message("Set g++-base.conf content to:\n") + message("${output_content}") + else() + # FIXME + endif() endif() function(calculate_list listname) diff --git a/cmake/projects/Qt/ep-stages/qt-install.cmake.in b/cmake/projects/Qt/ep-stages/qt-install.cmake.in index 290466c10..e57bd5544 100644 --- a/cmake/projects/Qt/ep-stages/qt-install.cmake.in +++ b/cmake/projects/Qt/ep-stages/qt-install.cmake.in @@ -64,6 +64,7 @@ foreach(deps ${depends_on}) endforeach() string(COMPARE EQUAL "@qt_component@" "qttools" is_qttools) +string(COMPARE EQUAL "@qt_component@" "qtbase" is_qtbase) list(FIND depends_on "qttools" depends_on_qttools_index) include("@hunter_self@/scripts/clear-all.cmake") @@ -181,6 +182,31 @@ if("@IOS@") endforeach() endif() +# Fix RPATH issue: +# * https://github.com/hunter-packages/Qt/issues/3 +if("@HUNTER_QT_OS_IS_LINUX@" AND "@BUILD_SHARED_LIBS@" AND is_qtbase) + set( + rpath_fix_list + qdbuscpp2xml + qdbusxml2cpp + qdoc + qlalr + uic + ) + + foreach(x ${rpath_fix_list}) + set(file_path "@local_install_dir@/bin/${x}") + if(EXISTS "${file_path}") + file( + RPATH_CHANGE + FILE "${file_path}" + OLD_RPATH "@local_install_dir@/lib" + NEW_RPATH "$ORIGIN/../lib" + ) + endif() + endforeach() +endif() + set( qml_plugin_from "@local_install_dir@/lib/cmake/Qt5Qml/Qt5Qml_QTcpServerConnection.cmake" @@ -196,12 +222,20 @@ endif() # Remove files installed by other components foreach(installed_file ${QT_INSTALLED_FILES}) set(filepath "@local_install_dir@/${installed_file}") - if(NOT EXISTS "${filepath}") - message(FATAL_ERROR "File not found: ${filepath}") - endif() - file(REMOVE "${filepath}") if(EXISTS "${filepath}") - message(FATAL_ERROR "File not removed: ${filepath}") + file(REMOVE "${filepath}") + if(EXISTS "${filepath}") + message(FATAL_ERROR "File not removed: ${filepath}") + endif() + else() + # Before Qt 5.10 it was assumed that while doing + # component install all files from dependent + # components installed too. + + # It's not true for Qt 5.10: + # on OSX component 'qtgraphicaleffects' + # will not install header 'qvulkanfunctions_p.h' + # which is installed by 'qtxmlpatterns'. endif() endforeach() diff --git a/cmake/projects/Qt/generate.sh b/cmake/projects/Qt/generate.sh index 78e123257..aca126c7a 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 f0b3ef9ed..b81ed2fba 100644 --- a/cmake/projects/Qt/hunter.cmake +++ b/cmake/projects/Qt/hunter.cmake @@ -9,6 +9,7 @@ include(hunter_cacheable) include(hunter_cmake_args) include(hunter_configuration_types) include(hunter_report_broken_package) +include(hunter_check_toolchain_definition) # Use *.7z version. # Qt 5.5 overview: @@ -182,6 +183,28 @@ hunter_add_version( 4219da1cc7d14bfdd59bcbecf9180c2133181e52 ) +hunter_add_version( + PACKAGE_NAME + Qt + VERSION + "5.5.1-cvpixelbuffer-2-p8" + URL + "https://github.com/hunter-packages/Qt/releases/download/v5.5.1-cvpixelbuffer-2-p8/hunter-5.5.1-cvpixelbuffer-2.7z" + SHA1 + 130b210eff2a29b2aa65421e23ec618b65aa5d0f +) + +hunter_add_version( + PACKAGE_NAME + Qt + VERSION + "5.5.1-cvpixelbuffer-2-p9" + URL + "https://github.com/hunter-packages/Qt/releases/download/v5.5.1-cvpixelbuffer-2-p9/hunter-5.5.1-cvpixelbuffer-2.7z" + SHA1 + da8682218c7ed731d1affbdd1abee3c7393fb3e7 +) + hunter_add_version( PACKAGE_NAME Qt @@ -193,6 +216,61 @@ 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_add_version( + PACKAGE_NAME + Qt + VERSION + "5.10.1" + URL + "http://download.qt.io/official_releases/qt/5.10/5.10.1/single/qt-everywhere-src-5.10.1.tar.xz" + SHA1 + 3d71e887287bdea664ac6f8db4aaa4a7d913be59 +) + +hunter_add_version( + PACKAGE_NAME + Qt + VERSION + "5.11.1" + URL + "http://download.qt.io/official_releases/qt/5.11/5.11.1/single/qt-everywhere-src-5.11.1.tar.xz" + SHA1 + 0ac866442a960d4038a51ba3096b2cc5d796b5ee +) + +hunter_add_version( + PACKAGE_NAME + Qt + VERSION + "5.11.3" + URL + "https://download.qt.io/official_releases/qt/5.11/5.11.3/single/qt-everywhere-src-5.11.3.tar.xz" + SHA1 + 3f6c0df4fa7524ed11557ed55db35ef551cd2782 +) + +hunter_add_version( + PACKAGE_NAME + Qt + VERSION + "5.12.3" + URL + "https://download.qt.io/official_releases/qt/5.12/5.12.3/single/qt-everywhere-src-5.12.3.tar.xz" + SHA1 + cf1bbdf0e69a651a67738e9b3e616e0dd9cf3087 +) + hunter_cacheable(Qt) if(NOT APPLE AND NOT WIN32) @@ -214,6 +292,30 @@ 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() + +if(MSVC) + hunter_check_toolchain_definition(NAME "_DLL" DEFINED _hunter_vs_md) + hunter_cmake_args( + Qt + CMAKE_ARGS + QT_BUILD_DYNAMIC_VSRUNTIME=${_hunter_vs_md} + ) +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 d40af1af5..a1117ea3b 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,30 +21,90 @@ 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + else() return() endif() endif() ## -- end -hunter_generate_qt_info( - "@qt_component@" - _unused_toskip - _depends_on - _unused_nobuild - "${HUNTER_Qt_VERSION}" - "${ANDROID}" - "${WIN32}" +## 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + return() + endif() +endif() +## -- end -foreach(_x ${_depends_on}) - hunter_add_package(Qt COMPONENTS ${_x}) -endforeach() +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( + "@qt_component@" + _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) @@ -82,5 +142,5 @@ hunter_pick_scheme(DEFAULT url_sha1_qt) hunter_download( PACKAGE_NAME Qt PACKAGE_COMPONENT "@qt_component@" - PACKAGE_INTERNAL_DEPS_ID "10" + PACKAGE_INTERNAL_DEPS_ID "14" ) diff --git a/cmake/projects/Qt/qt3d/hunter.cmake b/cmake/projects/Qt/qt3d/hunter.cmake index 806a0a5db..5268198e0 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,30 +21,90 @@ 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + else() return() endif() endif() ## -- end -hunter_generate_qt_info( - "qt3d" - _unused_toskip - _depends_on - _unused_nobuild - "${HUNTER_Qt_VERSION}" - "${ANDROID}" - "${WIN32}" +## 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + return() + endif() +endif() +## -- end -foreach(_x ${_depends_on}) - hunter_add_package(Qt COMPONENTS ${_x}) -endforeach() +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( + "qt3d" + _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) @@ -82,5 +142,5 @@ hunter_pick_scheme(DEFAULT url_sha1_qt) hunter_download( PACKAGE_NAME Qt PACKAGE_COMPONENT "qt3d" - PACKAGE_INTERNAL_DEPS_ID "10" + PACKAGE_INTERNAL_DEPS_ID "14" ) diff --git a/cmake/projects/Qt/qtactiveqt/hunter.cmake b/cmake/projects/Qt/qtactiveqt/hunter.cmake index 93f294c6b..b64b93cc8 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,30 +21,90 @@ 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + else() return() endif() endif() ## -- end -hunter_generate_qt_info( - "qtactiveqt" - _unused_toskip - _depends_on - _unused_nobuild - "${HUNTER_Qt_VERSION}" - "${ANDROID}" - "${WIN32}" +## 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + return() + endif() +endif() +## -- end -foreach(_x ${_depends_on}) - hunter_add_package(Qt COMPONENTS ${_x}) -endforeach() +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( + "qtactiveqt" + _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) @@ -82,5 +142,5 @@ hunter_pick_scheme(DEFAULT url_sha1_qt) hunter_download( PACKAGE_NAME Qt PACKAGE_COMPONENT "qtactiveqt" - PACKAGE_INTERNAL_DEPS_ID "10" + PACKAGE_INTERNAL_DEPS_ID "14" ) diff --git a/cmake/projects/Qt/qtandroidextras/hunter.cmake b/cmake/projects/Qt/qtandroidextras/hunter.cmake index 130c100d7..9c669ccd3 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,30 +21,90 @@ 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + else() return() endif() endif() ## -- end -hunter_generate_qt_info( - "qtandroidextras" - _unused_toskip - _depends_on - _unused_nobuild - "${HUNTER_Qt_VERSION}" - "${ANDROID}" - "${WIN32}" +## 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + return() + endif() +endif() +## -- end -foreach(_x ${_depends_on}) - hunter_add_package(Qt COMPONENTS ${_x}) -endforeach() +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( + "qtandroidextras" + _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) @@ -82,5 +142,5 @@ hunter_pick_scheme(DEFAULT url_sha1_qt) hunter_download( PACKAGE_NAME Qt PACKAGE_COMPONENT "qtandroidextras" - PACKAGE_INTERNAL_DEPS_ID "10" + PACKAGE_INTERNAL_DEPS_ID "14" ) diff --git a/cmake/projects/Qt/qtbase/hunter.cmake b/cmake/projects/Qt/qtbase/hunter.cmake index 24ca54018..55e5e1718 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,30 +21,90 @@ 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + else() return() endif() endif() ## -- end -hunter_generate_qt_info( - "qtbase" - _unused_toskip - _depends_on - _unused_nobuild - "${HUNTER_Qt_VERSION}" - "${ANDROID}" - "${WIN32}" +## 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + return() + endif() +endif() +## -- end -foreach(_x ${_depends_on}) - hunter_add_package(Qt COMPONENTS ${_x}) -endforeach() +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( + "qtbase" + _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) @@ -82,5 +142,5 @@ hunter_pick_scheme(DEFAULT url_sha1_qt) hunter_download( PACKAGE_NAME Qt PACKAGE_COMPONENT "qtbase" - PACKAGE_INTERNAL_DEPS_ID "10" + PACKAGE_INTERNAL_DEPS_ID "14" ) diff --git a/cmake/projects/Qt/qtcanvas3d/hunter.cmake b/cmake/projects/Qt/qtcanvas3d/hunter.cmake index c946ca726..53d85ae65 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,30 +21,90 @@ 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + else() return() endif() endif() ## -- end -hunter_generate_qt_info( - "qtcanvas3d" - _unused_toskip - _depends_on - _unused_nobuild - "${HUNTER_Qt_VERSION}" - "${ANDROID}" - "${WIN32}" +## 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + return() + endif() +endif() +## -- end -foreach(_x ${_depends_on}) - hunter_add_package(Qt COMPONENTS ${_x}) -endforeach() +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( + "qtcanvas3d" + _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) @@ -82,5 +142,5 @@ hunter_pick_scheme(DEFAULT url_sha1_qt) hunter_download( PACKAGE_NAME Qt PACKAGE_COMPONENT "qtcanvas3d" - PACKAGE_INTERNAL_DEPS_ID "10" + PACKAGE_INTERNAL_DEPS_ID "14" ) diff --git a/cmake/projects/Qt/qtcharts/hunter.cmake b/cmake/projects/Qt/qtcharts/hunter.cmake new file mode 100644 index 000000000..7762c8744 --- /dev/null +++ b/cmake/projects/Qt/qtcharts/hunter.cmake @@ -0,0 +1,146 @@ +# 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + 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 "14" +) diff --git a/cmake/projects/Qt/qtconnectivity/hunter.cmake b/cmake/projects/Qt/qtconnectivity/hunter.cmake index dfad70c96..043f1b115 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,30 +21,90 @@ 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + else() return() endif() endif() ## -- end -hunter_generate_qt_info( - "qtconnectivity" - _unused_toskip - _depends_on - _unused_nobuild - "${HUNTER_Qt_VERSION}" - "${ANDROID}" - "${WIN32}" +## 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + return() + endif() +endif() +## -- end -foreach(_x ${_depends_on}) - hunter_add_package(Qt COMPONENTS ${_x}) -endforeach() +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( + "qtconnectivity" + _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) @@ -82,5 +142,5 @@ hunter_pick_scheme(DEFAULT url_sha1_qt) hunter_download( PACKAGE_NAME Qt PACKAGE_COMPONENT "qtconnectivity" - PACKAGE_INTERNAL_DEPS_ID "10" + PACKAGE_INTERNAL_DEPS_ID "14" ) diff --git a/cmake/projects/Qt/qtdatavis3d/hunter.cmake b/cmake/projects/Qt/qtdatavis3d/hunter.cmake new file mode 100644 index 000000000..33a938e37 --- /dev/null +++ b/cmake/projects/Qt/qtdatavis3d/hunter.cmake @@ -0,0 +1,146 @@ +# 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + 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 "14" +) diff --git a/cmake/projects/Qt/qtdeclarative/hunter.cmake b/cmake/projects/Qt/qtdeclarative/hunter.cmake index 7183ca57c..3aa978319 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,30 +21,90 @@ 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + else() return() endif() endif() ## -- end -hunter_generate_qt_info( - "qtdeclarative" - _unused_toskip - _depends_on - _unused_nobuild - "${HUNTER_Qt_VERSION}" - "${ANDROID}" - "${WIN32}" +## 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + return() + endif() +endif() +## -- end -foreach(_x ${_depends_on}) - hunter_add_package(Qt COMPONENTS ${_x}) -endforeach() +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( + "qtdeclarative" + _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) @@ -82,5 +142,5 @@ hunter_pick_scheme(DEFAULT url_sha1_qt) hunter_download( PACKAGE_NAME Qt PACKAGE_COMPONENT "qtdeclarative" - PACKAGE_INTERNAL_DEPS_ID "10" + PACKAGE_INTERNAL_DEPS_ID "14" ) diff --git a/cmake/projects/Qt/qtdoc/hunter.cmake b/cmake/projects/Qt/qtdoc/hunter.cmake index 39f2f86bf..4e2d5d218 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,30 +21,90 @@ 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + else() return() endif() endif() ## -- end -hunter_generate_qt_info( - "qtdoc" - _unused_toskip - _depends_on - _unused_nobuild - "${HUNTER_Qt_VERSION}" - "${ANDROID}" - "${WIN32}" +## 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + return() + endif() +endif() +## -- end -foreach(_x ${_depends_on}) - hunter_add_package(Qt COMPONENTS ${_x}) -endforeach() +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( + "qtdoc" + _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) @@ -82,5 +142,5 @@ hunter_pick_scheme(DEFAULT url_sha1_qt) hunter_download( PACKAGE_NAME Qt PACKAGE_COMPONENT "qtdoc" - PACKAGE_INTERNAL_DEPS_ID "10" + PACKAGE_INTERNAL_DEPS_ID "14" ) diff --git a/cmake/projects/Qt/qtdocgallery/hunter.cmake b/cmake/projects/Qt/qtdocgallery/hunter.cmake new file mode 100644 index 000000000..abc6f3440 --- /dev/null +++ b/cmake/projects/Qt/qtdocgallery/hunter.cmake @@ -0,0 +1,146 @@ +# 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + 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 "14" +) diff --git a/cmake/projects/Qt/qtenginio/hunter.cmake b/cmake/projects/Qt/qtenginio/hunter.cmake index 3250ce452..1d071df0c 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,30 +21,90 @@ 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + else() return() endif() endif() ## -- end -hunter_generate_qt_info( - "qtenginio" - _unused_toskip - _depends_on - _unused_nobuild - "${HUNTER_Qt_VERSION}" - "${ANDROID}" - "${WIN32}" +## 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + return() + endif() +endif() +## -- end -foreach(_x ${_depends_on}) - hunter_add_package(Qt COMPONENTS ${_x}) -endforeach() +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( + "qtenginio" + _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) @@ -82,5 +142,5 @@ hunter_pick_scheme(DEFAULT url_sha1_qt) hunter_download( PACKAGE_NAME Qt PACKAGE_COMPONENT "qtenginio" - PACKAGE_INTERNAL_DEPS_ID "10" + PACKAGE_INTERNAL_DEPS_ID "14" ) diff --git a/cmake/projects/Qt/qtfeedback/hunter.cmake b/cmake/projects/Qt/qtfeedback/hunter.cmake new file mode 100644 index 000000000..9fc55f8c9 --- /dev/null +++ b/cmake/projects/Qt/qtfeedback/hunter.cmake @@ -0,0 +1,146 @@ +# 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + 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 "14" +) diff --git a/cmake/projects/Qt/qtgamepad/hunter.cmake b/cmake/projects/Qt/qtgamepad/hunter.cmake new file mode 100644 index 000000000..c29c42279 --- /dev/null +++ b/cmake/projects/Qt/qtgamepad/hunter.cmake @@ -0,0 +1,146 @@ +# 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + 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 "14" +) diff --git a/cmake/projects/Qt/qtgraphicaleffects/hunter.cmake b/cmake/projects/Qt/qtgraphicaleffects/hunter.cmake index 00db8d5c0..f628a184a 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,30 +21,90 @@ 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + else() return() endif() endif() ## -- end -hunter_generate_qt_info( - "qtgraphicaleffects" - _unused_toskip - _depends_on - _unused_nobuild - "${HUNTER_Qt_VERSION}" - "${ANDROID}" - "${WIN32}" +## 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + return() + endif() +endif() +## -- end -foreach(_x ${_depends_on}) - hunter_add_package(Qt COMPONENTS ${_x}) -endforeach() +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( + "qtgraphicaleffects" + _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) @@ -82,5 +142,5 @@ hunter_pick_scheme(DEFAULT url_sha1_qt) hunter_download( PACKAGE_NAME Qt PACKAGE_COMPONENT "qtgraphicaleffects" - PACKAGE_INTERNAL_DEPS_ID "10" + PACKAGE_INTERNAL_DEPS_ID "14" ) diff --git a/cmake/projects/Qt/qtimageformats/hunter.cmake b/cmake/projects/Qt/qtimageformats/hunter.cmake index 6ed816616..587bb6815 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,30 +21,90 @@ 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + else() return() endif() endif() ## -- end -hunter_generate_qt_info( - "qtimageformats" - _unused_toskip - _depends_on - _unused_nobuild - "${HUNTER_Qt_VERSION}" - "${ANDROID}" - "${WIN32}" +## 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + return() + endif() +endif() +## -- end -foreach(_x ${_depends_on}) - hunter_add_package(Qt COMPONENTS ${_x}) -endforeach() +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( + "qtimageformats" + _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) @@ -82,5 +142,5 @@ hunter_pick_scheme(DEFAULT url_sha1_qt) hunter_download( PACKAGE_NAME Qt PACKAGE_COMPONENT "qtimageformats" - PACKAGE_INTERNAL_DEPS_ID "10" + PACKAGE_INTERNAL_DEPS_ID "14" ) diff --git a/cmake/projects/Qt/qtlocation/hunter.cmake b/cmake/projects/Qt/qtlocation/hunter.cmake index af0fd3f82..3cec767f1 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,30 +21,90 @@ 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + else() return() endif() endif() ## -- end -hunter_generate_qt_info( - "qtlocation" - _unused_toskip - _depends_on - _unused_nobuild - "${HUNTER_Qt_VERSION}" - "${ANDROID}" - "${WIN32}" +## 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + return() + endif() +endif() +## -- end -foreach(_x ${_depends_on}) - hunter_add_package(Qt COMPONENTS ${_x}) -endforeach() +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( + "qtlocation" + _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) @@ -82,5 +142,5 @@ hunter_pick_scheme(DEFAULT url_sha1_qt) hunter_download( PACKAGE_NAME Qt PACKAGE_COMPONENT "qtlocation" - PACKAGE_INTERNAL_DEPS_ID "10" + PACKAGE_INTERNAL_DEPS_ID "14" ) diff --git a/cmake/projects/Qt/qtmacextras/hunter.cmake b/cmake/projects/Qt/qtmacextras/hunter.cmake index e5e94d5cd..ae4348e73 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,30 +21,90 @@ 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + else() return() endif() endif() ## -- end -hunter_generate_qt_info( - "qtmacextras" - _unused_toskip - _depends_on - _unused_nobuild - "${HUNTER_Qt_VERSION}" - "${ANDROID}" - "${WIN32}" +## 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + return() + endif() +endif() +## -- end -foreach(_x ${_depends_on}) - hunter_add_package(Qt COMPONENTS ${_x}) -endforeach() +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( + "qtmacextras" + _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) @@ -82,5 +142,5 @@ hunter_pick_scheme(DEFAULT url_sha1_qt) hunter_download( PACKAGE_NAME Qt PACKAGE_COMPONENT "qtmacextras" - PACKAGE_INTERNAL_DEPS_ID "10" + PACKAGE_INTERNAL_DEPS_ID "14" ) diff --git a/cmake/projects/Qt/qtmultimedia/hunter.cmake b/cmake/projects/Qt/qtmultimedia/hunter.cmake index a26d79326..572b6f311 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,30 +21,90 @@ 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + else() return() endif() endif() ## -- end -hunter_generate_qt_info( - "qtmultimedia" - _unused_toskip - _depends_on - _unused_nobuild - "${HUNTER_Qt_VERSION}" - "${ANDROID}" - "${WIN32}" +## 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + return() + endif() +endif() +## -- end -foreach(_x ${_depends_on}) - hunter_add_package(Qt COMPONENTS ${_x}) -endforeach() +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( + "qtmultimedia" + _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) @@ -82,5 +142,5 @@ hunter_pick_scheme(DEFAULT url_sha1_qt) hunter_download( PACKAGE_NAME Qt PACKAGE_COMPONENT "qtmultimedia" - PACKAGE_INTERNAL_DEPS_ID "10" + PACKAGE_INTERNAL_DEPS_ID "14" ) diff --git a/cmake/projects/Qt/qtnetworkauth/hunter.cmake b/cmake/projects/Qt/qtnetworkauth/hunter.cmake new file mode 100644 index 000000000..ec7d2ef57 --- /dev/null +++ b/cmake/projects/Qt/qtnetworkauth/hunter.cmake @@ -0,0 +1,146 @@ +# 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + 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 "14" +) diff --git a/cmake/projects/Qt/qtpim/hunter.cmake b/cmake/projects/Qt/qtpim/hunter.cmake new file mode 100644 index 000000000..72d523a4b --- /dev/null +++ b/cmake/projects/Qt/qtpim/hunter.cmake @@ -0,0 +1,146 @@ +# 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + 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 "14" +) diff --git a/cmake/projects/Qt/qtpurchasing/hunter.cmake b/cmake/projects/Qt/qtpurchasing/hunter.cmake new file mode 100644 index 000000000..b7a7cbc49 --- /dev/null +++ b/cmake/projects/Qt/qtpurchasing/hunter.cmake @@ -0,0 +1,146 @@ +# 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + 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 "14" +) diff --git a/cmake/projects/Qt/qtqa/hunter.cmake b/cmake/projects/Qt/qtqa/hunter.cmake new file mode 100644 index 000000000..134cf0527 --- /dev/null +++ b/cmake/projects/Qt/qtqa/hunter.cmake @@ -0,0 +1,146 @@ +# 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + 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 "14" +) diff --git a/cmake/projects/Qt/qtquick1/hunter.cmake b/cmake/projects/Qt/qtquick1/hunter.cmake index b9a454648..dc13ead4e 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,30 +21,90 @@ 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + else() return() endif() endif() ## -- end -hunter_generate_qt_info( - "qtquick1" - _unused_toskip - _depends_on - _unused_nobuild - "${HUNTER_Qt_VERSION}" - "${ANDROID}" - "${WIN32}" +## 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + return() + endif() +endif() +## -- end -foreach(_x ${_depends_on}) - hunter_add_package(Qt COMPONENTS ${_x}) -endforeach() +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( + "qtquick1" + _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) @@ -82,5 +142,5 @@ hunter_pick_scheme(DEFAULT url_sha1_qt) hunter_download( PACKAGE_NAME Qt PACKAGE_COMPONENT "qtquick1" - PACKAGE_INTERNAL_DEPS_ID "10" + PACKAGE_INTERNAL_DEPS_ID "14" ) diff --git a/cmake/projects/Qt/qtquickcontrols/hunter.cmake b/cmake/projects/Qt/qtquickcontrols/hunter.cmake index b08f0e4a4..870eaf500 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,30 +21,90 @@ 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + else() return() endif() endif() ## -- end -hunter_generate_qt_info( - "qtquickcontrols" - _unused_toskip - _depends_on - _unused_nobuild - "${HUNTER_Qt_VERSION}" - "${ANDROID}" - "${WIN32}" +## 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + return() + endif() +endif() +## -- end -foreach(_x ${_depends_on}) - hunter_add_package(Qt COMPONENTS ${_x}) -endforeach() +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( + "qtquickcontrols" + _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) @@ -82,5 +142,5 @@ hunter_pick_scheme(DEFAULT url_sha1_qt) hunter_download( PACKAGE_NAME Qt PACKAGE_COMPONENT "qtquickcontrols" - PACKAGE_INTERNAL_DEPS_ID "10" + PACKAGE_INTERNAL_DEPS_ID "14" ) diff --git a/cmake/projects/Qt/qtquickcontrols2/hunter.cmake b/cmake/projects/Qt/qtquickcontrols2/hunter.cmake index 30cc8dd65..0c5de4538 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,30 +21,90 @@ 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + else() return() endif() endif() ## -- end -hunter_generate_qt_info( - "qtquickcontrols2" - _unused_toskip - _depends_on - _unused_nobuild - "${HUNTER_Qt_VERSION}" - "${ANDROID}" - "${WIN32}" +## 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + return() + endif() +endif() +## -- end -foreach(_x ${_depends_on}) - hunter_add_package(Qt COMPONENTS ${_x}) -endforeach() +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( + "qtquickcontrols2" + _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) @@ -82,5 +142,5 @@ hunter_pick_scheme(DEFAULT url_sha1_qt) hunter_download( PACKAGE_NAME Qt PACKAGE_COMPONENT "qtquickcontrols2" - PACKAGE_INTERNAL_DEPS_ID "10" + PACKAGE_INTERNAL_DEPS_ID "14" ) diff --git a/cmake/projects/Qt/qtremoteobjects/hunter.cmake b/cmake/projects/Qt/qtremoteobjects/hunter.cmake new file mode 100644 index 000000000..95e4dbc26 --- /dev/null +++ b/cmake/projects/Qt/qtremoteobjects/hunter.cmake @@ -0,0 +1,146 @@ +# 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + 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 "14" +) diff --git a/cmake/projects/Qt/qtrepotools/hunter.cmake b/cmake/projects/Qt/qtrepotools/hunter.cmake new file mode 100644 index 000000000..9fe27fa5e --- /dev/null +++ b/cmake/projects/Qt/qtrepotools/hunter.cmake @@ -0,0 +1,146 @@ +# 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + 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 "14" +) diff --git a/cmake/projects/Qt/qtscript/hunter.cmake b/cmake/projects/Qt/qtscript/hunter.cmake index d6be1202d..922bebc2f 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,30 +21,90 @@ 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + else() return() endif() endif() ## -- end -hunter_generate_qt_info( - "qtscript" - _unused_toskip - _depends_on - _unused_nobuild - "${HUNTER_Qt_VERSION}" - "${ANDROID}" - "${WIN32}" +## 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + return() + endif() +endif() +## -- end -foreach(_x ${_depends_on}) - hunter_add_package(Qt COMPONENTS ${_x}) -endforeach() +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( + "qtscript" + _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) @@ -82,5 +142,5 @@ hunter_pick_scheme(DEFAULT url_sha1_qt) hunter_download( PACKAGE_NAME Qt PACKAGE_COMPONENT "qtscript" - PACKAGE_INTERNAL_DEPS_ID "10" + PACKAGE_INTERNAL_DEPS_ID "14" ) diff --git a/cmake/projects/Qt/qtscxml/hunter.cmake b/cmake/projects/Qt/qtscxml/hunter.cmake new file mode 100644 index 000000000..f15da9e83 --- /dev/null +++ b/cmake/projects/Qt/qtscxml/hunter.cmake @@ -0,0 +1,146 @@ +# 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + 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 "14" +) diff --git a/cmake/projects/Qt/qtsensors/hunter.cmake b/cmake/projects/Qt/qtsensors/hunter.cmake index c86dc902c..41e606a1f 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,30 +21,90 @@ 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + else() return() endif() endif() ## -- end -hunter_generate_qt_info( - "qtsensors" - _unused_toskip - _depends_on - _unused_nobuild - "${HUNTER_Qt_VERSION}" - "${ANDROID}" - "${WIN32}" +## 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + return() + endif() +endif() +## -- end -foreach(_x ${_depends_on}) - hunter_add_package(Qt COMPONENTS ${_x}) -endforeach() +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( + "qtsensors" + _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) @@ -82,5 +142,5 @@ hunter_pick_scheme(DEFAULT url_sha1_qt) hunter_download( PACKAGE_NAME Qt PACKAGE_COMPONENT "qtsensors" - PACKAGE_INTERNAL_DEPS_ID "10" + PACKAGE_INTERNAL_DEPS_ID "14" ) diff --git a/cmake/projects/Qt/qtserialbus/hunter.cmake b/cmake/projects/Qt/qtserialbus/hunter.cmake new file mode 100644 index 000000000..792f58858 --- /dev/null +++ b/cmake/projects/Qt/qtserialbus/hunter.cmake @@ -0,0 +1,146 @@ +# 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + 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 "14" +) diff --git a/cmake/projects/Qt/qtserialport/hunter.cmake b/cmake/projects/Qt/qtserialport/hunter.cmake index 7cefa28bc..32a5a13e2 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,30 +21,90 @@ 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + else() return() endif() endif() ## -- end -hunter_generate_qt_info( - "qtserialport" - _unused_toskip - _depends_on - _unused_nobuild - "${HUNTER_Qt_VERSION}" - "${ANDROID}" - "${WIN32}" +## 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + return() + endif() +endif() +## -- end -foreach(_x ${_depends_on}) - hunter_add_package(Qt COMPONENTS ${_x}) -endforeach() +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( + "qtserialport" + _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) @@ -82,5 +142,5 @@ hunter_pick_scheme(DEFAULT url_sha1_qt) hunter_download( PACKAGE_NAME Qt PACKAGE_COMPONENT "qtserialport" - PACKAGE_INTERNAL_DEPS_ID "10" + PACKAGE_INTERNAL_DEPS_ID "14" ) diff --git a/cmake/projects/Qt/qtspeech/hunter.cmake b/cmake/projects/Qt/qtspeech/hunter.cmake new file mode 100644 index 000000000..c4fd8df97 --- /dev/null +++ b/cmake/projects/Qt/qtspeech/hunter.cmake @@ -0,0 +1,146 @@ +# 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + 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 "14" +) diff --git a/cmake/projects/Qt/qtsvg/hunter.cmake b/cmake/projects/Qt/qtsvg/hunter.cmake index f3fa1312b..129130800 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,30 +21,90 @@ 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + else() return() endif() endif() ## -- end -hunter_generate_qt_info( - "qtsvg" - _unused_toskip - _depends_on - _unused_nobuild - "${HUNTER_Qt_VERSION}" - "${ANDROID}" - "${WIN32}" +## 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + return() + endif() +endif() +## -- end -foreach(_x ${_depends_on}) - hunter_add_package(Qt COMPONENTS ${_x}) -endforeach() +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( + "qtsvg" + _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) @@ -82,5 +142,5 @@ hunter_pick_scheme(DEFAULT url_sha1_qt) hunter_download( PACKAGE_NAME Qt PACKAGE_COMPONENT "qtsvg" - PACKAGE_INTERNAL_DEPS_ID "10" + PACKAGE_INTERNAL_DEPS_ID "14" ) diff --git a/cmake/projects/Qt/qtsystems/hunter.cmake b/cmake/projects/Qt/qtsystems/hunter.cmake new file mode 100644 index 000000000..111dbe766 --- /dev/null +++ b/cmake/projects/Qt/qtsystems/hunter.cmake @@ -0,0 +1,146 @@ +# 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + 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 "14" +) diff --git a/cmake/projects/Qt/qttools/hunter.cmake b/cmake/projects/Qt/qttools/hunter.cmake index fc7ad8392..a0de3d3c3 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,30 +21,90 @@ 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + else() return() endif() endif() ## -- end -hunter_generate_qt_info( - "qttools" - _unused_toskip - _depends_on - _unused_nobuild - "${HUNTER_Qt_VERSION}" - "${ANDROID}" - "${WIN32}" +## 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + return() + endif() +endif() +## -- end -foreach(_x ${_depends_on}) - hunter_add_package(Qt COMPONENTS ${_x}) -endforeach() +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( + "qttools" + _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) @@ -82,5 +142,5 @@ hunter_pick_scheme(DEFAULT url_sha1_qt) hunter_download( PACKAGE_NAME Qt PACKAGE_COMPONENT "qttools" - PACKAGE_INTERNAL_DEPS_ID "10" + PACKAGE_INTERNAL_DEPS_ID "14" ) diff --git a/cmake/projects/Qt/qttranslations/hunter.cmake b/cmake/projects/Qt/qttranslations/hunter.cmake index 3fe309cca..cca15723d 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,30 +21,90 @@ 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + else() return() endif() endif() ## -- end -hunter_generate_qt_info( - "qttranslations" - _unused_toskip - _depends_on - _unused_nobuild - "${HUNTER_Qt_VERSION}" - "${ANDROID}" - "${WIN32}" +## 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + return() + endif() +endif() +## -- end -foreach(_x ${_depends_on}) - hunter_add_package(Qt COMPONENTS ${_x}) -endforeach() +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( + "qttranslations" + _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) @@ -82,5 +142,5 @@ hunter_pick_scheme(DEFAULT url_sha1_qt) hunter_download( PACKAGE_NAME Qt PACKAGE_COMPONENT "qttranslations" - PACKAGE_INTERNAL_DEPS_ID "10" + PACKAGE_INTERNAL_DEPS_ID "14" ) diff --git a/cmake/projects/Qt/qtvirtualkeyboard/hunter.cmake b/cmake/projects/Qt/qtvirtualkeyboard/hunter.cmake new file mode 100644 index 000000000..ef1481979 --- /dev/null +++ b/cmake/projects/Qt/qtvirtualkeyboard/hunter.cmake @@ -0,0 +1,146 @@ +# 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + 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 "14" +) diff --git a/cmake/projects/Qt/qtwayland/hunter.cmake b/cmake/projects/Qt/qtwayland/hunter.cmake index a024816f9..4838491c4 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,30 +21,90 @@ 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + else() return() endif() endif() ## -- end -hunter_generate_qt_info( - "qtwayland" - _unused_toskip - _depends_on - _unused_nobuild - "${HUNTER_Qt_VERSION}" - "${ANDROID}" - "${WIN32}" +## 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + return() + endif() +endif() +## -- end -foreach(_x ${_depends_on}) - hunter_add_package(Qt COMPONENTS ${_x}) -endforeach() +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( + "qtwayland" + _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) @@ -82,5 +142,5 @@ hunter_pick_scheme(DEFAULT url_sha1_qt) hunter_download( PACKAGE_NAME Qt PACKAGE_COMPONENT "qtwayland" - PACKAGE_INTERNAL_DEPS_ID "10" + PACKAGE_INTERNAL_DEPS_ID "14" ) diff --git a/cmake/projects/Qt/qtwebchannel/hunter.cmake b/cmake/projects/Qt/qtwebchannel/hunter.cmake index b47beff1a..dffd101f0 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,30 +21,90 @@ 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + else() return() endif() endif() ## -- end -hunter_generate_qt_info( - "qtwebchannel" - _unused_toskip - _depends_on - _unused_nobuild - "${HUNTER_Qt_VERSION}" - "${ANDROID}" - "${WIN32}" +## 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + return() + endif() +endif() +## -- end -foreach(_x ${_depends_on}) - hunter_add_package(Qt COMPONENTS ${_x}) -endforeach() +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( + "qtwebchannel" + _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) @@ -82,5 +142,5 @@ hunter_pick_scheme(DEFAULT url_sha1_qt) hunter_download( PACKAGE_NAME Qt PACKAGE_COMPONENT "qtwebchannel" - PACKAGE_INTERNAL_DEPS_ID "10" + PACKAGE_INTERNAL_DEPS_ID "14" ) diff --git a/cmake/projects/Qt/qtwebengine/hunter.cmake b/cmake/projects/Qt/qtwebengine/hunter.cmake index 241fdfe82..c16abf006 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,30 +21,90 @@ 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + else() return() endif() endif() ## -- end -hunter_generate_qt_info( - "qtwebengine" - _unused_toskip - _depends_on - _unused_nobuild - "${HUNTER_Qt_VERSION}" - "${ANDROID}" - "${WIN32}" +## 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + return() + endif() +endif() +## -- end -foreach(_x ${_depends_on}) - hunter_add_package(Qt COMPONENTS ${_x}) -endforeach() +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( + "qtwebengine" + _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) @@ -82,5 +142,5 @@ hunter_pick_scheme(DEFAULT url_sha1_qt) hunter_download( PACKAGE_NAME Qt PACKAGE_COMPONENT "qtwebengine" - PACKAGE_INTERNAL_DEPS_ID "10" + PACKAGE_INTERNAL_DEPS_ID "14" ) diff --git a/cmake/projects/Qt/qtwebkit-examples/hunter.cmake b/cmake/projects/Qt/qtwebkit-examples/hunter.cmake index 1e9fdb7be..8d41721fb 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,30 +21,90 @@ 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + else() return() endif() endif() ## -- end -hunter_generate_qt_info( - "qtwebkit-examples" - _unused_toskip - _depends_on - _unused_nobuild - "${HUNTER_Qt_VERSION}" - "${ANDROID}" - "${WIN32}" +## 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + return() + endif() +endif() +## -- end -foreach(_x ${_depends_on}) - hunter_add_package(Qt COMPONENTS ${_x}) -endforeach() +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( + "qtwebkit-examples" + _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) @@ -82,5 +142,5 @@ hunter_pick_scheme(DEFAULT url_sha1_qt) hunter_download( PACKAGE_NAME Qt PACKAGE_COMPONENT "qtwebkit-examples" - PACKAGE_INTERNAL_DEPS_ID "10" + PACKAGE_INTERNAL_DEPS_ID "14" ) diff --git a/cmake/projects/Qt/qtwebkit/hunter.cmake b/cmake/projects/Qt/qtwebkit/hunter.cmake index 8dec00bef..0cae84e75 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,30 +21,90 @@ 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + else() return() endif() endif() ## -- end -hunter_generate_qt_info( - "qtwebkit" - _unused_toskip - _depends_on - _unused_nobuild - "${HUNTER_Qt_VERSION}" - "${ANDROID}" - "${WIN32}" +## 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + return() + endif() +endif() +## -- end -foreach(_x ${_depends_on}) - hunter_add_package(Qt COMPONENTS ${_x}) -endforeach() +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( + "qtwebkit" + _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) @@ -82,5 +142,5 @@ hunter_pick_scheme(DEFAULT url_sha1_qt) hunter_download( PACKAGE_NAME Qt PACKAGE_COMPONENT "qtwebkit" - PACKAGE_INTERNAL_DEPS_ID "10" + PACKAGE_INTERNAL_DEPS_ID "14" ) diff --git a/cmake/projects/Qt/qtwebsockets/hunter.cmake b/cmake/projects/Qt/qtwebsockets/hunter.cmake index 1ea4a7b1f..c07c155a3 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,30 +21,90 @@ 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + else() return() endif() endif() ## -- end -hunter_generate_qt_info( - "qtwebsockets" - _unused_toskip - _depends_on - _unused_nobuild - "${HUNTER_Qt_VERSION}" - "${ANDROID}" - "${WIN32}" +## 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + return() + endif() +endif() +## -- end -foreach(_x ${_depends_on}) - hunter_add_package(Qt COMPONENTS ${_x}) -endforeach() +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( + "qtwebsockets" + _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) @@ -82,5 +142,5 @@ hunter_pick_scheme(DEFAULT url_sha1_qt) hunter_download( PACKAGE_NAME Qt PACKAGE_COMPONENT "qtwebsockets" - PACKAGE_INTERNAL_DEPS_ID "10" + PACKAGE_INTERNAL_DEPS_ID "14" ) diff --git a/cmake/projects/Qt/qtwebview/hunter.cmake b/cmake/projects/Qt/qtwebview/hunter.cmake index 2314ff182..ef049eb10 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,30 +21,90 @@ 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + else() return() endif() endif() ## -- end -hunter_generate_qt_info( - "qtwebview" - _unused_toskip - _depends_on - _unused_nobuild - "${HUNTER_Qt_VERSION}" - "${ANDROID}" - "${WIN32}" +## 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + return() + endif() +endif() +## -- end -foreach(_x ${_depends_on}) - hunter_add_package(Qt COMPONENTS ${_x}) -endforeach() +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( + "qtwebview" + _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) @@ -82,5 +142,5 @@ hunter_pick_scheme(DEFAULT url_sha1_qt) hunter_download( PACKAGE_NAME Qt PACKAGE_COMPONENT "qtwebview" - PACKAGE_INTERNAL_DEPS_ID "10" + PACKAGE_INTERNAL_DEPS_ID "14" ) diff --git a/cmake/projects/Qt/qtwinextras/hunter.cmake b/cmake/projects/Qt/qtwinextras/hunter.cmake index fc58de361..e4c9d847f 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,30 +21,90 @@ 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + else() return() endif() endif() ## -- end -hunter_generate_qt_info( - "qtwinextras" - _unused_toskip - _depends_on - _unused_nobuild - "${HUNTER_Qt_VERSION}" - "${ANDROID}" - "${WIN32}" +## 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + return() + endif() +endif() +## -- end -foreach(_x ${_depends_on}) - hunter_add_package(Qt COMPONENTS ${_x}) -endforeach() +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( + "qtwinextras" + _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) @@ -82,5 +142,5 @@ hunter_pick_scheme(DEFAULT url_sha1_qt) hunter_download( PACKAGE_NAME Qt PACKAGE_COMPONENT "qtwinextras" - PACKAGE_INTERNAL_DEPS_ID "10" + PACKAGE_INTERNAL_DEPS_ID "14" ) diff --git a/cmake/projects/Qt/qtx11extras/hunter.cmake b/cmake/projects/Qt/qtx11extras/hunter.cmake index 8594d126d..fd8e31303 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,30 +21,90 @@ 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + else() return() endif() endif() ## -- end -hunter_generate_qt_info( - "qtx11extras" - _unused_toskip - _depends_on - _unused_nobuild - "${HUNTER_Qt_VERSION}" - "${ANDROID}" - "${WIN32}" +## 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + return() + endif() +endif() +## -- end -foreach(_x ${_depends_on}) - hunter_add_package(Qt COMPONENTS ${_x}) -endforeach() +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( + "qtx11extras" + _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) @@ -82,5 +142,5 @@ hunter_pick_scheme(DEFAULT url_sha1_qt) hunter_download( PACKAGE_NAME Qt PACKAGE_COMPONENT "qtx11extras" - PACKAGE_INTERNAL_DEPS_ID "10" + PACKAGE_INTERNAL_DEPS_ID "14" ) diff --git a/cmake/projects/Qt/qtxmlpatterns/hunter.cmake b/cmake/projects/Qt/qtxmlpatterns/hunter.cmake index ec64e338e..db3e48155 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,30 +21,90 @@ 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.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + else() return() endif() endif() ## -- end -hunter_generate_qt_info( - "qtxmlpatterns" - _unused_toskip - _depends_on - _unused_nobuild - "${HUNTER_Qt_VERSION}" - "${ANDROID}" - "${WIN32}" +## 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(HUNTER_Qt_VERSION MATCHES "^5\\.9\\.") + # Qt 5.9.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.10\\.") + # Qt 5.10.* + elseif(HUNTER_Qt_VERSION MATCHES "^5\\.11\\.") + # Qt 5.11.* + else() + return() + endif() +endif() +## -- end -foreach(_x ${_depends_on}) - hunter_add_package(Qt COMPONENTS ${_x}) -endforeach() +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( + "qtxmlpatterns" + _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) @@ -82,5 +142,5 @@ hunter_pick_scheme(DEFAULT url_sha1_qt) hunter_download( PACKAGE_NAME Qt PACKAGE_COMPONENT "qtxmlpatterns" - PACKAGE_INTERNAL_DEPS_ID "10" + PACKAGE_INTERNAL_DEPS_ID "14" ) diff --git a/cmake/projects/Qt/schemes/url_sha1_qt.cmake.in b/cmake/projects/Qt/schemes/url_sha1_qt.cmake.in index 778a0e4e5..ad78fd969 100644 --- a/cmake/projects/Qt/schemes/url_sha1_qt.cmake.in +++ b/cmake/projects/Qt/schemes/url_sha1_qt.cmake.in @@ -1,4 +1,4 @@ -# Copyright (c) 2013, 2015 Ruslan Baratov, Alexandre Pretyman +# Copyright (c) 2013, 2015-2016 Ruslan Baratov, Alexandre Pretyman # All rights reserved. cmake_minimum_required(VERSION 3.0) @@ -11,33 +11,34 @@ include("@HUNTER_SELF@/cmake/Hunter") include(hunter_internal_error) include(hunter_report_broken_package) include(hunter_status_debug) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) hunter_status_debug("Scheme: url_sha1_qt") # 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_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_INSTALL_PREFIX@") -hunter_test_string_not_empty("@HUNTER_PACKAGE_INSTALL_PREFIX@") -hunter_test_string_not_empty("@HUNTER_PACKAGE_LICENSE_FILE@") -hunter_test_string_not_empty("@HUNTER_Qt_VERSION@") -hunter_test_string_not_empty("@HUNTER_PACKAGE_SETUP_DIR@") -hunter_test_string_not_empty("@HUNTER_GLOBAL_SCRIPT_DIR@") +hunter_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_COMPONENT@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_BUILD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_CONFIGURATION_TYPES@") +hunter_assert_not_empty_string("@HUNTER_CONFIG_ID_PATH@") +hunter_assert_not_empty_string("@HUNTER_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_LICENSE_DIR@") +hunter_assert_not_empty_string("@HUNTER_Qt_VERSION@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SETUP_DIR@") +hunter_assert_not_empty_string("@HUNTER_GLOBAL_SCRIPT_DIR@") +hunter_assert_not_empty_string("@HUNTER_TLS_VERIFY@") set(HUNTER_Qt_VERSION "@HUNTER_Qt_VERSION@") if("@MSVC@") - hunter_test_string_not_empty("@HUNTER_MSVC_ARCH@") - hunter_test_string_not_empty("@HUNTER_MSVC_VCVARSALL@") - hunter_test_string_not_empty("@HUNTER_MSVC_YEAR@") + hunter_assert_not_empty_string("@HUNTER_MSVC_ARCH@") + hunter_assert_not_empty_string("@HUNTER_MSVC_VCVARSALL@") + hunter_assert_not_empty_string("@HUNTER_MSVC_YEAR@") endif() if("@MSVC@") @@ -104,20 +105,25 @@ elseif(_is_android) if(NOT BUILD_SHARED_LIBS) hunter_user_error("Static variant of Qt is not supported") endif() + + hunter_assert_not_empty_string("${CMAKE_ANDROID_NDK}") + hunter_assert_not_empty_string("${CMAKE_ANDROID_ARCH_ABI}") + hunter_assert_not_empty_string("${CMAKE_SYSTEM_VERSION}") + #setup the android ndk options hunter_add_package(Android-SDK) list(APPEND configure_opts -xplatform android-g++ -android-sdk "${ANDROID-SDK_ROOT}/android-sdk" - -android-ndk "${ANDROID_NDK}" - -android-ndk-platform "android-${ANDROID_NATIVE_API_LEVEL}" - -android-arch "${ANDROID_NDK_ABI_NAME}" + -android-ndk "${CMAKE_ANDROID_NDK}" + -android-ndk-platform "android-${CMAKE_SYSTEM_VERSION}" + -android-arch "${CMAKE_ANDROID_ARCH_ABI}" # -android-toolchain-version # ??? -no-warnings-are-errors ) - # Hint: directory ${ANDROID_NDK}/prebuilt + # Hint: directory ${CMAKE_ANDROID_NDK}/prebuilt if(CMAKE_HOST_APPLE) list(APPEND configure_opts -android-ndk-host "darwin-x86_64") elseif(CMAKE_HOST_UNIX) @@ -139,12 +145,18 @@ elseif(_is_darwin) set(HUNTER_PATCH_QT_MACX_CLANG TRUE) elseif(_is_linux) set(HUNTER_QT_OS_IS_LINUX TRUE) - hunter_add_package(xcb) + hunter_add_package(drm) + hunter_add_package(ice) + hunter_add_package(sm) hunter_add_package(x11) + hunter_add_package(xcb) + hunter_add_package(xcursor) + hunter_add_package(xdamage) hunter_add_package(xext) + hunter_add_package(xfixes) hunter_add_package(xrender) - hunter_add_package(sm) - hunter_add_package(ice) + hunter_add_package(xshmfence) + hunter_add_package(xxf86vm) string(COMPARE EQUAL "${X11_ROOT}" "${XCB_ROOT}" is_good) if(NOT is_good) @@ -180,11 +192,22 @@ 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") endif() +if(QT_WITH_GSTREAMER) + hunter_add_package(gst_plugins_bad) + hunter_add_package(gst_plugins_good) + hunter_add_package(gst_plugins_ugly) + + list(APPEND configure_opts -gstreamer 1.0) +endif() + if(HUNTER_STATUS_DEBUG AND NOT WIN32) list(APPEND configure_opts "-verbose") endif() @@ -193,6 +216,9 @@ if(BUILD_SHARED_LIBS) list(APPEND configure_opts "-shared") else() list(APPEND configure_opts "-static") + if("@MSVC@" AND NOT QT_BUILD_DYNAMIC_VSRUNTIME) + list(APPEND configure_opts "-static-runtime") + endif() endif() list(APPEND configure_opts "-prefix" "@HUNTER_PACKAGE_INSTALL_PREFIX@") @@ -231,8 +257,12 @@ 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") - list(APPEND configure_opts "-no-xinput2") + if(HUNTER_Qt_VERSION VERSION_LESS 5.9) + list(APPEND configure_opts "-no-gtkstyle") + endif() + if(HUNTER_Qt_VERSION VERSION_LESS 5.12) + list(APPEND configure_opts "-no-xinput2") + endif() endif() list(APPEND configure_opts "-no-icu") list(APPEND configure_opts "-no-openssl") @@ -246,7 +276,11 @@ list(APPEND configure_opts "-qt-libjpeg") list(APPEND configure_opts "-qt-libpng") list(APPEND configure_opts "-qt-pcre") if(NOT WIN32) - list(APPEND configure_opts "-qt-xkbcommon") + if(HUNTER_Qt_VERSION VERSION_LESS 5.12) + list(APPEND configure_opts "-qt-xkbcommon") + else() + list(APPEND configure_opts "-xkbcommon") + endif() endif() list(APPEND configure_opts "-qt-zlib") ### } @@ -287,7 +321,11 @@ hunter_status_debug("Qt configure options (without -skip): ${configure_opts}") list(APPEND configure_command ${configure_opts}) -set(ANDROID_API_VERSION "${HUNTER_Android-SDK-Platform_VERSION}") +if(ANDROID) + set(ANDROID_API_VERSION "android-${CMAKE_SYSTEM_VERSION}") +else() + set(ANDROID_API_VERSION "") +endif() set(qt_component "@HUNTER_PACKAGE_COMPONENT@") set(hunter_self "@HUNTER_SELF@") @@ -307,7 +345,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 @@ -353,6 +391,8 @@ configure_file( # * ANDROID # * IOS # * HUNTER_Qt_VERSION +# * HUNTER_QT_OS_IS_LINUX +# * BUILD_SHARED_LIBS configure_file( "@HUNTER_PACKAGE_SETUP_DIR@/ep-stages/qt-install.cmake.in" "@HUNTER_PACKAGE_BUILD_DIR@/qt-install.cmake" @@ -367,6 +407,8 @@ configure_file( # * is_release_debug # * is_release # * is_debug +# * global_install_dir +# * HUNTER_QT_OS_IS_LINUX configure_file( "@HUNTER_PACKAGE_SETUP_DIR@/ep-stages/qt-build.cmake.in" "@HUNTER_PACKAGE_BUILD_DIR@/qt-build.cmake" @@ -401,6 +443,8 @@ ExternalProject_Add( SHA1=@HUNTER_PACKAGE_SHA1@ DOWNLOAD_DIR "@HUNTER_PACKAGE_DOWNLOAD_DIR@" + TLS_VERIFY + "@HUNTER_TLS_VERIFY@" SOURCE_DIR "${qt_source_dir}" INSTALL_DIR @@ -437,11 +481,12 @@ ExternalProject_Add( COMMAND "@CMAKE_COMMAND@" -P "${qt_source_dir}/qt-install.cmake" COMMAND # Copy license files - "@CMAKE_COMMAND@" - "-Dsrcdir=@HUNTER_PACKAGE_SOURCE_DIR@" - "-Ddstfile=@HUNTER_PACKAGE_LICENSE_FILE@" - -P - "@HUNTER_GLOBAL_SCRIPT_DIR@/try-copy-license.cmake" + "@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" LOG_BUILD ${log_build} LOG_INSTALL ${log_install} ) diff --git a/cmake/projects/QtAndroidCMake/hunter.cmake b/cmake/projects/QtAndroidCMake/hunter.cmake index 249579aee..14fb7aec0 100644 --- a/cmake/projects/QtAndroidCMake/hunter.cmake +++ b/cmake/projects/QtAndroidCMake/hunter.cmake @@ -7,6 +7,39 @@ include(hunter_add_version) include(hunter_download) include(hunter_pick_scheme) +hunter_add_version( + PACKAGE_NAME + QtAndroidCMake + VERSION + "1.0.9" + URL + "https://github.com/hunter-packages/qt-android-cmake/archive/v1.0.9.tar.gz" + SHA1 + 673f529d84f13e72b54beaf284f742fcb6a33b9d +) + +hunter_add_version( + PACKAGE_NAME + QtAndroidCMake + VERSION + "1.0.8" + URL + "https://github.com/hunter-packages/qt-android-cmake/archive/v1.0.8.tar.gz" + SHA1 + 7d9773fd3df22b39b30f8ff96db93f2f9720d89d +) + +hunter_add_version( + PACKAGE_NAME + QtAndroidCMake + VERSION + "1.0.7" + URL + "https://github.com/hunter-packages/qt-android-cmake/archive/v1.0.7.tar.gz" + SHA1 + e9505011129d769925ec1ecc0ef1af41134f1b5d +) + hunter_add_version( PACKAGE_NAME QtAndroidCMake diff --git a/cmake/projects/QtCMakeExtra/hunter.cmake b/cmake/projects/QtCMakeExtra/hunter.cmake index 037b99358..515022cde 100644 --- a/cmake/projects/QtCMakeExtra/hunter.cmake +++ b/cmake/projects/QtCMakeExtra/hunter.cmake @@ -228,6 +228,149 @@ hunter_add_version( d8fde85d4df5a511c14d175b02a7ee10b46b8615 ) +hunter_add_version( + PACKAGE_NAME + QtCMakeExtra + VERSION + "1.0.20" + URL + "https://github.com/hunter-packages/QtCMakeExtra/archive/v1.0.20.tar.gz" + SHA1 + e2fbc120c0000a9f8e4adb722c95cc514183a17f +) + +hunter_add_version( + PACKAGE_NAME + QtCMakeExtra + VERSION + "1.0.21" + URL + "https://github.com/hunter-packages/QtCMakeExtra/archive/v1.0.21.tar.gz" + SHA1 + 34458c9b59b94be9f4ad96f3b0486f3362cafbbd +) + +hunter_add_version( + PACKAGE_NAME + QtCMakeExtra + VERSION + "1.0.22" + URL + "https://github.com/hunter-packages/QtCMakeExtra/archive/v1.0.22.tar.gz" + SHA1 + 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_add_version( + PACKAGE_NAME + QtCMakeExtra + VERSION + "1.0.28" + URL + "https://github.com/hunter-packages/QtCMakeExtra/archive/v1.0.28.tar.gz" + SHA1 + 940db41b3200ae6be0a559a2f3c0ba10ebb74e41 +) + +hunter_add_version( + PACKAGE_NAME + QtCMakeExtra + VERSION + "1.0.29" + URL + "https://github.com/hunter-packages/QtCMakeExtra/archive/v1.0.29.tar.gz" + SHA1 + e18fc889ffcff5ee14d6d201acc4b7126222f915 +) + +hunter_add_version( + PACKAGE_NAME + QtCMakeExtra + VERSION + "1.0.30" + URL + "https://github.com/hunter-packages/QtCMakeExtra/archive/v1.0.30.tar.gz" + SHA1 + 5b3df0153d8b64a008ffd1dca192c087b5c6b1a3 +) + +hunter_add_version( + PACKAGE_NAME + QtCMakeExtra + VERSION + "1.0.31" + URL + "https://github.com/hunter-packages/QtCMakeExtra/archive/v1.0.31.tar.gz" + SHA1 + 34bcbb076116de994fdd563c2fe071d3c0d24aa5 +) + +hunter_add_version( + PACKAGE_NAME + QtCMakeExtra + VERSION + "1.0.32" + URL + "https://github.com/hunter-packages/QtCMakeExtra/archive/v1.0.32.tar.gz" + SHA1 + 98fbb41190b629d65bee86b4cfadbd0556503b1a +) + +hunter_add_version( + PACKAGE_NAME + QtCMakeExtra + VERSION + "1.0.34" + URL + "https://github.com/hunter-packages/QtCMakeExtra/archive/v1.0.34.tar.gz" + SHA1 + f137ca99fb596ad33310db011c3a713b0c738fad +) + hunter_pick_scheme(DEFAULT url_sha1_cmake) hunter_cacheable(QtCMakeExtra) hunter_download(PACKAGE_NAME QtCMakeExtra) diff --git a/cmake/projects/QtPropertyEditor/hunter.cmake b/cmake/projects/QtPropertyEditor/hunter.cmake new file mode 100644 index 000000000..16a234b85 --- /dev/null +++ b/cmake/projects/QtPropertyEditor/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2018, 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 + QtPropertyEditor + VERSION + 2.1.3-p0 + URL + "https://github.com/hunter-packages/QtPropertyEditor/archive/v2.1.3-p0.tar.gz" + SHA1 + e566457c8f44cbb00d3001d659ed4e164ea57fdf +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(QtPropertyEditor) +hunter_download(PACKAGE_NAME QtPropertyEditor) diff --git a/cmake/projects/Qwt/hunter.cmake b/cmake/projects/Qwt/hunter.cmake new file mode 100644 index 000000000..7d8c9c284 --- /dev/null +++ b/cmake/projects/Qwt/hunter.cmake @@ -0,0 +1,36 @@ +# Copyright (c) 2016-2018, 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) +include(hunter_cmake_args) + +hunter_add_version( + PACKAGE_NAME + Qwt + VERSION + 6.1-p3 + URL + https://github.com/hunter-packages/Qwt/archive/6.1-p3.tar.gz + SHA1 + 9db2e7c254c181b43de414b05cca38152e4b6f88 +) + +hunter_cmake_args( + Qwt + CMAKE_ARGS + LIBQWT_ENABLE_PLOT=ON + LIBQWT_ENABLE_WIDGETS=ON + LIBQWT_ENABLE_MATHML=OFF + LIBQWT_ENABLE_OPENGL=ON + LIBQWT_ENABLE_SVG=ON + +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(Qwt) +hunter_download(PACKAGE_NAME Qwt) diff --git a/cmake/projects/RapidJSON/hunter.cmake b/cmake/projects/RapidJSON/hunter.cmake index 364caf63b..0913ab862 100644 --- a/cmake/projects/RapidJSON/hunter.cmake +++ b/cmake/projects/RapidJSON/hunter.cmake @@ -9,6 +9,28 @@ include(hunter_cmake_args) include(hunter_download) include(hunter_pick_scheme) +hunter_add_version( + PACKAGE_NAME + RapidJSON + VERSION + "1.1.0-66eb606-p0" + URL + "https://github.com/hunter-packages/rapidjson/archive/v1.1.0-66eb606-p0.tar.gz" + SHA1 + 6889242b198cbff7cd8610f214b4218436a4a7a9 +) + +hunter_add_version( + PACKAGE_NAME + RapidJSON + VERSION + "1.1.0" + URL + "https://github.com/hunter-packages/rapidjson/archive/v1.1.0-p0.tar.gz" + SHA1 + 0d97a2d171d5a483338c21b6878f42ea5fe76503 +) + hunter_add_version( PACKAGE_NAME RapidJSON @@ -42,6 +64,17 @@ hunter_add_version( 587ef53d1b82b246f27967fa67eefc1f4c3d1719 ) +hunter_add_version( + PACKAGE_NAME + RapidJSON + VERSION + "0.11-p2" + URL + "https://github.com/hunter-packages/rapidjson/archive/v0.11-p2.tar.gz" + SHA1 + bb0bfb8ad5cf2b575b57efbf2957619735a1696e +) + hunter_add_version( PACKAGE_NAME RapidJSON diff --git a/cmake/projects/RapidXML/hunter.cmake b/cmake/projects/RapidXML/hunter.cmake new file mode 100644 index 000000000..b0514b997 --- /dev/null +++ b/cmake/projects/RapidXML/hunter.cmake @@ -0,0 +1,21 @@ +# !!! 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 + RapidXML + VERSION + "1.13" + URL + "https://github.com/hunter-packages/rapidxml/archive/v1.13-hunter.tar.gz" + SHA1 + d7f9b263a4c1e90dca488d3cf040364339ff09e2 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(RapidXML) +hunter_download(PACKAGE_NAME RapidXML) diff --git a/cmake/projects/RedisClient/hunter.cmake b/cmake/projects/RedisClient/hunter.cmake new file mode 100644 index 000000000..edc7a49fe --- /dev/null +++ b/cmake/projects/RedisClient/hunter.cmake @@ -0,0 +1,32 @@ +# Copyright (c) 2016-2018, 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 + RedisClient + VERSION + 0.6.1-p1 + URL + "https://github.com/hunter-packages/redisclient/archive/v0.6.1-p1.tar.gz" + SHA1 + 0f105334715b512a6c08118b232f6b2f05ce8274 +) + +hunter_cmake_args( + RedisClient + CMAKE_ARGS + BUILD_TEST=OFF + BUILD_EXAMPLES=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(RedisClient) +hunter_download(PACKAGE_NAME RedisClient) diff --git a/cmake/projects/SDL2/hunter.cmake b/cmake/projects/SDL2/hunter.cmake index 3ff235155..f21a8a2a7 100644 --- a/cmake/projects/SDL2/hunter.cmake +++ b/cmake/projects/SDL2/hunter.cmake @@ -6,6 +6,72 @@ include(hunter_download) include(hunter_pick_scheme) include(hunter_cacheable) +hunter_add_version( + PACKAGE_NAME + SDL2 + VERSION + "2.0.4-p8" + URL + "https://github.com/hunter-packages/SDL2/archive/2.0.4-p8.tar.gz" + SHA1 + 568db770b6a137ce576f738638c42df4aa215c31 +) + +hunter_add_version( + PACKAGE_NAME + SDL2 + VERSION + "2.0.4-p7" + URL + "https://github.com/hunter-packages/SDL2/archive/2.0.4-p7.tar.gz" + SHA1 + 3dddf9fc88868ba4aecc5c1e762f79eac0c06b70 +) + +hunter_add_version( + PACKAGE_NAME + SDL2 + VERSION + "2.0.4-p6" + URL + "https://github.com/hunter-packages/SDL2/archive/2.0.4-p6.tar.gz" + SHA1 + c3b1e17ec55112f0a60d32707f70dcda5ac1d2ef +) + +hunter_add_version( + PACKAGE_NAME + SDL2 + VERSION + "2.0.4-p5" + URL + "https://github.com/hunter-packages/SDL2/archive/2.0.4-p5.tar.gz" + SHA1 + 14dcb4c439f0dbd71ad0b92184b35e3a7f29e3ca +) + +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 @@ -28,6 +94,72 @@ hunter_add_version( daebe20807e166f62f3671f742e81e8d2959388b ) +hunter_add_version( + PACKAGE_NAME + SDL2 + VERSION + "2.0.7-p1" + URL + "https://github.com/hunter-packages/SDL2/archive/v2.0.7-p1.tar.gz" + SHA1 + a3550bae876c3b6ca7c160a2ee583f04cb38207a +) + +hunter_add_version( + PACKAGE_NAME + SDL2 + VERSION + "2.0.7-p2" + URL + "https://github.com/hunter-packages/SDL2/archive/v2.0.7-p2.tar.gz" + SHA1 + 276390a8b41667f0f5c9e298825256cf7ac6a24b +) + +hunter_add_version( + PACKAGE_NAME + SDL2 + VERSION + "2.0.7-p3" + URL + "https://github.com/hunter-packages/SDL2/archive/v2.0.7-p3.tar.gz" + SHA1 + ee6639485622d0f81163cd2c7ee5c54c89e85482 +) + +hunter_add_version( + PACKAGE_NAME + SDL2 + VERSION + "2.0.4-urho-p2" + URL + "https://github.com/hunter-packages/SDL2/archive/v2.0.4-urho-p2.tar.gz" + SHA1 + 0d78d5fa59fb009e3ce9125cc518891889d09451 +) + +hunter_add_version( + PACKAGE_NAME + SDL2 + VERSION + "2.0.4-urho-p3" + URL + "https://github.com/hunter-packages/SDL2/archive/v2.0.4-urho-p3.tar.gz" + SHA1 + 4890004c9ba78d5aefe86e75b6197272d535c441 +) + +hunter_add_version( + PACKAGE_NAME + SDL2 + VERSION + "2.0.4-urho-p4" + URL + "https://github.com/hunter-packages/SDL2/archive/v2.0.4-urho-p4.tar.gz" + SHA1 + 580a574f6da1634500448dddf4a73b80c54d168c +) + hunter_pick_scheme(DEFAULT url_sha1_cmake) hunter_cacheable(SDL2) hunter_download(PACKAGE_NAME SDL2) diff --git a/cmake/projects/SDL_image/hunter.cmake b/cmake/projects/SDL_image/hunter.cmake new file mode 100644 index 000000000..b6d93d165 --- /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 000000000..331de5ef8 --- /dev/null +++ b/cmake/projects/SDL_mixer/hunter.cmake @@ -0,0 +1,33 @@ +# !!! 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_add_version( + PACKAGE_NAME + SDL_mixer + VERSION + "2.0.2-p0" + URL + "https://github.com/hunter-packages/SDL_mixer/archive/v2.0.2-p0.tar.gz" + SHA1 + a5c33841d5546611dd707a24553e9bf22cbc24f4 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(SDL_mixer) +hunter_download(PACKAGE_NAME SDL_mixer) diff --git a/cmake/projects/SDL_ttf/hunter.cmake b/cmake/projects/SDL_ttf/hunter.cmake new file mode 100644 index 000000000..2e94083b7 --- /dev/null +++ b/cmake/projects/SDL_ttf/hunter.cmake @@ -0,0 +1,22 @@ +# !!! 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 + SDL_ttf + VERSION + "2.0.14-p0" + URL + "https://github.com/hunter-packages/SDL_ttf/archive/v2.0.14-p0.tar.gz" + SHA1 + cd7f7806b5de657081d558ef1c12033c43522efe +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(SDL_ttf) +hunter_download(PACKAGE_NAME SDL_ttf) diff --git a/cmake/projects/SQLite3/hunter.cmake b/cmake/projects/SQLite3/hunter.cmake deleted file mode 100644 index 73538060b..000000000 --- a/cmake/projects/SQLite3/hunter.cmake +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2015, Ruslan Baratov, Alexandre Pretyman -# All rights reserved. - -# !!! 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 - SQLite3 - VERSION - "autoconf-3080803" - URL - "https://www.sqlite.org/2015/sqlite-autoconf-3080803.tar.gz" - SHA1 - 2fe3f6226a2a08a2e814b97cd53e36bb3c597112 -) - -hunter_configuration_types(SQLite3 CONFIGURATION_TYPES Release) -hunter_pick_scheme(DEFAULT url_sha1_sqlite3_autotools) -hunter_cacheable(SQLite3) -hunter_download( - PACKAGE_NAME SQLite3 - PACKAGE_INTERNAL_DEPS_ID "2" - PACKAGE_UNRELOCATABLE_TEXT_FILES - "lib/libsqlite3.la" - "lib/pkgconfig/sqlite3.pc" -) diff --git a/cmake/projects/SimpleSignal/hunter.cmake b/cmake/projects/SimpleSignal/hunter.cmake new file mode 100644 index 000000000..53ca0de11 --- /dev/null +++ b/cmake/projects/SimpleSignal/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2018, 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 + SimpleSignal + VERSION + 0.0.0-79c3f68-p1 + URL + "https://github.com/hunter-packages/SimpleSignal/archive/v0.0.0-79c3f68-p1.tar.gz" + SHA1 + 27ab940b3d803bb19311b993c76dfaf675aabfdd +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(SimpleSignal) +hunter_download(PACKAGE_NAME SimpleSignal) diff --git a/cmake/projects/Snappy/hunter.cmake b/cmake/projects/Snappy/hunter.cmake new file mode 100644 index 000000000..ad357bf20 --- /dev/null +++ b/cmake/projects/Snappy/hunter.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2019, 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_add_version( + PACKAGE_NAME + Snappy + VERSION + 1.1.7 + URL + "https://github.com/google/snappy/archive/1.1.7.tar.gz" + SHA1 + 1ec676b842fc96fd8a95b03c12758935e7f257b0 +) + +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/Sources-for-Android-SDK/hunter.cmake b/cmake/projects/Sources-for-Android-SDK/hunter.cmake index 03ead9778..8e46dc5ea 100755 --- a/cmake/projects/Sources-for-Android-SDK/hunter.cmake +++ b/cmake/projects/Sources-for-Android-SDK/hunter.cmake @@ -53,5 +53,16 @@ hunter_add_version( 0f83c14ed333c45d962279ab5d6bc98a0269ef84 ) +hunter_add_version( + PACKAGE_NAME + Sources-for-Android-SDK + VERSION + "24" # version affects layout: /sources/android-24 + URL + "http://dl-ssl.google.com/android/repository/sources-24_r01.zip" + SHA1 + 6b96115830a83d654479f32ce4b724ca9011148b +) + hunter_pick_scheme(DEFAULT url_sha1_unpack) hunter_download(PACKAGE_NAME Sources-for-Android-SDK) diff --git a/cmake/projects/Sqlpp11/hunter.cmake b/cmake/projects/Sqlpp11/hunter.cmake new file mode 100644 index 000000000..22db33c4c --- /dev/null +++ b/cmake/projects/Sqlpp11/hunter.cmake @@ -0,0 +1,30 @@ +# 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) +include(hunter_cmake_args) + +hunter_add_version( + PACKAGE_NAME + Sqlpp11 + VERSION + 0.57-p0 + URL + https://github.com/hunter-packages/sqlpp11/archive/v0.57-p0.tar.gz + SHA1 + 472f23489f9a063d2b9a492910ea59a36bc55263 +) + +hunter_cmake_args(Sqlpp11 CMAKE_ARGS + ENABLE_TESTS=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(Sqlpp11) +hunter_download(PACKAGE_NAME Sqlpp11) + diff --git a/cmake/projects/Sugar/hunter.cmake b/cmake/projects/Sugar/hunter.cmake deleted file mode 100644 index 1fd4c0fa2..000000000 --- a/cmake/projects/Sugar/hunter.cmake +++ /dev/null @@ -1,187 +0,0 @@ -# Copyright (c) 2013, Ruslan Baratov -# All rights reserved. - -# !!! DO NOT PLACE HEADER GUARDS HERE !!! - -include(hunter_add_version) -include(hunter_download) -include(hunter_pick_scheme) - -hunter_add_version( - PACKAGE_NAME - Sugar - VERSION - "1.0.0" - URL - "https://github.com/ruslo/sugar/archive/v1.0.0.tar.gz" - SHA1 - 3f1360e447dd23d3db9ce010e217053deb6aebde -) - -hunter_add_version( - PACKAGE_NAME - Sugar - VERSION - "1.0.1" - URL - "https://github.com/ruslo/sugar/archive/v1.0.1.tar.gz" - SHA1 - 1a8e29badc0e97913996e5228dc9b1788284e416 -) - -hunter_add_version( - PACKAGE_NAME - Sugar - VERSION - "1.0.2" - URL - "https://github.com/ruslo/sugar/archive/v1.0.2.tar.gz" - SHA1 - 393a2c190f76f52b253089d0a03c08de562a8622 -) - -hunter_add_version( - PACKAGE_NAME - Sugar - VERSION - "1.0.3" - URL - "https://github.com/ruslo/sugar/archive/v1.0.3.tar.gz" - SHA1 - d0929748df6c4cc7126863d5799018e513c73f27 -) - -hunter_add_version( - PACKAGE_NAME - Sugar - VERSION - "1.0.4" - URL - "https://github.com/ruslo/sugar/archive/v1.0.4.tar.gz" - SHA1 - f5547294647ed386e7bed7fc489f1ba53ab30b57 -) - -hunter_add_version( - PACKAGE_NAME - Sugar - VERSION - "1.0.5" - URL - "https://github.com/ruslo/sugar/archive/v1.0.5.tar.gz" - SHA1 - 0b410ec9576be60ac86bf81cf74def4b79efd342 -) - -hunter_add_version( - PACKAGE_NAME - Sugar - VERSION - "1.0.6" - URL - "https://github.com/ruslo/sugar/archive/v1.0.6.tar.gz" - SHA1 - 6979695f6802b2c980e453dc2eb3ca1ab6bb9fe0 -) - -hunter_add_version( - PACKAGE_NAME - Sugar - VERSION - "1.0.7" - URL - "https://github.com/ruslo/sugar/archive/v1.0.7.tar.gz" - SHA1 - a364edec71e6d52b809efba833e3041402d2a267 -) - -hunter_add_version( - PACKAGE_NAME - Sugar - VERSION - "1.0.8" - URL - "https://github.com/ruslo/sugar/archive/v1.0.8.tar.gz" - SHA1 - eca1cd13c0399c50c257dcb679c04ca8177307b8 -) - -hunter_add_version( - PACKAGE_NAME - Sugar - VERSION - "1.0.9" - URL - "https://github.com/ruslo/sugar/archive/v1.0.9.tar.gz" - SHA1 - fca4165caa3faa2ec88e207ea009927020e443cb -) - -hunter_add_version( - PACKAGE_NAME - Sugar - VERSION - "1.0.10" - URL - "https://github.com/ruslo/sugar/archive/v1.0.10.tar.gz" - SHA1 - ca73f6599986089968b112394e9bc7cbb253c574 -) - -hunter_add_version( - PACKAGE_NAME - Sugar - VERSION - "1.0.11" - URL - "https://github.com/ruslo/sugar/archive/v1.0.11.tar.gz" - SHA1 - ce98a7090a7fbc0197310c7299746568fddf6a43 -) - -hunter_add_version( - PACKAGE_NAME - Sugar - VERSION - "1.1.0" - URL - "https://github.com/ruslo/sugar/archive/v1.1.0.tar.gz" - SHA1 - 29bf1bb1f9920781ab17e8a5c9e329f308be03a8 -) - -hunter_add_version( - PACKAGE_NAME - Sugar - VERSION - "1.2.0" - URL - "https://github.com/ruslo/sugar/archive/v1.2.0.tar.gz" - SHA1 - cf9e625d6cadcae3c391cdb799171fd4889bc086 -) - -hunter_add_version( - PACKAGE_NAME - Sugar - VERSION - "1.2.1" - URL - "https://github.com/ruslo/sugar/archive/v1.2.1.tar.gz" - SHA1 - 7943038d1c3a418ae1a91ca95ec839cf06f166da -) - -hunter_add_version( - PACKAGE_NAME - Sugar - VERSION - "1.2.2" - URL - "https://github.com/ruslo/sugar/archive/v1.2.2.tar.gz" - SHA1 - f33ac0045d6ee4582d41f5290010802ad72fe2fa -) - -hunter_pick_scheme(DEFAULT url_sha1_unpack) -hunter_download(PACKAGE_NAME Sugar) diff --git a/cmake/projects/SuiteSparse/hunter.cmake b/cmake/projects/SuiteSparse/hunter.cmake new file mode 100644 index 000000000..7a53db434 --- /dev/null +++ b/cmake/projects/SuiteSparse/hunter.cmake @@ -0,0 +1,66 @@ +# 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 +) +## suitesparse-metis-for-windows version is 1.4.0 +## suitesparse library version is 5.1.2 +hunter_add_version( + PACKAGE_NAME + SuiteSparse + VERSION + "5.1.2-p0" + URL + "https://github.com/hunter-packages/suitesparse-metis-for-windows/archive/v1.4.0-p0.tar.gz" + SHA1 + 6ea701f288a51bc57f1db5918c6b0879d800ed28 +) + + +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/TCLAP/hunter.cmake b/cmake/projects/TCLAP/hunter.cmake new file mode 100644 index 000000000..6a2ac3fb0 --- /dev/null +++ b/cmake/projects/TCLAP/hunter.cmake @@ -0,0 +1,27 @@ + +# by Cyberunner23 +# for the Hunter project + +# !!! 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 + TCLAP + VERSION + 1.2.2-p1 + URL + "https://github.com/hunter-packages/tclap/archive/v1.2.2-p1.zip" + SHA1 + c31f3b37c5f1cc34e802000e338d3f04a4d5da79 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(TCLAP) +hunter_download(PACKAGE_NAME TCLAP) + diff --git a/cmake/projects/TIFF/hunter.cmake b/cmake/projects/TIFF/hunter.cmake index 902160a30..4d85dfc4f 100644 --- a/cmake/projects/TIFF/hunter.cmake +++ b/cmake/projects/TIFF/hunter.cmake @@ -52,6 +52,28 @@ hunter_add_version( 37c71656488797c4e5fde620570f1a1b9be36037 ) +hunter_add_version( + PACKAGE_NAME + TIFF + VERSION + "4.0.2-p4" + URL + "https://github.com/hunter-packages/tiff/archive/v4.0.2-p4.tar.gz" + SHA1 + 9ab44e0136d3da04b0a559d7ba57bd075afc48f9 +) + +hunter_add_version( + PACKAGE_NAME + TIFF + VERSION + "4.0.2-p5" + URL + "https://github.com/hunter-packages/tiff/archive/v4.0.2-p5.tar.gz" + SHA1 + 7bee2843b47c5f9865973b7235e58aa3fb26e1b0 +) + hunter_pick_scheme(DEFAULT url_sha1_cmake) hunter_cacheable(TIFF) hunter_download(PACKAGE_NAME TIFF) diff --git a/cmake/projects/Tesseract/hunter.cmake b/cmake/projects/Tesseract/hunter.cmake new file mode 100644 index 000000000..294a6ecd0 --- /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/Urho3D/hunter.cmake b/cmake/projects/Urho3D/hunter.cmake new file mode 100644 index 000000000..9b175ed3a --- /dev/null +++ b/cmake/projects/Urho3D/hunter.cmake @@ -0,0 +1,139 @@ +# Copyright (c) 2016-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 + Urho3D + VERSION + 1.7-p2 + URL + "https://github.com/hunter-packages/Urho3D/archive/v1.7-p2.tar.gz" + SHA1 + c828fad52e40475e34aa9829eb733dfe690b8942 +) + +hunter_add_version( + PACKAGE_NAME + Urho3D + VERSION + 1.7-p4 + URL + "https://github.com/hunter-packages/Urho3D/archive/v1.7-p4.tar.gz" + SHA1 + af0daeaa7be483ed98830b5080cfab54976db47e +) + +hunter_add_version( + PACKAGE_NAME + Urho3D + VERSION + 1.7-p5 + URL + "https://github.com/hunter-packages/Urho3D/archive/v1.7-p5.tar.gz" + SHA1 + 42bc93e302c8e35312fa966f4a9b1faf3ac8db7f +) + +hunter_add_version( + PACKAGE_NAME + Urho3D + VERSION + 1.7-p6 + URL + "https://github.com/hunter-packages/Urho3D/archive/v1.7-p6.tar.gz" + SHA1 + b75bc0de6ff64c403f45a39d27d60a7cd6363038 +) + +hunter_add_version( + PACKAGE_NAME + Urho3D + VERSION + 1.7-p7 + URL + "https://github.com/hunter-packages/Urho3D/archive/v1.7-p7.tar.gz" + SHA1 + 66b296e00edee7ba65c211a892e5ac0ae9a8877d +) + +hunter_add_version( + PACKAGE_NAME + Urho3D + VERSION + 1.7-p8 + URL + "https://github.com/hunter-packages/Urho3D/archive/v1.7-p8.tar.gz" + SHA1 + c150a5495a317ad2d92187d31388d42a8d413434 +) + +hunter_add_version( + PACKAGE_NAME + Urho3D + VERSION + 1.7-p9 + URL + "https://github.com/hunter-packages/Urho3D/archive/v1.7-p9.tar.gz" + SHA1 + df696bba70384368a703c3650988e91951ce51f1 +) + +hunter_add_version( + PACKAGE_NAME + Urho3D + VERSION + 1.7-p12 + URL + "https://github.com/hunter-packages/Urho3D/archive/v1.7-p12.tar.gz" + SHA1 + 1c6258cce46018d8386cf836bfda8fdfbfe225f6 +) + +hunter_add_version( + PACKAGE_NAME + Urho3D + VERSION + 1.7-p13 + URL + "https://github.com/hunter-packages/Urho3D/archive/v1.7-p13.tar.gz" + SHA1 + 9dc5df770d7b454feb880ada76bcc0868879adfb +) + +hunter_add_version( + PACKAGE_NAME + Urho3D + VERSION + 1.7-p15 + URL + "https://github.com/hunter-packages/Urho3D/archive/v1.7-p15.tar.gz" + SHA1 + 2413d786c419845fdcb062c102f810503ddd09d4 +) + +hunter_cmake_args( + Urho3D + CMAKE_ARGS + URHO3D_ANGELSCRIPT=ON + URHO3D_DATABASE_ODBC=OFF + URHO3D_DATABASE_SQLITE=ON + URHO3D_LUA=ON + URHO3D_NAVIGATION=ON + URHO3D_NETWORK=ON + URHO3D_PCH=OFF + URHO3D_PHYSICS=ON + URHO3D_SAMPLES=OFF + URHO3D_URHO2D=ON +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(Urho3D) +hunter_download(PACKAGE_NAME Urho3D) diff --git a/cmake/projects/VulkanMemoryAllocator/hunter.cmake b/cmake/projects/VulkanMemoryAllocator/hunter.cmake new file mode 100644 index 000000000..102fd0269 --- /dev/null +++ b/cmake/projects/VulkanMemoryAllocator/hunter.cmake @@ -0,0 +1,35 @@ +# Copyright (c) 2016-2018, 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 + VulkanMemoryAllocator + VERSION + 2.1.0-p0 + URL + "https://github.com/hunter-packages/VulkanMemoryAllocator/archive/v2.1.0-p0.tar.gz" + SHA1 + 3c09ea611290039ee58baa8971da424f46a4534c +) + +hunter_add_version( + PACKAGE_NAME + VulkanMemoryAllocator + VERSION + 2.0.0-p0 + URL + "https://github.com/hunter-packages/VulkanMemoryAllocator/archive/v2.0.0-p0.tar.gz" + SHA1 + f3b38054d2062563cf7cca66bd2e3fc8b9df832d +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(VulkanMemoryAllocator) +hunter_download(PACKAGE_NAME VulkanMemoryAllocator) diff --git a/cmake/projects/WDC/hunter.cmake b/cmake/projects/WDC/hunter.cmake new file mode 100644 index 000000000..e414a2d48 --- /dev/null +++ b/cmake/projects/WDC/hunter.cmake @@ -0,0 +1,67 @@ +# !!! 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.5" + URL "https://github.com/CloudPolis/webdav-client-cpp/archive/v1.1.5.tar.gz" + SHA1 652e3ea6e873b8b97fab9e95bd30a347c3329809 +) + +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/WebKit/hunter.cmake b/cmake/projects/WebKit/hunter.cmake new file mode 100644 index 000000000..43e06d92e --- /dev/null +++ b/cmake/projects/WebKit/hunter.cmake @@ -0,0 +1,51 @@ +# Copyright (c) 2016-2018, 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) + +hunter_add_version( + PACKAGE_NAME + WebKit + VERSION + 0.0.2 + URL + "https://github.com/hunter-packages/WebKit/archive/v0.0.2.tar.gz" + SHA1 + 2da25c0485984e8ffb236050316d454e6c0ff849 +) + +hunter_add_version( + PACKAGE_NAME + WebKit + VERSION + 0.0.2-p0 + URL + "https://github.com/hunter-packages/WebKit/archive/v0.0.2-p0.tar.gz" + SHA1 + a7becb00409bd2731040b175dd4fe69792014714 +) + +hunter_cmake_args( + WebKit + CMAKE_ARGS + PORT=JSCOnly + ENABLE_TOOLS=OFF + ENABLE_API_TESTS=OFF + ENABLE_WEBCORE=OFF + ENABLE_WEBKIT=OFF + ENABLE_JIT=ON +) + +# Package is pretty big + Debug is not working on Android +hunter_configuration_types(WebKit CONFIGURATION_TYPES Release) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(WebKit) +hunter_download(PACKAGE_NAME WebKit) diff --git a/cmake/projects/WebP/hunter.cmake b/cmake/projects/WebP/hunter.cmake new file mode 100644 index 000000000..a8d466656 --- /dev/null +++ b/cmake/projects/WebP/hunter.cmake @@ -0,0 +1,128 @@ +# Copyright (c) 2018, Ruslan Baratov +# Copyright (c) 2018, Mathieu-Andre Chiasson +# 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) + +hunter_add_version( + PACKAGE_NAME + WebP + VERSION + "0.6.1-p2" + URL + "https://github.com/hunter-packages/libwebp/archive/v0.6.1-p2.tar.gz" + SHA1 + 533f0f09be3134dd8c3d76be267bef56d1a1f4a2 +) + +hunter_add_version( + PACKAGE_NAME + WebP + VERSION + "0.6.1-p3" + URL + "https://github.com/hunter-packages/libwebp/archive/v0.6.1-p3.tar.gz" + SHA1 + bcce817366c9ba5f42d36130d973dc2f072e2862 +) + +hunter_add_version( + PACKAGE_NAME + WebP + VERSION + "0.6.1-p4" + URL + "https://github.com/hunter-packages/libwebp/archive/v0.6.1-p4.tar.gz" + SHA1 + 982223088b7594608861d25d716cdfa5f72c26c7 +) + +hunter_add_version( + PACKAGE_NAME + WebP + VERSION + "1.0.2-p0" + URL + "https://github.com/hunter-packages/libwebp/archive/v1.0.2-p0.tar.gz" + SHA1 + 2b5aba3283e1f61b7d3c60a9b9eb97c3910806c1 +) + +hunter_add_version( + PACKAGE_NAME + WebP + VERSION + "1.0.2-p2" + URL + "https://github.com/hunter-packages/libwebp/archive/v1.0.2-p2.tar.gz" + SHA1 + 58d3784b1552a03678bc35e5f38b35b356d528d9 +) + +hunter_add_version( + PACKAGE_NAME + WebP + VERSION + "1.0.2-p3" + URL + "https://github.com/hunter-packages/libwebp/archive/v1.0.2-p3.tar.gz" + SHA1 + f29c5354f31b91b4f9a73e6b0426af19e25d4ea2 +) + +set( + _hunter_webp_cmake_args + WEBP_BUILD_WEBP_JS=OFF + WEBP_ENABLE_NEAR_LOSSLESS=ON + WEBP_ENABLE_SIMD=ON + WEBP_ENABLE_SWAP_16BIT_CSP=OFF + WEBP_EXPERIMENTAL_FEATURES=OFF +) + +if(ANDROID OR IOS) + list( + APPEND + _hunter_webp_cmake_args + WEBP_BUILD_ANIM_UTILS=OFF + WEBP_BUILD_CWEBP=OFF + WEBP_BUILD_DWEBP=OFF + WEBP_BUILD_EXTRAS=OFF + WEBP_BUILD_GIF2WEBP=OFF + WEBP_BUILD_IMG2WEBP=OFF + WEBP_BUILD_WEBPINFO=OFF + WEBP_BUILD_WEBPMUX=OFF + ) +else() + list( + APPEND + _hunter_webp_cmake_args + WEBP_BUILD_CWEBP=ON + WEBP_BUILD_DWEBP=ON + WEBP_BUILD_GIF2WEBP=ON + WEBP_BUILD_IMG2WEBP=ON + WEBP_BUILD_WEBPINFO=ON + ) +endif() + +if(APPLE) + # FindGLUT issue: + # - https://travis-ci.org/ingenue/hunter/jobs/502944277 + list( + APPEND + _hunter_webp_cmake_args + WEBP_BUILD_VWEBP=OFF + ) +endif() + +hunter_cmake_args(WebP CMAKE_ARGS ${_hunter_webp_cmake_args}) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(WebP) +hunter_download(PACKAGE_NAME WebP) diff --git a/cmake/projects/YAJL/hunter.cmake b/cmake/projects/YAJL/hunter.cmake new file mode 100644 index 000000000..b3983a41b --- /dev/null +++ b/cmake/projects/YAJL/hunter.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2016-2019, 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 + YAJL + VERSION + 2.1.0-p0 + URL + "https://github.com/hunter-packages/yajl/archive/v2.1.0-p0.tar.gz" + SHA1 + d2dc11da34efb5148e6b84f43ba08783f1aefef4 +) + +hunter_cmake_args( + YAJL + CMAKE_ARGS + YAJL_BUILD_TOOLS=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(YAJL) +hunter_download(PACKAGE_NAME YAJL) diff --git a/cmake/projects/ZLIB/hunter.cmake b/cmake/projects/ZLIB/hunter.cmake index 49d54e690..fd279f097 100755 --- a/cmake/projects/ZLIB/hunter.cmake +++ b/cmake/projects/ZLIB/hunter.cmake @@ -12,11 +12,22 @@ hunter_add_version( PACKAGE_NAME ZLIB VERSION - "1.2.8-p3" + "1.2.8-hunter" URL - "https://github.com/hunter-packages/zlib/archive/v1.2.8-p3.tar.gz" + "https://github.com/hunter-packages/zlib/archive/v1.2.8-hunter.tar.gz" SHA1 - 573dc28474be47d0c7abc1475a14aa12f0dfcadc + 75a05fcc928ed52e1eeb93f07a1c78a7890860c0 +) + +hunter_add_version( + PACKAGE_NAME + ZLIB + VERSION + "1.2.8-hunter-1" + URL + "https://github.com/hunter-packages/zlib/archive/v1.2.8-hunter-1.tar.gz" + SHA1 + 24c89e4b193a56bb411fa9878968002ebe2c6209 ) hunter_add_version( @@ -34,24 +45,39 @@ hunter_add_version( PACKAGE_NAME ZLIB VERSION - "1.2.8-hunter-1" + "1.2.8-p3" URL - "https://github.com/hunter-packages/zlib/archive/v1.2.8-hunter-1.tar.gz" + "https://github.com/hunter-packages/zlib/archive/v1.2.8-p3.tar.gz" SHA1 - 24c89e4b193a56bb411fa9878968002ebe2c6209 + 573dc28474be47d0c7abc1475a14aa12f0dfcadc ) hunter_add_version( PACKAGE_NAME ZLIB VERSION - "1.2.8-hunter" + "1.2.11-p0" URL - "https://github.com/hunter-packages/zlib/archive/v1.2.8-hunter.tar.gz" + "https://github.com/hunter-packages/zlib/archive/v1.2.11-p0.tar.gz" SHA1 - 75a05fcc928ed52e1eeb93f07a1c78a7890860c0 + 9ced8b310aa341af7f3584bac0b2d2a669d2178b +) + +hunter_add_version( + PACKAGE_NAME + ZLIB + VERSION + "1.2.11-p1" + URL + "https://github.com/hunter-packages/zlib/archive/v1.2.11-p1.tar.gz" + SHA1 + fbb8be77db5cb3f4d1b269f273a357d22ccc4b32 ) hunter_pick_scheme(DEFAULT url_sha1_cmake) hunter_cacheable(ZLIB) -hunter_download(PACKAGE_NAME ZLIB) +hunter_download(PACKAGE_NAME ZLIB + PACKAGE_INTERNAL_DEPS_ID "1" + PACKAGE_UNRELOCATABLE_TEXT_FILES + "share/pkgconfig/zlib.pc" +) diff --git a/cmake/projects/ZMQPP/hunter.cmake b/cmake/projects/ZMQPP/hunter.cmake index 3861e0f42..84ca31127 100644 --- a/cmake/projects/ZMQPP/hunter.cmake +++ b/cmake/projects/ZMQPP/hunter.cmake @@ -16,6 +16,28 @@ hunter_add_version( 549d2d0078ed636d90ed0febe687a058bdd0d64d ) +hunter_add_version( + PACKAGE_NAME + ZMQPP + VERSION + "4.1.2-p3" + URL + "https://github.com/hunter-packages/zmqpp/archive/v4.1.2-p3.tar.gz" + SHA1 + fdc3a0d5a4e907c79709ec2fc3fcf4105ff1b91a + ) + +hunter_add_version( + PACKAGE_NAME + ZMQPP + VERSION + "4.2.0-p0" + URL + "https://github.com/hunter-packages/zmqpp/archive/v4.2.0-p0.tar.gz" + SHA1 + 0cf43d00fa22d26c5bf7a3c5d9f5f5c72cc92982 + ) + hunter_pick_scheme(DEFAULT url_sha1_cmake) hunter_cacheable(ZMQPP) hunter_download(PACKAGE_NAME ZMQPP) diff --git a/cmake/projects/ZeroMQ/hunter.cmake b/cmake/projects/ZeroMQ/hunter.cmake index 39001d56c..fa0ac4bd3 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/acf/hunter.cmake b/cmake/projects/acf/hunter.cmake new file mode 100644 index 000000000..c0184b44d --- /dev/null +++ b/cmake/projects/acf/hunter.cmake @@ -0,0 +1,77 @@ +# 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 + acf + VERSION + 0.0.1 + URL + "https://github.com/elucideye/acf/archive/v0.0.1.tar.gz" + SHA1 + 985bd3005b14120625e3684a8596d499bfc23a48 + ) + +hunter_add_version( + PACKAGE_NAME + acf + VERSION + 0.0.2 + URL + "https://github.com/elucideye/acf/archive/v0.0.2.tar.gz" + SHA1 + 0b2c6a2584539f1825eabc928e4b2abc7d16bbac + ) + +hunter_add_version( + PACKAGE_NAME + acf + VERSION + 0.1.3 + URL + "https://github.com/elucideye/acf/archive/v0.1.3.tar.gz" + SHA1 + 7df65c31312e6f364895dae249bb4fc9f20a8d7c +) + +hunter_add_version( + PACKAGE_NAME + acf + VERSION + 0.1.13 + URL + "https://github.com/elucideye/acf/archive/v0.1.13.tar.gz" + SHA1 + ab74bd7a6eead7f2fc1ca5c4d95b2d970f10cc71 +) + +hunter_add_version( + PACKAGE_NAME + acf + VERSION + 0.1.14 + URL + "https://github.com/elucideye/acf/archive/v0.1.14.tar.gz" + SHA1 + 79f9ccba6c8078c2831d68bb25c7bb40a17740ef +) + +hunter_cmake_args(acf CMAKE_ARGS + ACF_BUILD_OGLES_GPGPU=ON # optional opengl shaders on + ACF_USE_DRISHTI_CACHE=OFF # use hunter cache + ACF_BUILD_EXAMPLES=OFF + ACF_BUILD_TESTS=OFF + ) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(acf) +hunter_download(PACKAGE_NAME acf) diff --git a/cmake/projects/actionlib/hunter.cmake b/cmake/projects/actionlib/hunter.cmake new file mode 100644 index 000000000..b1b6c3994 --- /dev/null +++ b/cmake/projects/actionlib/hunter.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2016-2019, 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) +include(hunter_cmake_args) + +hunter_add_version( + PACKAGE_NAME + actionlib + VERSION + 1.11.13-p0 + URL + "https://github.com/hunter-packages/actionlib/archive/v1.11.13-p0.tar.gz" + SHA1 + f8efaa72ea2d28727832b99b1900f1c1bd21c438 +) + +hunter_cmake_args( + actionlib + CMAKE_ARGS + CATKIN_ENABLE_TESTING:BOOL=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(actionlib) +hunter_download(PACKAGE_NAME actionlib) diff --git a/cmake/projects/aes/hunter.cmake b/cmake/projects/aes/hunter.cmake new file mode 100644 index 000000000..2d0cf381d --- /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 000000000..63ecd5014 --- /dev/null +++ b/cmake/projects/aglet/hunter.cmake @@ -0,0 +1,69 @@ +# 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_add_version( + PACKAGE_NAME + aglet + VERSION + 1.2.1 + URL + "https://github.com/elucideye/aglet/archive/v1.2.1.tar.gz" + SHA1 + bbd0c7ec9e5b559aba05aabdeffefb843f76edb8 +) + +hunter_add_version( + PACKAGE_NAME + aglet + VERSION + 1.2.2 + URL + "https://github.com/elucideye/aglet/archive/v1.2.2.tar.gz" + SHA1 + cf82d02ec34583f8a878be8f331279445b5b53e2 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(aglet) +hunter_download(PACKAGE_NAME aglet) diff --git a/cmake/projects/android_arm64_v8a_system_image_packer/hunter.cmake b/cmake/projects/android_arm64_v8a_system_image_packer/hunter.cmake new file mode 100644 index 000000000..6bee554be --- /dev/null +++ b/cmake/projects/android_arm64_v8a_system_image_packer/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2018, 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 + android_arm64_v8a_system_image_packer + VERSION + 1.0.0 + URL + "https://github.com/hunter-packages/android_arm64_v8a_system_image_packer/archive/v1.0.0.tar.gz" + SHA1 + e11d0b19f4d542c2a1347fb7d813a8efa9031622 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(android_arm64_v8a_system_image_packer) +hunter_download(PACKAGE_NAME android_arm64_v8a_system_image_packer) diff --git a/cmake/projects/android_arm_eabi_v7a_system_image_packer/hunter.cmake b/cmake/projects/android_arm_eabi_v7a_system_image_packer/hunter.cmake new file mode 100644 index 000000000..f6911d200 --- /dev/null +++ b/cmake/projects/android_arm_eabi_v7a_system_image_packer/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2018, 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 + android_arm_eabi_v7a_system_image_packer + VERSION + 1.0 + URL + "https://github.com/hunter-packages/android_arm_eabi_v7a_system_image_packer/archive/v1.0.tar.gz" + SHA1 + a7a2e11c0fc621363600852a6e7e92d11781f554 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(android_arm_eabi_v7a_system_image_packer) +hunter_download(PACKAGE_NAME android_arm_eabi_v7a_system_image_packer) diff --git a/cmake/projects/android_build_tools_packer/hunter.cmake b/cmake/projects/android_build_tools_packer/hunter.cmake new file mode 100644 index 000000000..20e5e41b2 --- /dev/null +++ b/cmake/projects/android_build_tools_packer/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2018, 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 + android_build_tools_packer + VERSION + 1.0.0 + URL + "https://github.com/hunter-packages/android_build_tools_packer/archive/v1.0.0.tar.gz" + SHA1 + dcbd65c26c30d43c52c8dbb5a764201b3d270f55 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(android_build_tools_packer) +hunter_download(PACKAGE_NAME android_build_tools_packer) diff --git a/cmake/projects/android_google_apis_intel_x86_atom_system_image_packer/hunter.cmake b/cmake/projects/android_google_apis_intel_x86_atom_system_image_packer/hunter.cmake new file mode 100644 index 000000000..9e3ecbcfe --- /dev/null +++ b/cmake/projects/android_google_apis_intel_x86_atom_system_image_packer/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2018, 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 + android_google_apis_intel_x86_atom_system_image_packer + VERSION + 1.0.0 + URL + "https://github.com/hunter-packages/android_google_apis_intel_x86_atom_system_image_packer/archive/v1.0.0.tar.gz" + SHA1 + beb881562b055e0c6a050f26c5f14512793e9330 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(android_google_apis_intel_x86_atom_system_image_packer) +hunter_download(PACKAGE_NAME android_google_apis_intel_x86_atom_system_image_packer) diff --git a/cmake/projects/android_google_apis_packer/hunter.cmake b/cmake/projects/android_google_apis_packer/hunter.cmake new file mode 100644 index 000000000..ddb743488 --- /dev/null +++ b/cmake/projects/android_google_apis_packer/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2018, 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 + android_google_apis_packer + VERSION + 1.0.0 + URL + "https://github.com/hunter-packages/android_google_apis_packer/archive/v1.0.0.tar.gz" + SHA1 + aa0567990152846ee8c9aedb401bd8e6b0bdb67d +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(android_google_apis_packer) +hunter_download(PACKAGE_NAME android_google_apis_packer) diff --git a/cmake/projects/android_google_repository_packer/hunter.cmake b/cmake/projects/android_google_repository_packer/hunter.cmake new file mode 100644 index 000000000..fce402bc8 --- /dev/null +++ b/cmake/projects/android_google_repository_packer/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2018, 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 + android_google_repository_packer + VERSION + 1.0.0 + URL + "https://github.com/hunter-packages/android_google_repository_packer/archive/v1.0.0.tar.gz" + SHA1 + 0ed84e8bae92cc4f4d0a5eabd880299cd660624a +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(android_google_repository_packer) +hunter_download(PACKAGE_NAME android_google_repository_packer) diff --git a/cmake/projects/android_intel_x86_atom_system_image_packer/hunter.cmake b/cmake/projects/android_intel_x86_atom_system_image_packer/hunter.cmake new file mode 100644 index 000000000..d9078052b --- /dev/null +++ b/cmake/projects/android_intel_x86_atom_system_image_packer/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2018, 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 + android_intel_x86_atom_system_image_packer + VERSION + 1.0.0 + URL + "https://github.com/hunter-packages/android_intel_x86_atom_system_image_packer/archive/v1.0.0.tar.gz" + SHA1 + fb5c8373370c41ae2291825ff03ae50fbd244b09 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(android_intel_x86_atom_system_image_packer) +hunter_download(PACKAGE_NAME android_intel_x86_atom_system_image_packer) diff --git a/cmake/projects/android_mips_system_image_packer/hunter.cmake b/cmake/projects/android_mips_system_image_packer/hunter.cmake new file mode 100644 index 000000000..57fa0d920 --- /dev/null +++ b/cmake/projects/android_mips_system_image_packer/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2018, 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 + android_mips_system_image_packer + VERSION + 1.0.0 + URL + "https://github.com/hunter-packages/android_mips_system_image_packer/archive/v1.0.0.tar.gz" + SHA1 + 0b5b6d0771b6986ae50f6f7813c98608584bc31a +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(android_mips_system_image_packer) +hunter_download(PACKAGE_NAME android_mips_system_image_packer) diff --git a/cmake/projects/android_sdk_packer/hunter.cmake b/cmake/projects/android_sdk_packer/hunter.cmake new file mode 100644 index 000000000..fa83f9a44 --- /dev/null +++ b/cmake/projects/android_sdk_packer/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2018, 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 + android_sdk_packer + VERSION + 1.0.0 + URL + "https://github.com/hunter-packages/android_sdk_packer/archive/v1.0.0.tar.gz" + SHA1 + 9b32b707535d59f036d2600a1d876a0ca28a472e +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(android_sdk_packer) +hunter_download(PACKAGE_NAME android_sdk_packer) diff --git a/cmake/projects/android_sdk_platform_packer/hunter.cmake b/cmake/projects/android_sdk_platform_packer/hunter.cmake new file mode 100644 index 000000000..0c4319ed2 --- /dev/null +++ b/cmake/projects/android_sdk_platform_packer/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2018, 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 + android_sdk_platform_packer + VERSION + 1.0.0 + URL + "https://github.com/hunter-packages/android_sdk_platform_packer/archive/v1.0.0.tar.gz" + SHA1 + b99ffa829d6f0a80c02a038ccb24061881fb4d73 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(android_sdk_platform_packer) +hunter_download(PACKAGE_NAME android_sdk_platform_packer) diff --git a/cmake/projects/android_sdk_platform_tools_packer/hunter.cmake b/cmake/projects/android_sdk_platform_tools_packer/hunter.cmake new file mode 100644 index 000000000..228db686d --- /dev/null +++ b/cmake/projects/android_sdk_platform_tools_packer/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2018, 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 + android_sdk_platform_tools_packer + VERSION + 1.0.0 + URL + "https://github.com/hunter-packages/android_sdk_platform_tools_packer/archive/v1.0.0.tar.gz" + SHA1 + 4d5ac574a9e6e67f6c122fcc984a3a026bc0bc24 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(android_sdk_platform_tools_packer) +hunter_download(PACKAGE_NAME android_sdk_platform_tools_packer) diff --git a/cmake/projects/android_sdk_tools_packer/hunter.cmake b/cmake/projects/android_sdk_tools_packer/hunter.cmake new file mode 100644 index 000000000..c7268c08c --- /dev/null +++ b/cmake/projects/android_sdk_tools_packer/hunter.cmake @@ -0,0 +1,57 @@ +# Copyright (c) 2016-2018, 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 + android_sdk_tools_packer + VERSION + 1.0.0 + URL + "https://github.com/hunter-packages/android_sdk_tools_packer/archive/v1.0.0.tar.gz" + SHA1 + cff5f8931e74f3635b94282c7e0958fdd8cb740e +) + +hunter_add_version( + PACKAGE_NAME + android_sdk_tools_packer + VERSION + 1.0.1 + URL + "https://github.com/hunter-packages/android_sdk_tools_packer/archive/v1.0.1.tar.gz" + SHA1 + 06f6788c558ee5891d07301208260fbc64545768 +) + +hunter_add_version( + PACKAGE_NAME + android_sdk_tools_packer + VERSION + 1.0.2 + URL + "https://github.com/hunter-packages/android_sdk_tools_packer/archive/v1.0.2.tar.gz" + SHA1 + 486140b9a3db1610aba7fcbda8474f2d97d40072 +) + +hunter_add_version( + PACKAGE_NAME + android_sdk_tools_packer + VERSION + 1.0.3 + URL + "https://github.com/hunter-packages/android_sdk_tools_packer/archive/v1.0.3.tar.gz" + SHA1 + 71a497152e3e1efe535df2c30210596e91042ecf +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(android_sdk_tools_packer) +hunter_download(PACKAGE_NAME android_sdk_tools_packer) diff --git a/cmake/projects/android_support_repository_packer/hunter.cmake b/cmake/projects/android_support_repository_packer/hunter.cmake new file mode 100644 index 000000000..2ef8753af --- /dev/null +++ b/cmake/projects/android_support_repository_packer/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2018, 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 + android_support_repository_packer + VERSION + 1.0.0 + URL + "https://github.com/hunter-packages/android_support_repository_packer/archive/v1.0.0.tar.gz" + SHA1 + 3bea5189fd4a29cc060e235e304d8cc28badbdcc +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(android_support_repository_packer) +hunter_download(PACKAGE_NAME android_support_repository_packer) diff --git a/cmake/projects/angles/hunter.cmake b/cmake/projects/angles/hunter.cmake new file mode 100644 index 000000000..e3dd59977 --- /dev/null +++ b/cmake/projects/angles/hunter.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2016-2019, 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) +include(hunter_cmake_args) + +hunter_add_version( + PACKAGE_NAME + angles + VERSION + 1.9.11-p0 + URL + "https://github.com/hunter-packages/angles/archive/v1.9.11-p0.tar.gz" + SHA1 + 455a91947b1f81dba5769a6b6b59e00b2208119f +) + +hunter_cmake_args( + angles + CMAKE_ARGS + CATKIN_ENABLE_TESTING:BOOL=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(angles) +hunter_download(PACKAGE_NAME angles) diff --git a/cmake/projects/arabica/hunter.cmake b/cmake/projects/arabica/hunter.cmake new file mode 100644 index 000000000..554af6746 --- /dev/null +++ b/cmake/projects/arabica/hunter.cmake @@ -0,0 +1,32 @@ +# Copyright (c) 2016-2019, 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 + arabica + VERSION + 0.0.0-a202766-p0 + URL + "https://github.com/hunter-packages/arabica/archive/v0.0.0-a202766-p0.tar.gz" + SHA1 + b922f397223d54f7e6c646a862b3b4d93b0b9227 +) + +hunter_cmake_args( + arabica + CMAKE_ARGS + BUILD_ARABICA_EXAMPLES=OFF + ARABICA_XML_BACKEND=USE_EXPAT +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(arabica) +hunter_download(PACKAGE_NAME arabica) diff --git a/cmake/projects/autobahn-cpp/hunter.cmake b/cmake/projects/autobahn-cpp/hunter.cmake new file mode 100644 index 000000000..f92fe328a --- /dev/null +++ b/cmake/projects/autobahn-cpp/hunter.cmake @@ -0,0 +1,21 @@ +# !!! 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 + autobahn-cpp + VERSION + "0.2.0" + URL + "https://github.com/hunter-packages/autobahn-cpp/archive/0.2.0-hunter-p1.tar.gz" + SHA1 + 43e37635abc924017aeff1036479fde1aea36ceb + ) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(autobahn-cpp) +hunter_download(PACKAGE_NAME autobahn-cpp) diff --git a/cmake/projects/autoutils/hunter.cmake b/cmake/projects/autoutils/hunter.cmake new file mode 100644 index 000000000..a07a21be0 --- /dev/null +++ b/cmake/projects/autoutils/hunter.cmake @@ -0,0 +1,26 @@ +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME autoutils + VERSION "0.1.0" + URL "https://github.com/isaachier/autoutils/archive/v0.1.0.tar.gz" + SHA1 "5e7a54fe584a6055e54fd4e6fcfc6de1e458eb07") + +hunter_add_version( + PACKAGE_NAME autoutils + VERSION "0.2.0" + URL "https://github.com/isaachier/autoutils/archive/v0.2.0.tar.gz" + SHA1 "8f1390453f0fa4c8b438dc2a2a5d65db452fe4f1") + +hunter_add_version( + PACKAGE_NAME autoutils + VERSION "0.3.0" + URL "https://github.com/isaachier/autoutils/archive/v0.3.0.tar.gz" + SHA1 "289b3364766460f37ca311671e27487cef4c3dfe") + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(autoutils) +hunter_download(PACKAGE_NAME autoutils) diff --git a/cmake/projects/aws-c-common/hunter.cmake b/cmake/projects/aws-c-common/hunter.cmake new file mode 100644 index 000000000..92d7df400 --- /dev/null +++ b/cmake/projects/aws-c-common/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2018, 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 + aws-c-common + VERSION + 0.2.1-p0 + URL + "https://github.com/hunter-packages/aws-c-common/archive/v0.2.1-p0.tar.gz" + SHA1 + 65cf17a47d77054a4c043ef9c59978c872f8ed3d +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(aws-c-common) +hunter_download(PACKAGE_NAME aws-c-common) diff --git a/cmake/projects/benchmark/hunter.cmake b/cmake/projects/benchmark/hunter.cmake new file mode 100644 index 000000000..7e45c6182 --- /dev/null +++ b/cmake/projects/benchmark/hunter.cmake @@ -0,0 +1,32 @@ +# !!! 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 benchmark + VERSION "1.4.0" + URL "https://github.com/google/benchmark/archive/v1.4.0.tar.gz" + SHA1 "7d3c1379319d1c1c74e0854d023a0bf16f0cc978" +) + +hunter_add_version( + PACKAGE_NAME benchmark + VERSION "1.3.0" + URL "https://github.com/google/benchmark/archive/v1.3.0.tar.gz" + SHA1 "ea74b9d99327f7ef8150dc7c683e6155fa29ef3c") + +hunter_add_version( + PACKAGE_NAME benchmark + VERSION "1.2.0" + URL "https://github.com/google/benchmark/archive/v1.2.0.tar.gz" + SHA1 "5f26619848c59ddc354e2d51e2f196d2a6ddb189") + +hunter_cmake_args(benchmark CMAKE_ARGS BENCHMARK_ENABLE_TESTING=OFF) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(benchmark) +hunter_download(PACKAGE_NAME benchmark) diff --git a/cmake/projects/bento4/hunter.cmake b/cmake/projects/bento4/hunter.cmake new file mode 100644 index 000000000..c561a3584 --- /dev/null +++ b/cmake/projects/bento4/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2018, 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 + bento4 + VERSION + "1.5.1-628-e6ee435-p0" + URL + "https://github.com/hunter-packages/Bento4/archive/v1.5.1-628-e6ee435-p0.tar.gz" + SHA1 + 9193721f6b7dce92afa01c37d6c28ddf55103ba5 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(bento4) +hunter_download(PACKAGE_NAME bento4) diff --git a/cmake/projects/binaryen/hunter.cmake b/cmake/projects/binaryen/hunter.cmake new file mode 100644 index 000000000..784140923 --- /dev/null +++ b/cmake/projects/binaryen/hunter.cmake @@ -0,0 +1,45 @@ +# Copyright (c) 2016-2018, 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) +include(hunter_cmake_args) + + +hunter_add_version( + PACKAGE_NAME + binaryen + VERSION + 1.38.28-p0 + URL + "https://github.com/Warchant/binaryen/archive/1.38.28-p0.tar.gz" + SHA1 + 6c95a5a46a9e17a04521bb775266f2bae1763287 +) + +hunter_add_version( + PACKAGE_NAME + binaryen + VERSION + 1.38.28-p1 + URL + "https://github.com/Warchant/binaryen/archive/1.38.28-p1.tar.gz" + SHA1 + f8ff97ee1e16862e8c88bfea2ffb88247ad65223 +) + +hunter_cmake_args( + binaryen + CMAKE_ARGS + BUILD_STATIC_LIB=ON + BUILD_TOOLS=OFF # we don't want to build executables by default + ENABLE_WERROR=OFF # some new compilers (g++-{7,8}) produce warnings so build may fail. we explicitly disable -Werror +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(binaryen) +hunter_download(PACKAGE_NAME binaryen) diff --git a/cmake/projects/bison/hunter.cmake b/cmake/projects/bison/hunter.cmake new file mode 100644 index 000000000..65127c21a --- /dev/null +++ b/cmake/projects/bison/hunter.cmake @@ -0,0 +1,30 @@ +# !!! 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_add_version( + PACKAGE_NAME + bison + VERSION + "3.0.4-p0" + URL "https://github.com/hunter-packages/bison/releases/download/v3.0.4/bison-3.0.4.tar.gz" + SHA1 "984caba9061e21d048b71a49bf553d2e32ac8252" +) + +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 000000000..e41e9dbcc --- /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/botan/hunter.cmake b/cmake/projects/botan/hunter.cmake new file mode 100644 index 000000000..18669c23f --- /dev/null +++ b/cmake/projects/botan/hunter.cmake @@ -0,0 +1,71 @@ +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_download) +include(hunter_pick_scheme) +include(hunter_cmake_args) +include(hunter_configuration_types) + +hunter_add_version( + PACKAGE_NAME + botan + VERSION + 2.11.0-110af9494 + URL + "https://github.com/randombit/botan/archive/110af949412e7c4b28b447a3600a947ddf2a2f2f.zip" + SHA1 + b97b5a934c872310992635a2ef5d016e1e59a2dd +) + +hunter_add_version( + PACKAGE_NAME + botan + VERSION + 2.11.0 + URL + "https://github.com/randombit/botan/archive/2.11.0.tar.gz" + SHA1 + f9667a53c19a7eb8999f3580baf21dc29c6a5f33 +) + +hunter_add_version( + PACKAGE_NAME + botan + VERSION + 2.10.0 + URL + "https://github.com/randombit/botan/archive/2.10.0.tar.gz" + SHA1 + 6e6b0e4a4b5a69ff42de2dfec2cd998a981abd2d +) + +hunter_cmake_args( + botan + CMAKE_ARGS + WITH_BZIP2=NO + WITH_ZLIB=NO + PKGCONFIG_EXPORT_TARGETS=botan-2 +) + +hunter_configuration_types(botan CONFIGURATION_TYPES Release) + +if(MINGW) + hunter_pick_scheme(DEFAULT url_sha1_botan) +elseif(WIN32) + hunter_pick_scheme(DEFAULT url_sha1_botan_win) +elseif(APPLE) + if(IOS) + hunter_pick_scheme(DEFAULT url_sha1_botan_ios) + else() + hunter_pick_scheme(DEFAULT url_sha1_botan_macos) + endif() +else() + hunter_pick_scheme(DEFAULT url_sha1_botan) +endif() + +hunter_cacheable(botan) +hunter_download(PACKAGE_NAME botan + PACKAGE_UNRELOCATABLE_TEXT_FILES + lib/pkgconfig/botan-2.pc +) diff --git a/cmake/projects/botan/schemes/url_sha1_botan.cmake.in b/cmake/projects/botan/schemes/url_sha1_botan.cmake.in new file mode 100644 index 000000000..61f4e73f7 --- /dev/null +++ b/cmake/projects/botan/schemes/url_sha1_botan.cmake.in @@ -0,0 +1,299 @@ +cmake_minimum_required(VERSION 3.0) + +project(Hunter) + +include("@HUNTER_SELF@/cmake/Hunter") + +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_assert_not_empty_string) +include(hunter_get_toolchain_binaries) +include(hunter_get_build_flags) + +# print this message if HUNTER_STATUS_DEBUG option is ON +hunter_status_debug("Scheme: url_sha1_botan") + +# Check variables is not empty +hunter_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_TLS_VERIFY@") + +# Build command and options + +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 +) + +hunter_get_build_flags( + INSTALL_DIR + "@HUNTER_PACKAGE_INSTALL_PREFIX@" + PACKAGE_CONFIGURATION_TYPES + "@HUNTER_PACKAGE_CONFIGURATION_TYPES@" + OUT_CPPFLAGS + cppflags + OUT_CFLAGS + cflags + OUT_CXXFLAGS + cxxflags + OUT_LDFLAGS + ldflags +) + +# Usage: configure.py [options] +# +# Options: +# --version show program's version number and exit +# -h, --help show this help message and exit +# --verbose Show debug messages +# --quiet Show only warnings and errors +# +# Target options: +# --cpu=CPU set the target CPU architecture +# --os=OS set the target operating system +# --cc=COMPILER set the desired build compiler +# --cc-min-version=MAJOR.MINOR Set the minimal version of the target +# compiler. Use --cc-min-version=0.0 to +# support all compiler versions. Default is +# auto detection. +# --cc-bin=BINARY set path to compiler binary +# --cc-abi-flags=FLAGS set compiler ABI flags +# --cxxflags=FLAGS override all compiler flags +# --extra-cxxflags=FLAGS set extra compiler flags +# --ldflags=FLAGS set linker flags +# --ar-command=AR set path to static archive creator +# --ar-options=AR_OPTIONS set options for ar +# --msvc-runtime=RT specify MSVC runtime (MT, MD, MTd, MDd) +# --with-endian=ORDER override byte order guess +# --with-os-features=FEAT specify OS features to use +# --without-os-features=FEAT specify OS features to disable +# --disable-sse2 disable SSE2 intrinsics +# --disable-ssse3 disable SSSE3 intrinsics +# --disable-sse4.1 disable SSE4.1 intrinsics +# --disable-sse4.2 disable SSE4.2 intrinsics +# --disable-avx2 disable AVX2 intrinsics +# --disable-bmi2 disable BMI2 intrinsics +# --disable-rdrand disable RDRAND intrinsics +# --disable-rdseed disable RDSEED intrinsics +# --disable-aes-ni disable AES-NI intrinsics +# --disable-sha-ni disable SHA-NI intrinsics +# --disable-altivec disable AltiVec intrinsics +# --disable-neon disable NEON intrinsics +# --disable-armv8crypto disable ARMv8Crypto intrinsics +# +# Build options: +# --with-debug-info include debug symbols +# --with-sanitizers enable ASan/UBSan checks +# --enable-sanitizers=SAN enable specific sanitizers +# --without-stack-protector disable stack smashing protections +# --with-coverage add coverage info and disable opts +# --with-coverage-info add coverage info +# --disable-shared-library disable building shared library +# --disable-static-library disable building static library +# --optimize-for-size optimize for code size +# --no-optimizations disable all optimizations (for debugging) +# --debug-mode enable debug info, disable optimizations +# --amalgamation use amalgamation to build +# --single-amalgamation-file build single file instead of splitting on +# ABI +# --with-build-dir=DIR setup the build in DIR +# --with-external-includedir=DIR use DIR for external includes +# --with-external-libdir=DIR use DIR for external libs +# --with-sysroot-dir=DIR use DIR for system root while cross- +# compiling +# --with-openmp enable use of OpenMP +# --link-method=METHOD choose how links to include headers are +# created (symlink, hardlink, copy) +# --with-local-config=FILE include the contents of FILE into build.h +# --distribution-info=STRING distribution specific version +# --maintainer-mode Enable extra warnings +# --with-python-versions=N.M where to install botan2.py (def 2.7) +# --with-valgrind use valgrind API +# --unsafe-fuzzer-mode Disable essential checks for testing +# --build-fuzzers=TYPE Build fuzzers (afl, libfuzzer, klee, test) +# --with-fuzzer-lib=LIB additionally link in LIB +# +# Documentation Options: +# --without-documentation Skip building/installing documentation +# --with-sphinx Use Sphinx +# --with-pdf Use Sphinx to generate PDF doc +# --with-rst2man Use rst2man to generate man page +# --with-doxygen Use Doxygen +# +# Module selection: +# --module-policy=POL module policy file (see src/build- +# data/policy) +# --enable-modules=MODS enable specific modules +# --disable-modules=MODS disable specific modules +# --minimized-build minimize build +# --with-bearssl use bearssl +# --with-boost use boost +# --with-bzip2 use bzip2 +# --with-lzma use lzma +# --with-openssl use openssl +# --with-commoncrypto use commoncrypto +# --with-sqlite3 use sqlite3 +# --with-zlib use zlib +# --with-tpm use tpm +# +# Installation options: +# --program-suffix=SUFFIX append string to program names +# --library-suffix=SUFFIX append string to library names +# --prefix=DIR set the install prefix +# --docdir=DIR set the doc install dir +# --bindir=DIR set the binary install dir +# --libdir=DIR set the library install dir +# --mandir=DIR set the install dir for man pages +# --includedir=DIR set the include file install dir +# +# Informational: +# --list-modules list available modules and exit +# --list-os-features list available OS features and exit +# + +if(ANDROID) + list(APPEND configure_opts --os=android) + set(cpu_flag "${CMAKE_ANDROID_ARCH_ABI}") + if("${CMAKE_ANDROID_ARCH_ABI}" STREQUAL "arm64-v8a") + set(cpu_flag "arm64") + elseif("${CMAKE_ANDROID_ARCH_ABI}" STREQUAL "armeabi-v7a") + set(cpu_flag "armv7-a") + elseif("${CMAKE_ANDROID_ARCH_ABI}" STREQUAL "armeabi") + set(cpu_flag "arm") + endif() + + list(APPEND configure_opts --cpu=${cpu_flag}) +elseif(UNIX) + list(APPEND configure_opts --os=linux) +endif() + +if("@HUNTER_PACKAGE_CONFIGURATION_TYPES@" STREQUAL "Debug") + list(APPEND configure_opts --debug-mode) +endif() + +if(HUNTER_STATUS_DEBUG) + list(APPEND configure_opts --verbose) +endif() + +if(BUILD_SHARED_LIBS) + list(APPEND configure_opt --disable-static-library) +else() + list(APPEND configure_opts --disable-shared-library) +endif() + +if(WITH_ZLIB) + list(APPEND configure_opts --with-zlib) + hunter_add_package(ZLIB) +endif() + +if(WITH_BZIP2) + list(APPEND configure_opts --with-bzip2) + hunter_add_package(BZip2) +endif() + +if(ENABLE_MODULES) + list(APPEND configure_opts --enable-modules=${ENABLE_MODULES}) +endif() + +list(APPEND configure_opts + --cc-bin=${cxx} + --extra-cxxflags=${cxxflags} + "--ldflags=${cxxflags} ${ldflags}" +) + +if(NOT "${ar}" STREQUAL "") + list(APPEND configure_opts --ar-command=${ar}) +endif() + +set(autotools_build_command "make") +if(MINGW) + set(autotools_build_command "nmake") +endif() + +if(NOT "@HUNTER_JOBS_OPTION@" STREQUAL "") + list(APPEND autotools_build_command "-j" "@HUNTER_JOBS_OPTION@") +endif() + +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 + TLS_VERIFY + "@HUNTER_TLS_VERIFY@" + SOURCE_DIR + "@HUNTER_PACKAGE_SOURCE_DIR@" # Unpack directory + INSTALL_DIR + "@HUNTER_INSTALL_PREFIX@" # not used actually (see install command) + CONFIGURE_COMMAND + "./configure.py" + "--without-documentation" + "--prefix=@HUNTER_PACKAGE_INSTALL_PREFIX@" + "--with-external-includedir=@HUNTER_INSTALL_PREFIX@/include" + "--with-external-libdir=@HUNTER_INSTALL_PREFIX@/lib" + ${configure_opts} + BUILD_COMMAND + ${autotools_build_command} libs + BUILD_IN_SOURCE + 1 + INSTALL_COMMAND + make install + 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" +) + +string(COMPARE EQUAL "${DEPENDS_ON_PKGCONFIGS}" "" default_pkgconfig) +if(NOT default_pkgconfig) + set(DEPENDS_ON_PACKAGES ${DEPENDS_ON_PKGCONFIGS}) +endif() + +set(PKG_GENERATE_SHARED "${BUILD_SHARED_LIBS}") + +foreach(PKG_CONFIG_MODULE ${PKGCONFIG_EXPORT_TARGETS}) + # Use: + # * DEPENDS_ON_PACKAGES + # * PKG_GENERATE_SHARED + 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/projects/botan/schemes/url_sha1_botan_ios.cmake.in b/cmake/projects/botan/schemes/url_sha1_botan_ios.cmake.in new file mode 100644 index 000000000..080439064 --- /dev/null +++ b/cmake/projects/botan/schemes/url_sha1_botan_ios.cmake.in @@ -0,0 +1,324 @@ +cmake_minimum_required(VERSION 3.0) + +project(Hunter) + +include("@HUNTER_SELF@/cmake/Hunter") + +include(ExternalProject) # ExternalProject_Add + +# some Hunter modules will be used +list(APPEND CMAKE_MODULE_PATH "@HUNTER_SELF@/cmake/modules") + +include(hunter_dump_cmake_flags) +include(hunter_status_debug) +include(hunter_assert_not_empty_string) +include(hunter_unsetvar) + +# print this message if HUNTER_STATUS_DEBUG option is ON +hunter_status_debug("Scheme: url_sha1_botan_ios") + +# Check variables is not empty +hunter_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_TLS_VERIFY@") + +# Note: support for single architecture/native iOS builds (i.e., arm64) +hunter_assert_not_empty_string("@IPHONEOS_ARCHS@@IPHONESIMULATOR_ARCHS@") +hunter_assert_not_empty_string("@IOS_SDK_VERSION@") +hunter_assert_not_empty_string("@IPHONESIMULATOR_ROOT@") +hunter_assert_not_empty_string("@IPHONEOS_ROOT@") + +hunter_dump_cmake_flags(SKIP_INCLUDES) +# -> CMAKE_CXX_FLAGS +# -> CMAKE_C_FLAGS + +set(configure_architectures @IPHONEOS_ARCHS@ @IPHONESIMULATOR_ARCHS@) + +list(FIND configure_architectures "armv7s" x) +if(${x} GREATER -1) + message(STATUS "armv7s not supported by botan.") + list(REMOVE_ITEM configure_architectures "armv7s") +endif() + +hunter_unsetvar(botan_input_libraries) + +foreach(arch ${configure_architectures}) + list( + APPEND + botan_input_libraries + "@HUNTER_PACKAGE_SOURCE_DIR@/${arch}/libbotan-2.a" + ) +endforeach() + +# fuse all libraries by 'lipo' +list(GET configure_architectures 0 first_architecture) +ExternalProject_Add( + "@HUNTER_EP_NAME@-ios_universal" + DOWNLOAD_COMMAND + "" + DOWNLOAD_DIR + "@HUNTER_PACKAGE_DOWNLOAD_DIR@" + TLS_VERIFY + "@HUNTER_TLS_VERIFY@" + SOURCE_DIR + "@HUNTER_PACKAGE_SOURCE_DIR@/ios_universal" + INSTALL_DIR + "@HUNTER_PACKAGE_INSTALL_PREFIX@" + # not used, just avoid creating Install/ empty directory + CONFIGURE_COMMAND + "" + BUILD_COMMAND + "" + INSTALL_COMMAND + lipo + -create + ${botan_input_libraries} + -o + "@HUNTER_PACKAGE_INSTALL_PREFIX@/lib/libbotan-2.a" + COMMAND # Copy license files + "@CMAKE_COMMAND@" + "-C@HUNTER_ARGS_FILE@" # for 'HUNTER_INSTALL_LICENSE_FILES' + "-Dsrcdir=@HUNTER_PACKAGE_SOURCE_DIR@/${first_architecture}" + "-Ddstdir=@HUNTER_PACKAGE_LICENSE_DIR@" + -P + "@HUNTER_SELF@/scripts/try-copy-license.cmake" +) + +# Usage: configure.py [options] +# +# Options: +# --version show program's version number and exit +# -h, --help show this help message and exit +# --verbose Show debug messages +# --quiet Show only warnings and errors +# +# Target options: +# --cpu=CPU set the target CPU architecture +# --os=OS set the target operating system +# --cc=COMPILER set the desired build compiler +# --cc-min-version=MAJOR.MINOR Set the minimal version of the target +# compiler. Use --cc-min-version=0.0 to +# support all compiler versions. Default is +# auto detection. +# --cc-bin=BINARY set path to compiler binary +# --cc-abi-flags=FLAGS set compiler ABI flags +# --cxxflags=FLAGS override all compiler flags +# --extra-cxxflags=FLAGS set extra compiler flags +# --ldflags=FLAGS set linker flags +# --ar-command=AR set path to static archive creator +# --ar-options=AR_OPTIONS set options for ar +# --msvc-runtime=RT specify MSVC runtime (MT, MD, MTd, MDd) +# --with-endian=ORDER override byte order guess +# --with-os-features=FEAT specify OS features to use +# --without-os-features=FEAT specify OS features to disable +# --disable-sse2 disable SSE2 intrinsics +# --disable-ssse3 disable SSSE3 intrinsics +# --disable-sse4.1 disable SSE4.1 intrinsics +# --disable-sse4.2 disable SSE4.2 intrinsics +# --disable-avx2 disable AVX2 intrinsics +# --disable-bmi2 disable BMI2 intrinsics +# --disable-rdrand disable RDRAND intrinsics +# --disable-rdseed disable RDSEED intrinsics +# --disable-aes-ni disable AES-NI intrinsics +# --disable-sha-ni disable SHA-NI intrinsics +# --disable-altivec disable AltiVec intrinsics +# --disable-neon disable NEON intrinsics +# --disable-armv8crypto disable ARMv8Crypto intrinsics +# +# Build options: +# --with-debug-info include debug symbols +# --with-sanitizers enable ASan/UBSan checks +# --enable-sanitizers=SAN enable specific sanitizers +# --without-stack-protector disable stack smashing protections +# --with-coverage add coverage info and disable opts +# --with-coverage-info add coverage info +# --disable-shared-library disable building shared library +# --disable-static-library disable building static library +# --optimize-for-size optimize for code size +# --no-optimizations disable all optimizations (for debugging) +# --debug-mode enable debug info, disable optimizations +# --amalgamation use amalgamation to build +# --single-amalgamation-file build single file instead of splitting on +# ABI +# --with-build-dir=DIR setup the build in DIR +# --with-external-includedir=DIR use DIR for external includes +# --with-external-libdir=DIR use DIR for external libs +# --with-sysroot-dir=DIR use DIR for system root while cross- +# compiling +# --with-openmp enable use of OpenMP +# --link-method=METHOD choose how links to include headers are +# created (symlink, hardlink, copy) +# --with-local-config=FILE include the contents of FILE into build.h +# --distribution-info=STRING distribution specific version +# --maintainer-mode Enable extra warnings +# --with-python-versions=N.M where to install botan2.py (def 2.7) +# --with-valgrind use valgrind API +# --unsafe-fuzzer-mode Disable essential checks for testing +# --build-fuzzers=TYPE Build fuzzers (afl, libfuzzer, klee, test) +# --with-fuzzer-lib=LIB additionally link in LIB +# +# Documentation Options: +# --without-documentation Skip building/installing documentation +# --with-sphinx Use Sphinx +# --with-pdf Use Sphinx to generate PDF doc +# --with-rst2man Use rst2man to generate man page +# --with-doxygen Use Doxygen +# +# Module selection: +# --module-policy=POL module policy file (see src/build- +# data/policy) +# --enable-modules=MODS enable specific modules +# --disable-modules=MODS disable specific modules +# --minimized-build minimize build +# --with-bearssl use bearssl +# --with-boost use boost +# --with-bzip2 use bzip2 +# --with-lzma use lzma +# --with-openssl use openssl +# --with-commoncrypto use commoncrypto +# --with-sqlite3 use sqlite3 +# --with-zlib use zlib +# --with-tpm use tpm +# +# Installation options: +# --program-suffix=SUFFIX append string to program names +# --library-suffix=SUFFIX append string to library names +# --prefix=DIR set the install prefix +# --docdir=DIR set the doc install dir +# --bindir=DIR set the binary install dir +# --libdir=DIR set the library install dir +# --mandir=DIR set the install dir for man pages +# --includedir=DIR set the include file install dir +# +# Informational: +# --list-modules list available modules and exit +# --list-os-features list available OS features and exit +# +if("@HUNTER_PACKAGE_CONFIGURATION_TYPES@" STREQUAL "Debug") + list(APPEND configure_opts --debug-mode) +endif() + +if(HUNTER_STATUS_DEBUG) + list(APPEND configure_opts --verbose) +endif() + +if(BUILD_SHARED_LIBS) + list(APPEND configure_opt --disable-static-library) +else() + list(APPEND configure_opts --disable-shared-library) +endif() + +if(WITH_ZLIB) + list(APPEND configure_opts --with-zlib) + hunter_add_package(ZLIB) +endif() + +if(WITH_BZIP2) + list(APPEND configure_opts --with-bzip2) + hunter_add_package(BZip2) +endif() + +if(ENABLE_MODULES) + list(APPEND configure_opts --enable-modules=${ENABLE_MODULES}) +endif() + +list(APPEND configure_opts + --extra-cxxflags=${cxxflags} +) + +if(NOT "${ar}" STREQUAL "") + list(APPEND configure_opts --ar-command=${ar}) +endif() + +set(autotools_build_command "make") +if(NOT "@HUNTER_JOBS_OPTION@" STREQUAL "") + list(APPEND autotools_build_command "-j" "@HUNTER_JOBS_OPTION@") +endif() + +foreach(variant ${configure_architectures}) + + hunter_status_debug("Configure architecture: ${variant}") + + set(cc_abi_flags "${variant}") + set(cpu_flag "${variant}") + set(IPHONE_SDK "iphoneos") + set(additional_configure_opts "") + + if("${variant}" STREQUAL "armv7") + #list(APPEND additional_configure_opts --disable-neon) + message(STATUS "Disable newhope module in armv7 build because of of compiler crash see https://github.com/randombit/botan/issues/2015#issuecomment-508818269") + list(APPEND additional_configure_opts --disable-modules=newhope) + elseif("${variant}" STREQUAL "i386") + set(IPHONE_SDK "iphonesimulator") + elseif("${variant}" STREQUAL "x86_64") + set(IPHONE_SDK "iphonesimulator") + endif() + + hunter_status_debug("Configure options: ${configure_opts} ${additional_configure_opts}") + + ExternalProject_Add( + "@HUNTER_EP_NAME@-${variant}" # 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 + TLS_VERIFY + "@HUNTER_TLS_VERIFY@" + SOURCE_DIR + "@HUNTER_PACKAGE_SOURCE_DIR@/${variant}" # Unpack directory + INSTALL_DIR + "@HUNTER_INSTALL_PREFIX@" # not used actually (see install command) + CONFIGURE_COMMAND + . "@HUNTER_GLOBAL_SCRIPT_DIR@/clear-all.sh" && + xcrun --sdk ${IPHONE_SDK} "./configure.py" + "--os=ios" + "--cc=clang" + "--cpu=${cpu_flag}" + "--cc-abi-flags=-arch ${cc_abi_flags}" + "--without-documentation" + "--prefix=@HUNTER_PACKAGE_INSTALL_PREFIX@" + "--with-external-includedir=@HUNTER_INSTALL_PREFIX@/include" + "--with-external-libdir=@HUNTER_INSTALL_PREFIX@/lib" + ${additional_configure_opts} + ${configure_opts} + BUILD_COMMAND + . "@HUNTER_GLOBAL_SCRIPT_DIR@/clear-all.sh" && + xcrun --sdk ${IPHONE_SDK} make libs + BUILD_IN_SOURCE + 1 + INSTALL_COMMAND + . "@HUNTER_GLOBAL_SCRIPT_DIR@/clear-all.sh" && + xcrun --sdk ${IPHONE_SDK} make install + ) + + add_dependencies( + "@HUNTER_EP_NAME@-ios_universal" + "@HUNTER_EP_NAME@-${variant}" + ) +endforeach() + +string(COMPARE EQUAL "${DEPENDS_ON_PKGCONFIGS}" "" default_pkgconfig) +if(NOT default_pkgconfig) + set(DEPENDS_ON_PACKAGES ${DEPENDS_ON_PKGCONFIGS}) +endif() + +set(PKG_GENERATE_SHARED "${BUILD_SHARED_LIBS}") + +foreach(PKG_CONFIG_MODULE ${PKGCONFIG_EXPORT_TARGETS}) + # Use: + # * DEPENDS_ON_PACKAGES + # * PKG_GENERATE_SHARED + 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/projects/botan/schemes/url_sha1_botan_macos.cmake.in b/cmake/projects/botan/schemes/url_sha1_botan_macos.cmake.in new file mode 100644 index 000000000..a4afcc550 --- /dev/null +++ b/cmake/projects/botan/schemes/url_sha1_botan_macos.cmake.in @@ -0,0 +1,268 @@ +cmake_minimum_required(VERSION 3.0) + +project(Hunter) + +include("@HUNTER_SELF@/cmake/Hunter") + +include(ExternalProject) # ExternalProject_Add + +# some Hunter modules will be used +list(APPEND CMAKE_MODULE_PATH "@HUNTER_SELF@/cmake/modules") + +include(hunter_dump_cmake_flags) +include(hunter_status_debug) +include(hunter_assert_not_empty_string) +include(hunter_unsetvar) +include(hunter_user_error) + +# print this message if HUNTER_STATUS_DEBUG option is ON +hunter_status_debug("Scheme: url_sha1_botan_macos") + +# Check variables is not empty +hunter_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_LICENSE_DIR@") +hunter_assert_not_empty_string("@HUNTER_GLOBAL_SCRIPT_DIR@") +hunter_assert_not_empty_string("@HUNTER_TLS_VERIFY@") + +# Skip position independent code flags for macOS +hunter_dump_cmake_flags(SKIP_INCLUDES SKIP_PIC) +# -> CMAKE_CXX_FLAGS +# -> CMAKE_C_FLAGS + +set(configure_architectures @CMAKE_OSX_ARCHITECTURES@) + +if(NOT configure_architectures) + hunter_status_debug("Using default macOS architecture: x86_64") + set(configure_architectures "x86_64") +endif() + +# Usage: configure.py [options] +# +# Options: +# --version show program's version number and exit +# -h, --help show this help message and exit +# --verbose Show debug messages +# --quiet Show only warnings and errors +# +# Target options: +# --cpu=CPU set the target CPU architecture +# --os=OS set the target operating system +# --cc=COMPILER set the desired build compiler +# --cc-min-version=MAJOR.MINOR Set the minimal version of the target +# compiler. Use --cc-min-version=0.0 to +# support all compiler versions. Default is +# auto detection. +# --cc-bin=BINARY set path to compiler binary +# --cc-abi-flags=FLAGS set compiler ABI flags +# --cxxflags=FLAGS override all compiler flags +# --extra-cxxflags=FLAGS set extra compiler flags +# --ldflags=FLAGS set linker flags +# --ar-command=AR set path to static archive creator +# --ar-options=AR_OPTIONS set options for ar +# --msvc-runtime=RT specify MSVC runtime (MT, MD, MTd, MDd) +# --with-endian=ORDER override byte order guess +# --with-os-features=FEAT specify OS features to use +# --without-os-features=FEAT specify OS features to disable +# --disable-sse2 disable SSE2 intrinsics +# --disable-ssse3 disable SSSE3 intrinsics +# --disable-sse4.1 disable SSE4.1 intrinsics +# --disable-sse4.2 disable SSE4.2 intrinsics +# --disable-avx2 disable AVX2 intrinsics +# --disable-bmi2 disable BMI2 intrinsics +# --disable-rdrand disable RDRAND intrinsics +# --disable-rdseed disable RDSEED intrinsics +# --disable-aes-ni disable AES-NI intrinsics +# --disable-sha-ni disable SHA-NI intrinsics +# --disable-altivec disable AltiVec intrinsics +# --disable-neon disable NEON intrinsics +# --disable-armv8crypto disable ARMv8Crypto intrinsics +# +# Build options: +# --with-debug-info include debug symbols +# --with-sanitizers enable ASan/UBSan checks +# --enable-sanitizers=SAN enable specific sanitizers +# --without-stack-protector disable stack smashing protections +# --with-coverage add coverage info and disable opts +# --with-coverage-info add coverage info +# --disable-shared-library disable building shared library +# --disable-static-library disable building static library +# --optimize-for-size optimize for code size +# --no-optimizations disable all optimizations (for debugging) +# --debug-mode enable debug info, disable optimizations +# --amalgamation use amalgamation to build +# --single-amalgamation-file build single file instead of splitting on +# ABI +# --with-build-dir=DIR setup the build in DIR +# --with-external-includedir=DIR use DIR for external includes +# --with-external-libdir=DIR use DIR for external libs +# --with-sysroot-dir=DIR use DIR for system root while cross- +# compiling +# --with-openmp enable use of OpenMP +# --link-method=METHOD choose how links to include headers are +# created (symlink, hardlink, copy) +# --with-local-config=FILE include the contents of FILE into build.h +# --distribution-info=STRING distribution specific version +# --maintainer-mode Enable extra warnings +# --with-python-versions=N.M where to install botan2.py (def 2.7) +# --with-valgrind use valgrind API +# --unsafe-fuzzer-mode Disable essential checks for testing +# --build-fuzzers=TYPE Build fuzzers (afl, libfuzzer, klee, test) +# --with-fuzzer-lib=LIB additionally link in LIB +# +# Documentation Options: +# --without-documentation Skip building/installing documentation +# --with-sphinx Use Sphinx +# --with-pdf Use Sphinx to generate PDF doc +# --with-rst2man Use rst2man to generate man page +# --with-doxygen Use Doxygen +# +# Module selection: +# --module-policy=POL module policy file (see src/build- +# data/policy) +# --enable-modules=MODS enable specific modules +# --disable-modules=MODS disable specific modules +# --minimized-build minimize build +# --with-bearssl use bearssl +# --with-boost use boost +# --with-bzip2 use bzip2 +# --with-lzma use lzma +# --with-openssl use openssl +# --with-commoncrypto use commoncrypto +# --with-sqlite3 use sqlite3 +# --with-zlib use zlib +# --with-tpm use tpm +# +# Installation options: +# --program-suffix=SUFFIX append string to program names +# --library-suffix=SUFFIX append string to library names +# --prefix=DIR set the install prefix +# --docdir=DIR set the doc install dir +# --bindir=DIR set the binary install dir +# --libdir=DIR set the library install dir +# --mandir=DIR set the install dir for man pages +# --includedir=DIR set the include file install dir +# +# Informational: +# --list-modules list available modules and exit +# --list-os-features list available OS features and exit +# +if("@HUNTER_PACKAGE_CONFIGURATION_TYPES@" STREQUAL "Debug") + list(APPEND configure_opts --debug-mode) +endif() + +if(HUNTER_STATUS_DEBUG) + list(APPEND configure_opts --verbose) +endif() + +if(BUILD_SHARED_LIBS) + list(APPEND configure_opt --disable-static-library) +else() + list(APPEND configure_opts --disable-shared-library) +endif() + +if(WITH_ZLIB) + list(APPEND configure_opts --with-zlib) + hunter_add_package(ZLIB) +endif() + +if(WITH_BZIP2) + list(APPEND configure_opts --with-bzip2) + hunter_add_package(BZip2) +endif() + +if(ENABLE_MODULES) + list(APPEND configure_opts --enable-modules=${ENABLE_MODULES}) +endif() + +list(APPEND configure_opts + --extra-cxxflags=${cxxflags} +) + +if(NOT "${ar}" STREQUAL "") + list(APPEND configure_opts --ar-command=${ar}) +endif() + +set(build_command . "@HUNTER_GLOBAL_SCRIPT_DIR@/clear-all.sh" && "make") +if(NOT "@HUNTER_JOBS_OPTION@" STREQUAL "") + list(APPEND build_command "-j" "@HUNTER_JOBS_OPTION@") +endif() + +list(LENGTH configure_architectures configure_architectures_lenght) +if(${configure_architectures_lenght} GREATER 1) + set(arch_flags "") + foreach(arch ${configure_architectures}) + string(APPEND arch_flags "-arch ${arch} ") + endforeach() + list(APPEND configure_opts "--cc-abi-flags=\"-force_cpusubtype_ALL ${arch_flags}\"") +endif() + +set(configure_command . "@HUNTER_GLOBAL_SCRIPT_DIR@/clear-all.sh" && "./configure.py") + +hunter_status_debug("Configure command: ${configure_command}") +hunter_status_debug("Configure architectures: ${configure_architectures}") +hunter_status_debug("Configure options: ${configure_opts}") + +list(GET configure_architectures 0 first_architecture) +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 + TLS_VERIFY + "@HUNTER_TLS_VERIFY@" + SOURCE_DIR + "@HUNTER_PACKAGE_SOURCE_DIR@" # Unpack directory + INSTALL_DIR + "@HUNTER_INSTALL_PREFIX@" # not used actually (see install command) + CONFIGURE_COMMAND + "${configure_command}" + "--os=darwin" + "--cc=clang" + "--cpu=${first_architecture}" + "--without-documentation" + "--prefix=@HUNTER_PACKAGE_INSTALL_PREFIX@" + "--with-external-includedir=@HUNTER_INSTALL_PREFIX@/include" + "--with-external-libdir=@HUNTER_INSTALL_PREFIX@/lib" + ${configure_opts} + BUILD_COMMAND + ${build_command} libs + BUILD_IN_SOURCE + 1 + INSTALL_COMMAND + make install + COMMAND # Copy license files + "@CMAKE_COMMAND@" + "-C@HUNTER_ARGS_FILE@" # for 'HUNTER_INSTALL_LICENSE_FILES' + "-Dsrcdir=@HUNTER_PACKAGE_SOURCE_DIR@/${first_architecture}" + "-Ddstdir=@HUNTER_PACKAGE_LICENSE_DIR@" + -P + "@HUNTER_SELF@/scripts/try-copy-license.cmake" +) + +string(COMPARE EQUAL "${DEPENDS_ON_PKGCONFIGS}" "" default_pkgconfig) +if(NOT default_pkgconfig) + set(DEPENDS_ON_PACKAGES ${DEPENDS_ON_PKGCONFIGS}) +endif() + +set(PKG_GENERATE_SHARED "${BUILD_SHARED_LIBS}") + +foreach(PKG_CONFIG_MODULE ${PKGCONFIG_EXPORT_TARGETS}) + # Use: + # * DEPENDS_ON_PACKAGES + # * PKG_GENERATE_SHARED + 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/projects/botan/schemes/url_sha1_botan_win.cmake.in b/cmake/projects/botan/schemes/url_sha1_botan_win.cmake.in new file mode 100644 index 000000000..b27a180c1 --- /dev/null +++ b/cmake/projects/botan/schemes/url_sha1_botan_win.cmake.in @@ -0,0 +1,290 @@ +cmake_minimum_required(VERSION 3.0) + +project(Hunter) + +include("@HUNTER_SELF@/cmake/Hunter") + +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_assert_not_empty_string) +include(hunter_get_toolchain_binaries) +include(hunter_get_build_flags) +include(hunter_setup_msvc) + +# print this message if HUNTER_STATUS_DEBUG option is ON +hunter_status_debug("Scheme: url_sha1_botan_win") + +# Check variables is not empty +hunter_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_INSTALL_PREFIX@") +# TODO These properties are not set in msys-cxx17 build +#hunter_assert_not_empty_string("@HUNTER_MSVC_ARCH@") +#hunter_assert_not_empty_string("@HUNTER_MSVC_VCVARSALL@") +hunter_assert_not_empty_string("@HUNTER_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_TLS_VERIFY@") + +# Build command and options + +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 +) + +hunter_get_build_flags( + INSTALL_DIR + "@HUNTER_PACKAGE_INSTALL_PREFIX@" + PACKAGE_CONFIGURATION_TYPES + "@HUNTER_PACKAGE_CONFIGURATION_TYPES@" + OUT_CPPFLAGS + cppflags + OUT_CFLAGS + cflags + OUT_CXXFLAGS + cxxflags + OUT_LDFLAGS + ldflags +) + +hunter_setup_msvc() + +# Usage: configure.py [options] +# +# Options: +# --version show program's version number and exit +# -h, --help show this help message and exit +# --verbose Show debug messages +# --quiet Show only warnings and errors +# +# Target options: +# --cpu=CPU set the target CPU architecture +# --os=OS set the target operating system +# --cc=COMPILER set the desired build compiler +# --cc-min-version=MAJOR.MINOR Set the minimal version of the target +# compiler. Use --cc-min-version=0.0 to +# support all compiler versions. Default is +# auto detection. +# --cc-bin=BINARY set path to compiler binary +# --cc-abi-flags=FLAGS set compiler ABI flags +# --cxxflags=FLAGS override all compiler flags +# --extra-cxxflags=FLAGS set extra compiler flags +# --ldflags=FLAGS set linker flags +# --ar-command=AR set path to static archive creator +# --ar-options=AR_OPTIONS set options for ar +# --msvc-runtime=RT specify MSVC runtime (MT, MD, MTd, MDd) +# --with-endian=ORDER override byte order guess +# --with-os-features=FEAT specify OS features to use +# --without-os-features=FEAT specify OS features to disable +# --disable-sse2 disable SSE2 intrinsics +# --disable-ssse3 disable SSSE3 intrinsics +# --disable-sse4.1 disable SSE4.1 intrinsics +# --disable-sse4.2 disable SSE4.2 intrinsics +# --disable-avx2 disable AVX2 intrinsics +# --disable-bmi2 disable BMI2 intrinsics +# --disable-rdrand disable RDRAND intrinsics +# --disable-rdseed disable RDSEED intrinsics +# --disable-aes-ni disable AES-NI intrinsics +# --disable-sha-ni disable SHA-NI intrinsics +# --disable-altivec disable AltiVec intrinsics +# --disable-neon disable NEON intrinsics +# --disable-armv8crypto disable ARMv8Crypto intrinsics +# +# Build options: +# --with-debug-info include debug symbols +# --with-sanitizers enable ASan/UBSan checks +# --enable-sanitizers=SAN enable specific sanitizers +# --without-stack-protector disable stack smashing protections +# --with-coverage add coverage info and disable opts +# --with-coverage-info add coverage info +# --disable-shared-library disable building shared library +# --disable-static-library disable building static library +# --optimize-for-size optimize for code size +# --no-optimizations disable all optimizations (for debugging) +# --debug-mode enable debug info, disable optimizations +# --amalgamation use amalgamation to build +# --single-amalgamation-file build single file instead of splitting on +# ABI +# --with-build-dir=DIR setup the build in DIR +# --with-external-includedir=DIR use DIR for external includes +# --with-external-libdir=DIR use DIR for external libs +# --with-sysroot-dir=DIR use DIR for system root while cross- +# compiling +# --with-openmp enable use of OpenMP +# --link-method=METHOD choose how links to include headers are +# created (symlink, hardlink, copy) +# --with-local-config=FILE include the contents of FILE into build.h +# --distribution-info=STRING distribution specific version +# --maintainer-mode Enable extra warnings +# --with-python-versions=N.M where to install botan2.py (def 2.7) +# --with-valgrind use valgrind API +# --unsafe-fuzzer-mode Disable essential checks for testing +# --build-fuzzers=TYPE Build fuzzers (afl, libfuzzer, klee, test) +# --with-fuzzer-lib=LIB additionally link in LIB +# +# Documentation Options: +# --without-documentation Skip building/installing documentation +# --with-sphinx Use Sphinx +# --with-pdf Use Sphinx to generate PDF doc +# --with-rst2man Use rst2man to generate man page +# --with-doxygen Use Doxygen +# +# Module selection: +# --module-policy=POL module policy file (see src/build- +# data/policy) +# --enable-modules=MODS enable specific modules +# --disable-modules=MODS disable specific modules +# --minimized-build minimize build +# --with-bearssl use bearssl +# --with-boost use boost +# --with-bzip2 use bzip2 +# --with-lzma use lzma +# --with-openssl use openssl +# --with-commoncrypto use commoncrypto +# --with-sqlite3 use sqlite3 +# --with-zlib use zlib +# --with-tpm use tpm +# +# Installation options: +# --program-suffix=SUFFIX append string to program names +# --library-suffix=SUFFIX append string to library names +# --prefix=DIR set the install prefix +# --docdir=DIR set the doc install dir +# --bindir=DIR set the binary install dir +# --libdir=DIR set the library install dir +# --mandir=DIR set the install dir for man pages +# --includedir=DIR set the include file install dir +# +# Informational: +# --list-modules list available modules and exit +# --list-os-features list available OS features and exit +# +if("@HUNTER_PACKAGE_CONFIGURATION_TYPES@" STREQUAL "Debug") + list(APPEND configure_opts --debug-mode) +endif() + +if(HUNTER_STATUS_DEBUG) + list(APPEND configure_opts --verbose) +endif() + +if(BUILD_SHARED_LIBS) + list(APPEND configure_opt --disable-static-library) +else() + list(APPEND configure_opts --disable-shared-library) +endif() + +if(WITH_ZLIB) + list(APPEND configure_opts --with-zlib) + hunter_add_package(ZLIB) +endif() + +if(WITH_BZIP2) + list(APPEND configure_opts --with-bzip2) + hunter_add_package(BZip2) +endif() + +if(ENABLE_MODULES) + list(APPEND configure_opts --enable-modules=${ENABLE_MODULES}) +endif() + +if("${HUNTER_MSVC_ARCH}" STREQUAL "amd64") + list(APPEND configure_opts --cpu=x64) +else() + list(APPEND configure_opts --cpu=x86) +endif() + +# file(TO_NATIVE_PATH "${cxx}" CXX_BIN) + +# list(APPEND configure_opts +# #--cc-bin=${cxx} +# #"--cc-bin=${CXX_BIN}" +# "--extra-cxxflags=${cxxflags}" +# "--ldflags=${ldflags}" +# #--amalgamation --single-amalgamation-file +# ) + +if(NOT "${ar}" STREQUAL "") + list(APPEND configure_opts --ar-command=${ar}) +endif() + +# MSVS="2015" PLATFORM="x86_amd64" TARGET="shared" +#.\configure.py +#--prefix=c:\users\appveyor\appdata\local\temp\1\botan-install +#--cc=msvc +#--os=windows +#--cpu=x64 or --cpu=x86 +#--cc-bin=sccache cl --no-store-vc-rev + +if(NOT "@HUNTER_MSVC_VCVARSALL@" STREQUAL "") + file(TO_NATIVE_PATH "@HUNTER_MSVC_VCVARSALL@" RUN_MSVC_VCVARSALL) +endif() +file(TO_NATIVE_PATH "@HUNTER_PACKAGE_INSTALL_PREFIX@" INSTALL_PATH) +file(TO_NATIVE_PATH "@HUNTER_PACKAGE_INSTALL_PREFIX@/include" EXTERNAL_INCLUDE) +file(TO_NATIVE_PATH "@HUNTER_PACKAGE_INSTALL_PREFIX@/lib" EXTERNAL_LIB) + +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 + TLS_VERIFY + "@HUNTER_TLS_VERIFY@" + SOURCE_DIR + "@HUNTER_PACKAGE_SOURCE_DIR@" # Unpack directory + INSTALL_DIR + "@HUNTER_INSTALL_PREFIX@" # not used actually (see install command) + CONFIGURE_COMMAND + "${RUN_MSVC_VCVARSALL}" "@HUNTER_MSVC_ARCH@" + COMMAND + "./configure.py" + "--os=windows" + "--cc=msvc" + "--without-documentation" + "--prefix=${INSTALL_PATH}" + "--with-external-includedir=${EXTERNAL_INCLUDE}" + "--with-external-libdir=${EXTERNAL_LIB}" + ${configure_opts} + BUILD_COMMAND + nmake libs + BUILD_IN_SOURCE + 1 + INSTALL_COMMAND + nmake install + 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/breakpad/hunter.cmake b/cmake/projects/breakpad/hunter.cmake new file mode 100644 index 000000000..a0a52b9d6 --- /dev/null +++ b/cmake/projects/breakpad/hunter.cmake @@ -0,0 +1,35 @@ +# Copyright (c) 2016-2018, 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 + breakpad + VERSION + 0.0.0-12ecff3-p1 + URL + "https://github.com/hunter-packages/breakpad/archive/v0.0.0-12ecff3-p1.tar.gz" + SHA1 + 6d6ba5d3f0b8d317b61d1a4256dcdd55f29d19ee +) + +hunter_add_version( + PACKAGE_NAME + breakpad + VERSION + 0.0.0-12ecff3-p2 + URL + "https://github.com/hunter-packages/breakpad/archive/v0.0.0-12ecff3-p2.tar.gz" + SHA1 + 583524ee8f08d0b036bfb4ad3566144b4c272965 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(breakpad) +hunter_download(PACKAGE_NAME breakpad) diff --git a/cmake/projects/bullet/hunter.cmake b/cmake/projects/bullet/hunter.cmake new file mode 100644 index 000000000..41891cf79 --- /dev/null +++ b/cmake/projects/bullet/hunter.cmake @@ -0,0 +1,36 @@ +# Copyright (c) 2016-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 + bullet + VERSION + 2.87-p0 + URL + "https://github.com/hunter-packages/bullet3/archive/2.87-p0.tar.gz" + SHA1 + 7cd3e8b27b081d4c7f7503c3270009d7dc052a0f +) + +hunter_cmake_args( + bullet + CMAKE_ARGS + BUILD_BULLET2_DEMOS=OFF + BUILD_BULLET3=OFF + BUILD_EXTRAS=OFF + BUILD_OPENGL3_DEMOS=OFF + BUILD_UNIT_TESTS=OFF + INSTALL_LIBS=ON +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(bullet) +hunter_download(PACKAGE_NAME bullet) diff --git a/cmake/projects/c-ares/hunter.cmake b/cmake/projects/c-ares/hunter.cmake new file mode 100644 index 000000000..7d27f88bf --- /dev/null +++ b/cmake/projects/c-ares/hunter.cmake @@ -0,0 +1,28 @@ +# !!! 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 c-ares + VERSION "1.13.0" + URL "https://github.com/c-ares/c-ares/archive/cares-1_13_0.tar.gz" + SHA1 "00a0dcb85db6f08afdaf4731cc8e3606daf5a12b") + + +hunter_add_version( + PACKAGE_NAME c-ares + VERSION "1.14.0-p0" + URL "https://github.com/hunter-packages/c-ares/archive/v1.14.0-p0.tar.gz" + SHA1 "4708595fb0eb053a3ca8160cdd579ff626408973") + +if(ANDROID OR IOS) + hunter_cmake_args(c-ares CMAKE_ARGS CARES_BUILD_TOOLS=OFF) +endif() + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(c-ares) +hunter_download(PACKAGE_NAME c-ares) diff --git a/cmake/projects/catkin/hunter.cmake b/cmake/projects/catkin/hunter.cmake new file mode 100644 index 000000000..9da66a2e8 --- /dev/null +++ b/cmake/projects/catkin/hunter.cmake @@ -0,0 +1,64 @@ +# Copyright (c) 2017, Lukas Solanka +# 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 + catkin + VERSION + 0.7.11-p0 + URL + "https://github.com/hunter-packages/catkin/archive/v0.7.11-p0.tar.gz" + SHA1 + "f7d64b4908fe800e5ec128e78e8e2f5bb5c955b3" +) + +hunter_add_version( + PACKAGE_NAME + catkin + VERSION + 0.7.11-p1 + URL + "https://github.com/hunter-packages/catkin/archive/v0.7.11-p1.tar.gz" + SHA1 + "465960e1a8bf849ef045a6d543ed23c5be84e36f" +) + +hunter_add_version( + PACKAGE_NAME + catkin + VERSION + 0.7.11-p2 + URL + "https://github.com/hunter-packages/catkin/archive/v0.7.11-p2.tar.gz" + SHA1 + "d8001b873e2482a48eeb6fe573f88fc4d6d63b7b" +) + +hunter_add_version( + PACKAGE_NAME + catkin + VERSION + 0.7.17-p0 + URL + "https://github.com/hunter-packages/catkin/archive/v0.7.17-p0.tar.gz" + SHA1 + "13aac5184149590d3da67eb23002da690e8df0a6" +) + +hunter_cmake_args( + catkin + CMAKE_ARGS + CATKIN_ENABLE_TESTING:BOOL=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(catkin) +hunter_download(PACKAGE_NAME catkin) diff --git a/cmake/projects/cctz/hunter.cmake b/cmake/projects/cctz/hunter.cmake new file mode 100644 index 000000000..394905e47 --- /dev/null +++ b/cmake/projects/cctz/hunter.cmake @@ -0,0 +1,19 @@ +# !!! 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 cctz + VERSION "2.2.0" + URL "https://github.com/hunter-packages/cctz/archive/hunter-2.2-p0.tar.gz" + SHA1 "86d5ab7555a2f6a8c255dcb50fb7734c4cb8fdfd") + +hunter_cmake_args(cctz CMAKE_ARGS BUILD_TESTING=OFF BUILD_EXAMPLES=OFF) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(cctz) +hunter_download(PACKAGE_NAME cctz) diff --git a/cmake/projects/cereal/hunter.cmake b/cmake/projects/cereal/hunter.cmake index 5da735ab9..85c5670ed 100644 --- a/cmake/projects/cereal/hunter.cmake +++ b/cmake/projects/cereal/hunter.cmake @@ -12,6 +12,28 @@ 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 + VERSION + "1.2.1-p1" + URL + "https://github.com/headupinclouds/cereal/archive/v1.2.1-p1.tar.gz" + SHA1 + 8d8179d71a12bafae3d90b6a5a7fc09cb2e69474 + ) + # List of versions here... hunter_add_version( PACKAGE_NAME @@ -22,7 +44,13 @@ hunter_add_version( "https://github.com/headupinclouds/cereal/archive/v1.1.2-p5.tar.gz" SHA1 4b761dacf480b2dafab02f7f50060bc6c9e78dc7 -) + ) + + hunter_cmake_args( + cereal + CMAKE_ARGS + JUST_INSTALL_CEREAL=ON + ) # Pick a download scheme hunter_pick_scheme(DEFAULT url_sha1_cmake) diff --git a/cmake/projects/ceres-solver/hunter.cmake b/cmake/projects/ceres-solver/hunter.cmake new file mode 100644 index 000000000..fabeb4781 --- /dev/null +++ b/cmake/projects/ceres-solver/hunter.cmake @@ -0,0 +1,89 @@ +# !!! 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_add_version( + PACKAGE_NAME + ceres-solver + VERSION + "1.14.0-p0" + URL + "${_hunter_ceres_base_url_fork}/v1.14.0-p0.tar.gz" + SHA1 + e27d6c0720977667a7789fd7e865e7362dc58695 +) +hunter_add_version( + PACKAGE_NAME + ceres-solver + VERSION + "1.14.0-p1" + URL + "${_hunter_ceres_base_url_fork}/v1.14.0-p1.tar.gz" + SHA1 + fb63a3f1ee8c39a6eda1c3e1611aeb3789015fdf +) +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 + CXSPARSE=OFF # since 1.14.0-p0 + # 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/check_ci_tag/hunter.cmake b/cmake/projects/check_ci_tag/hunter.cmake new file mode 100644 index 000000000..b10eae560 --- /dev/null +++ b/cmake/projects/check_ci_tag/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 + check_ci_tag + VERSION + 1.0.0 + URL + "https://github.com/hunter-packages/check_ci_tag/archive/v1.0.0.tar.gz" + SHA1 + f220960c1174cda57a50a71d6037ca1c4fbbe796 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(check_ci_tag) +hunter_download(PACKAGE_NAME check_ci_tag) diff --git a/cmake/projects/civetweb/hunter.cmake b/cmake/projects/civetweb/hunter.cmake new file mode 100644 index 000000000..a9d651787 --- /dev/null +++ b/cmake/projects/civetweb/hunter.cmake @@ -0,0 +1,49 @@ +# Copyright (c) 2016-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 + civetweb + VERSION + 1.11-p0 + URL + "https://github.com/hunter-packages/civetweb/archive/v1.11-p0.tar.gz" + SHA1 + de6eee085d98419c2db70787cea0d3aff4639ea7 +) + +hunter_add_version( + PACKAGE_NAME + civetweb + VERSION + 1.10-p1 + URL + "https://github.com/hunter-packages/civetweb/archive/v1.10-p1.tar.gz" + SHA1 + 151d705b4c8eb3fe81b273da6ef65ad8a4c1ef8a +) + +hunter_cmake_args( + civetweb + CMAKE_ARGS + BUILD_TESTING=OFF + CIVETWEB_ENABLE_ASAN=OFF + CIVETWEB_ENABLE_SSL_DYNAMIC_LOADING=OFF + CIVETWEB_INSTALL_EXECUTABLE=OFF + CIVETWEB_BUILD_TESTING=OFF + CIVETWEB_ENABLE_CXX=ON + CIVETWEB_ENABLE_SERVER_EXECUTABLE=OFF + CIVETWEB_INSTALL_EXECUTABLE=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(civetweb) +hunter_download(PACKAGE_NAME civetweb) diff --git a/cmake/projects/class_loader/hunter.cmake b/cmake/projects/class_loader/hunter.cmake new file mode 100644 index 000000000..364bf3c5f --- /dev/null +++ b/cmake/projects/class_loader/hunter.cmake @@ -0,0 +1,32 @@ +# Copyright (c) 2016-2019, 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) +include(hunter_cmake_args) + +hunter_add_version( + PACKAGE_NAME + class_loader + VERSION + 0.4.1-p0 + URL + "https://github.com/hunter-packages/class_loader/archive/v0.4.1-p0.tar.gz" + SHA1 + 43e3227edd9131a3b4d9e655e60dbba7cd26c3ed +) + +hunter_cmake_args( + class_loader + CMAKE_ARGS + BUILD_SHARED_LIBS:BOOL=ON + CATKIN_ENABLE_TESTING:BOOL=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(class_loader) +hunter_download(PACKAGE_NAME class_loader) diff --git a/cmake/projects/cmcstl2/hunter.cmake b/cmake/projects/cmcstl2/hunter.cmake new file mode 100644 index 000000000..559bd44f1 --- /dev/null +++ b/cmake/projects/cmcstl2/hunter.cmake @@ -0,0 +1,33 @@ +# 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) +include(hunter_cmake_args) + +hunter_add_version( + PACKAGE_NAME + cmcstl2 + VERSION + 0.0.0-bee0705e99 + URL + "https://github.com/CaseyCarter/cmcstl2/archive/bee0705e9925dfac430cbf3097f82cca2a7de659.zip" + SHA1 + db38fedd3380137284c4d3570e65f1984597628e +) + +hunter_cmake_args( + cmcstl2 + CMAKE_ARGS + STL2_BUILD_EXAMPLES=OFF + STL2_BUILD_TESTING=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(cmcstl2) +hunter_download(PACKAGE_NAME cmcstl2) + diff --git a/cmake/projects/corrade/hunter.cmake b/cmake/projects/corrade/hunter.cmake new file mode 100644 index 000000000..e45a4f838 --- /dev/null +++ b/cmake/projects/corrade/hunter.cmake @@ -0,0 +1,61 @@ +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +# 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... +hunter_add_version( + PACKAGE_NAME + corrade + VERSION + 2019.01 + URL + "https://github.com/mosra/corrade/archive/v2019.01.tar.gz" + SHA1 + 3be8da37331e3dd6a2fa0753a49a1c305f4b5b6a +) + +hunter_add_version( + PACKAGE_NAME + corrade + VERSION + 2018.10 + URL + "https://github.com/mosra/corrade/archive/v2018.10.tar.gz" + SHA1 + 240c68bfe89a0cc86411b6854358b1607c06d90d +) + +hunter_add_version( + PACKAGE_NAME + corrade + VERSION + v2018.10 + URL + "https://github.com/mosra/corrade/archive/v2018.10.tar.gz" + SHA1 + 240c68bfe89a0cc86411b6854358b1607c06d90d +) + +hunter_cmake_args( + corrade + CMAKE_ARGS + # Build TestSuite library (these are not tests, but a test library) + WITH_TESTSUITE=ON + # Build PluginManager library + WITH_PLUGINMANAGER=ON + # Build Interconnect library + WITH_INTERCONNECT=ON + # Enable compatibility mode for MSVC 2015 (might disable some features) + MSVC2015_COMPATIBILITY=OFF + # Enable compatibility mode for GCC 4.7 (might disable some features) + GCC47_COMPATIBILITY:BOOL=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(corrade) +hunter_download(PACKAGE_NAME corrade) diff --git a/cmake/projects/cpp_redis/hunter.cmake b/cmake/projects/cpp_redis/hunter.cmake new file mode 100644 index 000000000..86d65b21a --- /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/cppcodec/hunter.cmake b/cmake/projects/cppcodec/hunter.cmake new file mode 100644 index 000000000..28dbbcbd6 --- /dev/null +++ b/cmake/projects/cppcodec/hunter.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2016-2018, 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 + cppcodec + VERSION + 0.2-p0 + URL + "https://github.com/hunter-packages/cppcodec/archive/v0.2-p0.tar.gz" + SHA1 + 9c52a769670a0fec4fc524fc036fa792fbb3e22e +) + +hunter_cmake_args( + cppcodec + CMAKE_ARGS + BUILD_TESTING=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(cppcodec) +hunter_download(PACKAGE_NAME cppcodec) diff --git a/cmake/projects/cpr/hunter.cmake b/cmake/projects/cpr/hunter.cmake new file mode 100644 index 000000000..f7d0764f1 --- /dev/null +++ b/cmake/projects/cpr/hunter.cmake @@ -0,0 +1,30 @@ +# 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) +include(hunter_cmake_args) + +hunter_add_version( + PACKAGE_NAME + cpr + VERSION + 1.3.0 + URL + https://github.com/hunter-packages/cpr/archive/1.3.0-p.tar.gz + SHA1 + 6a44d4ed75cc75b21ff7612c319a0d9587fcf18d +) + +hunter_cmake_args(cpr CMAKE_ARGS + BUILD_CPR_TESTS=OFF + CMAKE_USE_OPENSSL=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(cpr) +hunter_download(PACKAGE_NAME cpr) diff --git a/cmake/projects/cpuinfo/hunter.cmake b/cmake/projects/cpuinfo/hunter.cmake new file mode 100644 index 000000000..a5fe3c932 --- /dev/null +++ b/cmake/projects/cpuinfo/hunter.cmake @@ -0,0 +1,33 @@ +# 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) +include(hunter_cmake_args) + +hunter_add_version( + PACKAGE_NAME + cpuinfo + VERSION + 0.0.0-d5e37ad-p0 + URL + https://github.com/hunter-packages/cpuinfo/archive/v0.0.0-d5e37ad-p0.tar.gz + SHA1 + 211cc7d1d630e56ee22770f0a9d35c4774d7e671 +) + +hunter_cmake_args(cpuinfo CMAKE_ARGS + CPUINFO_BUILD_TOOLS=OFF + CPUINFO_BUILD_UNIT_TESTS=OFF + CPUINFO_BUILD_MOCK_TESTS=OFF + CPUINFO_BUILD_BENCHMARKS=OFF + CLOG_BUILD_TESTS=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(cpuinfo) +hunter_download(PACKAGE_NAME cpuinfo) diff --git a/cmake/projects/crc32c/hunter.cmake b/cmake/projects/crc32c/hunter.cmake new file mode 100644 index 000000000..9237ca9e4 --- /dev/null +++ b/cmake/projects/crc32c/hunter.cmake @@ -0,0 +1,22 @@ +# !!! 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 crc32c + VERSION "1.0.5" + URL "https://github.com/hunter-packages/crc32c/archive/hunter-1.0.5.tar.gz" + SHA1 "dc7fa8cb877b9cb12a4e22e553087fdd6ce28cce") + +hunter_cmake_args(crc32c CMAKE_ARGS + CRC32C_BUILD_TESTS=OFF + CRC32C_BUILD_BENCHMARKS=OFF + CRC32C_USE_GLOG=OFF) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(crc32c) +hunter_download(PACKAGE_NAME crc32c) diff --git a/cmake/projects/cryptopp/hunter.cmake b/cmake/projects/cryptopp/hunter.cmake new file mode 100644 index 000000000..f878c4936 --- /dev/null +++ b/cmake/projects/cryptopp/hunter.cmake @@ -0,0 +1,63 @@ +# !!! 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 + cryptopp + VERSION + "8.2.0-p0" + URL + "https://github.com/hunter-packages/cryptopp/archive/v8.2.0-p0.tar.gz" + SHA1 + 38a70c9ba970cc862b5cca0010fffdd4e56afcae +) + +hunter_add_version( + PACKAGE_NAME + cryptopp + VERSION + "5.6.5-p0" + URL + "https://github.com/hunter-packages/cryptopp/archive/v5.6.5-p0.tar.gz" + SHA1 + 4258c9b49c48c433c4aa63629bc896ac9a3902e3 +) + +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 + USE_INTERMEDIATE_OBJECTS_TARGET=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/ctti/hunter.cmake b/cmake/projects/ctti/hunter.cmake new file mode 100644 index 000000000..14218c605 --- /dev/null +++ b/cmake/projects/ctti/hunter.cmake @@ -0,0 +1,32 @@ +# !!! 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 + ctti + VERSION + "0.0.2" + URL + "https://github.com/hunter-packages/ctti/archive/0.0.2.tar.gz" + SHA1 + 20858e749b12505863f57e4b5c2e7852b3ea9027 +) + +hunter_cmake_args( + ctti + CMAKE_ARGS + CTTI_BUILD_TESTS=OFF + CTTI_BUILD_EXAMPLES=OFF +) + +# Pick a download scheme +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(ctti) +hunter_download(PACKAGE_NAME ctti) diff --git a/cmake/projects/cub/hunter.cmake b/cmake/projects/cub/hunter.cmake new file mode 100644 index 000000000..0e7d1a61d --- /dev/null +++ b/cmake/projects/cub/hunter.cmake @@ -0,0 +1,37 @@ +# 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 + cub + VERSION + 1.7.4-p0 + URL + "https://github.com/hunter-packages/cub/archive/v1.7.4-p0.tar.gz" + SHA1 + c90ecb5fd3c393371abb9cfbf61d4fd5e36564f1 + ) + +hunter_add_version( + PACKAGE_NAME + cub + VERSION + 1.8.0-p0 + URL + "https://github.com/hunter-packages/cub/archive/v1.8.0-p0.tar.gz" + SHA1 + 99bbf25d1052f9668c3f7ea140971513e6b661c0 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(cub) +hunter_download(PACKAGE_NAME cub) diff --git a/cmake/projects/cvmatio/hunter.cmake b/cmake/projects/cvmatio/hunter.cmake index 49e48e7f5..1d6fc7cee 100644 --- a/cmake/projects/cvmatio/hunter.cmake +++ b/cmake/projects/cvmatio/hunter.cmake @@ -10,6 +10,17 @@ include(hunter_cacheable) include(hunter_download) include(hunter_pick_scheme) +hunter_add_version( + PACKAGE_NAME + cvmatio + VERSION + "1.0.28" + URL + https://github.com/hunter-packages/cvmatio/archive/v1.0.28.tar.gz + SHA1 + 42005086c8c4f85ffcf7f42652c24c8fec3fbe76 +) + hunter_add_version( PACKAGE_NAME cvmatio diff --git a/cmake/projects/cvsteer/hunter.cmake b/cmake/projects/cvsteer/hunter.cmake new file mode 100644 index 000000000..492ac09ba --- /dev/null +++ b/cmake/projects/cvsteer/hunter.cmake @@ -0,0 +1,37 @@ +# Copyright (c) 2016-2018, Ruslan Baratov +# Copyright (c) 2018, 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 + cvsteer + VERSION + 0.1.1 + URL + "https://github.com/headupinclouds/cvsteer/archive/v0.1.1.tar.gz" + SHA1 + b54b096910c0947e1af125e134b2511b25dc847d + ) + +hunter_add_version( + PACKAGE_NAME + cvsteer + VERSION + 0.1.2 + URL + "https://github.com/headupinclouds/cvsteer/archive/v0.1.2.tar.gz" + SHA1 + a61ae7e1b965d47bca449721150576711f3f7f67 + ) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(cvsteer) +hunter_download(PACKAGE_NAME cvsteer) diff --git a/cmake/projects/cxxopts/hunter.cmake b/cmake/projects/cxxopts/hunter.cmake new file mode 100644 index 000000000..075e0bbf1 --- /dev/null +++ b/cmake/projects/cxxopts/hunter.cmake @@ -0,0 +1,122 @@ +# 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 + cxxopts + VERSION + 1.3.0 + URL + "https://github.com/jarro2783/cxxopts/archive/v1.3.0.tar.gz" + SHA1 + 860dac4282e02d02ec5dde49af8317cd0a959e04 +) + +hunter_add_version( + PACKAGE_NAME + cxxopts + VERSION + 1.4.0 + URL + "https://github.com/jarro2783/cxxopts/archive/v1.4.0.tar.gz" + SHA1 + c5efdf5ea875329e6376622c696378e3778111c3 +) + +hunter_add_version( + PACKAGE_NAME + cxxopts + VERSION + 1.4.1 + URL + "https://github.com/jarro2783/cxxopts/archive/v1.4.1.tar.gz" + SHA1 + 330c8ab0d3eab18429a4d903b640ec26fe1bece1 +) + +hunter_add_version( + PACKAGE_NAME + cxxopts + VERSION + 1.4.2 + URL + "https://github.com/jarro2783/cxxopts/archive/v1.4.2.tar.gz" + SHA1 + 3f2544aeb082a82409ba9bd93f93f37bbd8b0269 +) + +hunter_add_version( + PACKAGE_NAME + cxxopts + VERSION + 1.4.3 + URL + "https://github.com/jarro2783/cxxopts/archive/v1.4.3.tar.gz" + SHA1 + bc9a333a56c0a3d90bcab72ea8ecebed9d66da58 +) + +hunter_add_version( + PACKAGE_NAME + cxxopts + VERSION + 1.4.4 + URL + "https://github.com/jarro2783/cxxopts/archive/v1.4.4.tar.gz" + SHA1 + aa9b63a74a38d90c93cd16f9d091afa7361e2083 +) + +hunter_add_version( + PACKAGE_NAME + cxxopts + VERSION + 2.0.0 + URL + "https://github.com/jarro2783/cxxopts/archive/v2.0.0.tar.gz" + SHA1 + 0466413a55646b7e7947bd0b8f602cb22f17dd23 +) + +hunter_add_version( + PACKAGE_NAME + cxxopts + VERSION + 2.1.0 + URL + "https://github.com/jarro2783/cxxopts/archive/v2.1.0.tar.gz" + SHA1 + eb11b3f56444a70225237eb008d930ae758a0f24 +) + +# FIXME, waiting for release: +# * https://github.com/jarro2783/cxxopts/issues/110#issuecomment-394909564 +hunter_add_version( + PACKAGE_NAME + cxxopts + VERSION + 2.1.1-pre + URL + "https://github.com/jarro2783/cxxopts/archive/e725ea308468ab50751ba7f930842a4c061226e9.zip" + SHA1 + cbeec5576599d031f6f992d987e1f3575b3afee3 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(cxxopts) +hunter_cmake_args( + cxxopts + CMAKE_ARGS + CXXOPTS_BUILD_EXAMPLES=OFF + CXXOPTS_BUILD_TESTS=OFF + CXXOPTS_USE_UNICODE_HELP=OFF +) +hunter_download(PACKAGE_NAME cxxopts) diff --git a/cmake/projects/czmq/hunter.cmake b/cmake/projects/czmq/hunter.cmake new file mode 100644 index 000000000..81bfcbc4b --- /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 9d37cb17d..00410693f 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 "3" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/damageproto.pc" ) diff --git a/cmake/projects/date/hunter.cmake b/cmake/projects/date/hunter.cmake new file mode 100644 index 000000000..f5cb21b85 --- /dev/null +++ b/cmake/projects/date/hunter.cmake @@ -0,0 +1,27 @@ +# Copyright (c) 2016-2018, 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 + date + VERSION + 2.4.1 + URL + "https://github.com/HowardHinnant/date/archive/v2.4.1.tar.gz" + SHA1 + 4ed983e1d19ee28bc565bd62907d203304b38cf7 +) + +hunter_cmake_args(date CMAKE_ARGS USE_SYSTEM_TZ_DB=ON) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(date) +hunter_download(PACKAGE_NAME date) diff --git a/cmake/projects/debug_assert/hunter.cmake b/cmake/projects/debug_assert/hunter.cmake new file mode 100644 index 000000000..8499eaee9 --- /dev/null +++ b/cmake/projects/debug_assert/hunter.cmake @@ -0,0 +1,48 @@ +# 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 + debug_assert + VERSION + "1.3.2" + URL + "https://github.com/foonathan/debug_assert/archive/v1.3.2.tar.gz" + SHA1 + f833029bd2bb2af1d7c93d3faf84898722b00bc2 +) + +hunter_add_version( + PACKAGE_NAME + debug_assert + VERSION + "1.3" + URL + "https://github.com/foonathan/debug_assert/archive/v1.3.tar.gz" + SHA1 + 0dd6930196488741ebb79680b261694a8141bf9c +) + +hunter_add_version( + PACKAGE_NAME + debug_assert + VERSION + "1.2" + URL + "https://github.com/foonathan/debug_assert/archive/v1.2.tar.gz" + SHA1 + 0cc89e62d79198fe5df4fda9337bb3e44a0d58c3 +) + +# Pick a download scheme +hunter_pick_scheme(DEFAULT url_sha1_cmake) # use scheme for cmake projects +hunter_cacheable(debug_assert) +hunter_download(PACKAGE_NAME debug_assert) diff --git a/cmake/projects/dest/hunter.cmake b/cmake/projects/dest/hunter.cmake index 96f5f2d3b..81ba347d6 100644 --- a/cmake/projects/dest/hunter.cmake +++ b/cmake/projects/dest/hunter.cmake @@ -19,6 +19,17 @@ hunter_add_version( 8ba961af7c59548cee4dad8ebef042d9eb5bf581 ) +hunter_add_version( + PACKAGE_NAME + dest + VERSION + "0.8.0-p4" + URL + "https://github.com/hunter-packages/dest/archive/v0.8.0-p4.tar.gz" + SHA1 + 36e9e2fef97b91811e346d0eec46e54bcd87e35a + ) + hunter_pick_scheme(DEFAULT url_sha1_cmake) hunter_cacheable(dest) hunter_download(PACKAGE_NAME dest) diff --git a/cmake/projects/dlib/hunter.cmake b/cmake/projects/dlib/hunter.cmake index be69319ac..f25fc6d2c 100644 --- a/cmake/projects/dlib/hunter.cmake +++ b/cmake/projects/dlib/hunter.cmake @@ -5,9 +5,230 @@ include(hunter_add_version) include(hunter_cacheable) +include(hunter_cmake_args) include(hunter_download) include(hunter_pick_scheme) +hunter_add_version( + PACKAGE_NAME + dlib + VERSION + "19.17-p0" + URL + "https://github.com/hunter-packages/dlib/archive/v19.17-p0.tar.gz" + SHA1 + d7fd9d4cec0909be0bbd9c803fd3ed42a5f9f601 +) + +hunter_add_version( + PACKAGE_NAME + dlib + VERSION + "19.16-p0" + URL + "https://github.com/hunter-packages/dlib/archive/v19.16-p0.tar.gz" + SHA1 + 4e0bc81270ed8fc30e0288276e28ccb425e974f1 +) + +hunter_add_version( + PACKAGE_NAME + dlib + VERSION + "19.14-p0" + URL + "https://github.com/hunter-packages/dlib/archive/v19.14-p0.tar.gz" + SHA1 + 22c52e64ff0e5f8bdd163333153f7c6ac98ef5ee +) + +hunter_add_version( + PACKAGE_NAME + dlib + VERSION + "19.12-p2" + URL + "https://github.com/hunter-packages/dlib/archive/v19.12-p2.tar.gz" + SHA1 + 016b26e1378044d1fe7f1df42738505e1315d310 +) + +hunter_add_version( + PACKAGE_NAME + dlib + VERSION + "19.12-p1" + URL + "https://github.com/hunter-packages/dlib/archive/v19.12-p1.tar.gz" + SHA1 + 2f4d339f92b5ba0462eddafb21af9625e734d590 +) + +hunter_add_version( + PACKAGE_NAME + dlib + VERSION + "19.12-p0" + URL + "https://github.com/hunter-packages/dlib/archive/v19.12-p0.tar.gz" + SHA1 + c3f7b6a8eb0e4256dc0130d319555a5e6040b4c1 +) + +hunter_add_version( + PACKAGE_NAME + dlib + VERSION + "19.10-p4" + URL + "https://github.com/hunter-packages/dlib/archive/v19.10-p4.tar.gz" + SHA1 + 3b0d66d73351a2d42a2e28044f568a5224f458ce +) + +hunter_add_version( + PACKAGE_NAME + dlib + VERSION + "19.10-p3" + URL + "https://github.com/hunter-packages/dlib/archive/v19.10-p3.tar.gz" + SHA1 + 42817cf82b7f300c9b2d647d270ada5b02b3709c +) + +hunter_add_version( + PACKAGE_NAME + dlib + VERSION + "19.10-p2" + URL + "https://github.com/hunter-packages/dlib/archive/v19.10-p2.tar.gz" + SHA1 + 8962447a89512ac93904aec2c94d1138d07006b0 +) + +hunter_add_version( + PACKAGE_NAME + dlib + VERSION + "19.8-p0" + URL + "https://github.com/hunter-packages/dlib/archive/v19.8-p0.tar.gz" + SHA1 + 42a19443f08d3015b105550db85b3161f1020325 +) + +hunter_add_version( + PACKAGE_NAME + dlib + VERSION + "19.6-p2" + URL + "https://github.com/hunter-packages/dlib/archive/v19.6-p2.tar.gz" + SHA1 + 2f763c72f9d7fc5f2d7120d775a37606a4b3b899 +) + +hunter_add_version( + PACKAGE_NAME + dlib + VERSION + "19.6-p1" + URL + "https://github.com/hunter-packages/dlib/archive/v19.6-p1.tar.gz" + SHA1 + 1f514ffabb5aced4248f40e22db701f0356dcb0f +) + +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 + VERSION + "19.2-p1" + URL + "https://github.com/hunter-packages/dlib/archive/v19.2-p1.tar.gz" + SHA1 + fec7fdc72c42c5bc1ca466f9be325594921a80c8 +) + +hunter_add_version( + PACKAGE_NAME + dlib + VERSION + "19.2-p2" + URL + "https://github.com/hunter-packages/dlib/archive/v19.2-p2.tar.gz" + SHA1 + 5ce3d09490536dc0dc9bcb0d14ee25f1bebdbfa3 +) + +hunter_add_version( + PACKAGE_NAME + dlib + VERSION + "19.0-p3" + URL + "https://github.com/hunter-packages/dlib/archive/v19.0-p3.tar.gz" + SHA1 + 9671c304c770b580921a6aba7287a92cf5db5417 +) + +hunter_add_version( + PACKAGE_NAME + dlib + VERSION + "19.0-p2" + URL + "https://github.com/hunter-packages/dlib/archive/v19.0-p2.tar.gz" + SHA1 + 549550ab2da038b32eca3e0247c0da4f0df253df +) + hunter_add_version( PACKAGE_NAME dlib @@ -41,6 +262,28 @@ hunter_add_version( bf73cd97ab81162e085d06f1b4595902abe5a436 ) +hunter_add_version( + PACKAGE_NAME + dlib + VERSION + "19.8-p1" + URL + "https://github.com/hunter-packages/dlib/archive/v19.8-p1.tar.gz" + SHA1 + 83426cea82aad42a0f7b1d6bac42996c4f2b69ea +) + +hunter_cmake_args( + dlib + CMAKE_ARGS + DLIB_PNG_SUPPORT=ON + DLIB_GIF_SUPPORT=ON + DLIB_JPEG_SUPPORT=ON + DLIB_NO_GUI_SUPPORT=ON + DLIB_LINK_WITH_SQLITE3=ON + HUNTER_INSTALL_LICENSE_FILES=dlib/LICENSE.txt +) + hunter_pick_scheme(DEFAULT url_sha1_cmake) hunter_cacheable(dlib) hunter_download(PACKAGE_NAME dlib) diff --git a/cmake/projects/dlpack/hunter.cmake b/cmake/projects/dlpack/hunter.cmake new file mode 100644 index 000000000..2b8cdcfa3 --- /dev/null +++ b/cmake/projects/dlpack/hunter.cmake @@ -0,0 +1,82 @@ +# Copyright (c) 2016-2018, 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 + dlpack + VERSION + "0.2-p0" + URL + "https://github.com/hunter-packages/dlpack/archive/v0.2-p0.tar.gz" + SHA1 + 0ecb2a1bbf1f5578e92c11f1deda96cf625eb401 +) + +hunter_add_version( + PACKAGE_NAME + dlpack + VERSION + "0.2-bee4d1d-p0" + URL + "https://github.com/hunter-packages/dlpack/archive/v0.2-bee4d1d-p0.tar.gz" + SHA1 + 86a28f7458fc029dea30a096e2e0f4b78c7719be +) + +hunter_add_version( + PACKAGE_NAME + dlpack + VERSION + 0.2-5c792ce + URL + "https://github.com/dmlc/dlpack/archive/5c792cef3aee54ad8b7000111c9dc1797f327b59.zip" + SHA1 + 315b8c46ff85ec777fa3e5db06213710f62e1116 +) + +hunter_add_version( + PACKAGE_NAME + dlpack + VERSION + "0.2-5c792ce-p0" + URL + "https://github.com/hunter-packages/dlpack/archive/v0.2-5c792ce-p0.tar.gz" + SHA1 + 0be27ccdaf2142517e21b62cb3629c363ccebbf2 +) + +hunter_add_version( + PACKAGE_NAME + dlpack + VERSION + "0.2-a4aa2f5" + URL + "https://github.com/dmlc/dlpack/archive/a4aa2f516b995e5241331db128bec527d24f4cb6.zip" + SHA1 + 387656143ea23920551a881b157e59cffb91ef71 +) + +hunter_add_version( + PACKAGE_NAME + dlpack + VERSION + "0.2-0acb731" + URL + "https://github.com/dmlc/dlpack/archive/0acb731e0e43d15deee27b66f10e4c5b4e667913.zip" + SHA1 + 4fa2048869dbbc589c05eac3295002b866ee456a +) + +hunter_cmake_args(dlpack CMAKE_ARGS BUILD_MOCK=OFF) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(dlpack) +hunter_download(PACKAGE_NAME dlpack) diff --git a/cmake/projects/dmlc-core/hunter.cmake b/cmake/projects/dmlc-core/hunter.cmake new file mode 100644 index 000000000..50e11e2a4 --- /dev/null +++ b/cmake/projects/dmlc-core/hunter.cmake @@ -0,0 +1,114 @@ +# Copyright (c) 2016-2018, Ruslan Baratov +# Copyright (c) 2018, 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 + dmlc-core + VERSION + 0.0.0-p1 + URL + https://github.com/hunter-packages/dmlc-core/archive/v0.0.0-p1.tar.gz + SHA1 + ba306bb39910c2bb635fb034150b1afde0a6660c + ) + +hunter_add_version( + PACKAGE_NAME + dmlc-core + VERSION + 0.0.0-p0 + URL + https://github.com/hunter-packages/dmlc-core/archive/v0.0.0-p0.tar.gz + SHA1 + f2fbfca630b897e75507e8d3e9e05cc00eee6e8e + ) + +hunter_add_version( + PACKAGE_NAME + dmlc-core + VERSION + 0.0.0-mxnet-0a0e8ad-p0 + URL + https://github.com/hunter-packages/dmlc-core/archive/0.0.0-mxnet-0a0e8ad-p0.tar.gz + SHA1 + 551ef4e0e51dfd6cdf79d766fe37e64a3a90d3e0 + ) + +hunter_add_version( + PACKAGE_NAME + dmlc-core + VERSION + 0.0.0-946a540-p0 + URL + https://github.com/hunter-packages/dmlc-core/archive/v0.0.0-946a540-p0.tar.gz + SHA1 + e31258568ec9951272fd1a6a25a04e166931ebbd + ) + +hunter_add_version( + PACKAGE_NAME + dmlc-core + VERSION + 0.3-d07fb7a-p0 + URL + "https://github.com/hunter-packages/dmlc-core/archive/v0.3-d07fb7a-p0.tar.gz" + SHA1 + 4f0abf7a0a06091d2c26de073d992e239fd6e63f + ) + +hunter_add_version( + PACKAGE_NAME + dmlc-core + VERSION + 0.3-d07fb7a-p1 + URL + "https://github.com/hunter-packages/dmlc-core/archive/v0.3-d07fb7a-p1.tar.gz" + SHA1 + 3185100daf1942e7fdd7707fa71a3e8598232913 + ) + +hunter_add_version( + PACKAGE_NAME + dmlc-core + VERSION + 0.3-d07fb7a-p2 + URL + "https://github.com/hunter-packages/dmlc-core/archive/v0.3-d07fb7a-p2.tar.gz" + SHA1 + 027989d7f4e4c2bc805ebee08a405e4236e39b73 + ) + +hunter_add_version( + PACKAGE_NAME + dmlc-core + VERSION + 0.3-3943914-p0 + URL + "https://github.com/hunter-packages/dmlc-core/archive/v0.3-3943914-p0.tar.gz" + SHA1 + b81c6bc89f4887971c472bfeefdc756083d13966 + ) + +hunter_cmake_args( + dmlc-core + CMAKE_ARGS + USE_OPENMP=OFF # since not all compilers support this + + # '/usr/include' leaking into compilation will ruine everything + # - https://travis-ci.org/ingenue/hunter/jobs/510403904 + # -- Found Backtrace: /usr/include + CMAKE_DISABLE_FIND_PACKAGE_Backtrace=ON + ) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(dmlc-core) +hunter_download(PACKAGE_NAME dmlc-core) diff --git a/cmake/projects/doctest/hunter.cmake b/cmake/projects/doctest/hunter.cmake new file mode 100644 index 000000000..4b9a6da71 --- /dev/null +++ b/cmake/projects/doctest/hunter.cmake @@ -0,0 +1,56 @@ +# 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_add_version( + PACKAGE_NAME + doctest + VERSION + "2.2.0" + URL + "https://github.com/onqtam/doctest/archive/2.2.0.tar.gz" + SHA1 + b8a16ca63ce7f263b84f3404db1500fcf2295488 +) + +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 000000000..fb6060f15 --- /dev/null +++ b/cmake/projects/double-conversion/hunter.cmake @@ -0,0 +1,33 @@ +# !!! 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_add_version( + PACKAGE_NAME + double-conversion + VERSION + "3.1.4" + URL + "https://github.com/google/double-conversion/archive/v3.1.4.tar.gz" + SHA1 + 26a0ddaf0abb7e53c67f2abfac95b1e009c2a002 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(double-conversion) +hunter_download(PACKAGE_NAME double-conversion) diff --git a/cmake/projects/draco/hunter.cmake b/cmake/projects/draco/hunter.cmake new file mode 100644 index 000000000..c91718233 --- /dev/null +++ b/cmake/projects/draco/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2018, 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 + draco + VERSION + 1.3.4-p0 + URL + "https://github.com/hunter-packages/draco/archive/v1.3.4-p0.tar.gz" + SHA1 + 64cd8ac43fc213ad4cb088aa7bba190adb87bb5d +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(draco) +hunter_download(PACKAGE_NAME draco) diff --git a/cmake/projects/dri2proto/hunter.cmake b/cmake/projects/dri2proto/hunter.cmake index b28f7dec1..1fbd9f0c5 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 "3" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/dri2proto.pc" ) diff --git a/cmake/projects/dri3proto/hunter.cmake b/cmake/projects/dri3proto/hunter.cmake index ce9cc8158..30baf18fc 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 "3" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/dri3proto.pc" ) diff --git a/cmake/projects/drishti/hunter.cmake b/cmake/projects/drishti/hunter.cmake new file mode 100644 index 000000000..36ee80e86 --- /dev/null +++ b/cmake/projects/drishti/hunter.cmake @@ -0,0 +1,54 @@ +# Copyright (c) 2016-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 + drishti + VERSION + 0.8.4 + URL + "https://github.com/elucideye/drishti/archive/v0.8.4.tar.gz" + SHA1 + 8d3bdc346073c0a1449b213fe374f6baf7589af1 +) + +hunter_add_version( + PACKAGE_NAME + drishti + VERSION + 0.8.6 + URL + "https://github.com/elucideye/drishti/archive/v0.8.6.tar.gz" + SHA1 + 180161389f017719380f344e09f76fd1cdae609d +) + +hunter_add_version( + PACKAGE_NAME + drishti + VERSION + 0.8.9 + URL + "https://github.com/elucideye/drishti/archive/v0.8.9.tar.gz" + SHA1 + b53bd5e779c2f1cca85c74d0c9dce7dd5c2b92f1 + ) + +hunter_cmake_args( + drishti + CMAKE_ARGS + DRISHTI_BUILD_EXAMPLES=NO + DRISHTI_BUILD_OGLES_GPGPU=ON +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(drishti) +hunter_download(PACKAGE_NAME drishti) diff --git a/cmake/projects/drishti_assets/hunter.cmake b/cmake/projects/drishti_assets/hunter.cmake new file mode 100644 index 000000000..9898ea7dd --- /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 000000000..a17f47f7e --- /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 f5b00ac0c..723421d5d 100644 --- a/cmake/projects/drm/hunter.cmake +++ b/cmake/projects/drm/hunter.cmake @@ -22,6 +22,17 @@ hunter_add_version( 21d43437219ddd1e409fb4b7d77254cd129e8075 ) +hunter_add_version( + PACKAGE_NAME + drm + VERSION + "2.4.94" + URL + "https://dri.freedesktop.org/libdrm/libdrm-2.4.94.tar.bz2" + SHA1 + f8daee6cc2e7d2c9eb2dd062a2712172fb9f4e18 +) + hunter_configuration_types(drm CONFIGURATION_TYPES Release) hunter_pick_scheme(DEFAULT url_sha1_autotools) set(drm_dependencies @@ -37,7 +48,7 @@ hunter_cmake_args( hunter_cacheable(drm) hunter_download( PACKAGE_NAME drm - PACKAGE_INTERNAL_DEPS_ID "2" + PACKAGE_INTERNAL_DEPS_ID "4" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/libdrm.la" "lib/libdrm_amdgpu.la" diff --git a/cmake/projects/duktape/hunter.cmake b/cmake/projects/duktape/hunter.cmake new file mode 100644 index 000000000..1266c0f84 --- /dev/null +++ b/cmake/projects/duktape/hunter.cmake @@ -0,0 +1,35 @@ +# Copyright (c) 2016-2018, 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 + duktape + VERSION + 1.5.2-p0 + URL + "https://github.com/hunter-packages/duktape/archive/v1.5.2-p0.tar.gz" + SHA1 + d5e271aecae4fd6da5d3526783f4278e83c2853a +) + +hunter_add_version( + PACKAGE_NAME + duktape + VERSION + 2.2.1-p0 + URL + "https://github.com/hunter-packages/duktape/archive/v2.2.1-p0.tar.gz" + SHA1 + 7482a0870d9dd1908384fdc465e1f31fc0ae04ca +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(duktape) +hunter_download(PACKAGE_NAME duktape) diff --git a/cmake/projects/dynalo/hunter.cmake b/cmake/projects/dynalo/hunter.cmake new file mode 100644 index 000000000..fe3438087 --- /dev/null +++ b/cmake/projects/dynalo/hunter.cmake @@ -0,0 +1,21 @@ +# Copyright (c) 2016-2018, Ruslan Baratov +# Copyright (c) 2018, Yassine Maddouri +# 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 dynalo + VERSION 1.0.3 + URL "https://github.com/maddouri/dynalo/archive/1.0.3.tar.gz" + SHA1 b79a1d10c166eea483d0911f849168ceecf8cdbc +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(dynalo) +hunter_download(PACKAGE_NAME dynalo) diff --git a/cmake/projects/eigen3-nnls/hunter.cmake b/cmake/projects/eigen3-nnls/hunter.cmake new file mode 100644 index 000000000..09e9a44a3 --- /dev/null +++ b/cmake/projects/eigen3-nnls/hunter.cmake @@ -0,0 +1,37 @@ +# 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_add_version( + PACKAGE_NAME + eigen3-nnls + VERSION + 1.0.1 + URL + "https://github.com/hunter-packages/eigen3-nnls/archive/v1.0.1.tar.gz" + SHA1 + c324595a32b51476eb5e26ce70616709e97b2ec3 + ) + +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 000000000..962d789d8 --- /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/entityx/hunter.cmake b/cmake/projects/entityx/hunter.cmake new file mode 100644 index 000000000..136c9d317 --- /dev/null +++ b/cmake/projects/entityx/hunter.cmake @@ -0,0 +1,33 @@ +# Copyright (c) 2016-2018, 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 + entityx + VERSION + 1.3.0-p1 + URL + "https://github.com/hunter-packages/entityx/archive/v1.3.0-p1.tar.gz" + SHA1 + 8df57150ba8a850ed7250fbd7fd4396a0fa05c22 +) + +hunter_cmake_args( + entityx + CMAKE_ARGS + ENTITYX_BUILD_TESTING=0 + ENTITYX_RUN_BENCHMARKS=0 + ENTITYX_BUILD_SHARED=0 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(entityx) +hunter_download(PACKAGE_NAME entityx) diff --git a/cmake/projects/eos/hunter.cmake b/cmake/projects/eos/hunter.cmake index 7c7a1fd3c..2a64b058a 100644 --- a/cmake/projects/eos/hunter.cmake +++ b/cmake/projects/eos/hunter.cmake @@ -1,4 +1,5 @@ -# Copyright (c) 2016, Ruslan Baratov +# Copyright (c) 2016-2017, Ruslan Baratov +# Copyright (c) 2017, David Hirvonen # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -9,6 +10,28 @@ include(hunter_cmake_args) include(hunter_download) include(hunter_pick_scheme) +hunter_add_version( + PACKAGE_NAME + eos + VERSION + 0.12.1 + URL + "https://github.com/hunter-packages/eos/archive/v0.12.1.tar.gz" + SHA1 + cbc8143c270fe4ade45be47adae83f34db280659 +) + +hunter_add_version( + PACKAGE_NAME + eos + VERSION + 0.6.1-p1 + URL + "https://github.com/hunter-packages/eos/archive/v0.6.1-p1.tar.gz" + SHA1 + 663e02aa35275f9dc447e8d4004e091f107eb686 +) + hunter_add_version( PACKAGE_NAME eos diff --git a/cmake/projects/ethash/hunter.cmake b/cmake/projects/ethash/hunter.cmake new file mode 100644 index 000000000..fb93b0544 --- /dev/null +++ b/cmake/projects/ethash/hunter.cmake @@ -0,0 +1,85 @@ +# Copyright (c) 2018, Pawel Bylica + +# !!! 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 + ethash + VERSION + 0.1.0 + URL + https://github.com/chfast/ethash/archive/v0.1.0.tar.gz + SHA1 + bc97f901164e04a53c67b536cc9b58fae6ed9bb5 +) + +hunter_add_version( + PACKAGE_NAME + ethash + VERSION + 0.2.0 + URL + https://github.com/chfast/ethash/archive/v0.2.0.tar.gz + SHA1 + 262f0926ccd2f1dc09541c013f257248da976e14 +) + +hunter_add_version( + PACKAGE_NAME + ethash + VERSION + 0.3.0 + URL + https://github.com/chfast/ethash/archive/v0.3.0.tar.gz + SHA1 + 42597f359c25018e058289652caed8475b6fc1e5 +) + +hunter_add_version( + PACKAGE_NAME + ethash + VERSION + 0.4.3 + URL + https://github.com/chfast/ethash/archive/v0.4.3.tar.gz + SHA1 + ec5a7a54c508cc5f2c11d175b68f3ac3db2200ed +) + +hunter_add_version( + PACKAGE_NAME + ethash + VERSION + 0.4.4 + URL + https://github.com/chfast/ethash/archive/v0.4.4.tar.gz + SHA1 + d09e4560cf7e5ea9ce9e3c1f35a98edeb46e6bb6 +) + +hunter_add_version( + PACKAGE_NAME + ethash + VERSION + 0.5.0 + URL + https://github.com/chfast/ethash/archive/v0.5.0.tar.gz + SHA1 + 674af68ac051e46895ad74f68c9378311fe89b2b +) + +hunter_cmake_args( + ethash + CMAKE_ARGS + ETHASH_BUILD_TESTS=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(ethash) +hunter_download(PACKAGE_NAME ethash) diff --git a/cmake/projects/farmhash/hunter.cmake b/cmake/projects/farmhash/hunter.cmake new file mode 100644 index 000000000..a53ba2dc2 --- /dev/null +++ b/cmake/projects/farmhash/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 + farmhash + VERSION + 1.1 + URL + https://github.com/hunter-packages/farmhash/archive/v1.1.tar.gz + SHA1 + d2f911dc4fa72af2a6ff82c2ca372c7b0f05493d + ) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(farmhash) +hunter_download(PACKAGE_NAME farmhash) diff --git a/cmake/projects/ffmpeg/hunter.cmake b/cmake/projects/ffmpeg/hunter.cmake new file mode 100644 index 000000000..49dd17f5a --- /dev/null +++ b/cmake/projects/ffmpeg/hunter.cmake @@ -0,0 +1,83 @@ +# Copyright (c) 2016-2019, Ruslan Baratov +# All rights reserved. + +# !!! 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 + ffmpeg + VERSION + n4.1-dev-45499e557c-p1 + URL + "https://github.com/hunter-packages/FFmpeg/archive/n4.1-dev-45499e557c-p1.tar.gz" + SHA1 + cc130bde82f4f71fed00496a5a9b9348f427536e +) + +hunter_add_version( + PACKAGE_NAME + ffmpeg + VERSION + n4.1-dev-45499e557c-p2 + URL + "https://github.com/hunter-packages/FFmpeg/archive/n4.1-dev-45499e557c-p2.tar.gz" + SHA1 + 41935479eda43783440d220bb9da04f4dae5ceaa +) + +hunter_add_version( + PACKAGE_NAME + ffmpeg + VERSION + n4.1-dev-45499e557c-p3 + URL + "https://github.com/hunter-packages/FFmpeg/archive/n4.1-dev-45499e557c-p3.tar.gz" + SHA1 + 4f14e0ffd920f8cd5e17496189166ce5b6a5983b +) + +hunter_add_version( + PACKAGE_NAME + ffmpeg + VERSION + n4.1-dev-45499e557c-p4 + URL + "https://github.com/hunter-packages/FFmpeg/archive/n4.1-dev-45499e557c-p4.tar.gz" + SHA1 + e54bfe17b6e6d46de28ee79599e691b318ea50e4 +) + +hunter_add_version( + PACKAGE_NAME + ffmpeg + VERSION + n4.1-dev-45499e557c-p6 + URL + "https://github.com/hunter-packages/FFmpeg/archive/n4.1-dev-45499e557c-p6.tar.gz" + SHA1 + a6b9a15d56a652ca151d2cf4b1686a2da3f1545c +) + +hunter_add_version( + PACKAGE_NAME + ffmpeg + VERSION + n4.1-dev-45499e557c-p7 + URL + "https://github.com/hunter-packages/FFmpeg/archive/n4.1-dev-45499e557c-p7.tar.gz" + SHA1 + 477525bae6a5395f61b470d25b47163a4048dab6 +) + +# GCC 4.8 + examples/OpenCV-ffmpeg link error +hunter_configuration_types(ffmpeg CONFIGURATION_TYPES Release) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(ffmpeg) +hunter_download(PACKAGE_NAME ffmpeg) diff --git a/cmake/projects/fft2d/hunter.cmake b/cmake/projects/fft2d/hunter.cmake new file mode 100644 index 000000000..3795b5073 --- /dev/null +++ b/cmake/projects/fft2d/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 + fft2d + VERSION + 1.0.0-p0 + URL + "https://github.com/hunter-packages/fft2d/archive/v1.0.0-p0.tar.gz" + SHA1 + 080f5415229653fe032e981e4ce65a05a6967bbe + ) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(fft2d) +hunter_download(PACKAGE_NAME fft2d) diff --git a/cmake/projects/fixesproto/hunter.cmake b/cmake/projects/fixesproto/hunter.cmake index 48481d8a1..7187a214d 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 "3" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/fixesproto.pc" ) diff --git a/cmake/projects/flatbuffers/hunter.cmake b/cmake/projects/flatbuffers/hunter.cmake index 6f5a834be..069dde41a 100644 --- a/cmake/projects/flatbuffers/hunter.cmake +++ b/cmake/projects/flatbuffers/hunter.cmake @@ -20,12 +20,22 @@ hunter_add_version( b031689b876c2abac28c8e22fea68ca6d572d1f5 ) +hunter_add_version( + PACKAGE_NAME + flatbuffers + VERSION + 1.8.0-p1 + URL + "https://github.com/google/flatbuffers/archive/dfe68566e4b90d90635f19f466dc3f4b50a58a4f.zip" + SHA1 + 7f596e79368bc0d3080d22708bcc7625cc03a1d1 +) + hunter_cmake_args( flatbuffers CMAKE_ARGS FLATBUFFERS_BUILD_FLATC=OFF FLATBUFFERS_BUILD_FLATHASH=OFF - FLATBUFFERS_BUILD_FLATLIB=OFF FLATBUFFERS_BUILD_TESTS=OFF ) diff --git a/cmake/projects/flex/hunter.cmake b/cmake/projects/flex/hunter.cmake new file mode 100644 index 000000000..836157335 --- /dev/null +++ b/cmake/projects/flex/hunter.cmake @@ -0,0 +1,25 @@ +# !!! 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) + +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_flex_autotools) +hunter_cacheable(flex) +hunter_download(PACKAGE_NAME flex + PACKAGE_INTERNAL_DEPS_ID "1") diff --git a/cmake/projects/SQLite3/schemes/url_sha1_sqlite3_autotools.cmake.in b/cmake/projects/flex/schemes/url_sha1_flex_autotools.cmake.in similarity index 54% rename from cmake/projects/SQLite3/schemes/url_sha1_sqlite3_autotools.cmake.in rename to cmake/projects/flex/schemes/url_sha1_flex_autotools.cmake.in index 13c70c5d7..e5dc8699f 100644 --- a/cmake/projects/SQLite3/schemes/url_sha1_sqlite3_autotools.cmake.in +++ b/cmake/projects/flex/schemes/url_sha1_flex_autotools.cmake.in @@ -1,6 +1,3 @@ -# Copyright (c) 2013, 2015 Ruslan Baratov, Alexandre Pretyman -# All rights reserved. - cmake_minimum_required(VERSION 3.0) project(Hunter) @@ -8,25 +5,25 @@ list(APPEND CMAKE_MODULE_PATH "@HUNTER_SELF@/cmake/modules") include(hunter_autotools_project) include(hunter_status_debug) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) include(hunter_user_error) -hunter_status_debug("Scheme: url_sha1_sqlite3_autotools") +hunter_status_debug("Scheme: url_sha1_flex_autotools") if("@MSVC@") hunter_user_error("Autotools scheme not supported with Visual Studio") endif() # 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_BUILD_DIR@") -hunter_test_string_not_empty("@HUNTER_PACKAGE_INSTALL_PREFIX@") -hunter_test_string_not_empty("@HUNTER_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_BUILD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_INSTALL_PREFIX@") hunter_autotools_project("@HUNTER_EP_NAME@" HUNTER_SELF @@ -50,6 +47,5 @@ hunter_autotools_project("@HUNTER_EP_NAME@" PACKAGE_CONFIGURATION_TYPES "@HUNTER_PACKAGE_CONFIGURATION_TYPES@" CPPFLAGS - "-DSQLITE_ENABLE_UNLOCK_NOTIFY=1 -DSQLITE_ENABLE_RTREE=1" + "-D_GNU_SOURCE" ) - diff --git a/cmake/projects/fmt/hunter.cmake b/cmake/projects/fmt/hunter.cmake index 322f008ef..34154d81d 100644 --- a/cmake/projects/fmt/hunter.cmake +++ b/cmake/projects/fmt/hunter.cmake @@ -19,11 +19,45 @@ hunter_add_version( 82ca4625f977ee1e0627ce8421bc52fbbf6e5cc5 ) +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 + VERSION + "4.1.0" + URL + "https://github.com/fmtlib/fmt/archive/4.1.0.tar.gz" + SHA1 + 9df8f7a70c1b45ffe308e8e3f4f92b31cb927a7a +) + +hunter_add_version( + PACKAGE_NAME + fmt + VERSION + "5.2.1" + URL + "https://github.com/fmtlib/fmt/archive/5.2.1.tar.gz" + SHA1 + 8b38f1ecdf137e8ca24e9b66145c1b94fa5f921d +) + hunter_cmake_args( fmt CMAKE_ARGS FMT_DOC=OFF FMT_TEST=OFF + FMT_USE_CPP14=OFF # don't force c++14 ) # Pick a download scheme diff --git a/cmake/projects/folly/hunter.cmake b/cmake/projects/folly/hunter.cmake new file mode 100644 index 000000000..e6f02f87b --- /dev/null +++ b/cmake/projects/folly/hunter.cmake @@ -0,0 +1,90 @@ +# Copyright (c) 2016-2018, 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 + folly + VERSION + 2017.11.13.00-p0 + URL + "https://github.com/hunter-packages/folly/archive/v2017.11.13.00-p0.tar.gz" + SHA1 + cb7592adcda706df5f558466b96b1ab4c6bc751a +) + +hunter_add_version( + PACKAGE_NAME + folly + VERSION + 2018.10.22.00-p2 + URL + "https://github.com/hunter-packages/folly/archive/v2018.10.22.00-p2.tar.gz" + SHA1 + 5cd5d03bbddd3ad047afc0e402bd3ee3af2888f4 +) + +hunter_add_version( + PACKAGE_NAME + folly + VERSION + 2018.10.22.00-p3 + URL + "https://github.com/hunter-packages/folly/archive/v2018.10.22.00-p3.tar.gz" + SHA1 + 74487a7393a9cac9c8b49581b3fe965c129d28f3 +) + +hunter_add_version( + PACKAGE_NAME + folly + VERSION + 2018.10.22.00-p4 + URL + "https://github.com/hunter-packages/folly/archive/v2018.10.22.00-p4.tar.gz" + SHA1 + aeb254f1010cff1857e5fff897ebbc20e710b410 +) + +set(__hunter_folly_args FOLLY_POD_CONFIGURATION=ON) + +if("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore") + set(__hunter_folly_windows_store TRUE) +else() + set(__hunter_folly_windows_store FALSE) +endif() + +if(__hunter_folly_windows_store) + list(APPEND __hunter_folly_args FOLLY_USE_GLOG=OFF) +endif() + +if(IOS OR ANDROID OR __hunter_folly_windows_store) + # Fix 'try_run' + list( + APPEND + __hunter_folly_args + FOLLY_HAVE_UNALIGNED_ACCESS_EXITCODE="" + FOLLY_HAVE_UNALIGNED_ACCESS_EXITCODE__TRYRUN_OUTPUT="" + FOLLY_HAVE_LINUX_VDSO_EXITCODE="" + FOLLY_HAVE_LINUX_VDSO_EXITCODE__TRYRUN_OUTPUT="" + FOLLY_HAVE_WCHAR_SUPPORT_EXITCODE="" + FOLLY_HAVE_WCHAR_SUPPORT_EXITCODE__TRYRUN_OUTPUT="" + HAVE_VSNPRINTF_ERRORS_EXITCODE="" + HAVE_VSNPRINTF_ERRORS_EXITCODE__TRYRUN_OUTPUT="" + FOLLY_HAVE_XSI_STRERROR_R_EXITCODE="" + FOLLY_HAVE_XSI_STRERROR_R_EXITCODE__TRYRUN_OUTPUT="" + ) +endif() + +hunter_cmake_args(folly CMAKE_ARGS ${__hunter_folly_args}) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(folly) +hunter_download(PACKAGE_NAME folly) diff --git a/cmake/projects/foo/hunter.cmake b/cmake/projects/foo/hunter.cmake new file mode 100644 index 000000000..478a1557a --- /dev/null +++ b/cmake/projects/foo/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2019, 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_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(foo) +hunter_download(PACKAGE_NAME foo) diff --git a/cmake/projects/freetype/hunter.cmake b/cmake/projects/freetype/hunter.cmake index 49d542f86..35f680d17 100644 --- a/cmake/projects/freetype/hunter.cmake +++ b/cmake/projects/freetype/hunter.cmake @@ -4,9 +4,32 @@ include(hunter_add_version) include(hunter_cacheable) +include(hunter_cmake_args) include(hunter_download) include(hunter_pick_scheme) +hunter_add_version( + PACKAGE_NAME + freetype + VERSION + "2.9.1-p1" + URL + "https://github.com/hunter-packages/freetype/archive/v2.9.1-p1.tar.gz" + SHA1 + d4000efdea07253ff2dc9132403e09c321ec88ea +) + +hunter_add_version( + PACKAGE_NAME + freetype + VERSION + "2.9.1-p0" + URL + "https://github.com/hunter-packages/freetype/archive/v2.9.1-p0.tar.gz" + SHA1 + e3b929a3af402059e88c847dd9b92e92c10401fe +) + hunter_add_version( PACKAGE_NAME freetype @@ -18,6 +41,37 @@ hunter_add_version( d797e30cfa79eb95dc3b67e75fa6d6a3da80d1ae ) +hunter_add_version( + PACKAGE_NAME + freetype + VERSION + "2.4.12-p0" + URL + "https://github.com/hunter-packages/freetype/archive/v2.4.12-p0.tar.gz" + SHA1 + 6623f3b91b921c71c4b4485f67b252a7025eb18e +) + +hunter_add_version( + PACKAGE_NAME + freetype + VERSION + "2.4.12-p1" + URL + "https://github.com/hunter-packages/freetype/archive/v2.4.12-p1.tar.gz" + SHA1 + 7f172287e594c916150f1b2a2882a188f945e969 +) + +hunter_cmake_args( + freetype + CMAKE_ARGS + FT_WITH_PNG=ON + FT_WITH_ZLIB=ON + FT_WITH_BZIP2=ON + FT_WITH_HARFBUZZ=OFF # harfbuzz already depends on freetype! +) + hunter_pick_scheme(DEFAULT url_sha1_cmake) hunter_cacheable(freetype) hunter_download(PACKAGE_NAME freetype) diff --git a/cmake/projects/frugally-deep/hunter.cmake b/cmake/projects/frugally-deep/hunter.cmake new file mode 100644 index 000000000..df2d61d21 --- /dev/null +++ b/cmake/projects/frugally-deep/hunter.cmake @@ -0,0 +1,39 @@ +# Copyright (c) 2013-2018, Ruslan Baratov +# Copyright (c) 2018, David Hirvonen +# 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(frugally-deep) + +hunter_add_version( + PACKAGE_NAME frugally-deep + VERSION 0.2.2-p0 + URL "https://github.com/Dobiasd/frugally-deep/archive/v0.2.2-p0.tar.gz" + SHA1 330fd9d2177c4b2ac5ebb9ef17bf358a8dfbd62b +) + +hunter_add_version( + PACKAGE_NAME frugally-deep + VERSION 0.2.1-p0 + URL "https://github.com/Dobiasd/frugally-deep/archive/v0.2.1-p0.tar.gz" + SHA1 9a9287e059cc25c1ffc938c1815b9d4c323683be +) + +hunter_cmake_args( + frugally-deep + CMAKE_ARGS + FDEEP_USE_TOOLCHAIN=ON + FDEEP_BUILD_UNITTEST=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(frugally-deep) +hunter_download(PACKAGE_NAME frugally-deep) diff --git a/cmake/projects/gRPC/hunter.cmake b/cmake/projects/gRPC/hunter.cmake new file mode 100644 index 000000000..682c6197c --- /dev/null +++ b/cmake/projects/gRPC/hunter.cmake @@ -0,0 +1,40 @@ +# !!! 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 gRPC + VERSION "1.6.6" + URL "https://github.com/hunter-packages/grpc/archive/v1.6.6-p7.tar.gz" + SHA1 "4658a5f88aad19dc8105a8662db616837bacb6cd") + +hunter_add_version( + PACKAGE_NAME gRPC + VERSION "1.8.1" + URL "https://github.com/hunter-packages/grpc/archive/v1.8.1-p0.tar.gz" + SHA1 "d38c4895a689b394bebdb8a4960a616d850b62b8") + +hunter_add_version( + PACKAGE_NAME gRPC + VERSION "1.9.1-p0" + URL "https://github.com/hunter-packages/grpc/archive/v1.9.1-p0.tar.gz" + SHA1 "ecde82be350f51b2f41bdd5378f92513b3ebccc1") + +hunter_add_version( + PACKAGE_NAME gRPC + VERSION "1.12.1-p0" + URL "https://github.com/hunter-packages/grpc/archive/v1.12.1-p0.tar.gz" + SHA1 "cee253f1a9075afe7eb8061a2783f50368ff3495") + +hunter_add_version( + PACKAGE_NAME gRPC + VERSION "1.17.2-p0" + URL "https://github.com/hunter-packages/grpc/archive/v1.17.2-p0.tar.gz" + SHA1 "7eb5711cc4fbc7a33563121b1a6921eac0a863ef") + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(gRPC) +hunter_download(PACKAGE_NAME gRPC) diff --git a/cmake/projects/gauze/hunter.cmake b/cmake/projects/gauze/hunter.cmake new file mode 100644 index 000000000..784ad0817 --- /dev/null +++ b/cmake/projects/gauze/hunter.cmake @@ -0,0 +1,158 @@ +# 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_add_version( + PACKAGE_NAME + gauze + VERSION + 0.1.2 + URL + "https://github.com/hunter-packages/gauze/archive/v0.1.2.tar.gz" + SHA1 + 43e56210b7f42bd83bb15a91acb1f940037da329 +) + +hunter_add_version( + PACKAGE_NAME + gauze + VERSION + 0.2.0 + URL + "https://github.com/hunter-packages/gauze/archive/v0.2.0.tar.gz" + SHA1 + 1e5705ce502b2794a5bc13bbd7964e9c0010fa25 +) + +hunter_add_version( + PACKAGE_NAME + gauze + VERSION + 0.3.0 + URL + "https://github.com/hunter-packages/gauze/archive/v0.3.0.tar.gz" + SHA1 + 7d2fd034f49e679f114e620d0bd1ade0c4f59df9 +) + +hunter_add_version( + PACKAGE_NAME + gauze + VERSION + 0.3.1 + URL + "https://github.com/hunter-packages/gauze/archive/v0.3.1.tar.gz" + SHA1 + 60a1c9eafe02259d262a2d44ad784878db9de740 +) + +hunter_add_version( + PACKAGE_NAME + gauze + VERSION + 0.3.2 + URL + "https://github.com/hunter-packages/gauze/archive/v0.3.2.tar.gz" + SHA1 + 8994a92cc42a099bd3e19656acb939d9a53fd926 +) + +hunter_add_version( + PACKAGE_NAME + gauze + VERSION + 0.3.3 + URL + "https://github.com/hunter-packages/gauze/archive/v0.3.3.tar.gz" + SHA1 + b9e047217b27b4e5ee9e85e51a13ef391550e8eb +) + +hunter_add_version( + PACKAGE_NAME + gauze + VERSION + 0.4.0 + URL + "https://github.com/hunter-packages/gauze/archive/v0.4.0.tar.gz" + SHA1 + 5b8da33fed8f5eacbc884318c88f3f50a7a59bb6 +) + +hunter_add_version( + PACKAGE_NAME + gauze + VERSION + 0.5.0 + URL + "https://github.com/hunter-packages/gauze/archive/v0.5.0.tar.gz" + SHA1 + 3fff909740e22ce789c57eba7eb35dce916957b3 +) + +hunter_add_version( + PACKAGE_NAME + gauze + VERSION + 0.6.0 + URL + "https://github.com/hunter-packages/gauze/archive/v0.6.0.tar.gz" + SHA1 + be82af13be82d92809fb0d132b9d7e554d06c07b +) + +hunter_add_version( + PACKAGE_NAME + gauze + VERSION + 0.7.0 + URL + "https://github.com/hunter-packages/gauze/archive/v0.7.0.tar.gz" + SHA1 + 88261e2d68654659323ef452bccdad10766575d4 +) + +hunter_add_version( + PACKAGE_NAME + gauze + VERSION + 0.7.1 + URL + "https://github.com/hunter-packages/gauze/archive/v0.7.1.tar.gz" + SHA1 + 858ccd32c2e9901df7c19757aa3f742b49b78ed2 +) + +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/gemmlowp/hunter.cmake b/cmake/projects/gemmlowp/hunter.cmake new file mode 100644 index 000000000..32171006b --- /dev/null +++ b/cmake/projects/gemmlowp/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 + gemmlowp + VERSION + 1.0.0 + URL + "https://github.com/hunter-packages/gemmlowp/archive/v1.0.0.tar.gz" + SHA1 + 2da3f6f97b9e3368a3afd5d002334248b79cf6c3 + ) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(gemmlowp) +hunter_download(PACKAGE_NAME gemmlowp) diff --git a/cmake/projects/geos/hunter.cmake b/cmake/projects/geos/hunter.cmake index 5401a5b8e..d6018cef7 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 "2" +) diff --git a/cmake/projects/getopt/hunter.cmake b/cmake/projects/getopt/hunter.cmake new file mode 100644 index 000000000..ef9a8b9e5 --- /dev/null +++ b/cmake/projects/getopt/hunter.cmake @@ -0,0 +1,26 @@ +# !!! 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 + getopt + VERSION + "1.0.0-p0" + URL + "https://github.com/caseymcc/getopt/archive/1.0.0-p0.tar.gz" + SHA1 + 4e9a11b5dad6ff849fbb775556df02251198c249 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(getopt) + +if(NOT MSVC) #only for Visual Studios, all other posix compiliers should have getopt + hunter_user_error("Only for MSVC") +endif() + +hunter_download(PACKAGE_NAME getopt) diff --git a/cmake/projects/gflags/hunter.cmake b/cmake/projects/gflags/hunter.cmake index 8fbd44923..c98669937 100644 --- a/cmake/projects/gflags/hunter.cmake +++ b/cmake/projects/gflags/hunter.cmake @@ -5,9 +5,21 @@ include(hunter_add_version) include(hunter_cacheable) +include(hunter_cmake_args) include(hunter_download) include(hunter_pick_scheme) +hunter_add_version( + PACKAGE_NAME + gflags + VERSION + 2.1.2-p1 + URL + "https://github.com/hunter-packages/gflags/archive/v2.1.2-p1.tar.gz" + SHA1 + 24cfd7c456193fda187db993075b3c2b15b4f2c9 +) + hunter_add_version( PACKAGE_NAME gflags @@ -19,6 +31,23 @@ 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_cmake_args( + gflags + CMAKE_ARGS + REGISTER_INSTALL_PREFIX=OFF +) + hunter_pick_scheme(DEFAULT url_sha1_cmake) hunter_cacheable(gflags) hunter_download(PACKAGE_NAME gflags) diff --git a/cmake/projects/giflib/hunter.cmake b/cmake/projects/giflib/hunter.cmake new file mode 100644 index 000000000..7d5eadb57 --- /dev/null +++ b/cmake/projects/giflib/hunter.cmake @@ -0,0 +1,37 @@ +# 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 + giflib + VERSION + 5.1.4-p0 + URL + "https://github.com/hunter-packages/giflib/archive/v5.1.4-p0.tar.gz" + SHA1 + d93b71a805de3c24316e55164828fe687527a8f4 + ) + +hunter_add_version( + PACKAGE_NAME + giflib + VERSION + 5.1.4-p1 + URL + "https://github.com/hunter-packages/giflib/archive/v5.1.4-p1.tar.gz" + SHA1 + 886897af5b36a5d3179e31cf2c1f2d83170eae52 + ) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(giflib) +hunter_download(PACKAGE_NAME giflib) diff --git a/cmake/projects/glbinding/hunter.cmake b/cmake/projects/glbinding/hunter.cmake new file mode 100644 index 000000000..38cfec3d4 --- /dev/null +++ b/cmake/projects/glbinding/hunter.cmake @@ -0,0 +1,54 @@ +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +# 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... + +hunter_add_version( + PACKAGE_NAME + glbinding + VERSION + "3.0.2-p0" + URL + "https://github.com/hunter-packages/glbinding/archive/v3.0.2-p0.tar.gz" + SHA1 + ef0a1585db171f8321aa620699391d1641443989 +) + + +hunter_add_version( + PACKAGE_NAME + glbinding + VERSION + "2.1.3-p0" + URL + "https://github.com/hunter-packages/glbinding/archive/v2.1.3-p0.tar.gz" + SHA1 + 7bb774ee35f63e7f769d4f4ae6194cbc3f8afe16 +) + +hunter_cmake_args( + glbinding + CMAKE_ARGS + BUILD_SHARED_LIBS=OFF + OPTION_BUILD_TESTS=OFF + OPTION_BUILD_GPU_TESTS=OFF + OPTION_BUILD_EXAMPLES=OFF + OPTION_BUILD_TOOLS=OFF + OPTION_BUILD_DOCS=OFF + HUNTER_INSTALL_LICENSE_FILES=LICENSE +) + +# Pick a download scheme +hunter_pick_scheme(DEFAULT url_sha1_cmake) # use scheme for cmake projects +hunter_cacheable(glbinding) + +# Download package. +# Two versions of library will be build by default: +hunter_download(PACKAGE_NAME glbinding) + diff --git a/cmake/projects/glew/hunter.cmake b/cmake/projects/glew/hunter.cmake index 4fae75b7d..c678d3244 100644 --- a/cmake/projects/glew/hunter.cmake +++ b/cmake/projects/glew/hunter.cmake @@ -21,6 +21,17 @@ hunter_add_version( 4355b4a89e11a4ce575b7b4858bfe7511be53b36 ) +hunter_add_version( + PACKAGE_NAME + glew + VERSION + "2.0.0-p1" + URL + "https://github.com/hunter-packages/glew/archive/v2.0.0-p1.tar.gz" + SHA1 + 6a305e0cd0b2b4f02cc82809ba7e258c427ff36b +) + hunter_pick_scheme(DEFAULT url_sha1_cmake) hunter_cacheable(glew) hunter_download( @@ -30,4 +41,3 @@ hunter_download( # https://github.com/ruslo/hunter/issues/486 is implemented PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/cmake/glew/glewTargets.cmake" ) - diff --git a/cmake/projects/glfw/hunter.cmake b/cmake/projects/glfw/hunter.cmake index 992a5455c..4f7f5cec6 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,11 @@ 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) +include(GNUInstallDirs) hunter_add_version( PACKAGE_NAME @@ -19,8 +22,83 @@ 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_add_version( + PACKAGE_NAME + glfw + VERSION + "3.3.0-f9923e9-p0" + URL + "https://github.com/hunter-packages/glfw/archive/v3.3.0-f9923e9-p0.tar.gz" + SHA1 + 533debc50f12ce147d54d210408c7e33654f10a4 +) + +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( @@ -30,8 +108,7 @@ hunter_download( # Patching of glfw3Targets.cmake required as it has full paths due to the lack # of imported targets for x11 packages. This should be removed when # https://github.com/ruslo/hunter/issues/486 is implemented - "lib/cmake/glfw3/glfw3Targets.cmake" - "lib/pkgconfig/glfw3.pc" + "${CMAKE_INSTALL_LIBDIR}/cmake/glfw3/glfw3Targets.cmake" + "${CMAKE_INSTALL_LIBDIR}/pkgconfig/glfw3.pc" ) - diff --git a/cmake/projects/glib/hunter.cmake b/cmake/projects/glib/hunter.cmake new file mode 100644 index 000000000..280ad52c8 --- /dev/null +++ b/cmake/projects/glib/hunter.cmake @@ -0,0 +1,54 @@ +# Copyright (c) 2016-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) + +hunter_add_version( + PACKAGE_NAME + glib + VERSION + 2.54.0 + URL + "https://download.gnome.org/sources/glib/2.54/glib-2.54.0.tar.xz" + SHA1 + 96b434a9ca142344b93f38ed0cd88d36196b68ae +) + +hunter_configuration_types(glib CONFIGURATION_TYPES Release) + +hunter_cmake_args( + glib + CMAKE_ARGS + DEPENDS_ON_PACKAGES=libffi;util_linux;libpcre;ZLIB + DEPENDS_ON_PKGCONFIGS=libffi;blkid;fdisk;mount;smartcols;uuid;libpcre;libpcrecpp;libpcreposix + PKGCONFIG_EXPORT_TARGETS=glib-2.0 +) + +hunter_pick_scheme(DEFAULT url_sha1_autotools) +hunter_cacheable(glib) +hunter_download( + PACKAGE_NAME glib + PACKAGE_INTERNAL_DEPS_ID "2" + PACKAGE_UNRELOCATABLE_TEXT_FILES + "bin/glib-gettextize" + "lib/libgio-2.0.la" + "lib/libglib-2.0.la" + "lib/libgmodule-2.0.la" + "lib/libgobject-2.0.la" + "lib/libgthread-2.0.la" + "lib/pkgconfig/gio-2.0.pc" + "lib/pkgconfig/gio-unix-2.0.pc" + "lib/pkgconfig/glib-2.0.pc" + "lib/pkgconfig/gmodule-2.0.pc" + "lib/pkgconfig/gmodule-export-2.0.pc" + "lib/pkgconfig/gmodule-no-export-2.0.pc" + "lib/pkgconfig/gobject-2.0.pc" + "lib/pkgconfig/gthread-2.0.pc" +) diff --git a/cmake/projects/glm/hunter.cmake b/cmake/projects/glm/hunter.cmake index bd0f7ecac..91801eb21 100644 --- a/cmake/projects/glm/hunter.cmake +++ b/cmake/projects/glm/hunter.cmake @@ -2,9 +2,10 @@ # All rights reserved. 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 @@ -17,10 +18,58 @@ hunter_add_version( 6169cec7b94172141431ef4661e70a5e515c1fa6 ) +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 + VERSION + "0.9.9.0" + URL + "https://github.com/g-truc/glm/releases/download/0.9.9.0/glm-0.9.9.0.7z" + SHA1 + 0c0bafb9af65d565a7b026efccddfb965505b019 +) + +hunter_add_version( + PACKAGE_NAME + glm + VERSION + "0.9.9.1" + URL + "https://github.com/g-truc/glm/releases/download/0.9.9.1/glm-0.9.9.1.7z" + SHA1 + 574ee609d1848cd5425d85b09f5c4c4a1b579099 +) + +hunter_add_version( + PACKAGE_NAME + glm + VERSION + "0.9.9.2" + URL + "https://github.com/g-truc/glm/releases/download/0.9.9.2/glm-0.9.9.2.7z" + SHA1 + e25b219ead246b255b369e35c37c2e31430021f2 +) +include(GNUInstallDirs) + +# glm use custom bundled GNUInstallDirs module so we have to +# set correct value explicitly +hunter_cmake_args(glm CMAKE_ARGS CMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}) + hunter_pick_scheme(DEFAULT url_sha1_cmake) hunter_cacheable(glm) hunter_download( PACKAGE_NAME glm - PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/glm.pc" + PACKAGE_UNRELOCATABLE_TEXT_FILES "${CMAKE_INSTALL_LIBDIR}/pkgconfig/glm.pc" ) - diff --git a/cmake/projects/globjects/hunter.cmake b/cmake/projects/globjects/hunter.cmake new file mode 100644 index 000000000..e925f3070 --- /dev/null +++ b/cmake/projects/globjects/hunter.cmake @@ -0,0 +1,41 @@ +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +# 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... + +hunter_add_version( + PACKAGE_NAME + globjects + VERSION + "1.1.0-p0" + URL + "https://github.com/hunter-packages/globjects/archive/v1.1.0-p0.tar.gz" + SHA1 + c20c8f9c384802be99b8449b447c0620c603b027 +) + +hunter_cmake_args( + globjects + CMAKE_ARGS + BUILD_SHARED_LIBS=OFF + OPTION_BUILD_TESTS=OFF + OPTION_BUILD_EXAMPLES=OFF + OPTION_BUILD_TOOLS=OFF + OPTION_BUILD_DOCS=OFF + HUNTER_INSTALL_LICENSE_FILES=LICENSE +) + +# Pick a download scheme +hunter_pick_scheme(DEFAULT url_sha1_cmake) # use scheme for cmake projects +hunter_cacheable(globjects) + +# Download package. +# Two versions of library will be build by default: +hunter_download(PACKAGE_NAME globjects) + diff --git a/cmake/projects/glog/hunter.cmake b/cmake/projects/glog/hunter.cmake index b6144374b..2df999ff1 100644 --- a/cmake/projects/glog/hunter.cmake +++ b/cmake/projects/glog/hunter.cmake @@ -4,6 +4,7 @@ # !!! DO NOT PLACE HEADER GUARDS HERE !!! include(hunter_add_version) +include(hunter_cmake_args) include(hunter_cacheable) include(hunter_download) include(hunter_pick_scheme) @@ -12,11 +13,44 @@ hunter_add_version( PACKAGE_NAME glog VERSION - "0.3.4-p0" + "0.3.5-p2" URL - "https://github.com/ruslo/glog/archive/v0.3.4-p0.tar.gz" + "https://github.com/hunter-packages/glog/archive/v0.3.5-p2.tar.gz" SHA1 - de92243289267cb0f0f971a9aedf21bba74b71b3 + 3e95e5bcfb5c9d20c3391b72f831a285a3fc238f +) + +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 + VERSION + "0.3.4-p2" + URL + "https://github.com/hunter-packages/glog/archive/v0.3.4-p2.tar.gz" + SHA1 + 61e308854b397e68435994818fefb0ff6e1bbccb ) hunter_add_version( @@ -30,6 +64,20 @@ hunter_add_version( 512b8ad6d9aae9499cca2e4c4530b9386cb05440 ) +hunter_add_version( + PACKAGE_NAME + glog + VERSION + "0.4.0" + URL + "https://github.com/google/glog/archive/v0.4.0.tar.gz" + SHA1 + 0d79fb524591dee0f46213e9a23f609f74e0cbb2 +) + +# explicitly remove dependency on gflags (only needed for tests) +hunter_cmake_args(glog CMAKE_ARGS WITH_GFLAGS=OFF BUILD_TESTING=OFF) + hunter_pick_scheme(DEFAULT url_sha1_cmake) hunter_cacheable(glog) hunter_download(PACKAGE_NAME glog) diff --git a/cmake/projects/glproto/hunter.cmake b/cmake/projects/glproto/hunter.cmake index 219de93b0..051ceb06d 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 "3" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/glproto.pc" ) diff --git a/cmake/projects/glslang/hunter.cmake b/cmake/projects/glslang/hunter.cmake new file mode 100644 index 000000000..26d2ddf69 --- /dev/null +++ b/cmake/projects/glslang/hunter.cmake @@ -0,0 +1,40 @@ +# Copyright (c) 2016-2018, 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) +include(hunter_cmake_args) + +hunter_add_version( + PACKAGE_NAME + glslang + VERSION + 7.7.2767-p0 + URL + "https://github.com/hunter-packages/glslang/archive/v7.7.2767-p0.tar.gz" + SHA1 + 44d6157e5bf6005f1f611bcea323488e6268d9c9 +) + +if(IOS) +hunter_cmake_args( + glslang + CMAKE_ARGS + ENABLE_HLSL=OFF + ENABLE_GLSLANG_BINARIES=OFF +) +else() +hunter_cmake_args( + glslang + CMAKE_ARGS + ENABLE_HLSL=OFF +) +endif() + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(glslang) +hunter_download(PACKAGE_NAME glslang) diff --git a/cmake/projects/gst_plugins_bad/hunter.cmake b/cmake/projects/gst_plugins_bad/hunter.cmake new file mode 100644 index 000000000..e01945455 --- /dev/null +++ b/cmake/projects/gst_plugins_bad/hunter.cmake @@ -0,0 +1,143 @@ +# Copyright (c) 2016-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) + +hunter_add_version( + PACKAGE_NAME + gst_plugins_bad + VERSION + 1.10.4 + URL + "https://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-1.10.4.tar.xz" + SHA1 + 97ac75ee92e37cdff75298cd98ce29b8b0c2b5c7 +) + +set( + _gstreamer_components + bad-audio + bad-base + bad-video + codecparsers + insertbin + mpegts + player + plugins-bad +) + +set(_gstreamer_pkg "") +foreach(_x ${_gstreamer_components}) + list(APPEND _gstreamer_pkg gstreamer-${_x}-1.0) +endforeach() + +hunter_cmake_args( + gst_plugins_bad + CMAKE_ARGS + DEPENDS_ON_PACKAGES=gst_plugins_base + DEPENDS_ON_PKGCONFIGS=gstreamer-plugins-base-1.0 # ??? + PKGCONFIG_EXPORT_TARGETS=${_gstreamer_pkg} +) + +hunter_configuration_types(gst_plugins_bad CONFIGURATION_TYPES Release) +hunter_pick_scheme(DEFAULT url_sha1_autotools) +hunter_cacheable(gst_plugins_bad) + +hunter_download( + PACKAGE_NAME + gst_plugins_bad + PACKAGE_INTERNAL_DEPS_ID "2" + PACKAGE_UNRELOCATABLE_TEXT_FILES + "lib/gstreamer-1.0/libgstaccurip.la" + "lib/gstreamer-1.0/libgstadpcmdec.la" + "lib/gstreamer-1.0/libgstadpcmenc.la" + "lib/gstreamer-1.0/libgstaiff.la" + "lib/gstreamer-1.0/libgstasfmux.la" + "lib/gstreamer-1.0/libgstaudiofxbad.la" + "lib/gstreamer-1.0/libgstaudiomixer.la" + "lib/gstreamer-1.0/libgstaudiovisualizers.la" + "lib/gstreamer-1.0/libgstautoconvert.la" + "lib/gstreamer-1.0/libgstbayer.la" + "lib/gstreamer-1.0/libgstbz2.la" + "lib/gstreamer-1.0/libgstcamerabin2.la" + "lib/gstreamer-1.0/libgstcoloreffects.la" + "lib/gstreamer-1.0/libgstcompositor.la" + "lib/gstreamer-1.0/libgstdataurisrc.la" + "lib/gstreamer-1.0/libgstdebugutilsbad.la" + "lib/gstreamer-1.0/libgstdecklink.la" + "lib/gstreamer-1.0/libgstdvb.la" + "lib/gstreamer-1.0/libgstdvbsuboverlay.la" + "lib/gstreamer-1.0/libgstdvdspu.la" + "lib/gstreamer-1.0/libgstfbdevsink.la" + "lib/gstreamer-1.0/libgstfestival.la" + "lib/gstreamer-1.0/libgstfieldanalysis.la" + "lib/gstreamer-1.0/libgstfreeverb.la" + "lib/gstreamer-1.0/libgstfrei0r.la" + "lib/gstreamer-1.0/libgstgaudieffects.la" + "lib/gstreamer-1.0/libgstgdp.la" + "lib/gstreamer-1.0/libgstgeometrictransform.la" + "lib/gstreamer-1.0/libgsthls.la" + "lib/gstreamer-1.0/libgstid3tag.la" + "lib/gstreamer-1.0/libgstinter.la" + "lib/gstreamer-1.0/libgstinterlace.la" + "lib/gstreamer-1.0/libgstivfparse.la" + "lib/gstreamer-1.0/libgstivtc.la" + "lib/gstreamer-1.0/libgstjp2kdecimator.la" + "lib/gstreamer-1.0/libgstjpegformat.la" + "lib/gstreamer-1.0/libgstmidi.la" + "lib/gstreamer-1.0/libgstmpegpsdemux.la" + "lib/gstreamer-1.0/libgstmpegpsmux.la" + "lib/gstreamer-1.0/libgstmpegtsdemux.la" + "lib/gstreamer-1.0/libgstmpegtsmux.la" + "lib/gstreamer-1.0/libgstmxf.la" + "lib/gstreamer-1.0/libgstnetsim.la" + "lib/gstreamer-1.0/libgstpcapparse.la" + "lib/gstreamer-1.0/libgstpnm.la" + "lib/gstreamer-1.0/libgstrawparse.la" + "lib/gstreamer-1.0/libgstremovesilence.la" + "lib/gstreamer-1.0/libgstrfbsrc.la" + "lib/gstreamer-1.0/libgstrtponvif.la" + "lib/gstreamer-1.0/libgstsdpelem.la" + "lib/gstreamer-1.0/libgstsegmentclip.la" + "lib/gstreamer-1.0/libgstshm.la" + "lib/gstreamer-1.0/libgstsiren.la" + "lib/gstreamer-1.0/libgstsmooth.la" + "lib/gstreamer-1.0/libgstspeed.la" + "lib/gstreamer-1.0/libgststereo.la" + "lib/gstreamer-1.0/libgstsubenc.la" + "lib/gstreamer-1.0/libgsttimecode.la" + "lib/gstreamer-1.0/libgstvcdsrc.la" + "lib/gstreamer-1.0/libgstvideofiltersbad.la" + "lib/gstreamer-1.0/libgstvideoframe_audiolevel.la" + "lib/gstreamer-1.0/libgstvideoparsersbad.la" + "lib/gstreamer-1.0/libgstvideosignal.la" + "lib/gstreamer-1.0/libgstvmnc.la" + "lib/gstreamer-1.0/libgsty4mdec.la" + "lib/gstreamer-1.0/libgstyadif.la" + "lib/libgstadaptivedemux-1.0.la" + "lib/libgstbadaudio-1.0.la" + "lib/libgstbadbase-1.0.la" + "lib/libgstbadvideo-1.0.la" + "lib/libgstbasecamerabinsrc-1.0.la" + "lib/libgstcodecparsers-1.0.la" + "lib/libgstinsertbin-1.0.la" + "lib/libgstmpegts-1.0.la" + "lib/libgstphotography-1.0.la" + "lib/libgstplayer-1.0.la" + "lib/libgsturidownloader-1.0.la" + "lib/pkgconfig/gstreamer-bad-audio-1.0.pc" + "lib/pkgconfig/gstreamer-bad-base-1.0.pc" + "lib/pkgconfig/gstreamer-bad-video-1.0.pc" + "lib/pkgconfig/gstreamer-codecparsers-1.0.pc" + "lib/pkgconfig/gstreamer-insertbin-1.0.pc" + "lib/pkgconfig/gstreamer-mpegts-1.0.pc" + "lib/pkgconfig/gstreamer-player-1.0.pc" + "lib/pkgconfig/gstreamer-plugins-bad-1.0.pc" +) diff --git a/cmake/projects/gst_plugins_base/hunter.cmake b/cmake/projects/gst_plugins_base/hunter.cmake new file mode 100644 index 000000000..a11d68e72 --- /dev/null +++ b/cmake/projects/gst_plugins_base/hunter.cmake @@ -0,0 +1,104 @@ +# Copyright (c) 2016-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) + +hunter_add_version( + PACKAGE_NAME + gst_plugins_base + VERSION + 1.10.4 + URL + "https://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-base-1.10.4.tar.xz" + SHA1 + c6749d515d49373f2e04e7a87f5fc5bcfa16d7ef +) + +set( + _gst_export_components + allocators + app + audio + fft + pbutils + plugins-base + riff + rtp + rtsp + sdp + tag + video +) + +set(_gst_export_targets "") +foreach(_x ${_gst_export_components}) + list(APPEND _gst_export_targets gstreamer-${_x}-1.0) +endforeach() + +hunter_cmake_args( + gst_plugins_base + CMAKE_ARGS + DEPENDS_ON_PACKAGES=gstreamer;libogg;x11 + DEPENDS_ON_PKGCONFIGS=gstreamer-1.0 + PKGCONFIG_EXPORT_TARGETS=${_gst_export_targets} +) + +hunter_configuration_types(gst_plugins_base CONFIGURATION_TYPES Release) +hunter_pick_scheme(DEFAULT url_sha1_autotools) +hunter_cacheable(gst_plugins_base) + +hunter_download( + PACKAGE_NAME + gst_plugins_base + PACKAGE_INTERNAL_DEPS_ID "2" + PACKAGE_UNRELOCATABLE_TEXT_FILES + "lib/gstreamer-1.0/libgstadder.la" + "lib/gstreamer-1.0/libgstapp.la" + "lib/gstreamer-1.0/libgstaudioconvert.la" + "lib/gstreamer-1.0/libgstaudiorate.la" + "lib/gstreamer-1.0/libgstaudioresample.la" + "lib/gstreamer-1.0/libgstaudiotestsrc.la" + "lib/gstreamer-1.0/libgstencodebin.la" + "lib/gstreamer-1.0/libgstgio.la" + "lib/gstreamer-1.0/libgstogg.la" + "lib/gstreamer-1.0/libgstplayback.la" + "lib/gstreamer-1.0/libgstsubparse.la" + "lib/gstreamer-1.0/libgsttcp.la" + "lib/gstreamer-1.0/libgsttypefindfunctions.la" + "lib/gstreamer-1.0/libgstvideoconvert.la" + "lib/gstreamer-1.0/libgstvideorate.la" + "lib/gstreamer-1.0/libgstvideoscale.la" + "lib/gstreamer-1.0/libgstvideotestsrc.la" + "lib/gstreamer-1.0/libgstvolume.la" + "lib/gstreamer-1.0/libgstximagesink.la" + "lib/libgstallocators-1.0.la" + "lib/libgstapp-1.0.la" + "lib/libgstaudio-1.0.la" + "lib/libgstfft-1.0.la" + "lib/libgstpbutils-1.0.la" + "lib/libgstriff-1.0.la" + "lib/libgstrtp-1.0.la" + "lib/libgstrtsp-1.0.la" + "lib/libgstsdp-1.0.la" + "lib/libgsttag-1.0.la" + "lib/libgstvideo-1.0.la" + "lib/pkgconfig/gstreamer-allocators-1.0.pc" + "lib/pkgconfig/gstreamer-app-1.0.pc" + "lib/pkgconfig/gstreamer-audio-1.0.pc" + "lib/pkgconfig/gstreamer-fft-1.0.pc" + "lib/pkgconfig/gstreamer-pbutils-1.0.pc" + "lib/pkgconfig/gstreamer-plugins-base-1.0.pc" + "lib/pkgconfig/gstreamer-riff-1.0.pc" + "lib/pkgconfig/gstreamer-rtp-1.0.pc" + "lib/pkgconfig/gstreamer-rtsp-1.0.pc" + "lib/pkgconfig/gstreamer-sdp-1.0.pc" + "lib/pkgconfig/gstreamer-tag-1.0.pc" + "lib/pkgconfig/gstreamer-video-1.0.pc" +) diff --git a/cmake/projects/gst_plugins_good/hunter.cmake b/cmake/projects/gst_plugins_good/hunter.cmake new file mode 100644 index 000000000..13a755e93 --- /dev/null +++ b/cmake/projects/gst_plugins_good/hunter.cmake @@ -0,0 +1,89 @@ +# Copyright (c) 2016-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) + +hunter_add_version( + PACKAGE_NAME + gst_plugins_good + VERSION + 1.10.4 + URL + "https://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-1.10.4.tar.xz" + SHA1 + 6ff3f3a7facae861c7687f27055fd9ced7c7fe10 +) + +hunter_cmake_args( + gst_plugins_good + CMAKE_ARGS + DEPENDS_ON_PACKAGES=gst_plugins_base;xext;Jpeg + DEPENDS_ON_PKGCONFIGS=gstreamer-plugins-base-1.0 # ??? +) + +hunter_configuration_types(gst_plugins_good CONFIGURATION_TYPES Release) +hunter_pick_scheme(DEFAULT url_sha1_autotools) +hunter_cacheable(gst_plugins_good) + +hunter_download( + PACKAGE_NAME + gst_plugins_good + PACKAGE_INTERNAL_DEPS_ID "2" + PACKAGE_UNRELOCATABLE_TEXT_FILES + "lib/gstreamer-1.0/libgstalaw.la" + "lib/gstreamer-1.0/libgstalpha.la" + "lib/gstreamer-1.0/libgstalphacolor.la" + "lib/gstreamer-1.0/libgstapetag.la" + "lib/gstreamer-1.0/libgstaudiofx.la" + "lib/gstreamer-1.0/libgstaudioparsers.la" + "lib/gstreamer-1.0/libgstauparse.la" + "lib/gstreamer-1.0/libgstautodetect.la" + "lib/gstreamer-1.0/libgstavi.la" + "lib/gstreamer-1.0/libgstcutter.la" + "lib/gstreamer-1.0/libgstdebug.la" + "lib/gstreamer-1.0/libgstdeinterlace.la" + "lib/gstreamer-1.0/libgstdtmf.la" + "lib/gstreamer-1.0/libgsteffectv.la" + "lib/gstreamer-1.0/libgstequalizer.la" + "lib/gstreamer-1.0/libgstflv.la" + "lib/gstreamer-1.0/libgstflxdec.la" + "lib/gstreamer-1.0/libgstgoom.la" + "lib/gstreamer-1.0/libgstgoom2k1.la" + "lib/gstreamer-1.0/libgsticydemux.la" + "lib/gstreamer-1.0/libgstid3demux.la" + "lib/gstreamer-1.0/libgstimagefreeze.la" + "lib/gstreamer-1.0/libgstinterleave.la" + "lib/gstreamer-1.0/libgstisomp4.la" + "lib/gstreamer-1.0/libgstjpeg.la" + "lib/gstreamer-1.0/libgstlevel.la" + "lib/gstreamer-1.0/libgstmatroska.la" + "lib/gstreamer-1.0/libgstmulaw.la" + "lib/gstreamer-1.0/libgstmultifile.la" + "lib/gstreamer-1.0/libgstmultipart.la" + "lib/gstreamer-1.0/libgstnavigationtest.la" + "lib/gstreamer-1.0/libgstoss4audio.la" + "lib/gstreamer-1.0/libgstossaudio.la" + "lib/gstreamer-1.0/libgstreplaygain.la" + "lib/gstreamer-1.0/libgstrtp.la" + "lib/gstreamer-1.0/libgstrtpmanager.la" + "lib/gstreamer-1.0/libgstrtsp.la" + "lib/gstreamer-1.0/libgstshapewipe.la" + "lib/gstreamer-1.0/libgstsmpte.la" + "lib/gstreamer-1.0/libgstspectrum.la" + "lib/gstreamer-1.0/libgstudp.la" + "lib/gstreamer-1.0/libgstvideo4linux2.la" + "lib/gstreamer-1.0/libgstvideobox.la" + "lib/gstreamer-1.0/libgstvideocrop.la" + "lib/gstreamer-1.0/libgstvideofilter.la" + "lib/gstreamer-1.0/libgstvideomixer.la" + "lib/gstreamer-1.0/libgstwavenc.la" + "lib/gstreamer-1.0/libgstwavparse.la" + "lib/gstreamer-1.0/libgsty4menc.la" +) diff --git a/cmake/projects/gst_plugins_ugly/hunter.cmake b/cmake/projects/gst_plugins_ugly/hunter.cmake new file mode 100644 index 000000000..95c598cd8 --- /dev/null +++ b/cmake/projects/gst_plugins_ugly/hunter.cmake @@ -0,0 +1,45 @@ +# Copyright (c) 2016-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) + +hunter_add_version( + PACKAGE_NAME + gst_plugins_ugly + VERSION + 1.10.4 + URL + "https://gstreamer.freedesktop.org/src/gst-plugins-ugly/gst-plugins-ugly-1.10.4.tar.xz" + SHA1 + a01ab3ac71bdd0d52e4a120349a8f26fde48f317 +) + +hunter_cmake_args( + gst_plugins_ugly + CMAKE_ARGS + DEPENDS_ON_PACKAGES=gst_plugins_base + DEPENDS_ON_PKGCONFIGS=gstreamer-plugins-base-1.0 # ??? +) + +hunter_configuration_types(gst_plugins_ugly CONFIGURATION_TYPES Release) +hunter_pick_scheme(DEFAULT url_sha1_autotools) +hunter_cacheable(gst_plugins_ugly) + +hunter_download( + PACKAGE_NAME + gst_plugins_ugly + PACKAGE_INTERNAL_DEPS_ID "2" + PACKAGE_UNRELOCATABLE_TEXT_FILES + "lib/gstreamer-1.0/libgstasf.la" + "lib/gstreamer-1.0/libgstdvdlpcmdec.la" + "lib/gstreamer-1.0/libgstdvdsub.la" + "lib/gstreamer-1.0/libgstrmdemux.la" + "lib/gstreamer-1.0/libgstxingmux.la" +) diff --git a/cmake/projects/gstreamer/hunter.cmake b/cmake/projects/gstreamer/hunter.cmake new file mode 100644 index 000000000..582a900e6 --- /dev/null +++ b/cmake/projects/gstreamer/hunter.cmake @@ -0,0 +1,52 @@ +# 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) + +hunter_add_version( + PACKAGE_NAME + gstreamer + VERSION + "1.10.4" + URL + "https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-1.10.4.tar.xz" + SHA1 + 217f56f474b1a89fdd27c8025a3eee7a7cd13559 +) + +hunter_configuration_types(gstreamer CONFIGURATION_TYPES Release) +hunter_pick_scheme(DEFAULT url_sha1_autotools) + +hunter_cmake_args( + gstreamer + CMAKE_ARGS + DEPENDS_ON_PACKAGES=glib + DEPENDS_ON_PKGCONFIGS=glib-2.0 + PKGCONFIG_EXPORT_TARGETS=gstreamer-1.0 +) + +hunter_cacheable(gstreamer) +hunter_download( + PACKAGE_NAME gstreamer + PACKAGE_INTERNAL_DEPS_ID "5" + PACKAGE_UNRELOCATABLE_TEXT_FILES + "lib/gstreamer-1.0/libgstcoreelements.la" + "lib/gstreamer-1.0/libgstcoretracers.la" + "lib/libgstbase-1.0.la" + "lib/libgstcheck-1.0.la" + "lib/libgstcontroller-1.0.la" + "lib/libgstnet-1.0.la" + "lib/libgstreamer-1.0.la" + "lib/pkgconfig/gstreamer-1.0.pc" + "lib/pkgconfig/gstreamer-base-1.0.pc" + "lib/pkgconfig/gstreamer-check-1.0.pc" + "lib/pkgconfig/gstreamer-controller-1.0.pc" + "lib/pkgconfig/gstreamer-net-1.0.pc" +) diff --git a/cmake/projects/gumbo/hunter.cmake b/cmake/projects/gumbo/hunter.cmake new file mode 100644 index 000000000..dfa647ccc --- /dev/null +++ b/cmake/projects/gumbo/hunter.cmake @@ -0,0 +1,19 @@ +# !!! 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 gumbo + VERSION "0.10.1" + URL "https://github.com/hunter-packages/gumbo-parser/archive/hunter-0.10.1.tar.gz" + SHA1 "0b060d7b67f605fc2c06a2c474fbd00ad5c48b18") + +hunter_cmake_args(gumbo CMAKE_ARGS BUILD_TESTING=OFF) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(gumbo) +hunter_download(PACKAGE_NAME gumbo) diff --git a/cmake/projects/h3/hunter.cmake b/cmake/projects/h3/hunter.cmake new file mode 100644 index 000000000..c68eb3522 --- /dev/null +++ b/cmake/projects/h3/hunter.cmake @@ -0,0 +1,40 @@ +# !!! 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 h3 + VERSION "3.0.4" + URL "https://github.com/uber/h3/archive/v3.0.4.tar.gz" + SHA1 "e09d18583e3da9d03d718fba482d2281eff011d1") + +hunter_add_version( + PACKAGE_NAME h3 + VERSION "3.0.5" + URL "https://github.com/uber/h3/archive/v3.0.5.tar.gz" + SHA1 "ff4bc3c066dbfcb2ee1aa6474f63c934b0dfe4ee") + +hunter_add_version( + PACKAGE_NAME h3 + VERSION "3.0.6" + URL "https://github.com/uber/h3/archive/v3.0.6.tar.gz" + SHA1 "bb8502a7e7b6c2e367874dcd55677c6d288e6cc7") + +hunter_add_version( + PACKAGE_NAME h3 + VERSION "3.0.7" + URL "https://github.com/uber/h3/archive/v3.0.7.tar.gz" + SHA1 "062dbe6f17a19d5734a7d538fcfade2ae8949b04") + +hunter_cmake_args(h3 CMAKE_ARGS + BUILD_TESTING=OFF + ENABLE_DOCS=OFF + ENABLE_LINTING=OFF) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(h3) +hunter_download(PACKAGE_NAME h3) diff --git a/cmake/projects/harfbuzz/hunter.cmake b/cmake/projects/harfbuzz/hunter.cmake new file mode 100644 index 000000000..aff7aab3a --- /dev/null +++ b/cmake/projects/harfbuzz/hunter.cmake @@ -0,0 +1,64 @@ +# Copyright (c) 2016-2018, 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) +include(hunter_cmake_args) + +hunter_add_version( + PACKAGE_NAME + harfbuzz + VERSION + 1.7.6-p0 + URL + "https://github.com/hunter-packages/harfbuzz/archive/v1.7.6-p0.tar.gz" + SHA1 + 11102ba60b34a12e1fd31b3bbd18e0a61f5f6ba1 +) + +hunter_add_version( + PACKAGE_NAME + harfbuzz + VERSION + 1.7.6-p1 + URL + "https://github.com/hunter-packages/harfbuzz/archive/v1.7.6-p1.tar.gz" + SHA1 + adec471f56a305970a071f7ab10803012660cf79 +) + +hunter_add_version( + PACKAGE_NAME + harfbuzz + VERSION + 1.7.6-p2 + URL + "https://github.com/hunter-packages/harfbuzz/archive/v1.7.6-p2.tar.gz" + SHA1 + 105c15b2c0c56e6dc13b0dda0915f759231dfb0c +) + +set( + _hunter_hb_cmake_args + HB_HAVE_FREETYPE=ON + HB_HAVE_ICU=ON +) + +if(RASPBERRY_PI) + # sysroot xlocale.h issue + list( + APPEND + _hunter_hb_cmake_args + HAVE_XLOCALE_H=OFF + ) +endif() + +hunter_cmake_args(harfbuzz CMAKE_ARGS ${_hunter_hb_cmake_args}) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(harfbuzz) +hunter_download(PACKAGE_NAME harfbuzz) diff --git a/cmake/projects/hdf5/hunter.cmake b/cmake/projects/hdf5/hunter.cmake index 22ee93e5d..15a46610c 100644 --- a/cmake/projects/hdf5/hunter.cmake +++ b/cmake/projects/hdf5/hunter.cmake @@ -20,6 +20,63 @@ hunter_add_version( "aa7524bae51f286a4f2b2c22434c1cbab71ff530" ) +hunter_add_version( + PACKAGE_NAME + hdf5 + VERSION + "1.10.5-hp1" + URL + "https://github.com/cpp-pm/hdf5/archive/1.10.5-hp1.tar.gz" + SHA1 + "eaa00311ee9e61e34a71d0258bc9a76c8f24001a" +) + +hunter_add_version( + PACKAGE_NAME + hdf5 + VERSION + "1.10.5-hp2" + URL + "https://github.com/cpp-pm/hdf5/archive/1.10.5-hp2.tar.gz" + SHA1 + "9061212757196109437412d80885b9219bfc0ceb" +) + +hunter_add_version( + PACKAGE_NAME + hdf5 + VERSION + "1.10.5-hp3" + URL + "https://github.com/cpp-pm/hdf5/archive/1.10.5-hp3.tar.gz" + SHA1 + "968876aee5af1edf70ce352b6d94fd5ffac338bf" +) + +hunter_add_version( + PACKAGE_NAME + hdf5 + VERSION + "1.10.5-hp4" + URL + "https://github.com/cpp-pm/hdf5/archive/1.10.5-hp4.tar.gz" + SHA1 + "212fe7ae2e39a9fd3cd771aabc5ddedf31c5daa4" +) + + +hunter_add_version( + PACKAGE_NAME + hdf5 + VERSION + "1.10.5-hp5" + URL + "https://github.com/cpp-pm/hdf5/archive/1.10.5-hp5.tar.gz" + SHA1 + "3e9c4bddabd03102bab681d997edb38f7a7844a0" +) + + hunter_cmake_args( hdf5 CMAKE_ARGS diff --git a/cmake/projects/highwayhash/hunter.cmake b/cmake/projects/highwayhash/hunter.cmake new file mode 100644 index 000000000..6f5e645cd --- /dev/null +++ b/cmake/projects/highwayhash/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 + highwayhash + VERSION + 0.0.0 + URL + "https://github.com/hunter-packages/highwayhash/archive/v0.0.0.tar.gz" + SHA1 + d62b32d5c8b6e63f6d4f8e72cfb495572b4f5386 + ) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(highwayhash) +hunter_download(PACKAGE_NAME highwayhash) diff --git a/cmake/projects/http-parser/hunter.cmake b/cmake/projects/http-parser/hunter.cmake new file mode 100644 index 000000000..d4e1f6832 --- /dev/null +++ b/cmake/projects/http-parser/hunter.cmake @@ -0,0 +1,17 @@ +# !!! 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 http-parser + VERSION "2.8.0" + URL "https://github.com/hunter-packages/http-parser/archive/v2.8.0-p0.tar.gz" + SHA1 "3ef5048ecc6625f75a8c756026f501ebd5f3f388") + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(http-parser) +hunter_download(PACKAGE_NAME http-parser) diff --git a/cmake/projects/hunter_venv/hunter.cmake b/cmake/projects/hunter_venv/hunter.cmake new file mode 100644 index 000000000..e4688f811 --- /dev/null +++ b/cmake/projects/hunter_venv/hunter.cmake @@ -0,0 +1,45 @@ +# Copyright (c) 2016-2019, 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) + +hunter_add_version( + PACKAGE_NAME + hunter_venv + VERSION + 1.0.1 + URL + "https://github.com/hunter-packages/hunter_venv/archive/v1.0.1.tar.gz" + SHA1 + e15dd948ab070960538ec6918bb4c64296174f14 +) + +# DOCUMENTATION_START { +if(APPLE) + set(__hunter_venv_default_python "3.6.5") +elseif(WIN32) + set(__hunter_venv_default_python "3.6.8") +else() + set(__hunter_venv_default_python "3.5.2") +endif() + +hunter_cmake_args( + hunter_venv + CMAKE_ARGS + HUNTER_VENV_PYTHON_VERSION=${__hunter_venv_default_python} +) +# DOCUMENTATION_END } + +# No real build +hunter_configuration_types(hunter_venv CONFIGURATION_TYPES Release) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(hunter_venv) +hunter_download(PACKAGE_NAME hunter_venv) diff --git a/cmake/projects/ice/hunter.cmake b/cmake/projects/ice/hunter.cmake index 455b59a1f..837705878 100644 --- a/cmake/projects/ice/hunter.cmake +++ b/cmake/projects/ice/hunter.cmake @@ -22,21 +22,29 @@ hunter_add_version( ddb14df8bbc43df7322978f5f9f802936e2a7324 ) +# https://www.x.org/releases/individual/lib/ +hunter_add_version( + PACKAGE_NAME + ice + VERSION + "1.0.9" + URL + "https://www.x.org/releases/individual/lib/libICE-1.0.9.tar.bz2" + SHA1 + 3c3a857a117ce48a1947a16860056e77cd494fdf +) + hunter_configuration_types(ice CONFIGURATION_TYPES Release) hunter_pick_scheme(DEFAULT url_sha1_autotools) -set(x11_dependencies - xproto - xtrans -) hunter_cmake_args( - x11 - CMAKE_ARGS # do not use double quotes on CMAKE_ARGS - DEPENDS_ON_PACKAGES=${x11_dependencies} + ice + CMAKE_ARGS + DEPENDS_ON_PACKAGES=xproto;xtrans ) hunter_cacheable(ice) hunter_download( PACKAGE_NAME ice - PACKAGE_INTERNAL_DEPS_ID "2" + PACKAGE_INTERNAL_DEPS_ID "4" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/libICE.la" "lib/pkgconfig/ice.pc" diff --git a/cmake/projects/icu-le-hb/hunter.cmake b/cmake/projects/icu-le-hb/hunter.cmake new file mode 100644 index 000000000..77e69b8f8 --- /dev/null +++ b/cmake/projects/icu-le-hb/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2018, 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 + icu-le-hb + VERSION + 1.0.3-231788a-p0 + URL + "https://github.com/hunter-packages/icu-le-hb/archive/v1.0.3-231788a-p0.tar.gz" + SHA1 + 0ce9cabd279e690773c044063d75f9c5d6e229bb +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(icu-le-hb) +hunter_download(PACKAGE_NAME icu-le-hb) diff --git a/cmake/projects/icu-lx/hunter.cmake b/cmake/projects/icu-lx/hunter.cmake new file mode 100644 index 000000000..7d4ff4e31 --- /dev/null +++ b/cmake/projects/icu-lx/hunter.cmake @@ -0,0 +1,35 @@ +# Copyright (c) 2016-2018, 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 + icu-lx + VERSION + 63.1-p0 + URL + "https://github.com/hunter-packages/icu-lx/archive/v63.1-p0.tar.gz" + SHA1 + 264075debfe574ff5dc963b04375b262b6f8199f +) + +hunter_add_version( + PACKAGE_NAME + icu-lx + VERSION + 63.1-p1 + URL + "https://github.com/hunter-packages/icu-lx/archive/v63.1-p1.tar.gz" + SHA1 + cabcef58770922c9b0695663445f57c3f66750dd +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(icu-lx) +hunter_download(PACKAGE_NAME icu-lx) diff --git a/cmake/projects/imagequant/hunter.cmake b/cmake/projects/imagequant/hunter.cmake new file mode 100644 index 000000000..34eb7eacd --- /dev/null +++ b/cmake/projects/imagequant/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2018, 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 + imagequant + VERSION + 2.12.2-p0 + URL + "https://github.com/hunter-packages/libimagequant/archive/v2.12.2-p0.tar.gz" + SHA1 + 95960f65c1e103cc87a2b07e656ce247188ee082 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(imagequant) +hunter_download(PACKAGE_NAME imagequant) diff --git a/cmake/projects/imgui/hunter.cmake b/cmake/projects/imgui/hunter.cmake new file mode 100644 index 000000000..26baa7c70 --- /dev/null +++ b/cmake/projects/imgui/hunter.cmake @@ -0,0 +1,43 @@ +# !!! 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 + imgui + VERSION + "1.70.p0" + URL + "https://github.com/hunter-packages/imgui/archive/v1.70.p0.tar.gz" + SHA1 + 36a806ecc3b43204e4a895d6842f88519d3d4b98 +) + +hunter_add_version( + PACKAGE_NAME + imgui + VERSION + "1.62" + URL + "https://github.com/hunter-packages/imgui/archive/v1.62.p0.tar.gz" + SHA1 + 0e1fb683036a45372bc34d39c29068443b6d97e6 +) + +hunter_cmake_args( + imgui + CMAKE_ARGS + IMGUI_BUILD_EXAMPLES=OFF + IMGUI_ENABLE_TEST_ENGINE=OFF +) + +# Pick a download scheme +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(imgui) +hunter_download(PACKAGE_NAME imgui) diff --git a/cmake/projects/imshow/hunter.cmake b/cmake/projects/imshow/hunter.cmake new file mode 100644 index 000000000..3997f1b96 --- /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/inja/hunter.cmake b/cmake/projects/inja/hunter.cmake new file mode 100644 index 000000000..08caabfd3 --- /dev/null +++ b/cmake/projects/inja/hunter.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2016-2017, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cmake_args) +include(hunter_pick_scheme) +include(hunter_cacheable) +include(hunter_download) + +hunter_add_version( + PACKAGE_NAME + inja + VERSION + 0.1.1 + URL + "https://github.com/pantor/inja/archive/v0.1.1.tar.gz" + SHA1 + fdf2af404917350a7d9c4f263ddf020130088444 +) + +hunter_cmake_args( + inja + CMAKE_ARGS + BUILD_UNIT_TESTS=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(inja) +hunter_download(PACKAGE_NAME inja) diff --git a/cmake/projects/inputproto/hunter.cmake b/cmake/projects/inputproto/hunter.cmake index e650fde24..18f7b585b 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) @@ -21,11 +22,27 @@ hunter_add_version( 500e0a6dac3523887c0b82753fe5e9d4bb982137 ) +hunter_add_version( + PACKAGE_NAME + inputproto + VERSION + "2.3" + URL + "https://www.x.org/releases/individual/proto/inputproto-2.3.tar.bz2" + SHA1 + 4eacc1883593d3f0040e410be3afc8483c7d2409 +) + 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 "3" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/inputproto.pc" ) diff --git a/cmake/projects/intltool/hunter.cmake b/cmake/projects/intltool/hunter.cmake index ddc47b464..6489bf943 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 "2" +) diff --git a/cmake/projects/intsizeof/hunter.cmake b/cmake/projects/intsizeof/hunter.cmake new file mode 100644 index 000000000..5461d3ba5 --- /dev/null +++ b/cmake/projects/intsizeof/hunter.cmake @@ -0,0 +1,57 @@ +# 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_add_version( + PACKAGE_NAME + intsizeof + VERSION + "2.0.2" + URL + "https://github.com/ruslo/intsizeof/archive/v2.0.2.tar.gz" + SHA1 + 729d72510beea3fb23f74fc08899b8c1c4f726d2 +) + +hunter_cacheable(intsizeof) +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_download(PACKAGE_NAME intsizeof) diff --git a/cmake/projects/intx/hunter.cmake b/cmake/projects/intx/hunter.cmake new file mode 100644 index 000000000..f1e4543b3 --- /dev/null +++ b/cmake/projects/intx/hunter.cmake @@ -0,0 +1,43 @@ +# Copyright (c) 2019, Pawel Bylica + +# !!! 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 + intx + VERSION + 0.1.0 + URL + https://github.com/chfast/intx/archive/v0.1.0.tar.gz + SHA1 + a70da498a9868e9484e01530c22690910d7222e6 +) + +hunter_add_version( + PACKAGE_NAME + intx + VERSION + 0.2.0 + URL + https://github.com/chfast/intx/archive/v0.2.0.tar.gz + SHA1 + 50c4d8ec601114755be9fd5bf5b288ee4eeacd54 +) + +hunter_cmake_args( + intx + CMAKE_ARGS + INTX_TESTING=OFF + INTX_BENCHMARKING=OFF + INTX_FUZZING=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(intx) +hunter_download(PACKAGE_NAME intx) diff --git a/cmake/projects/iroha-ed25519/hunter.cmake b/cmake/projects/iroha-ed25519/hunter.cmake new file mode 100644 index 000000000..5a7d08e0f --- /dev/null +++ b/cmake/projects/iroha-ed25519/hunter.cmake @@ -0,0 +1,36 @@ +# Copyright (c) 2016-2018, 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) +include(hunter_cmake_args) + +hunter_add_version( + PACKAGE_NAME + iroha-ed25519 + VERSION + 2.0.0 + URL + "https://github.com/hyperledger/iroha-ed25519/archive/2.0.0.tar.gz" + SHA1 + fde00802a907081cf1ce6d54158108e81511b285 +) + +# let iroha-ed25519 automatically select ED and RNG implementations, they +# will depend on OS. +# explicitly set usage of sha2 (as for default in ed25519 spec) +hunter_cmake_args( + iroha-ed25519 + CMAKE_ARGS + BUILD=STATIC # build static library + TESTING=OFF # disable tests + HASH=sha2_sphlib # use sha2_sphlib impl for hash +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(iroha-ed25519) +hunter_download(PACKAGE_NAME iroha-ed25519) diff --git a/cmake/projects/irrXML/hunter.cmake b/cmake/projects/irrXML/hunter.cmake index c0baccaae..2e1ffb786 100644 --- a/cmake/projects/irrXML/hunter.cmake +++ b/cmake/projects/irrXML/hunter.cmake @@ -8,6 +8,17 @@ include(hunter_cacheable) include(hunter_download) include(hunter_pick_scheme) +hunter_add_version( + PACKAGE_NAME + irrXML + VERSION + "1.2-p0" + URL + "https://github.com/hunter-packages/irrXML/archive/v1.2-p0.tar.gz" + SHA1 + c766ac44744f8387b7d745b00233b80713c5b689 +) + hunter_add_version( PACKAGE_NAME irrXML diff --git a/cmake/projects/jaegertracing/hunter.cmake b/cmake/projects/jaegertracing/hunter.cmake new file mode 100644 index 000000000..96b0d2b63 --- /dev/null +++ b/cmake/projects/jaegertracing/hunter.cmake @@ -0,0 +1,20 @@ +# !!! 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 jaegertracing + VERSION "0.4.1" + URL "https://github.com/jaegertracing/jaeger-client-cpp/archive/v0.4.1.tar.gz" + SHA1 "b398a8174cad9d2e815e2bc9910f75c89e35a46a") + +hunter_cmake_args(jaegertracing CMAKE_ARGS + BUILD_TESTING=OFF) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(jaegertracing) +hunter_download(PACKAGE_NAME jaegertracing) diff --git a/cmake/projects/jansson/hunter.cmake b/cmake/projects/jansson/hunter.cmake new file mode 100644 index 000000000..7b5cf111a --- /dev/null +++ b/cmake/projects/jansson/hunter.cmake @@ -0,0 +1,21 @@ +# !!! 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 jansson + VERSION "2.11.0" + URL "https://github.com/hunter-packages/jansson/archive/v2.11-p0.tar.gz" + SHA1 "4f5855dac698e9658fd94620b64f8430f265be1d") + +hunter_cmake_args(jansson CMAKE_ARGS + JANSSON_BUILD_DOCS=OFF + JANSSON_EXAMPLES=OFF + JANSSON_WITHOUT_TESTS=ON) +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(jansson) +hunter_download(PACKAGE_NAME jansson) diff --git a/cmake/projects/jasper/hunter.cmake b/cmake/projects/jasper/hunter.cmake new file mode 100644 index 000000000..cdf010d11 --- /dev/null +++ b/cmake/projects/jasper/hunter.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2016-2018, 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 + jasper + VERSION + 2.0.14-p0 + URL + "https://github.com/hunter-packages/jasper/archive/v2.0.14-p0.tar.gz" + SHA1 + e443966cfacdad2e3f975ba31d72333e06b433b4 +) + +hunter_add_version( + PACKAGE_NAME + jasper + VERSION + 2.0.14-p1 + URL + "https://github.com/hunter-packages/jasper/archive/v2.0.14-p1.tar.gz" + SHA1 + 0ff33939db0b90d8666755a87d692182916c9774 +) + +hunter_add_version( + PACKAGE_NAME + jasper + VERSION + 2.0.14-p2 + URL + "https://github.com/hunter-packages/jasper/archive/v2.0.14-p2.tar.gz" + SHA1 + 97ef42fa8b82d27fc5db5007e0d7179b02315b1d +) + +hunter_add_version( + PACKAGE_NAME + jasper + VERSION + 2.0.14-p3 + URL + "https://github.com/hunter-packages/jasper/archive/v2.0.14-p3.tar.gz" + SHA1 + 3ce4f2b8fe7471badbb1827c733fcfff64cae08c +) + +hunter_cmake_args( + jasper + CMAKE_ARGS + JAS_ENABLE_AUTOMATIC_DEPENDENCIES=OFF + JAS_ENABLE_OPENGL=OFF + JAS_ENABLE_PROGRAMS=OFF + JAS_ENABLE_DOC=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(jasper) +hunter_download(PACKAGE_NAME jasper) diff --git a/cmake/projects/jo_jpeg/hunter.cmake b/cmake/projects/jo_jpeg/hunter.cmake new file mode 100644 index 000000000..7c145aa1d --- /dev/null +++ b/cmake/projects/jo_jpeg/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 + jo_jpeg + VERSION + 0.0.1 + URL + "https://github.com/hunter-packages/jo_jpeg/archive/v0.0.1.tar.gz" + SHA1 + 1fdfa0b7f1e0c958f692dea080b8fbee6fca25e9 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(jo_jpeg) +hunter_download(PACKAGE_NAME jo_jpeg) diff --git a/cmake/projects/jsoncpp/hunter.cmake b/cmake/projects/jsoncpp/hunter.cmake new file mode 100644 index 000000000..2d41addba --- /dev/null +++ b/cmake/projects/jsoncpp/hunter.cmake @@ -0,0 +1,59 @@ +# cmake/projects/jsoncpp/hunter.cmake + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +# Load used modules +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 + jsoncpp + VERSION + "1.8.0" + URL + "https://github.com/open-source-parsers/jsoncpp/archive/1.8.0.tar.gz" + SHA1 + 40f7f34551012f68e822664a0b179e7e6cac5a97 +) + +hunter_add_version( + PACKAGE_NAME + jsoncpp + VERSION + "1.7.7" + URL + "https://github.com/open-source-parsers/jsoncpp/archive/1.7.7.tar.gz" + SHA1 + 7bbb47e25b3aa7c4c8b579ca46b32d55f32cb46e +) + +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 + +hunter_cmake_args( + jsoncpp + CMAKE_ARGS + JSONCPP_WITH_TESTS=OFF + JSONCPP_WITH_PKGCONFIG_SUPPORT=OFF + JSONCPP_WITH_CMAKE_PACKAGE=ON +) + +hunter_cacheable(jsoncpp) +hunter_download(PACKAGE_NAME jsoncpp) diff --git a/cmake/projects/kNet/hunter.cmake b/cmake/projects/kNet/hunter.cmake new file mode 100644 index 000000000..be53f78c0 --- /dev/null +++ b/cmake/projects/kNet/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 + kNet + VERSION + 2.7-p1 + URL + "https://github.com/hunter-packages/kNet/archive/v2.7-p1.tar.gz" + SHA1 + 3a7bc8c9f9f14ffbfac4ce5328fa6735544b51c8 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(kNet) +hunter_download(PACKAGE_NAME kNet) diff --git a/cmake/projects/kbproto/hunter.cmake b/cmake/projects/kbproto/hunter.cmake index 1fbc9b15d..b65d667fe 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) @@ -21,11 +22,28 @@ hunter_add_version( a2cc82357c22a1f4d6243017982c32703c95575c ) +# https://www.x.org/releases/individual/proto/ +hunter_add_version( + PACKAGE_NAME + kbproto + VERSION + "1.0.7" + URL + "https://www.x.org/releases/individual/proto/kbproto-1.0.7.tar.bz2" + SHA1 + bc9c0fa7d39edf4ac043e6eeaa771d3e245ac5b2 +) + 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 "3" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/kbproto.pc" ) diff --git a/cmake/projects/lcms/hunter.cmake b/cmake/projects/lcms/hunter.cmake new file mode 100644 index 000000000..b49e743fd --- /dev/null +++ b/cmake/projects/lcms/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2018, 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 + lcms + VERSION + 2.9-p0 + URL + "https://github.com/hunter-packages/Little-CMS/archive/v2.9-p0.tar.gz" + SHA1 + 5bea20d0e6e98b743e5e72ba1c130e13b9b73584 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(lcms) +hunter_download(PACKAGE_NAME lcms) diff --git a/cmake/projects/lehrfempp/hunter.cmake b/cmake/projects/lehrfempp/hunter.cmake new file mode 100644 index 000000000..2f190053d --- /dev/null +++ b/cmake/projects/lehrfempp/hunter.cmake @@ -0,0 +1,164 @@ +# Copyright (c) 2016-2018, 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 + lehrfempp + VERSION + 0.7.3 + URL + "https://github.com/craffael/lehrfempp/archive/release-0.7.3.tar.gz" + SHA1 + 228512a28abe9e49484d1794a20657a47fbf5a1d +) + +hunter_add_version( + PACKAGE_NAME + lehrfempp + VERSION + 0.7.6 + URL + "https://github.com/craffael/lehrfempp/archive/release-0.7.6.tar.gz" + SHA1 + c5ed5b1262a46dad28ac2d558781f08cffbd4993 +) + +hunter_add_version( + PACKAGE_NAME + lehrfempp + VERSION + 0.7.8 + URL + "https://github.com/craffael/lehrfempp/archive/release-0.7.8.tar.gz" + SHA1 + ddb39d94039000686d5acd5e7e1cfa464c15dacb +) + +hunter_add_version( + PACKAGE_NAME + lehrfempp + VERSION + 0.7.9 + URL + "https://github.com/craffael/lehrfempp/archive/release-0.7.9.tar.gz" + SHA1 + 9ed490443ce93612ee64435fe87c9af4735bbfed +) + +hunter_add_version( + PACKAGE_NAME + lehrfempp + VERSION + 0.7.10 + URL + "https://github.com/craffael/lehrfempp/archive/release-0.7.10.tar.gz" + SHA1 + 1cc185cb5e148fb53d5fa3cd595e3e071cfd435f +) + +hunter_add_version( + PACKAGE_NAME + lehrfempp + VERSION + 0.7.11 + URL + "https://github.com/craffael/lehrfempp/archive/release-0.7.11.tar.gz" + SHA1 + b1352d52e4cd5518d6bc867ef8a9082c8f22569d +) + +hunter_add_version( + PACKAGE_NAME + lehrfempp + VERSION + 0.7.12 + URL + "https://github.com/craffael/lehrfempp/archive/release-0.7.12.tar.gz" + SHA1 + b8ecd27061fa0f393509b935a5802e41f0dc8e7a +) + +hunter_add_version( + PACKAGE_NAME + lehrfempp + VERSION + 0.7.13 + URL + "https://github.com/craffael/lehrfempp/archive/release-0.7.13.tar.gz" + SHA1 + 9ac01bb0384be64a68f36b50bad8c07a92dae519 +) + +hunter_add_version( + PACKAGE_NAME + lehrfempp + VERSION + 0.7.15 + URL + "https://github.com/craffael/lehrfempp/archive/release-0.7.15.tar.gz" + SHA1 + d9361b0a227ce397670d23cac294d9f27504e092 +) + +hunter_add_version( + PACKAGE_NAME + lehrfempp + VERSION + 0.7.16 + URL + "https://github.com/craffael/lehrfempp/archive/release-0.7.16.tar.gz" + SHA1 + cef45f47892c864659ae8941b87f79ebbbf8041f +) + +hunter_add_version( + PACKAGE_NAME + lehrfempp + VERSION + 0.7.18 + URL + "https://github.com/craffael/lehrfempp/archive/release-0.7.18.tar.gz" + SHA1 + ff088d2c7164d3cabb591f4e2aa29981f1f99540 +) + +hunter_add_version( + PACKAGE_NAME + lehrfempp + VERSION + 0.7.19 + URL + "https://github.com/craffael/lehrfempp/archive/release-0.7.19.tar.gz" + SHA1 + 9b1233b42e73eae59b7f6cbb0792c07f85eabd51 +) + +hunter_add_version( + PACKAGE_NAME + lehrfempp + VERSION + 0.7.20 + URL + "https://github.com/craffael/lehrfempp/archive/release-0.7.20.tar.gz" + SHA1 + 65ed75a901f700e8f61a1272ad15423223bfe932 +) + +hunter_cmake_args( + lehrfempp + CMAKE_ARGS + LF_ENABLE_TESTING=OFF + LF_BUILD_EXAMPLES=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(lehrfempp) +hunter_download(PACKAGE_NAME lehrfempp) diff --git a/cmake/projects/leveldb/hunter.cmake b/cmake/projects/leveldb/hunter.cmake new file mode 100644 index 000000000..63b2972ff --- /dev/null +++ b/cmake/projects/leveldb/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 leveldb + VERSION "1.20" + URL "https://github.com/hunter-packages/leveldb/archive/v1.20-p3.tar.gz" + SHA1 "e843a3321605bd818628509c669d6dae65854657") + +hunter_add_version( + PACKAGE_NAME leveldb + VERSION "1.22" + URL "https://github.com/hunter-packages/leveldb/archive/v1.22-p0.tar.gz" + SHA1 "616e3816c0f44423136dcf286ae51417f0d75198") + +hunter_cmake_args(leveldb CMAKE_ARGS + LEVELDB_BUILD_TESTS=OFF + LEVELDB_BUILD_BENCHMARKS=OFF) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(leveldb) +hunter_download(PACKAGE_NAME leveldb) diff --git a/cmake/projects/libcpuid/hunter.cmake b/cmake/projects/libcpuid/hunter.cmake new file mode 100644 index 000000000..6b0fa1b24 --- /dev/null +++ b/cmake/projects/libcpuid/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 + libcpuid + VERSION + 0.4.0 + URL + "https://github.com/hunter-packages/libcpuid/archive/v0.4.0-p0.tar.gz" + SHA1 + dd8255b9a6e84f0d4c81f26b4a32c9af9b2a4e03 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(libcpuid) +hunter_download(PACKAGE_NAME libcpuid) diff --git a/cmake/projects/libdaemon/hunter.cmake b/cmake/projects/libdaemon/hunter.cmake index 699b81a7d..7eb04b025 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 "2" +) diff --git a/cmake/projects/libdill/hunter.cmake b/cmake/projects/libdill/hunter.cmake new file mode 100644 index 000000000..928731852 --- /dev/null +++ b/cmake/projects/libdill/hunter.cmake @@ -0,0 +1,20 @@ +# !!! 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 libdill + VERSION "1.6" + URL "https://github.com/hunter-packages/libdill/archive/hunter-1.6.tar.gz" + SHA1 "603ca85ac4b0d9f0ab4f5db57281127370c5cacc") +hunter_cmake_args(libdill CMAKE_ARGS + BUILD_TESTING=OFF + BUILD_PERF=OFF) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(libdill) +hunter_download(PACKAGE_NAME libdill) diff --git a/cmake/projects/libevhtp/hunter.cmake b/cmake/projects/libevhtp/hunter.cmake new file mode 100644 index 000000000..98b9a5aae --- /dev/null +++ b/cmake/projects/libevhtp/hunter.cmake @@ -0,0 +1,17 @@ +# !!! 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 libevhtp + VERSION "1.2.16-p4" + URL "https://github.com/hunter-packages/libevhtp/archive/v1.2.16-p4.tar.gz" + SHA1 "c6d7b4b4e27de15670f72e36b127613a707164ee") + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(libevhtp) +hunter_download(PACKAGE_NAME libevhtp) diff --git a/cmake/projects/libffi/hunter.cmake b/cmake/projects/libffi/hunter.cmake new file mode 100644 index 000000000..8ae800021 --- /dev/null +++ b/cmake/projects/libffi/hunter.cmake @@ -0,0 +1,40 @@ +# Copyright (c) 2016-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) + +hunter_add_version( + PACKAGE_NAME + libffi + VERSION + "3.2.1" + URL + "https://sourceware.org/pub/libffi/libffi-3.2.1.tar.gz" + SHA1 + 280c265b789e041c02e5c97815793dfc283fb1e6 +) + +hunter_configuration_types(libffi CONFIGURATION_TYPES Release) +hunter_pick_scheme(DEFAULT url_sha1_autotools) + +hunter_cmake_args( + libffi + CMAKE_ARGS + PKGCONFIG_EXPORT_TARGETS=libffi +) + +hunter_cacheable(libffi) +hunter_download( + PACKAGE_NAME libffi + PACKAGE_INTERNAL_DEPS_ID "2" + PACKAGE_UNRELOCATABLE_TEXT_FILES + "lib/libffi.la" + "lib/pkgconfig/libffi.pc" +) diff --git a/cmake/projects/libigl/hunter.cmake b/cmake/projects/libigl/hunter.cmake new file mode 100644 index 000000000..2bde5209e --- /dev/null +++ b/cmake/projects/libigl/hunter.cmake @@ -0,0 +1,57 @@ +# Copyright (c) 2016-2019, 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) + +# Tags v1.3.3 and v2.0.0 are the same: +# - https://github.com/hunter-packages/libigl/pull/1#issuecomment-495176368 +hunter_add_version( + PACKAGE_NAME + libigl + VERSION + 2.0.0-e33f534-p0 + URL + "https://github.com/hunter-packages/libigl/archive/v1.3.3-e33f534-p0.tar.gz" + SHA1 + b94120a61fd5c6320edc7a79f14a37877527767d +) + +hunter_add_version( + PACKAGE_NAME + libigl + VERSION + 2.0.0-e33f534-p1 + URL + "https://github.com/hunter-packages/libigl/archive/v1.3.3-e33f534-p1.tar.gz" + SHA1 + 24637b17fb4700db898099fb6f21e8425ea08a30 +) + +hunter_cmake_args( + libigl + CMAKE_ARGS + # LIBIGL_USE_STATIC_LIBRARY=OFF means make it an INTERFACE library + LIBIGL_USE_STATIC_LIBRARY=ON + LIBIGL_BUILD_TESTS=OFF + LIBIGL_BUILD_TUTORIALS=OFF + LIBIGL_BUILD_PYTHON=OFF + LIBIGL_WITH_COMISO=OFF + LIBIGL_WITH_EMBREE=OFF + LIBIGL_WITH_OPENGL=OFF + LIBIGL_WITH_OPENGL_GLFW=OFF + LIBIGL_WITH_OPENGL_GLFW_IMGUI=OFF + LIBIGL_WITH_PNG=OFF + LIBIGL_WITH_TETGEN=OFF + LIBIGL_WITH_TRIANGLE=OFF + LIBIGL_WITH_XML=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(libigl) +hunter_download(PACKAGE_NAME libigl) diff --git a/cmake/projects/libjson-rpc-cpp/hunter.cmake b/cmake/projects/libjson-rpc-cpp/hunter.cmake new file mode 100644 index 000000000..12c19f7aa --- /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/libmill/hunter.cmake b/cmake/projects/libmill/hunter.cmake new file mode 100644 index 000000000..d66b2290f --- /dev/null +++ b/cmake/projects/libmill/hunter.cmake @@ -0,0 +1,20 @@ +# !!! 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 libmill + VERSION "1.18" + URL "https://github.com/hunter-packages/libmill/archive/hunter-1.18.tar.gz" + SHA1 "447807f84cbd3369d3031b394e0941574e01b08a") +hunter_cmake_args(libmill CMAKE_ARGS + BUILD_TESTING=OFF + BUILD_PERF=OFF) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(libmill) +hunter_download(PACKAGE_NAME libmill) diff --git a/cmake/projects/libogg/hunter.cmake b/cmake/projects/libogg/hunter.cmake index 714568c5f..3ec2e9635 100644 --- a/cmake/projects/libogg/hunter.cmake +++ b/cmake/projects/libogg/hunter.cmake @@ -1,6 +1,19 @@ include(hunter_add_version) +include(hunter_cacheable) include(hunter_download) include(hunter_pick_scheme) +include(GNUInstallDirs) + +hunter_add_version( + PACKAGE_NAME + libogg + VERSION + "1.3.3-p0" + URL + "https://github.com/hunter-packages/ogg/archive/v1.3.3-p0.tar.gz" + SHA1 + 1c83a80374670c6c3cd2ffba59397a0329b69544 +) hunter_add_version( PACKAGE_NAME @@ -10,10 +23,15 @@ hunter_add_version( URL "https://github.com/Meralis40/ogg/archive/v1.3.2-cmake3.tar.gz" SHA1 - 2640E75997765339BA06BE0E4BFA66D85B70636A + 646672cabc9eec253c9199a872541e3a182f6062 ) hunter_pick_scheme(DEFAULT url_sha1_cmake) - -hunter_download(PACKAGE_NAME libogg) - +hunter_cacheable(libogg) +hunter_download( + PACKAGE_NAME + libogg + PACKAGE_UNRELOCATABLE_TEXT_FILES + "${CMAKE_INSTALL_LIBDIR}/pkgconfig/ogg.pc" + PACKAGE_INTERNAL_DEPS_ID "1" +) diff --git a/cmake/projects/libpcre/hunter.cmake b/cmake/projects/libpcre/hunter.cmake new file mode 100644 index 000000000..09c166b3c --- /dev/null +++ b/cmake/projects/libpcre/hunter.cmake @@ -0,0 +1,46 @@ +# Copyright (c) 2016 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) + +hunter_add_version( + PACKAGE_NAME + libpcre + VERSION + "8.41" + URL + "https://ftp.pcre.org/pub/pcre/pcre-8.41.tar.bz2" + SHA1 + 7d1f4aae4191512744a718cc2b81bcf995ec1437 +) + +hunter_configuration_types(libpcre CONFIGURATION_TYPES Release) +hunter_pick_scheme(DEFAULT url_sha1_autotools) + +hunter_cmake_args( + libpcre + CMAKE_ARGS + PKGCONFIG_EXPORT_TARGETS=libpcre;libpcrecpp;libpcreposix + EXTRA_FLAGS=--enable-unicode-properties +) + +hunter_cacheable(libpcre) +hunter_download( + PACKAGE_NAME libpcre + PACKAGE_INTERNAL_DEPS_ID "2" + PACKAGE_UNRELOCATABLE_TEXT_FILES + "lib/libpcre.la" + "lib/libpcrecpp.la" + "lib/libpcreposix.la" + "lib/pkgconfig/libpcre.pc" + "lib/pkgconfig/libpcrecpp.pc" + "lib/pkgconfig/libpcreposix.pc" + "bin/pcre-config" +) diff --git a/cmake/projects/librtmp/hunter.cmake b/cmake/projects/librtmp/hunter.cmake new file mode 100644 index 000000000..abd2e4466 --- /dev/null +++ b/cmake/projects/librtmp/hunter.cmake @@ -0,0 +1,27 @@ +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +# Load used modules +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_download) +include(hunter_pick_scheme) + +# List of versions here... + +hunter_add_version( + PACKAGE_NAME + librtmp + VERSION + "2.4.0-p0" + URL + "https://github.com/hunter-packages/rtmpdump/archive/2.4.0-p0.tar.gz" + SHA1 + 14e8ceedd20423e7a60c6040765fd7d10a379ddd +) + +# Pick a download scheme +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(librtmp) +hunter_download(PACKAGE_NAME librtmp) diff --git a/cmake/projects/libscrypt/hunter.cmake b/cmake/projects/libscrypt/hunter.cmake new file mode 100644 index 000000000..c332e99ab --- /dev/null +++ b/cmake/projects/libscrypt/hunter.cmake @@ -0,0 +1,34 @@ +# Copyright (c) 2017, Pawel Bylica + +# !!! 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 + libscrypt + VERSION + 1.21-p0 + URL + "https://github.com/hunter-packages/libscrypt/archive/v1.21-p0.tar.gz" + SHA1 + 2910558f6275fe4ce077038fcb96f7e0ba9521a3 +) + +hunter_add_version( + PACKAGE_NAME + libscrypt + VERSION + 1.21-p1 + URL + "https://github.com/hunter-packages/libscrypt/archive/v1.21-p1.tar.gz" + SHA1 + 2c70238da6471224c9b37d7e328e5955f0fb42f3 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(libscrypt) +hunter_download(PACKAGE_NAME libscrypt) diff --git a/cmake/projects/libsodium/hunter.cmake b/cmake/projects/libsodium/hunter.cmake index c331b75e8..e338f9c04 100644 --- a/cmake/projects/libsodium/hunter.cmake +++ b/cmake/projects/libsodium/hunter.cmake @@ -18,12 +18,43 @@ hunter_add_version( 00a999629f1f8f500cef29818135f8f889f44e41 ) -hunter_configuration_types(libsodium CONFIGURATION_TYPES Release) -if(MSVC) + +hunter_add_version( + PACKAGE_NAME + libsodium + VERSION + "1.0.16" + URL + "https://github.com/jedisct1/libsodium/archive/1.0.16.tar.gz" + SHA1 + 18a2c5758aaf60c0abbc0e6a21f63df80faccfc6 +) + +hunter_add_version( + PACKAGE_NAME + libsodium + VERSION + "1.0.16-p0" + URL + "https://github.com/hunter-packages/libsodium/archive/v1.0.16-p0.tar.gz" + SHA1 + d986ca5b9759d6518df26248f03db44d4dc9f590 +) + +string(COMPARE EQUAL "${HUNTER_libsodium_VERSION}" "1.0.10" __is_1_0_10) +string(COMPARE EQUAL "${HUNTER_libsodium_VERSION}" "1.0.16" __is_1_0_16) + +if(__is_1_0_10 OR __is_1_0_16) + hunter_configuration_types(libsodium CONFIGURATION_TYPES Release) + if(MSVC) hunter_pick_scheme(DEFAULT url_sha1_libsodium_msbuild) -else() + else() hunter_pick_scheme(DEFAULT url_sha1_libsodium_autogen_autotools) + endif() +else() + hunter_pick_scheme(DEFAULT url_sha1_cmake) endif() + hunter_cacheable(libsodium) hunter_download( PACKAGE_NAME libsodium diff --git a/cmake/projects/libsodium/schemes/url_sha1_libsodium_autogen_autotools.cmake.in b/cmake/projects/libsodium/schemes/url_sha1_libsodium_autogen_autotools.cmake.in index 1f851e47a..bff176b17 100644 --- a/cmake/projects/libsodium/schemes/url_sha1_libsodium_autogen_autotools.cmake.in +++ b/cmake/projects/libsodium/schemes/url_sha1_libsodium_autogen_autotools.cmake.in @@ -9,7 +9,7 @@ list(APPEND CMAKE_MODULE_PATH "@HUNTER_SELF@/cmake/modules") include(hunter_libsodium_install_tools) include(hunter_user_error) include(hunter_status_debug) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) include(hunter_autotools_project) hunter_status_debug("Scheme: url_sha1_libsodium_autogen_autotools") @@ -19,16 +19,16 @@ if("@MSVC@") endif() # 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_BUILD_DIR@") -hunter_test_string_not_empty("@HUNTER_PACKAGE_CONFIGURATION_TYPES@") -hunter_test_string_not_empty("@HUNTER_PACKAGE_INSTALL_PREFIX@") -hunter_test_string_not_empty("@HUNTER_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_BUILD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_CONFIGURATION_TYPES@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_INSTALL_PREFIX@") set(previous_project "") diff --git a/cmake/projects/libsodium/schemes/url_sha1_libsodium_msbuild.cmake.in b/cmake/projects/libsodium/schemes/url_sha1_libsodium_msbuild.cmake.in index 1dcf05af6..cbc030158 100644 --- a/cmake/projects/libsodium/schemes/url_sha1_libsodium_msbuild.cmake.in +++ b/cmake/projects/libsodium/schemes/url_sha1_libsodium_msbuild.cmake.in @@ -8,22 +8,23 @@ include(ExternalProject) include(hunter_libsodium_install_tools) include(hunter_user_error) include(hunter_status_debug) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) # Check preconditions -hunter_test_string_not_empty("@HUNTER_EP_NAME@") -hunter_test_string_not_empty("@HUNTER_INSTALL_PREFIX@") -hunter_test_string_not_empty("@HUNTER_libsodium_VERSION@") -hunter_test_string_not_empty("@HUNTER_MSVC_ARCH@") -hunter_test_string_not_empty("@HUNTER_MSVC_VCVARSALL@") -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_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_libsodium_VERSION@") +hunter_assert_not_empty_string("@HUNTER_MSVC_ARCH@") +hunter_assert_not_empty_string("@HUNTER_MSVC_VCVARSALL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_CONFIGURATION_TYPES@") +hunter_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_TLS_VERIFY@") if(NOT "@MSVC@") @@ -35,6 +36,7 @@ string(COMPARE EQUAL "@HUNTER_MSVC_VERSION@" "10" _is_platform_toolset_v100) # V string(COMPARE EQUAL "@HUNTER_MSVC_VERSION@" "11" _is_platform_toolset_v110) # VC2012 string(COMPARE EQUAL "@HUNTER_MSVC_VERSION@" "12" _is_platform_toolset_v120) # VC2013 string(COMPARE EQUAL "@HUNTER_MSVC_VERSION@" "14" _is_platform_toolset_v140) # VC2015 +string(COMPARE EQUAL "@HUNTER_MSVC_VERSION@" "15" _is_platform_toolset_v141) # VC2017 if(_is_platform_toolset_v100) set(msvc_platform_toolset "v100") @@ -44,9 +46,11 @@ elseif(_is_platform_toolset_v120) set(msvc_platform_toolset "v120") elseif(_is_platform_toolset_v140) set(msvc_platform_toolset "v140") +elseif(_is_platform_toolset_v141) + set(msvc_platform_toolset "v141") else() hunter_user_error( - "Visual studio version not supported. Supported versions are: Visual studio 2010, 2012, 2013 and 2015." + "Visual studio version not supported. Supported versions are: Visual studio 2010, 2012, 2013, 2015 and 2017." "If there is a new version please open an issue at https://github.com/ruslo/hunter and mention @Cyberunner23") endif() @@ -113,6 +117,8 @@ foreach(build_config_type @HUNTER_PACKAGE_CONFIGURATION_TYPES@) SHA1=@HUNTER_PACKAGE_SHA1@ DOWNLOAD_DIR "@HUNTER_PACKAGE_DOWNLOAD_DIR@" + TLS_VERIFY + "@HUNTER_TLS_VERIFY@" SOURCE_DIR "@HUNTER_PACKAGE_SOURCE_DIR@" INSTALL_DIR diff --git a/cmake/projects/libunibreak/hunter.cmake b/cmake/projects/libunibreak/hunter.cmake new file mode 100644 index 000000000..e9aea174e --- /dev/null +++ b/cmake/projects/libunibreak/hunter.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2016-2018, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_download) +include(hunter_pick_scheme) +include(hunter_cmake_args) +include(hunter_configuration_types) + +hunter_add_version( + PACKAGE_NAME + libunibreak + VERSION + 4.0 + URL + "https://github.com/adah1972/libunibreak/releases/download/libunibreak_4_0/libunibreak-4.0.tar.gz" + SHA1 + 44c3294546c56c592d918dcaff14b3b5f96ca627 +) + +hunter_cmake_args( + libunibreak + CMAKE_ARGS + PKGCONFIG_EXPORT_TARGETS=libunibreak +) + +hunter_configuration_types(libunibreak CONFIGURATION_TYPES Release) +hunter_pick_scheme(DEFAULT url_sha1_autotools) +hunter_download(PACKAGE_NAME libunibreak) diff --git a/cmake/projects/libusb/hunter.cmake b/cmake/projects/libusb/hunter.cmake new file mode 100644 index 000000000..f312afb5f --- /dev/null +++ b/cmake/projects/libusb/hunter.cmake @@ -0,0 +1,37 @@ +# Copyright (c) 2016-2019, 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) + +hunter_add_version( + PACKAGE_NAME + libusb + VERSION + 1.0.22 + URL + "https://github.com/libusb/libusb/archive/v1.0.22.tar.gz" + SHA1 + cdb45a2d679e2ccbc3a8193f843e3f0c7187f74c +) + +hunter_cmake_args( + libusb + CMAKE_ARGS + PKGCONFIG_EXPORT_TARGETS=libusb-1.0 +) + +hunter_configuration_types(libusb CONFIGURATION_TYPES Release) +hunter_pick_scheme(DEFAULT url_sha1_autogen_autotools) +hunter_cacheable(libusb) +hunter_download(PACKAGE_NAME libusb + PACKAGE_INTERNAL_DEPS_ID "2" + PACKAGE_UNRELOCATABLE_TEXT_FILES + lib/pkgconfig/libusb-1.0.pc +) diff --git a/cmake/projects/libuv/hunter.cmake b/cmake/projects/libuv/hunter.cmake new file mode 100644 index 000000000..7cfc876ca --- /dev/null +++ b/cmake/projects/libuv/hunter.cmake @@ -0,0 +1,93 @@ +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_cmake_args) +include(hunter_download) +include(hunter_pick_scheme) +include(hunter_report_broken_package) + +hunter_add_version( + PACKAGE_NAME + libuv + VERSION + 1.24.0-p1 + URL + "https://github.com/hunter-packages/libuv/archive/v1.24.0-p1.tar.gz" + SHA1 + cfcb32493c2f9d14014865aa6db7af16b358e852 + ) + +hunter_add_version( + PACKAGE_NAME + libuv + VERSION + 1.24.0-p0 + URL + "https://github.com/hunter-packages/libuv/archive/v1.24.0-p0.tar.gz" + SHA1 + fe7a1a5aede28e1f5c6f4d62aa267d5fdc16b5f7 + ) + +hunter_add_version( + PACKAGE_NAME + libuv + VERSION + 1.21.0-p0 + URL + "https://github.com/hunter-packages/libuv/archive/v1.21.0-p0.tar.gz" + SHA1 + c5fbbe3cfd17c7816d0d063e090c33fae9e1cb32 + ) + +# 2.0.0 is not an upstream tag +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) + +hunter_cmake_args(libuv CMAKE_ARGS BUILD_TESTING=OFF) + +hunter_cacheable(libuv) +hunter_download(PACKAGE_NAME libuv) diff --git a/cmake/projects/libxdg-basedir/hunter.cmake b/cmake/projects/libxdg-basedir/hunter.cmake new file mode 100644 index 000000000..a90f62ae9 --- /dev/null +++ b/cmake/projects/libxdg-basedir/hunter.cmake @@ -0,0 +1,27 @@ +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 libxdg-basedir + VERSION "1.2.0" + URL "https://github.com/devnev/libxdg-basedir/archive/libxdg-basedir-1.2.0.tar.gz" + SHA1 e671b01b17c8cf785d95dd3aefa93e7cf31e56a5 + ) + +hunter_configuration_types(libxdg-basedir CONFIGURATION_TYPES Release) +hunter_pick_scheme(DEFAULT url_sha1_autogen_autotools) +hunter_cacheable(libxdg-basedir) + +hunter_cmake_args( + libxdg-basedir + CMAKE_ARGS + PKGCONFIG_EXPORT_TARGETS=libxdg-basedir + ) + +hunter_download(PACKAGE_NAME libxdg-basedir + PACKAGE_INTERNAL_DEPS_ID "1" # Increment for each new pull request + PACKAGE_UNRELOCATABLE_TEXT_FILES lib/pkgconfig/libxdg-basedir.pc) diff --git a/cmake/projects/libxml2/hunter.cmake b/cmake/projects/libxml2/hunter.cmake new file mode 100644 index 000000000..8c35c8825 --- /dev/null +++ b/cmake/projects/libxml2/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016, Ruslan Baratov, Alexandre Pretyman +# 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 + libxml2 + VERSION + "2.9.7-p0" + URL + "https://github.com/hunter-packages/libxml2/archive/v2.9.7-p0.tar.gz" + SHA1 + 5d5d6da2a87267f160f76a26c5637cbc48b28784 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(libxml2) +hunter_download(PACKAGE_NAME libxml2) diff --git a/cmake/projects/libxml2/schemes/url_sha1_libxml2_msvc.cmake.in b/cmake/projects/libxml2/schemes/url_sha1_libxml2_msvc.cmake.in new file mode 100644 index 000000000..04aa86b34 --- /dev/null +++ b/cmake/projects/libxml2/schemes/url_sha1_libxml2_msvc.cmake.in @@ -0,0 +1,140 @@ +# Copyright (c) 2016, Ruslan Baratov +# Copyright (c) 2017, Sacha Refshauge +# All rights reserved. + +cmake_minimum_required(VERSION 3.0) +project(Hunter) + +include(ExternalProject) # ExternalProject_Add + +# Scheme for download and install LibXML2 library for Windows + +list(APPEND CMAKE_MODULE_PATH "@HUNTER_SELF@/cmake/modules") +include(hunter_libxml2_install_tools) +include(hunter_fatal_error) +include(hunter_internal_error) +include(hunter_status_debug) +include(hunter_assert_not_empty_string) + +hunter_status_debug("Scheme: url_sha1_libxml2_msvc") + +# Check preconditions +hunter_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_MSVC_ARCH@") +hunter_assert_not_empty_string("@HUNTER_MSVC_VCVARSALL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_LICENSE_DIR@") +hunter_assert_not_empty_string("@HUNTER_GLOBAL_SCRIPT_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SCRIPT_DIR@") +hunter_assert_not_empty_string("@HUNTER_TLS_VERIFY@") + +if (BUILD_SHARED_LIBS) + set(shared "static=no") +else() + set(shared "static=yes") +endif() + +# Use native slashes to help nmake if statements work +file(TO_NATIVE_PATH "@HUNTER_PACKAGE_INSTALL_PREFIX@" LIBXML2_INSTALL_DIR) + +set(HUNTER_MSVC_VCVARSALL "@HUNTER_MSVC_VCVARSALL@") +set(HUNTER_MSVC_ARCH "@HUNTER_MSVC_ARCH@") +set(HUNTER_PACKAGE_SOURCE_DIR "@HUNTER_PACKAGE_SOURCE_DIR@") +set(patch_cmd "@CMAKE_COMMAND@" -E copy "@HUNTER_PACKAGE_DOWNLOAD_DIR@/patched_bootstrap.bat" "@HUNTER_PACKAGE_SOURCE_DIR@/patched_bootstrap.bat") +set(bootstrap_cmd "patched_bootstrap.bat") + +set(previous_project "") +foreach(build_config_type @HUNTER_PACKAGE_CONFIGURATION_TYPES@) + + # Check for valid configuration (exact capitalization required) + string(COMPARE EQUAL "${build_config_type}" "Release" is_release) + string(COMPARE EQUAL "${build_config_type}" "Debug" is_debug) + if(NOT (is_release OR is_debug)) + hunter_user_error("libxml2: Invalid build configuration type provided. Valid values are: \"Release\", \"Debug\", \"Release\;Debug\" (HUNTER_PACKAGE_CONFIGURATION_TYPES)") + endif() + + if(@BUILD_SHARED_LIBS@) + set(LIB_EXT "") + else() + set(LIB_EXT "_a") + endif() + + # Configure bootstrap with different MSVC runtime + if (LIBXML2_BUILD_DYNAMIC_VSRUNTIME) + set(LIBXML2_RUNTIME "/MD") + else() + set(LIBXML2_RUNTIME "/MT") + endif() + if (is_debug) + set(LIBXML2_RUNTIME "${LIBXML2_RUNTIME}d") + endif() + configure_file("@HUNTER_PACKAGE_SCRIPT_DIR@/patched_bootstrap.bat.in" "@HUNTER_PACKAGE_DOWNLOAD_DIR@/patched_bootstrap.bat") + + set(current_project "@HUNTER_EP_NAME@${build_config_type}") + + ExternalProject_Add( + ${current_project} + URL + "@HUNTER_PACKAGE_URL@" + URL_HASH + SHA1=@HUNTER_PACKAGE_SHA1@ + DOWNLOAD_DIR + "@HUNTER_PACKAGE_DOWNLOAD_DIR@" + TLS_VERIFY + "@HUNTER_TLS_VERIFY@" + SOURCE_DIR + "@HUNTER_PACKAGE_SOURCE_DIR@" + INSTALL_DIR + "@HUNTER_PACKAGE_INSTALL_PREFIX@" + # not used, just avoid creating Install/ empty directory + CONFIGURE_COMMAND + ${patch_cmd} + COMMAND + ${bootstrap_cmd} + BUILD_COMMAND + "@CMAKE_COMMAND@" -E echo "Dummy build step" + BUILD_IN_SOURCE + 1 + INSTALL_COMMAND + "@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" + LOG_CONFIGURE 1 + ) + + # Each external project must depends on previous one since they all use + # the same building directory + string(COMPARE EQUAL "${previous_project}" "" is_empty) + if(NOT is_empty) + add_dependencies( + "${current_project}" + "${previous_project}" + ) + endif() + set(previous_project "${current_project}") + + # Install target file + # Required: lib file name, BUILD_SHARED_LIBS, install prefix, hunter_self + string(TOUPPER ${build_config_type} TARGET_CONFIGURATION) + set(HUNTER_PACKAGE_INSTALL_PREFIX "@HUNTER_PACKAGE_INSTALL_PREFIX@") + set(TARGET_LIB_FILE "libxml2${LIB_EXT}.lib") + set(HUNTER_SELF "@HUNTER_SELF@") + + hunter_install_libxml2_targets() +endforeach() + +# Forward some variables +set(BUILD_SHARED_LIBS "@BUILD_SHARED_LIBS@") +set(HUNTER_libxml2_VERSION "@HUNTER_libxml2_VERSION@") +set(HUNTER_PACKAGE_CONFIGURATION_TYPES "@HUNTER_PACKAGE_CONFIGURATION_TYPES@") +set(HUNTER_PACKAGE_INSTALL_PREFIX "@HUNTER_PACKAGE_INSTALL_PREFIX@") + +hunter_install_libxml2_config() diff --git a/cmake/projects/libxml2/scripts/patched_bootstrap.bat.in b/cmake/projects/libxml2/scripts/patched_bootstrap.bat.in new file mode 100644 index 000000000..000e09d45 --- /dev/null +++ b/cmake/projects/libxml2/scripts/patched_bootstrap.bat.in @@ -0,0 +1,7 @@ +call "@HUNTER_MSVC_VCVARSALL@" @HUNTER_MSVC_ARCH@ +REM The /d flag is required because vcvarsall.bat changes the current drive +REM If the hunter cache is located on a different drive to vcvarsall.bat the +REM cd command will fail. https://technet.microsoft.com/en-gb/library/bb490875.aspx +cd /d @HUNTER_PACKAGE_SOURCE_DIR@/win32 +cscript //B configure.js @shared@ compiler=msvc "cruntime=@LIBXML2_RUNTIME@" "prefix=@LIBXML2_INSTALL_DIR@" iconv=no debug=no zlib=no ftp=no +nmake /f Makefile.msvc libxml install-libs diff --git a/cmake/projects/libzip/hunter.cmake b/cmake/projects/libzip/hunter.cmake new file mode 100644 index 000000000..e247aa6a6 --- /dev/null +++ b/cmake/projects/libzip/hunter.cmake @@ -0,0 +1,39 @@ +# Copyright (c) 2016-2019, 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 + libzip + VERSION + 1.5.2-d68a667-p0 + URL + "https://github.com/hunter-packages/libzip/archive/v1.5.2-d68a667-p0.tar.gz" + SHA1 + c3fce63f125fe5a50103d9f20846ca2a269439b7 +) + +hunter_cmake_args( + libzip + CMAKE_ARGS + ENABLE_COMMONCRYPTO=OFF + ENABLE_GNUTLS=OFF + ENABLE_MBEDTLS=OFF + ENABLE_WINDOWS_CRYPTO=OFF + BUILD_TOOLS=OFF + BUILD_REGRESS=OFF + BUILD_EXAMPLES=OFF + BUILD_DOC=OFF + BUILD_SHARED_LIBS=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(libzip) +hunter_download(PACKAGE_NAME libzip) diff --git a/cmake/projects/lmdb/hunter.cmake b/cmake/projects/lmdb/hunter.cmake new file mode 100644 index 000000000..a010d2211 --- /dev/null +++ b/cmake/projects/lmdb/hunter.cmake @@ -0,0 +1,35 @@ +# 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 + lmdb + VERSION + 0.9.21-p1 + URL + "https://github.com/hunter-packages/lmdb/archive/v0.9.21-p1.tar.gz" + SHA1 + 4218e126cbc18756d93a798f56e5e6dd10803aae + ) + +hunter_add_version( + PACKAGE_NAME + lmdb + VERSION + 0.9.21-p2 + URL "https://github.com/hunter-packages/lmdb/archive/v0.9.21-p2.tar.gz" + SHA1 "ae88e15f646d26ca0a4a4b0d05041460bd509736" + ) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(lmdb) +hunter_download(PACKAGE_NAME lmdb) diff --git a/cmake/projects/lmdbxx/hunter.cmake b/cmake/projects/lmdbxx/hunter.cmake new file mode 100644 index 000000000..2d5d2f4f1 --- /dev/null +++ b/cmake/projects/lmdbxx/hunter.cmake @@ -0,0 +1,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 lmdbxx + VERSION "0.9.14.0" + URL "https://github.com/isaachier/lmdbxx/archive/hunter-0.9.14.0-p1.tar.gz" + SHA1 "1e6120db2f563f81ebe4160829b644d919dc574b") + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(lmdbxx) +hunter_download(PACKAGE_NAME lmdbxx) diff --git a/cmake/projects/lz4/hunter.cmake b/cmake/projects/lz4/hunter.cmake new file mode 100644 index 000000000..5a7467c72 --- /dev/null +++ b/cmake/projects/lz4/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 + lz4 + VERSION + 1.8.0-p1 + URL + "https://github.com/hunter-packages/lz4/archive/v1.8.0-p1.tar.gz" + SHA1 + 00b58d5f28404ed1fdd3410468ebaa44c2ad8a16 +) + +hunter_add_version( + PACKAGE_NAME + lz4 + VERSION + 1.8.0-p2 + URL + "https://github.com/hunter-packages/lz4/archive/v1.8.0-p2.tar.gz" + SHA1 + e96abaedd5d8a5a61c21316c8bb173b1954c7c6b +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(lz4) +hunter_download(PACKAGE_NAME lz4) diff --git a/cmake/projects/lzma/hunter.cmake b/cmake/projects/lzma/hunter.cmake new file mode 100644 index 000000000..4e94d5ede --- /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/magnum/hunter.cmake b/cmake/projects/magnum/hunter.cmake new file mode 100644 index 000000000..5af263d07 --- /dev/null +++ b/cmake/projects/magnum/hunter.cmake @@ -0,0 +1,116 @@ +# Copyright (c) 2016-2018, 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) +include(hunter_cmake_args) + +hunter_add_version( + PACKAGE_NAME + magnum + VERSION + 2019.01 + URL + "https://github.com/mosra/magnum/archive/v2019.01.tar.gz" + SHA1 + af356adc9e83826d55bd7f438c29f98104f95fd0 +) + +# CMAKE_SYSTEM_NAME dependant default options below + +# Take all the plugins +set(_hunter_magnum_cmake_args + WITH_ANYIMAGECONVERTER=ON + WITH_ANYIMAGEIMPORTER=ON + WITH_ANYSCENEIMPORTER=ON + WITH_MAGNUMFONT=ON + WITH_MAGNUMFONTCONVERTER=ON + WITH_OBJIMPORTER=ON + WITH_TGAIMAGECONVERTER=ON + WITH_TGAIMPORTER=ON) + +# Default application implementation +if(ANDROID) + list(APPEND _hunter_magnum_cmake_args WITH_ANDROIDAPPLICATION=ON) +elseif(NOT IOS) + # TODO: There's no SDL2 for iOS? + list(APPEND _hunter_magnum_cmake_args WITH_SDL2APPLICATION=ON) +endif() + +# Command-line utilities for desktop platforms +if(WIN32 OR UNIX) + list(APPEND _hunter_magnum_cmake_args + WITH_GL_INFO=ON + WITH_DISTANCEFIELDCONVERTER=ON + WITH_FONTCONVERTER=ON + WITH_IMAGECONVERTER=ON + WITH_OPENGLTESTER=ON) +endif() + +# Windows-specific +if(WIN32) + list(APPEND _hunter_magnum_cmake_args + WITH_WINDOWLESSWGLAPPLICATION=ON + WITH_WGLCONTEXT=ON) +endif() + +# Linux-specific +if(UNIX AND NOT APPLE) + list(APPEND _hunter_magnum_cmake_args + WITH_WINDOWLESSGLXAPPLICATION=ON + WITH_GLXCONTEXT=ON) +endif() + +# macOS-specific +if(APPLE AND NOT IOS) + list(APPEND _hunter_magnum_cmake_args + WITH_WINDOWLESSCGLAPPLICATION=ON + WITH_CGLCONTEXT=ON) +endif() + +# iOS-specific +if(IOS) + list(APPEND _hunter_magnum_cmake_args + WITH_WINDOWLESSIOSAPPLICATION=ON + WITH_EGLCONTEXT=ON) +endif() + +# Emscripten-specific. No EglContext here. +if(EMSCRIPTEN) + list(APPEND _hunter_magnum_cmake_args + WITH_WINDOWLESSEGLAPPLICATION=ON) +endif() + +# Audio, where supported. +# - Linux and macOS has it +# - OpenAL hunter package fails to build under windows +# See https://ci.appveyor.com/project/pthom/hunter/builds/20697140/job/03xop04ea11c47vf +# CMake Error at C:/projects/hunter/_ci/cmake/share/cmake-3.13/Modules/CheckIncludeFiles.cmake:63 (message): +# Unknown arguments: +# -D_WIN32_WINNT=0x0502 +# - Audio / OpenAL not ported to Android yet +if((UNIX OR EMSCRIPTEN) AND NOT IOS) + list(APPEND _hunter_magnum_cmake_args + WITH_AUDIO=ON + WITH_WAVAUDIOIMPORTER=ON + WITH_ANYAUDIOIMPORTER=ON) + + # Also the magnum-al-info for desktop platforms + if(UNIX) + list(APPEND _hunter_magnum_cmake_args WITH_AL_INFO=ON) + endif() +endif() + +hunter_cmake_args( + magnum + CMAKE_ARGS + ${_hunter_magnum_cmake_args} + ) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(magnum) +hunter_download(PACKAGE_NAME magnum) diff --git a/cmake/projects/IntSizeof/hunter.cmake b/cmake/projects/md5/hunter.cmake similarity index 51% rename from cmake/projects/IntSizeof/hunter.cmake rename to cmake/projects/md5/hunter.cmake index 82f66348c..3642e33de 100644 --- a/cmake/projects/IntSizeof/hunter.cmake +++ b/cmake/projects/md5/hunter.cmake @@ -1,22 +1,24 @@ -# Copyright (c) 2014, Ruslan Baratov +# 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 - IntSizeof + md5 VERSION - "1.0.0" + 1.6 URL - "https://github.com/ruslo/intsizeof/archive/v1.0.0.tar.gz" + "https://github.com/hunter-packages/md5/archive/v1.6.tar.gz" SHA1 - 9959e0e29c88fe414ba082fb28a722e411682bb3 + e693ece280ba161001c6024baac3146b2b8778dc ) hunter_pick_scheme(DEFAULT url_sha1_cmake) -hunter_download(PACKAGE_NAME IntSizeof) +hunter_cacheable(md5) +hunter_download(PACKAGE_NAME md5) diff --git a/cmake/projects/minizip/hunter.cmake b/cmake/projects/minizip/hunter.cmake index e1ebdd865..dea1c5856 100644 --- a/cmake/projects/minizip/hunter.cmake +++ b/cmake/projects/minizip/hunter.cmake @@ -7,6 +7,18 @@ include(hunter_add_version) include(hunter_cacheable) include(hunter_download) include(hunter_pick_scheme) +include(hunter_cmake_args) + +hunter_add_version( + PACKAGE_NAME + minizip + VERSION + "1.0.1-p3" + URL + "https://github.com/hunter-packages/minizip/archive/v1.0.1-p3.tar.gz" + SHA1 + 9ad9dab6758d7fdbeae492515b7027ecd4903b16 +) hunter_add_version( PACKAGE_NAME @@ -30,6 +42,8 @@ hunter_add_version( 65728dbf7573d3f1826d04a3b686d80eb099d7b8 ) +hunter_cmake_args(minizip CMAKE_ARGS USE_AES=FALSE) + hunter_pick_scheme(DEFAULT url_sha1_cmake) hunter_cacheable(minizip) hunter_download(PACKAGE_NAME minizip) diff --git a/cmake/projects/mkl/hunter.cmake b/cmake/projects/mkl/hunter.cmake new file mode 100644 index 000000000..b6802d126 --- /dev/null +++ b/cmake/projects/mkl/hunter.cmake @@ -0,0 +1,82 @@ +# Copyright (c) 2016-2018, Ruslan Baratov +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_download) +include(hunter_pick_scheme) +include(hunter_user_error) + +if(WIN32) + hunter_add_version( + PACKAGE_NAME + mkl + VERSION + 20180406 + URL + "https://github.com/intel/mkl-dnn/releases/download/v0.14/mklml_win_2018.0.3.20180406.zip" + SHA1 + d607ca92d7bfc101f0828c0b005098b75531669b + ) + + hunter_add_version( + PACKAGE_NAME + mkl + VERSION + 20190502 + URL + "https://github.com/intel/mkl-dnn/releases/download/v0.19/mklml_win_2019.0.5.20190502.zip" + SHA1 + 9d6ff4d5a486689338158093e96c43ee442b65f0 + ) +elseif(APPLE) + hunter_add_version( + PACKAGE_NAME + mkl + VERSION + 20180406 + URL + "https://github.com/intel/mkl-dnn/releases/download/v0.14/mklml_mac_2018.0.3.20180406.tgz" + SHA1 + d76083fd5a79767a96572ad0e23e7f4c892818f2 + ) + + hunter_add_version( + PACKAGE_NAME + mkl + VERSION + 20190502 + URL + "https://github.com/intel/mkl-dnn/releases/download/v0.19/mklml_mac_2019.0.5.20190502.tgz" + SHA1 + a1c42af04f990b0e515a1c31946424b2e68fccc9 + ) +elseif(UNIX) + hunter_add_version( + PACKAGE_NAME + mkl + VERSION + 20180406 + URL + "https://github.com/intel/mkl-dnn/releases/download/v0.14/mklml_lnx_2018.0.3.20180406.tgz" + SHA1 + aea0d9ce65773cfcf5d8292b8db553bde965fc8f + ) + + hunter_add_version( + PACKAGE_NAME + mkl + VERSION + 20190502 + URL + "https://github.com/intel/mkl-dnn/releases/download/v0.19/mklml_lnx_2019.0.5.20190502.tgz" + SHA1 + 6ab490f0b358124338d04ee9383c3cbc536969d8 + ) +else() + hunter_user_error("Platform not supported") +endif() + +hunter_pick_scheme(DEFAULT url_sha1_unpack_install) +hunter_download(PACKAGE_NAME mkl) diff --git a/cmake/projects/mkldnn/hunter.cmake b/cmake/projects/mkldnn/hunter.cmake new file mode 100644 index 000000000..73e7e234b --- /dev/null +++ b/cmake/projects/mkldnn/hunter.cmake @@ -0,0 +1,66 @@ +# Copyright (c) 2016-2018, 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 + mkldnn + VERSION + 0.14-p0 + URL + "https://github.com/hunter-packages/mkldnn/archive/v0.14-p0.tar.gz" + SHA1 + 374092d906d8163491d96907095727429fed776e +) + +hunter_add_version( + PACKAGE_NAME + mkldnn + VERSION + 0.17.4-p0 + URL + "https://github.com/hunter-packages/mkldnn/archive/v0.17.4-p0.tar.gz" + SHA1 + 73a88f93c27e372c901608a399be54c7f21c4daa +) + +hunter_add_version( + PACKAGE_NAME + mkldnn + VERSION + 0.17.4-p1 + URL + "https://github.com/hunter-packages/mkldnn/archive/v0.17.4-p1.tar.gz" + SHA1 + ee1cdb9a1a3359af85e4a0c6274292b2a0873a8f +) + +hunter_add_version( + PACKAGE_NAME + mkldnn + VERSION + 0.19-p0 + URL + "https://github.com/hunter-packages/mkldnn/archive/v0.19-p0.tar.gz" + SHA1 + 50b706789a891f0af17b0e8732a7c1954683403e +) + +hunter_cmake_args( + mkldnn + CMAKE_ARGS + FAIL_WITHOUT_MKL=ON + WITH_EXAMPLE=OFF + WITH_TEST=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(mkldnn) +hunter_download(PACKAGE_NAME mkldnn) diff --git a/cmake/projects/mng/hunter.cmake b/cmake/projects/mng/hunter.cmake new file mode 100644 index 000000000..e86fef868 --- /dev/null +++ b/cmake/projects/mng/hunter.cmake @@ -0,0 +1,49 @@ +# Copyright (c) 2016-2018, 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 + mng + VERSION + 2.0.3-p0 + URL + https://github.com/hunter-packages/mng/archive/v2.0.3-p0.tar.gz + SHA1 + d0f3f21b816785841f27f704a69436cc261364bc +) + +hunter_add_version( + PACKAGE_NAME + mng + VERSION + 2.0.3-p1 + URL + https://github.com/hunter-packages/mng/archive/v2.0.3-p1.tar.gz + SHA1 + 7093e4ea2701834ff858aa3441294edbbf83c4b1 +) + +hunter_add_version( + PACKAGE_NAME + mng + VERSION + 2.0.3-p2 + URL + https://github.com/hunter-packages/mng/archive/v2.0.3-p2.tar.gz + SHA1 + 54d8034ced87b6411df40d0f3cfd5724257e9b00 +) + +hunter_cmake_args(mng CMAKE_ARGS MNG_INSTALL_LIB_DIR=lib) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(mng) +hunter_download(PACKAGE_NAME mng) diff --git a/cmake/projects/mojoshader/hunter.cmake b/cmake/projects/mojoshader/hunter.cmake new file mode 100644 index 000000000..0babda401 --- /dev/null +++ b/cmake/projects/mojoshader/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 + mojoshader + VERSION + 0.0.1 + URL + "https://github.com/hunter-packages/mojoshader/archive/v0.0.1.tar.gz" + SHA1 + 177e1a81bf0fe0253ee111ca679b69c61685e79c +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(mojoshader) +hunter_download(PACKAGE_NAME mojoshader) diff --git a/cmake/projects/mongoose/hunter.cmake b/cmake/projects/mongoose/hunter.cmake new file mode 100644 index 000000000..f6a192827 --- /dev/null +++ b/cmake/projects/mongoose/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 + mongoose + VERSION + 6.10 + URL + https://github.com/hunter-packages/mongoose/archive/6.10-p.tar.gz + SHA1 + 7f2af8da196c29a60f597b67cde5706d0acb20a0 +) + +hunter_add_version( + PACKAGE_NAME + mongoose + VERSION + 5.6 + URL + https://github.com/hunter-packages/mongoose/archive/5.6-p.tar.gz + SHA1 + cbb313403e742f09cbbcf1c1a62c13e156c6b803 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(mongoose) +hunter_download(PACKAGE_NAME mongoose) diff --git a/cmake/projects/mpark_variant/hunter.cmake b/cmake/projects/mpark_variant/hunter.cmake new file mode 100644 index 000000000..e64bfd0b8 --- /dev/null +++ b/cmake/projects/mpark_variant/hunter.cmake @@ -0,0 +1,29 @@ +# cmake/projects/mpark_variant/hunter.cmake + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +# Load used modules +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_download) +include(hunter_pick_scheme) + +# List of versions here... +hunter_add_version( + PACKAGE_NAME + mpark_variant + VERSION + "1.0.0" + URL + "https://github.com/mpark/variant/archive/v1.0.0.tar.gz" + SHA1 + 59ab98b61daa335ba1fa613e591de743f72d24b4 +) + +# Probably more versions for real packages... + +# Pick a download scheme +hunter_pick_scheme(DEFAULT url_sha1_cmake) # use scheme for cmake projects + +hunter_cacheable(mpark_variant) +hunter_download(PACKAGE_NAME mpark_variant) diff --git a/cmake/projects/msgpack/hunter.cmake b/cmake/projects/msgpack/hunter.cmake index 4b3fc9c9b..7493b10ab 100644 --- a/cmake/projects/msgpack/hunter.cmake +++ b/cmake/projects/msgpack/hunter.cmake @@ -16,6 +16,17 @@ hunter_add_version( 5074d28857661693b71c4bda3f8fc662e4c73990 ) +hunter_add_version( + PACKAGE_NAME + msgpack + VERSION + "1.4.1-p2" + URL + "https://github.com/hunter-packages/msgpack-c/archive/cpp-1.4.1-hunter-p2.tar.gz" + SHA1 + eafdcb4c0a29d7416248740bd8132316a4b03910 + ) + hunter_pick_scheme(DEFAULT url_sha1_cmake) hunter_cacheable(msgpack) hunter_download(PACKAGE_NAME msgpack) diff --git a/cmake/projects/mshadow/hunter.cmake b/cmake/projects/mshadow/hunter.cmake new file mode 100644 index 000000000..9a0be1de3 --- /dev/null +++ b/cmake/projects/mshadow/hunter.cmake @@ -0,0 +1,35 @@ +# Copyright (c) 2016-2018, 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 + mshadow + VERSION + 1.1-696803b-p0 + URL + "https://github.com/hunter-packages/mshadow/archive/v1.1-696803b-p0.tar.gz" + SHA1 + 34429211cc841afbde7f8f36994501836a36eb6f +) + +hunter_add_version( + PACKAGE_NAME + mshadow + VERSION + 1.1-1d79ecf-p0 + URL + "https://github.com/hunter-packages/mshadow/archive/v1.1-1d79ecf-p0.tar.gz" + SHA1 + 45e424dc081ccd02f61ab58b59030e3da3890a8a +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(mshadow) +hunter_download(PACKAGE_NAME mshadow) diff --git a/cmake/projects/mtplz/hunter.cmake b/cmake/projects/mtplz/hunter.cmake new file mode 100644 index 000000000..b12f07784 --- /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/mxnet/hunter.cmake b/cmake/projects/mxnet/hunter.cmake new file mode 100644 index 000000000..0a65d832f --- /dev/null +++ b/cmake/projects/mxnet/hunter.cmake @@ -0,0 +1,108 @@ +# Copyright (c) 2016-2018, 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 + mxnet + VERSION + 0.0.0-5b86701f2-p0 + URL + "https://github.com/hunter-packages/mxnet/archive/0.0.0-5b86701f2-p0.tar.gz" + SHA1 + 8b7d898d2f474bef2ca436cca2c2ab15483535cd +) + +hunter_add_version( + PACKAGE_NAME + mxnet + VERSION + 0.0.0-5b86701f2-p1 + URL + "https://github.com/hunter-packages/mxnet/archive/0.0.0-5b86701f2-p1.tar.gz" + SHA1 + 71c01aaa65448f4826e2ec4cadb44987370d664f +) + +hunter_add_version( + PACKAGE_NAME + mxnet + VERSION + 0.0.0-5b86701f2-p2 + URL + "https://github.com/hunter-packages/mxnet/archive/0.0.0-5b86701f2-p2.tar.gz" + SHA1 + 60c4d0ef4b9ac35e6a23c5482a1702da7e377d5c +) + +hunter_add_version( + PACKAGE_NAME + mxnet + VERSION + 1.4.0-p2 + URL + "https://github.com/hunter-packages/mxnet/archive/v1.4.0-p2.tar.gz" + SHA1 + bb80e4b173d2630313195f38d528f2d2d42455c3 +) + +hunter_add_version( + PACKAGE_NAME + mxnet + VERSION + 1.4.0-p3 + URL + "https://github.com/hunter-packages/mxnet/archive/v1.4.0-p3.tar.gz" + SHA1 + aa01fea9b74bd4a10f5a1d028e61be62c4536bd0 +) + +hunter_add_version( + PACKAGE_NAME + mxnet + VERSION + 1.5.0.rc1-b64e00a-p0 + URL + "https://github.com/hunter-packages/mxnet/archive/v1.5.0.rc1-b64e00a-p0.tar.gz" + SHA1 + 01c400835d280a7ffec86361d17a2a10b3851998 +) + +set( + __hunter_mxnet_args + BUILD_CPP_EXAMPLES=OFF + BUILD_TESTS=OFF + USE_CPP_PACKAGE=ON + USE_GPERFTOOLS=OFF + USE_JEMALLOC=OFF + USE_OPENMP=OFF +) + +if(APPLE) + list( + APPEND + __hunter_mxnet_args + BLAS=apple + USE_CUDA=OFF + USE_LAPACK=OFF + ) +else() + list( + APPEND + __hunter_mxnet_args + USE_LAPACK=OFF + ) +endif() + +hunter_cmake_args(mxnet CMAKE_ARGS ${__hunter_mxnet_args}) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(mxnet) +hunter_download(PACKAGE_NAME mxnet) diff --git a/cmake/projects/nanoflann/hunter.cmake b/cmake/projects/nanoflann/hunter.cmake new file mode 100644 index 000000000..47a4d38b3 --- /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/nanosvg/hunter.cmake b/cmake/projects/nanosvg/hunter.cmake new file mode 100644 index 000000000..543e751c6 --- /dev/null +++ b/cmake/projects/nanosvg/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2018, 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 + nanosvg + VERSION + "0.0.0-2b08dee-p0" + URL + "https://github.com/hunter-packages/nanosvg/archive/v0.0.0-2b08dee-p0.tar.gz" + SHA1 + ee4b86de4478fc912510bada2341d4f8faa8feaf +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(nanosvg) +hunter_download(PACKAGE_NAME nanosvg) diff --git a/cmake/projects/ncnn/hunter.cmake b/cmake/projects/ncnn/hunter.cmake new file mode 100644 index 000000000..cc34d982c --- /dev/null +++ b/cmake/projects/ncnn/hunter.cmake @@ -0,0 +1,32 @@ +# Copyright (c) 2016-2018, Ruslan Baratov +# Copyright (c) 2018, 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 + ncnn + VERSION + 20180314-p2 + URL + "https://github.com/hunter-packages/ncnn/archive/20180314-p2.tar.gz" + SHA1 + 7ae8c7e168206885d18eee3068dee96705841bf7 +) + +hunter_cmake_args( + ncnn + CMAKE_ARGS + NCNN_LOCAL_TOOLCHAIN=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(ncnn) +hunter_download(PACKAGE_NAME ncnn) diff --git a/cmake/projects/ncursesw/hunter.cmake b/cmake/projects/ncursesw/hunter.cmake new file mode 100644 index 000000000..19ffcb196 --- /dev/null +++ b/cmake/projects/ncursesw/hunter.cmake @@ -0,0 +1,43 @@ +# Copyright (c) 2016-2019, 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) + +hunter_add_version( + PACKAGE_NAME + ncursesw + VERSION + 6.1 + URL + "https://ftp.gnu.org/gnu/ncurses/ncurses-6.1.tar.gz" + SHA1 + 57acf6bc24cacd651d82541929f726f4def780cc +) + +hunter_configuration_types(ncursesw CONFIGURATION_TYPES Release) +hunter_pick_scheme(DEFAULT url_sha1_autotools) +hunter_cmake_args( + ncursesw + CMAKE_ARGS + EXTRA_FLAGS=--enable-ext-mouse --enable-sigwinch --enable-ext-colors --enable-widec --enable-pc-files + PKGCONFIG_EXPORT_TARGETS=ncursesw;formw;ncurses++w;menuw;panelw +) +hunter_cacheable(ncursesw) +hunter_download( + PACKAGE_NAME ncursesw + PACKAGE_INTERNAL_DEPS_ID "1" + PACKAGE_UNRELOCATABLE_TEXT_FILES + lib/pkgconfig/ncursesw.pc + lib/pkgconfig/formw.pc + lib/pkgconfig/ncurses++w.pc + lib/pkgconfig/menuw.pc + lib/pkgconfig/panelw.pc + bin/ncursesw6-config +) diff --git a/cmake/projects/nlohmann-json/hunter.cmake b/cmake/projects/nlohmann-json/hunter.cmake deleted file mode 100644 index a5c9e2df7..000000000 --- a/cmake/projects/nlohmann-json/hunter.cmake +++ /dev/null @@ -1,25 +0,0 @@ -# !!! DO NOT PLACE HEADER GUARDS HERE !!! - -include(hunter_add_version) -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_download(PACKAGE_NAME nlohmann-json) diff --git a/cmake/projects/nlohmann_fifo_map/hunter.cmake b/cmake/projects/nlohmann_fifo_map/hunter.cmake new file mode 100644 index 000000000..a0314eca8 --- /dev/null +++ b/cmake/projects/nlohmann_fifo_map/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2018, 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 + nlohmann_fifo_map + VERSION + "0.0.0-0dfbf5d-p1" + URL + "https://github.com/hunter-packages/fifo_map/archive/v0.0.0-0dfbf5d-p1.tar.gz" + SHA1 + 5361545721631631fd0cb4112f888cba8a2ef7ef +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(nlohmann_fifo_map) +hunter_download(PACKAGE_NAME nlohmann_fifo_map) diff --git a/cmake/projects/nlohmann_json/hunter.cmake b/cmake/projects/nlohmann_json/hunter.cmake new file mode 100644 index 000000000..a26c6f151 --- /dev/null +++ b/cmake/projects/nlohmann_json/hunter.cmake @@ -0,0 +1,127 @@ +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_cmake_args) +include(hunter_download) +include(hunter_pick_scheme) +include(hunter_report_broken_package) +include(hunter_status_debug) + +# See https://github.com/nlohmann/json#supported-compilers +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8") + hunter_report_broken_package("The nlohmann_json package requires GCC 4.8 or newer.") + endif() +elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.4") + hunter_report_broken_package("The nlohmann_json package requires Clang 3.4 or newer.") + endif() +elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "19.0") + hunter_report_broken_package("The nlohmann_json package requires Visual Studio 2015 or newer.") + endif() +elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "17.0.2") + hunter_report_broken_package("The nlohmann_json package requires Intel compiler 17.0.2 or newer.") + endif() +else() + hunter_status_debug("You are using an untested compiler for the nlohmann_json package.") +endif() + +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_add_version( + PACKAGE_NAME nlohmann_json + VERSION "3.0.0" + URL "https://github.com/nlohmann/json/archive/v3.0.0.tar.gz" + SHA1 dbc3bb35d0bf9e21e5348291caa4142ab3ad418b +) + +hunter_add_version( + PACKAGE_NAME nlohmann_json + VERSION "3.0.1" + URL "https://github.com/nlohmann/json/archive/v3.0.1.tar.gz" + SHA1 56d0b45d94b78b9bee73e8457d222457952d9270 +) + +hunter_add_version( + PACKAGE_NAME nlohmann_json + VERSION "3.1.0" + URL "https://github.com/nlohmann/json/archive/v3.1.0.tar.gz" + SHA1 d59929f5796e92c70dfc0fd9d37bf9b90265bfd3 +) + +hunter_add_version( + PACKAGE_NAME nlohmann_json + VERSION "3.1.1" + URL "https://github.com/nlohmann/json/archive/v3.1.1.tar.gz" + SHA1 3bdcd9dd6b3c5a0f376ac9c77020f3b9676d3e62 +) + +hunter_add_version( + PACKAGE_NAME nlohmann_json + VERSION "3.1.2" + URL "https://github.com/nlohmann/json/archive/v3.1.2.tar.gz" + SHA1 7b668b6af9839c7a46449a0d7f3389982c21ccbb +) + +hunter_add_version( + PACKAGE_NAME nlohmann_json + VERSION "3.2.0" + URL "https://github.com/nlohmann/json/archive/v3.2.0.tar.gz" + SHA1 d14cd77f0badfdacd867861633d5a8ab45d7b9df +) + +hunter_add_version( + PACKAGE_NAME nlohmann_json + VERSION "3.3.0" + URL "https://github.com/nlohmann/json/archive/v3.3.0.tar.gz" + SHA1 90842f04aadc1af1af600ce84c7fbe0d1dfc3d3c +) + +hunter_add_version( + PACKAGE_NAME nlohmann_json + VERSION "3.4.0" + URL "https://github.com/nlohmann/json/archive/v3.4.0.tar.gz" + SHA1 eb8cedccbe5868cbd963bf72f5c27f4ebea51423 +) + +hunter_add_version( + PACKAGE_NAME nlohmann_json + VERSION "3.5.0" + URL "https://github.com/nlohmann/json/archive/v3.5.0.tar.gz" + SHA1 d5fb01debe55c2f56ef44dabb0539947434e815d +) + +hunter_add_version( + PACKAGE_NAME nlohmann_json + VERSION "3.6.0" + URL "https://github.com/nlohmann/json/archive/v3.6.0.tar.gz" + SHA1 2848ddd69a5ddc6b48d134e9c7ad2f0896c67f9c +) + +hunter_add_version( + PACKAGE_NAME nlohmann_json + VERSION "3.6.1" + URL "https://github.com/nlohmann/json/archive/v3.6.1.tar.gz" + SHA1 581e1d1c89c65670fb5212d74493a4545d9ab91c +) + +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/nsync/hunter.cmake b/cmake/projects/nsync/hunter.cmake new file mode 100644 index 000000000..dd4d7de08 --- /dev/null +++ b/cmake/projects/nsync/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 + nsync + VERSION + 1.14-p1 + URL + "https://github.com/hunter-packages/nsync/archive/v1.14-p1.tar.gz" + SHA1 + ba52dbd178fc5162aac4469b67c0b5a684e37075 + ) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(nsync) +hunter_download(PACKAGE_NAME nsync) diff --git a/cmake/projects/odb-boost/hunter.cmake b/cmake/projects/odb-boost/hunter.cmake index bfe2ecb59..f96fb58e6 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 "12" ) - diff --git a/cmake/projects/odb-boost/schemes/url_sha1_odb-boost_autotools.cmake.in b/cmake/projects/odb-boost/schemes/url_sha1_odb-boost_autotools.cmake.in index 1df098485..187378809 100644 --- a/cmake/projects/odb-boost/schemes/url_sha1_odb-boost_autotools.cmake.in +++ b/cmake/projects/odb-boost/schemes/url_sha1_odb-boost_autotools.cmake.in @@ -9,7 +9,7 @@ include("@HUNTER_SELF@/cmake/Hunter") include(hunter_autotools_project) include(hunter_fatal_error) include(hunter_status_debug) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) hunter_status_debug("Scheme: url_sha1_odb-boost_autotools") @@ -24,15 +24,15 @@ hunter_add_package(Boost COMPONENTS date_time) find_package(Boost CONFIG REQUIRED COMPONENTS date_time) # 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_BUILD_DIR@") -hunter_test_string_not_empty("@HUNTER_PACKAGE_INSTALL_PREFIX@") -hunter_test_string_not_empty("@HUNTER_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_BUILD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_INSTALL_PREFIX@") hunter_autotools_project("@HUNTER_EP_NAME@" HUNTER_SELF diff --git a/cmake/projects/odb-mysql/schemes/url_sha1_odb-mysql_autotools.cmake.in b/cmake/projects/odb-mysql/schemes/url_sha1_odb-mysql_autotools.cmake.in index 0006f0287..e3cb13936 100644 --- a/cmake/projects/odb-mysql/schemes/url_sha1_odb-mysql_autotools.cmake.in +++ b/cmake/projects/odb-mysql/schemes/url_sha1_odb-mysql_autotools.cmake.in @@ -9,7 +9,7 @@ include("@HUNTER_SELF@/cmake/Hunter") include(hunter_autotools_project) include(hunter_fatal_error) include(hunter_status_debug) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) hunter_status_debug("Scheme: url_sha1_odb-mysql_autotools") @@ -24,15 +24,15 @@ hunter_add_package(MySQL-client) find_package(MySQL-client REQUIRED) # 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_BUILD_DIR@") -hunter_test_string_not_empty("@HUNTER_PACKAGE_INSTALL_PREFIX@") -hunter_test_string_not_empty("@HUNTER_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_BUILD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_INSTALL_PREFIX@") hunter_autotools_project("@HUNTER_EP_NAME@" HUNTER_SELF diff --git a/cmake/projects/odb-pgsql/schemes/url_sha1_odb-pgsql_autotools.cmake.in b/cmake/projects/odb-pgsql/schemes/url_sha1_odb-pgsql_autotools.cmake.in index 9e67af293..e4dfbdcf0 100644 --- a/cmake/projects/odb-pgsql/schemes/url_sha1_odb-pgsql_autotools.cmake.in +++ b/cmake/projects/odb-pgsql/schemes/url_sha1_odb-pgsql_autotools.cmake.in @@ -9,7 +9,7 @@ include("@HUNTER_SELF@/cmake/Hunter") include(hunter_autotools_project) include(hunter_fatal_error) include(hunter_status_debug) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) hunter_status_debug("Scheme: url_sha1_odb-pgsql_autotools") @@ -24,15 +24,15 @@ hunter_add_package(PostgreSQL) find_package(PostgreSQL REQUIRED) # 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_BUILD_DIR@") -hunter_test_string_not_empty("@HUNTER_PACKAGE_INSTALL_PREFIX@") -hunter_test_string_not_empty("@HUNTER_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_BUILD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_INSTALL_PREFIX@") set(pgsql_include_flags "") foreach(_pgsql_include_dir PostgreSQL_INCLUDE_DIRS) diff --git a/cmake/projects/odb-sqlite/hunter.cmake b/cmake/projects/odb-sqlite/hunter.cmake index 1b063b239..442bb384c 100644 --- a/cmake/projects/odb-sqlite/hunter.cmake +++ b/cmake/projects/odb-sqlite/hunter.cmake @@ -9,9 +9,6 @@ include(hunter_configuration_types) include(hunter_download) include(hunter_pick_scheme) -hunter_add_package(odb) -hunter_add_package(SQLite3) - hunter_add_version( PACKAGE_NAME odb-sqlite @@ -31,4 +28,5 @@ hunter_download( PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/libodb-sqlite.la" "lib/pkgconfig/libodb-sqlite.pc" + PACKAGE_INTERNAL_DEPS_ID "1" ) diff --git a/cmake/projects/odb-sqlite/schemes/url_sha1_odb-sqlite_autotools.cmake.in b/cmake/projects/odb-sqlite/schemes/url_sha1_odb-sqlite_autotools.cmake.in index eb8b45258..e0c82f6f1 100644 --- a/cmake/projects/odb-sqlite/schemes/url_sha1_odb-sqlite_autotools.cmake.in +++ b/cmake/projects/odb-sqlite/schemes/url_sha1_odb-sqlite_autotools.cmake.in @@ -9,7 +9,7 @@ include("@HUNTER_SELF@/cmake/Hunter") include(hunter_autotools_project) include(hunter_fatal_error) include(hunter_status_debug) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) hunter_status_debug("Scheme: url_sha1_odb-sqlite_autotools") @@ -20,19 +20,19 @@ endif() hunter_add_package(odb) find_package(odb REQUIRED) -hunter_add_package(SQLite3) -find_package(SQLite3 REQUIRED) +hunter_add_package(sqlite3) +find_package(sqlite3 CONFIG REQUIRED) # 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_BUILD_DIR@") -hunter_test_string_not_empty("@HUNTER_PACKAGE_INSTALL_PREFIX@") -hunter_test_string_not_empty("@HUNTER_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_BUILD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_INSTALL_PREFIX@") hunter_autotools_project("@HUNTER_EP_NAME@" HUNTER_SELF @@ -56,7 +56,7 @@ hunter_autotools_project("@HUNTER_EP_NAME@" PACKAGE_CONFIGURATION_TYPES "@HUNTER_PACKAGE_CONFIGURATION_TYPES@" CPPFLAGS - "-I${ODB_INCLUDE_DIR} -I${SQLITE3_INCLUDE_DIR}" + "-I${ODB_INCLUDE_DIR} -I${SQLITE3_ROOT}/include" LDFLAGS - "-L${ODB_LIB_DIR} -lodb -L${SQLITE3_LIB_DIR} -lsqlite3" + "-L${ODB_LIB_DIR} -lodb -L${SQLITE3_ROOT}/lib -lsqlite3" ) diff --git a/cmake/projects/odb/hunter.cmake b/cmake/projects/odb/hunter.cmake index e9985490c..c453ffe35 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 "2" 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 7db24beee..b76f7b553 100644 --- a/cmake/projects/ogles_gpgpu/hunter.cmake +++ b/cmake/projects/ogles_gpgpu/hunter.cmake @@ -9,6 +9,171 @@ include(hunter_cmake_args) include(hunter_download) include(hunter_pick_scheme) +hunter_add_version( + PACKAGE_NAME + ogles_gpgpu + VERSION + 0.3.6 + URL + "https://github.com/hunter-packages/ogles_gpgpu/archive/v0.3.6.tar.gz" + SHA1 + 7ce1b25580c0c9de554056920eb2e449635ef9d8 + ) + +hunter_add_version( + PACKAGE_NAME + ogles_gpgpu + VERSION + 0.2.10 + URL + "https://github.com/hunter-packages/ogles_gpgpu/archive/v0.2.10.tar.gz" + SHA1 + 3f89e354752e74b6574638918d9d27d83fedab69 + ) + +hunter_add_version( + PACKAGE_NAME + ogles_gpgpu + VERSION + 0.2.9 + URL + "https://github.com/hunter-packages/ogles_gpgpu/archive/v0.2.9.tar.gz" + SHA1 + 0dd7e0834a4bef34cde33faeb3279d3e5706ab79 + ) + +hunter_add_version( + PACKAGE_NAME + ogles_gpgpu + VERSION + 0.2.8 + URL + "https://github.com/hunter-packages/ogles_gpgpu/archive/v0.2.8.tar.gz" + SHA1 + 49868c9f19798c2170ba276f01aa1d0dc5174841 + ) + +hunter_add_version( + PACKAGE_NAME + ogles_gpgpu + VERSION + 0.2.7 + URL + "https://github.com/hunter-packages/ogles_gpgpu/archive/v0.2.7.tar.gz" + SHA1 + 3a2f944abf86007b563f3f4fd16bb3dd1e53c5b6 + ) + +hunter_add_version( + PACKAGE_NAME + ogles_gpgpu + VERSION + 0.2.6 + URL + "https://github.com/hunter-packages/ogles_gpgpu/archive/v0.2.6.tar.gz" + SHA1 + 9cbb696e74df2ef358bd11bd8503a9783ec8f188 + ) + +hunter_add_version( + PACKAGE_NAME + ogles_gpgpu + VERSION + 0.2.5 + URL + "https://github.com/hunter-packages/ogles_gpgpu/archive/v0.2.5.tar.gz" + SHA1 + d6b3f57470effbfe6b89678144272f22923597db + ) + +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_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 + VERSION + 0.1.6-p2 + URL + "https://github.com/hunter-packages/ogles_gpgpu/archive/v0.1.6-p2.tar.gz" + SHA1 + 23b5729b77def9a633b01689ac97821bf11b413b +) + +hunter_add_version( + PACKAGE_NAME + ogles_gpgpu + VERSION + 0.1.6-p1 + URL + "https://github.com/hunter-packages/ogles_gpgpu/archive/v0.1.6-p1.tar.gz" + SHA1 + b6b2cc03f49dabf0dd72a09b6c760164f6fb6e10 +) + +hunter_add_version( + PACKAGE_NAME + ogles_gpgpu + VERSION + 0.1.6 + URL + "https://github.com/hunter-packages/ogles_gpgpu/archive/v0.1.6.tar.gz" + SHA1 + dd6a039cbfb0f240ed29211f9e606703ee79a355 +) + +hunter_add_version( + PACKAGE_NAME + ogles_gpgpu + VERSION + 0.1.4 + URL + "https://github.com/hunter-packages/ogles_gpgpu/archive/v0.1.4.tar.gz" + SHA1 + 636f2fb45c45e4ab22a7d60dabe1816df561a5b0 +) + +hunter_add_version( + PACKAGE_NAME + ogles_gpgpu + VERSION + 0.1.3 + URL + "https://github.com/hunter-packages/ogles_gpgpu/archive/v0.1.3.tar.gz" + SHA1 + 1025b418b9a949ed8885d4ab1872d7a7b77c3b03 +) + +hunter_add_version( + PACKAGE_NAME + ogles_gpgpu + VERSION + 0.1.2 + URL + "https://github.com/hunter-packages/ogles_gpgpu/archive/v0.1.2.tar.gz" + SHA1 + a007c80de2d92147d6172ed52820e0c1268ed429 +) + hunter_add_version( PACKAGE_NAME ogles_gpgpu @@ -20,6 +185,17 @@ 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_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/oniguruma/hunter.cmake b/cmake/projects/oniguruma/hunter.cmake new file mode 100644 index 000000000..8c2043c5e --- /dev/null +++ b/cmake/projects/oniguruma/hunter.cmake @@ -0,0 +1,17 @@ +# !!! 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 oniguruma + VERSION "6.8.1-p0" + URL "https://github.com/hunter-packages/oniguruma/archive/v6.8.1-p0.tar.gz" + SHA1 "6d82ba6bf7a7313b64ba9772622eeeb964e951fb") + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(oniguruma) +hunter_download(PACKAGE_NAME oniguruma) diff --git a/cmake/projects/onmt/hunter.cmake b/cmake/projects/onmt/hunter.cmake new file mode 100644 index 000000000..d32e4122e --- /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/opentracing-cpp/hunter.cmake b/cmake/projects/opentracing-cpp/hunter.cmake new file mode 100644 index 000000000..618f1d862 --- /dev/null +++ b/cmake/projects/opentracing-cpp/hunter.cmake @@ -0,0 +1,56 @@ +# !!! 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 opentracing-cpp + VERSION "1.0.0" + URL "https://github.com/hunter-packages/opentracing-cpp/archive/hunter-v1.0.0.tar.gz" + SHA1 "881faab1353be98f605534d2777349eb5cbbe6be") + +hunter_add_version( + PACKAGE_NAME opentracing-cpp + VERSION "1.1.0" + URL "https://github.com/opentracing/opentracing-cpp/archive/v1.1.0.tar.gz" + SHA1 "800c98b4b049a89e9e38a34d797b42d470476e1d") + +hunter_add_version( + PACKAGE_NAME opentracing-cpp + VERSION "1.2.0" + URL "https://github.com/opentracing/opentracing-cpp/archive/v1.2.0.tar.gz" + SHA1 "5f95ff287a03948c48a572de1d11d5cb0d055662") + +hunter_add_version( + PACKAGE_NAME opentracing-cpp + VERSION "1.3.0" + URL "https://github.com/opentracing/opentracing-cpp/archive/v1.3.0.tar.gz" + SHA1 "7329f65e48e3c2e7c1bdd95683f4433c34649bfc") + +hunter_add_version( + PACKAGE_NAME opentracing-cpp + VERSION "1.4.0" + URL "https://github.com/opentracing/opentracing-cpp/archive/v1.4.0.tar.gz" + SHA1 "cddf6a6c13a9167cd05715a07e14e9bcff71e11b") + +hunter_add_version( + PACKAGE_NAME opentracing-cpp + VERSION "1.4.2" + URL "https://github.com/opentracing/opentracing-cpp/archive/v1.4.2.tar.gz" + SHA1 "2785569bda67f654ff9cacc97124fd59f3161fb4") + +hunter_add_version( + PACKAGE_NAME opentracing-cpp + VERSION "1.5.0" + URL "https://github.com/opentracing/opentracing-cpp/archive/v1.5.0.tar.gz" + SHA1 "8aa1d0251274749d2f0604b56fb215431529387b") + +hunter_cmake_args(opentracing-cpp CMAKE_ARGS + BUILD_TESTING=OFF ENABLE_LINTING=OFF) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(opentracing-cpp) +hunter_download(PACKAGE_NAME opentracing-cpp) diff --git a/cmake/projects/pcg/hunter.cmake b/cmake/projects/pcg/hunter.cmake new file mode 100644 index 000000000..e19959935 --- /dev/null +++ b/cmake/projects/pcg/hunter.cmake @@ -0,0 +1,19 @@ +# !!! 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 pcg + VERSION "0.0.0-p1" + URL "https://github.com/hunter-packages/pcg-c/archive/v0.0.0-p1.tar.gz" + SHA1 "5036df47f4b4c62e6a2e267abc1ca2f7a657d62c") + +hunter_cmake_args(pcg CMAKE_ARGS BUILD_TESTING=OFF) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(pcg) +hunter_download(PACKAGE_NAME pcg) diff --git a/cmake/projects/pciaccess/hunter.cmake b/cmake/projects/pciaccess/hunter.cmake index e821a62f7..e87a2d915 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 "4" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/libpciaccess.la" "lib/pkgconfig/pciaccess.pc" diff --git a/cmake/projects/pcre2/hunter.cmake b/cmake/projects/pcre2/hunter.cmake new file mode 100644 index 000000000..5a62ea4cf --- /dev/null +++ b/cmake/projects/pcre2/hunter.cmake @@ -0,0 +1,35 @@ +# Copyright (c) 2016-2019, 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 + pcre2 + VERSION + 10.13-p0 + URL + "https://github.com/hunter-packages/pcre2/archive/v10.33-p0.tar.gz" + SHA1 + 7fa03a8b27230770f6d8fa09885825dd95483405 +) + +hunter_cmake_args( + pcre2 + CMAKE_ARGS + PCRE2_BUILD_TESTS=OFF + PCRE2_BUILD_PCRE2_16=ON + PCRE2_BUILD_PCRE2_32=ON + PCRE2_SUPPORT_JIT=ON + PCRE2_BUILD_PCRE2GREP=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(pcre2) +hunter_download(PACKAGE_NAME pcre2) diff --git a/cmake/projects/pegtl/hunter.cmake b/cmake/projects/pegtl/hunter.cmake new file mode 100644 index 000000000..e8c1e43fd --- /dev/null +++ b/cmake/projects/pegtl/hunter.cmake @@ -0,0 +1,66 @@ +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_cmake_args) +include(hunter_download) +include(hunter_pick_scheme) + + +# master branch will be the next 3.x.x release in pegtl +hunter_add_version( + PACKAGE_NAME + pegtl + VERSION + 3.0.0-697aaa06 + URL + "https://github.com/taocpp/PEGTL/archive/697aaa06564c6ea9d13f95de081a2d2d46b39160.zip" + SHA1 + 3b441aee41d1932809807ba27f30ca95602e322c +) + +hunter_add_version( + PACKAGE_NAME + pegtl + VERSION + 2.8.1 + URL + "https://github.com/taocpp/PEGTL/archive/2.8.1.tar.gz" + SHA1 + 50a8f7a24062794fb7caccc45ca7c635258595e3 +) + +hunter_add_version( + PACKAGE_NAME + pegtl + VERSION + 2.8.0 + URL + "https://github.com/taocpp/PEGTL/archive/2.8.0.tar.gz" + SHA1 + 57457c00d90b1c33d50afbb2956cbf2b2533ce6e +) + +hunter_add_version( + PACKAGE_NAME + pegtl + VERSION + 2.5.1 + URL + "https://github.com/taocpp/PEGTL/archive/2.5.1.zip" + SHA1 + 3d2a2a0eb1b928882f4d827c75c5d4290cd58082 +) + +hunter_cmake_args( + pegtl + CMAKE_ARGS + PEGTL_BUILD_TESTS=OFF + PEGTL_BUILD_EXAMPLES=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(pegtl) +hunter_download( + PACKAGE_NAME pegtl +) diff --git a/cmake/projects/pip_GitPython/hunter.cmake b/cmake/projects/pip_GitPython/hunter.cmake new file mode 100644 index 000000000..1a841cb77 --- /dev/null +++ b/cmake/projects/pip_GitPython/hunter.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2016-2019, 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 + pip_GitPython + VERSION + 2.1.11 + URL + "https://github.com/gitpython-developers/GitPython/archive/2.1.11.tar.gz" + SHA1 + c0a1515a29b3f64c6745ea2d2dedd3a43ac19678 +) + +hunter_cmake_args( + pip_GitPython + CMAKE_ARGS + DEPENDS_ON_PACKAGES=pip_gitdb +) + +hunter_pick_scheme(DEFAULT url_sha1_pip) +hunter_cacheable(pip_GitPython) +hunter_download(PACKAGE_NAME pip_GitPython) diff --git a/cmake/projects/pip_astroid/hunter.cmake b/cmake/projects/pip_astroid/hunter.cmake new file mode 100644 index 000000000..69b7cb5ce --- /dev/null +++ b/cmake/projects/pip_astroid/hunter.cmake @@ -0,0 +1,38 @@ +# Copyright (c) 2016-2019, 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 + pip_astroid + VERSION + 2.2.5 + URL + "https://github.com/PyCQA/astroid/archive/astroid-2.2.5.tar.gz" + SHA1 + d6316f6e6363305aae4643679cb8b07ef9c94451 +) + +set( + __hunter_astroid_deps + pip_lazy-object-proxy + pip_wrapt + pip_six +) + +hunter_cmake_args( + pip_astroid + CMAKE_ARGS + DEPENDS_ON_PACKAGES=${__hunter_astroid_deps} +) + +hunter_pick_scheme(DEFAULT url_sha1_pip) +hunter_cacheable(pip_astroid) +hunter_download(PACKAGE_NAME pip_astroid) diff --git a/cmake/projects/pip_boto3/hunter.cmake b/cmake/projects/pip_boto3/hunter.cmake new file mode 100644 index 000000000..a40cb4cfd --- /dev/null +++ b/cmake/projects/pip_boto3/hunter.cmake @@ -0,0 +1,40 @@ +# Copyright (c) 2016-2019, 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 + pip_boto3 + VERSION + 1.9.130 + URL + "https://github.com/boto/boto3/archive/1.9.130.tar.gz" + SHA1 + 8a10d9204be8d3903ccf62b5a1db6204336a52d4 +) + +set( + __hunter_boto3_deps + pip_botocore + pip_jmespath + pip_python-dateutil + pip_six + pip_urllib3 +) + +hunter_cmake_args( + pip_boto3 + CMAKE_ARGS + DEPENDS_ON_PACKAGES=${__hunter_boto3_deps} +) + +hunter_pick_scheme(DEFAULT url_sha1_pip) +hunter_cacheable(pip_boto3) +hunter_download(PACKAGE_NAME pip_boto3) diff --git a/cmake/projects/pip_botocore/hunter.cmake b/cmake/projects/pip_botocore/hunter.cmake new file mode 100644 index 000000000..3102caf02 --- /dev/null +++ b/cmake/projects/pip_botocore/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2019, 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 + pip_botocore + VERSION + 1.12.130 + URL + "https://github.com/boto/botocore/archive/1.12.130.tar.gz" + SHA1 + 6c4d82b257c31606fb7e3af1f6d0d89bac30325d +) + +hunter_pick_scheme(DEFAULT url_sha1_pip) +hunter_cacheable(pip_botocore) +hunter_download(PACKAGE_NAME pip_botocore) diff --git a/cmake/projects/pip_certifi/hunter.cmake b/cmake/projects/pip_certifi/hunter.cmake new file mode 100644 index 000000000..e7c270566 --- /dev/null +++ b/cmake/projects/pip_certifi/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2019, 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 + pip_certifi + VERSION + 2019.3.9 + URL + "https://files.pythonhosted.org/packages/06/b8/d1ea38513c22e8c906275d135818fee16ad8495985956a9b7e2bb21942a1/certifi-2019.3.9.tar.gz" + SHA1 + f3873edcfc60c52e97e6601b2576ccdac419281a +) + +hunter_pick_scheme(DEFAULT url_sha1_pip) +hunter_cacheable(pip_certifi) +hunter_download(PACKAGE_NAME pip_certifi) diff --git a/cmake/projects/pip_chardet/hunter.cmake b/cmake/projects/pip_chardet/hunter.cmake new file mode 100644 index 000000000..5d0bc69fa --- /dev/null +++ b/cmake/projects/pip_chardet/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2019, 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 + pip_chardet + VERSION + 3.0.4 + URL + "https://github.com/chardet/chardet/archive/3.0.4.tar.gz" + SHA1 + bf740348e002581b026dc4af47d56479097c1fcd +) + +hunter_pick_scheme(DEFAULT url_sha1_pip) +hunter_cacheable(pip_chardet) +hunter_download(PACKAGE_NAME pip_chardet) diff --git a/cmake/projects/pip_cpplint/hunter.cmake b/cmake/projects/pip_cpplint/hunter.cmake new file mode 100644 index 000000000..3ed1b737a --- /dev/null +++ b/cmake/projects/pip_cpplint/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2019, 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 + pip_cpplint + VERSION + 1.4.4 + URL + "https://github.com/cpplint/cpplint/archive/1.4.4.tar.gz" + SHA1 + 9ca2b8fc3992130a62f4dc3708a67b10eb1baec7 +) + +hunter_pick_scheme(DEFAULT url_sha1_pip) +hunter_cacheable(pip_cpplint) +hunter_download(PACKAGE_NAME pip_cpplint) diff --git a/cmake/projects/pip_decorator/hunter.cmake b/cmake/projects/pip_decorator/hunter.cmake new file mode 100644 index 000000000..efb4eb137 --- /dev/null +++ b/cmake/projects/pip_decorator/hunter.cmake @@ -0,0 +1,25 @@ +# Copyright (c) 2016-2019, 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 + pip_decorator + VERSION + 4.4.0 + URL + # GitHub is missing 4.4.0 release: https://github.com/micheles/decorator/releases + "https://files.pythonhosted.org/packages/ba/19/1119fe7b1e49b9c8a9f154c930060f37074ea2e8f9f6558efc2eeaa417a2/decorator-4.4.0.tar.gz" + SHA1 + de59d002bcf83b16421e6ea6fe40256b5fccedad +) + +hunter_pick_scheme(DEFAULT url_sha1_pip) +hunter_cacheable(pip_decorator) +hunter_download(PACKAGE_NAME pip_decorator) diff --git a/cmake/projects/pip_gitdb/hunter.cmake b/cmake/projects/pip_gitdb/hunter.cmake new file mode 100644 index 000000000..f581f433f --- /dev/null +++ b/cmake/projects/pip_gitdb/hunter.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2016-2019, 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 + pip_gitdb + VERSION + 2.0.5 + URL + "https://github.com/gitpython-developers/gitdb/archive/2.0.5.tar.gz" + SHA1 + e4d8f36d4d3c8c57d2decb05909ebea8e53c807f +) + +hunter_cmake_args( + pip_gitdb + CMAKE_ARGS + DEPENDS_ON_PACKAGES=pip_smmap +) + +hunter_pick_scheme(DEFAULT url_sha1_pip) +hunter_cacheable(pip_gitdb) +hunter_download(PACKAGE_NAME pip_gitdb) diff --git a/cmake/projects/pip_idna/hunter.cmake b/cmake/projects/pip_idna/hunter.cmake new file mode 100644 index 000000000..ee91b8699 --- /dev/null +++ b/cmake/projects/pip_idna/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2019, 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 + pip_idna + VERSION + 2.8 + URL + "https://github.com/kjd/idna/archive/v2.8.tar.gz" + SHA1 + 7ca7e073f13574f51ddcfa3cc1a2e5789e895d9b +) + +hunter_pick_scheme(DEFAULT url_sha1_pip) +hunter_cacheable(pip_idna) +hunter_download(PACKAGE_NAME pip_idna) diff --git a/cmake/projects/pip_jmespath/hunter.cmake b/cmake/projects/pip_jmespath/hunter.cmake new file mode 100644 index 000000000..41bb8bd0c --- /dev/null +++ b/cmake/projects/pip_jmespath/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2019, 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 + pip_jmespath + VERSION + 0.9.4 + URL + "https://github.com/jmespath/jmespath.py/archive/0.9.4.tar.gz" + SHA1 + 203f430114ffc35a86e8070c434367f2e080f7ea +) + +hunter_pick_scheme(DEFAULT url_sha1_pip) +hunter_cacheable(pip_jmespath) +hunter_download(PACKAGE_NAME pip_jmespath) diff --git a/cmake/projects/pip_lazy-object-proxy/hunter.cmake b/cmake/projects/pip_lazy-object-proxy/hunter.cmake new file mode 100644 index 000000000..31b86f7f3 --- /dev/null +++ b/cmake/projects/pip_lazy-object-proxy/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2019, 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 + pip_lazy-object-proxy + VERSION + 1.3.1 + URL + "https://github.com/ionelmc/python-lazy-object-proxy/archive/v1.3.1.tar.gz" + SHA1 + ce01a65239f634c64b72a4dc9054026872fafd64 +) + +hunter_pick_scheme(DEFAULT url_sha1_pip) +hunter_cacheable(pip_lazy-object-proxy) +hunter_download(PACKAGE_NAME pip_lazy-object-proxy) diff --git a/cmake/projects/pip_nose-timer/hunter.cmake b/cmake/projects/pip_nose-timer/hunter.cmake new file mode 100644 index 000000000..b3b818d8c --- /dev/null +++ b/cmake/projects/pip_nose-timer/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2019, 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 + pip_nose-timer + VERSION + 0.7.5 + URL + "https://github.com/mahmoudimus/nose-timer/archive/v0.7.5.tar.gz" + SHA1 + ac66d620dcb3b06eee43e0c6955bc4c56852ad89 +) + +hunter_pick_scheme(DEFAULT url_sha1_pip) +hunter_cacheable(pip_nose-timer) +hunter_download(PACKAGE_NAME pip_nose-timer) diff --git a/cmake/projects/pip_nose/hunter.cmake b/cmake/projects/pip_nose/hunter.cmake new file mode 100644 index 000000000..07f365d88 --- /dev/null +++ b/cmake/projects/pip_nose/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2019, 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 + pip_nose + VERSION + 1.3.7 + URL + "https://github.com/nose-devs/nose/archive/release_1.3.7.tar.gz" + SHA1 + 19ed6623b0c41dee05e07fae08faaff960c3307a +) + +hunter_pick_scheme(DEFAULT url_sha1_pip) +hunter_cacheable(pip_nose) +hunter_download(PACKAGE_NAME pip_nose) diff --git a/cmake/projects/pip_numpy/hunter.cmake b/cmake/projects/pip_numpy/hunter.cmake new file mode 100644 index 000000000..a047e556c --- /dev/null +++ b/cmake/projects/pip_numpy/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2019, 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 + pip_numpy + VERSION + 1.16.2 + URL + "https://github.com/numpy/numpy/releases/download/v1.16.2/numpy-1.16.2.tar.gz" + SHA1 + 2a5a60f2b49befaf01a12dc66bab33d519af0cba +) + +hunter_pick_scheme(DEFAULT url_sha1_pip) +hunter_cacheable(pip_numpy) +hunter_download(PACKAGE_NAME pip_numpy) diff --git a/cmake/projects/pip_pylint/hunter.cmake b/cmake/projects/pip_pylint/hunter.cmake new file mode 100644 index 000000000..0d4f237fb --- /dev/null +++ b/cmake/projects/pip_pylint/hunter.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2016-2019, 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 + pip_pylint + VERSION + 2.3.1 + URL + "https://github.com/PyCQA/pylint/archive/pylint-2.3.1.tar.gz" + SHA1 + 9dc2b3825611baeca43d3601f36841aa8cb7ef60 +) + +hunter_cmake_args( + pip_pylint + CMAKE_ARGS + DEPENDS_ON_PACKAGES=pip_astroid +) + +hunter_pick_scheme(DEFAULT url_sha1_pip) +hunter_cacheable(pip_pylint) +hunter_download(PACKAGE_NAME pip_pylint) diff --git a/cmake/projects/pip_python-dateutil/hunter.cmake b/cmake/projects/pip_python-dateutil/hunter.cmake new file mode 100644 index 000000000..e806b9c15 --- /dev/null +++ b/cmake/projects/pip_python-dateutil/hunter.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2016-2019, 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) + +# Error while using GitHub release: +# +# Make sure you're either building from a fully intact git repository or +# PyPI tarballs. Most other sources (such as GitHub's tarballs, a git +# checkout without the .git folder) don't contain the necessary metadata +# and will not work. + +hunter_add_version( + PACKAGE_NAME + pip_python-dateutil + VERSION + 2.8.0 + URL + "https://files.pythonhosted.org/packages/ad/99/5b2e99737edeb28c71bcbec5b5dda19d0d9ef3ca3e92e3e925e7c0bb364c/python-dateutil-2.8.0.tar.gz" + SHA1 + 140cbe261ba86ff30970bd8ca3326f543de91e4d +) + +hunter_pick_scheme(DEFAULT url_sha1_pip) +hunter_cacheable(pip_python-dateutil) +hunter_download(PACKAGE_NAME pip_python-dateutil) diff --git a/cmake/projects/pip_requests/hunter.cmake b/cmake/projects/pip_requests/hunter.cmake new file mode 100644 index 000000000..6c3aabb77 --- /dev/null +++ b/cmake/projects/pip_requests/hunter.cmake @@ -0,0 +1,39 @@ +# Copyright (c) 2016-2019, 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 + pip_requests + VERSION + 2.21.0 + URL + "https://github.com/kennethreitz/requests/archive/v2.21.0.tar.gz" + SHA1 + 03f02f356fc00936c492f54f4d4a403598e47333 +) + +set( + __hunter_requests_deps + pip_certifi + pip_chardet + pip_idna + pip_urllib3 +) + +hunter_cmake_args( + pip_requests + CMAKE_ARGS + DEPENDS_ON_PACKAGES=${__hunter_requests_deps} +) + +hunter_pick_scheme(DEFAULT url_sha1_pip) +hunter_cacheable(pip_requests) +hunter_download(PACKAGE_NAME pip_requests) diff --git a/cmake/projects/pip_six/hunter.cmake b/cmake/projects/pip_six/hunter.cmake new file mode 100644 index 000000000..2b7a69816 --- /dev/null +++ b/cmake/projects/pip_six/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2019, 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 + pip_six + VERSION + 1.12.0 + URL + "https://github.com/benjaminp/six/archive/1.12.0.tar.gz" + SHA1 + eb86fb797c4be6069ed821113cc908bc02774175 +) + +hunter_pick_scheme(DEFAULT url_sha1_pip) +hunter_cacheable(pip_six) +hunter_download(PACKAGE_NAME pip_six) diff --git a/cmake/projects/pip_smmap/hunter.cmake b/cmake/projects/pip_smmap/hunter.cmake new file mode 100644 index 000000000..d763e6938 --- /dev/null +++ b/cmake/projects/pip_smmap/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2019, 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 + pip_smmap + VERSION + 2.0.5 + URL + "https://github.com/gitpython-developers/smmap/archive/v2.0.5.tar.gz" + SHA1 + ea9a04d7ab8e32f4d458da84906a7cd2ba94f97c +) + +hunter_pick_scheme(DEFAULT url_sha1_pip) +hunter_cacheable(pip_smmap) +hunter_download(PACKAGE_NAME pip_smmap) diff --git a/cmake/projects/pip_urllib3/hunter.cmake b/cmake/projects/pip_urllib3/hunter.cmake new file mode 100644 index 000000000..7e85fc324 --- /dev/null +++ b/cmake/projects/pip_urllib3/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2019, 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 + pip_urllib3 + VERSION + 1.24.1 + URL + "https://github.com/urllib3/urllib3/archive/1.24.1.tar.gz" + SHA1 + 67cf61811cf7356be5fe60a5ff8dacbb74e54dcf +) + +hunter_pick_scheme(DEFAULT url_sha1_pip) +hunter_cacheable(pip_urllib3) +hunter_download(PACKAGE_NAME pip_urllib3) diff --git a/cmake/projects/pip_wrapt/hunter.cmake b/cmake/projects/pip_wrapt/hunter.cmake new file mode 100644 index 000000000..c182e9bc0 --- /dev/null +++ b/cmake/projects/pip_wrapt/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2019, 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 + pip_wrapt + VERSION + 1.11.1 + URL + "https://github.com/GrahamDumpleton/wrapt/archive/1.11.1.tar.gz" + SHA1 + 20677372a74167bd9a7eb312996a0cca90db593e +) + +hunter_pick_scheme(DEFAULT url_sha1_pip) +hunter_cacheable(pip_wrapt) +hunter_download(PACKAGE_NAME pip_wrapt) diff --git a/cmake/projects/pluginlib/hunter.cmake b/cmake/projects/pluginlib/hunter.cmake new file mode 100644 index 000000000..f85ac1099 --- /dev/null +++ b/cmake/projects/pluginlib/hunter.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2016-2019, 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) +include(hunter_cmake_args) + +hunter_add_version( + PACKAGE_NAME + pluginlib + VERSION + 1.12.1-p0 + URL + "https://github.com/hunter-packages/pluginlib/archive/v1.12.1-p0.tar.gz" + SHA1 + 602a153b9d4bde918e7a4090f38eed60b64f8547 +) + +hunter_cmake_args( + pluginlib + CMAKE_ARGS + CATKIN_ENABLE_TESTING:BOOL=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(pluginlib) +hunter_download(PACKAGE_NAME pluginlib) diff --git a/cmake/projects/presentproto/hunter.cmake b/cmake/projects/presentproto/hunter.cmake index 133f76aa1..20afebfd0 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 "3" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/presentproto.pc" ) diff --git a/cmake/projects/prometheus-cpp/hunter.cmake b/cmake/projects/prometheus-cpp/hunter.cmake new file mode 100644 index 000000000..5671d1b56 --- /dev/null +++ b/cmake/projects/prometheus-cpp/hunter.cmake @@ -0,0 +1,33 @@ +# Copyright (c) 2016-2018, 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 + prometheus-cpp + VERSION + 0.6.0-p2 + URL + "https://github.com/hunter-packages/prometheus-cpp/archive/v0.6.0-p2.tar.gz" + SHA1 + 43ef1b4c9e0867f979a5579ee9b5fd80652d7919 +) + +hunter_cmake_args( + prometheus-cpp + CMAKE_ARGS + ENABLE_TESTING=OFF + USE_THIRDPARTY_LIBRARIES=OFF + OVERRIDE_CXX_STANDARD_FLAGS=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(prometheus-cpp) +hunter_download(PACKAGE_NAME prometheus-cpp) diff --git a/cmake/projects/protobuf-c/hunter.cmake b/cmake/projects/protobuf-c/hunter.cmake new file mode 100644 index 000000000..7e81b6c57 --- /dev/null +++ b/cmake/projects/protobuf-c/hunter.cmake @@ -0,0 +1,25 @@ +# !!! 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 protobuf-c + VERSION "1.3.0-p0" + URL "https://github.com/hunter-packages/protobuf-c/archive/v1.3.0-p0.tar.gz" + SHA1 "e106e376b95650521e860642cd660e503a2d4f5c") + +hunter_add_version( + PACKAGE_NAME protobuf-c + VERSION "1.3.0-p1" + URL "https://github.com/hunter-packages/protobuf-c/archive/v1.3.0-p1.tar.gz" + SHA1 "d93fc3f0f422f62a5c0454981f73a5acdbf8b078") + +hunter_cmake_args(protobuf-c CMAKE_ARGS BUILD_TESTING=OFF) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(protobuf-c) +hunter_download(PACKAGE_NAME protobuf-c) diff --git a/cmake/projects/pthread-stubs/hunter.cmake b/cmake/projects/pthread-stubs/hunter.cmake index a7a714f13..cc1e78905 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) @@ -21,11 +22,28 @@ hunter_add_version( 7fc486ad0ec54938f8b781cc374218f50eac8b99 ) +# https://www.x.org/releases/individual/xcb/ +hunter_add_version( + PACKAGE_NAME + pthread-stubs + VERSION + "0.4" + URL + "https://www.x.org/releases/individual/xcb/libpthread-stubs-0.4.tar.bz2" + SHA1 + c42503a2ae0067b2238b2f3fefc86656baa4dd8e +) + 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 "3" 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 000000000..913d04a49 --- /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/pybind11/hunter.cmake b/cmake/projects/pybind11/hunter.cmake new file mode 100644 index 000000000..adb1f11a4 --- /dev/null +++ b/cmake/projects/pybind11/hunter.cmake @@ -0,0 +1,25 @@ +# !!! 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 pybind11 + VERSION "2.2.1" + URL "https://github.com/pybind/pybind11/archive/v2.2.1.tar.gz" + SHA1 "a2bfabe5ae736c3fc3408b5401a656c1f584b511") + +hunter_add_version( + PACKAGE_NAME pybind11 + VERSION "2.2.4" + URL "https://github.com/pybind/pybind11/archive/v2.2.4.tar.gz" + SHA1 "488971990bbd3828311356faaa30f4b0d7575dad") + +hunter_cmake_args(pybind11 CMAKE_ARGS PYBIND11_TEST=OFF) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(pybind11) +hunter_download(PACKAGE_NAME pybind11) diff --git a/cmake/projects/qhull/hunter.cmake b/cmake/projects/qhull/hunter.cmake new file mode 100644 index 000000000..226f8796b --- /dev/null +++ b/cmake/projects/qhull/hunter.cmake @@ -0,0 +1,35 @@ +# Copyright (c) 2016-2018, Ruslan Baratov +# All rights reserved. +#ok +# !!! 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 + qhull + VERSION + 7.2.0-p0 + URL + "https://github.com/hunter-packages/qhull/archive/v7.2.0-p0.tar.gz" + SHA1 + 17ee22ce8b2814aecb300f31cecf3fb4971b2f1f +) + +hunter_add_version( + PACKAGE_NAME + qhull + VERSION + 7.2.0-p1 + URL + "https://github.com/hunter-packages/qhull/archive/v7.2.0-p1.tar.gz" + SHA1 + 48e45eab0d6331403539bd2f3408e02eba7a0256 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(qhull) +hunter_download(PACKAGE_NAME qhull) diff --git a/cmake/projects/quickjs/hunter.cmake b/cmake/projects/quickjs/hunter.cmake new file mode 100644 index 000000000..239d0df2c --- /dev/null +++ b/cmake/projects/quickjs/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2019, 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 + quickjs + VERSION + 2019-07-21-p0 + URL + "https://github.com/hunter-packages/quickjs/archive/2019-07-21-p0.tar.gz" + SHA1 + def3915206ca673831601adf4efbe0f8264806e5 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(quickjs) +hunter_download(PACKAGE_NAME quickjs) diff --git a/cmake/projects/rabit/hunter.cmake b/cmake/projects/rabit/hunter.cmake new file mode 100644 index 000000000..179d1ddfb --- /dev/null +++ b/cmake/projects/rabit/hunter.cmake @@ -0,0 +1,48 @@ +# 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 + rabit + VERSION + 0.0.0-p2 + URL + https://github.com/hunter-packages/rabit/archive/v0.0.0-p2.tar.gz + SHA1 + bdb425ca303e1b09bdf8245eed419834bc9b4752 + ) + +hunter_add_version( + PACKAGE_NAME + rabit + VERSION + 0.0.0-p1 + URL + https://github.com/hunter-packages/rabit/archive/v0.0.0-p1.tar.gz + SHA1 + f2bb803b381bebe42089acf9946848dd580d9470 + ) + +hunter_add_version( + PACKAGE_NAME + rabit + VERSION + 0.0.0-p0 + URL + https://github.com/hunter-packages/rabit/archive/v0.0.0-p0.tar.gz + SHA1 + 4f0a65c6f1fcd6b7cce1618aa49faf25e8a8a337 + ) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(rabit) +hunter_download(PACKAGE_NAME rabit) diff --git a/cmake/projects/randrproto/hunter.cmake b/cmake/projects/randrproto/hunter.cmake index 2bde8c87e..bc24bd530 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 "2" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/randrproto.pc" ) diff --git a/cmake/projects/rang/hunter.cmake b/cmake/projects/rang/hunter.cmake new file mode 100644 index 000000000..fdc86bb25 --- /dev/null +++ b/cmake/projects/rang/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2019, 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 + rang + VERSION + 3.1.0-p0 + URL + "https://github.com/hunter-packages/rang/archive/v3.1.0-p0.tar.gz" + SHA1 + 6a49f08c81009e2ab513b3d62e3c5fbc7efab882 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(rang) +hunter_download(PACKAGE_NAME rang) diff --git a/cmake/projects/range-v3/hunter.cmake b/cmake/projects/range-v3/hunter.cmake new file mode 100644 index 000000000..4515cd3b9 --- /dev/null +++ b/cmake/projects/range-v3/hunter.cmake @@ -0,0 +1,72 @@ +# 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) +include(hunter_cmake_args) + +hunter_add_version( + PACKAGE_NAME + range-v3 + VERSION + vcpkg5-p + URL + "https://github.com/hunter-packages/range-v3/archive/vcpkg5-p.tar.gz" + SHA1 + d8b723b955d7c92d3734fead371538d11cf73452 +) + +hunter_add_version( + PACKAGE_NAME + range-v3 + VERSION + 0.3.0-p + URL + "https://github.com/hunter-packages/range-v3/archive/0.3.0-p.tar.gz" + SHA1 + d2b3c31c66c4c7d0b11798e370af4e1e372a307b +) + +hunter_add_version( + PACKAGE_NAME + range-v3 + VERSION + 0.4.0-01ccd0e5-p0 + URL + "https://github.com/hunter-packages/range-v3/archive/0.4.0-01ccd0e5-p0.tar.gz" + SHA1 + 7ae50752d40beb489935b73d521c14b4c147cfd5 +) + +hunter_add_version( + PACKAGE_NAME + range-v3 + VERSION + 0.5.0 + URL + "https://github.com/ericniebler/range-v3/archive/0.5.0.tar.gz" + SHA1 + 5c0eac44a710f85cae6dc11aa7577ec90f30c5a8 +) + +hunter_cmake_args( + range-v3 + CMAKE_ARGS + BUILD_DOCS=FALSE + BUILD_TESTS=FALSE + BUILD_TESTING=FALSE + RANGE_V3_EXAMPLES=FALSE + RANGE_V3_PERF=FALSE + RANGE_V3_DOCS=FALSE + RANGE_V3_TESTS=FALSE + RANGE_V3_HEADER_CHECKS=FALSE +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(range-v3) +hunter_download(PACKAGE_NAME range-v3) + diff --git a/cmake/projects/re2/hunter.cmake b/cmake/projects/re2/hunter.cmake new file mode 100644 index 000000000..9b7b0b7fe --- /dev/null +++ b/cmake/projects/re2/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 + re2 + VERSION + 2017.11.01-p0 + URL + https://github.com/hunter-packages/re2/archive/2017.11.01-p0.tar.gz + SHA1 + 78ed8b27fe1499a30281f3763bb282ea47636b1a + ) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(re2) +hunter_download(PACKAGE_NAME re2) diff --git a/cmake/projects/readline/hunter.cmake b/cmake/projects/readline/hunter.cmake new file mode 100644 index 000000000..49054c111 --- /dev/null +++ b/cmake/projects/readline/hunter.cmake @@ -0,0 +1,35 @@ +# Copyright (c) 2016-2019, 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) + +hunter_add_version( + PACKAGE_NAME + readline + VERSION + "6.3" + URL + "https://ftp.gnu.org/gnu/readline/readline-6.3.tar.gz" + SHA1 + 017b92dc7fd4e636a2b5c9265a77ccc05798c9e1 +) + +hunter_configuration_types(readline CONFIGURATION_TYPES Release) +hunter_pick_scheme(DEFAULT url_sha1_autotools) +hunter_cmake_args( + readline + CMAKE_ARGS + DEPENDS_ON_PACKAGES=ncursesw +) +hunter_cacheable(readline) +hunter_download( + PACKAGE_NAME readline +) + diff --git a/cmake/projects/recastnavigation/hunter.cmake b/cmake/projects/recastnavigation/hunter.cmake new file mode 100644 index 000000000..5b0ac76c1 --- /dev/null +++ b/cmake/projects/recastnavigation/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 + recastnavigation + VERSION + 1.4-p0 + URL + "https://github.com/hunter-packages/recastnavigation/archive/v1.4-p0.tar.gz" + SHA1 + fbbd0387e3e46e4486c8848b9582915eb4cf1084 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(recastnavigation) +hunter_download(PACKAGE_NAME recastnavigation) diff --git a/cmake/projects/renderproto/hunter.cmake b/cmake/projects/renderproto/hunter.cmake index 72391c029..afda17ed3 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 "3" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/renderproto.pc" ) diff --git a/cmake/projects/rocksdb/hunter.cmake b/cmake/projects/rocksdb/hunter.cmake new file mode 100644 index 000000000..23f43c8f1 --- /dev/null +++ b/cmake/projects/rocksdb/hunter.cmake @@ -0,0 +1,47 @@ +# 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 rocksdb + VERSION 5.7.2 + URL "https://github.com/facebook/rocksdb/archive/v5.7.2.tar.gz" + SHA1 "f14feee1348bc62b733c6db620a02979477e234f" +) + +hunter_add_version( + PACKAGE_NAME rocksdb + VERSION 5.8.6 + URL "https://github.com/facebook/rocksdb/archive/v5.8.6.tar.gz" + SHA1 "0610c260676e78b03ba48b2d671ba92bdcff2641") + +hunter_add_version( + PACKAGE_NAME rocksdb + VERSION 5.14.2 + URL "https://github.com/facebook/rocksdb/archive/v5.14.2.tar.gz" + SHA1 "376bc537e8c716111214274755f5fe4026e5a354") + + +if(MSVC) + hunter_cmake_args(rocksdb CMAKE_ARGS + WITH_TESTS=OFF + PORTABLE=ON + ROCKSDB_INSTALL_ON_WINDOWS=ON + FAIL_ON_WARNINGS=OFF) +else() + hunter_cmake_args(rocksdb CMAKE_ARGS + WITH_TESTS=OFF + PORTABLE=ON + FAIL_ON_WARNINGS=OFF) +endif() + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(rocksdb) +hunter_download(PACKAGE_NAME rocksdb) diff --git a/cmake/projects/ros/hunter.cmake b/cmake/projects/ros/hunter.cmake new file mode 100644 index 000000000..f188023c5 --- /dev/null +++ b/cmake/projects/ros/hunter.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2017, Lukas Solanka +# 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 + ros + VERSION + 1.14.4-p0 + URL + "https://github.com/hunter-packages/ros/archive/v1.14.4-p0.tar.gz" + SHA1 + "9ca792b460313dbe161760713abb24dd28d3b35d" +) + +hunter_add_version( + PACKAGE_NAME + ros + VERSION + 1.14.6-p0 + URL + "https://github.com/hunter-packages/ros/archive/v1.14.6-p0.tar.gz" + SHA1 + "fb44ebcebcc17664ddd6324366beee9ee90d2a2d" +) + +hunter_cmake_args( + ros_message_generation + CMAKE_ARGS + CATKIN_ENABLE_TESTING:BOOL=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(ros) +hunter_download(PACKAGE_NAME ros) diff --git a/cmake/projects/ros_comm/hunter.cmake b/cmake/projects/ros_comm/hunter.cmake new file mode 100644 index 000000000..c679dfab3 --- /dev/null +++ b/cmake/projects/ros_comm/hunter.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2016-2019, 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) +include(hunter_cmake_args) + +hunter_add_version( + PACKAGE_NAME + ros_comm + VERSION + 1.14.3-p1 + URL + "https://github.com/hunter-packages/ros_comm/archive/v1.14.3-p1.tar.gz" + SHA1 + 132f614a7ce4d5765ecdba8cc31c7f3504ef046f +) + +hunter_cmake_args( + ros_comm + CMAKE_ARGS + CATKIN_ENABLE_TESTING:BOOL=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(ros_comm) +hunter_download(PACKAGE_NAME ros_comm) diff --git a/cmake/projects/ros_comm_msgs/hunter.cmake b/cmake/projects/ros_comm_msgs/hunter.cmake new file mode 100644 index 000000000..17e47056c --- /dev/null +++ b/cmake/projects/ros_comm_msgs/hunter.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2017, Lukas Solanka +# 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 + ros_comm_msgs + VERSION + 1.11.2-p0 + URL + "https://github.com/hunter-packages/ros_comm_msgs/archive/v1.11.2-p0.tar.gz" + SHA1 + "e2fdd9878eb68b16672b57e46f4fc1103f84844a" +) + +hunter_cmake_args( + ros_comm_msgs + CMAKE_ARGS + CATKIN_ENABLE_TESTING:BOOL=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(ros_comm_msgs) +hunter_download(PACKAGE_NAME ros_comm_msgs) diff --git a/cmake/projects/ros_common_msgs/hunter.cmake b/cmake/projects/ros_common_msgs/hunter.cmake new file mode 100644 index 000000000..23f563355 --- /dev/null +++ b/cmake/projects/ros_common_msgs/hunter.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2017, Lukas Solanka +# 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 + ros_common_msgs + VERSION + 1.12.6-p0 + URL + "https://github.com/hunter-packages/ros_common_msgs/archive/v1.12.6-p0.tar.gz" + SHA1 + "9ebf01d2b3e146121c42314acb9629e2322737ae" +) + +hunter_add_version( + PACKAGE_NAME + ros_common_msgs + VERSION + 1.12.7-p0 + URL + "https://github.com/hunter-packages/ros_common_msgs/archive/v1.12.7-p0.tar.gz" + SHA1 + "353c4058cf50d4359a068109dc91a91076b29053" +) + +hunter_cmake_args( + ros_common_msgs + CMAKE_ARGS + CATKIN_ENABLE_TESTING:BOOL=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(ros_common_msgs) +hunter_download(PACKAGE_NAME ros_common_msgs) diff --git a/cmake/projects/ros_console_bridge/hunter.cmake b/cmake/projects/ros_console_bridge/hunter.cmake new file mode 100644 index 000000000..2345f1751 --- /dev/null +++ b/cmake/projects/ros_console_bridge/hunter.cmake @@ -0,0 +1,35 @@ +# Copyright (c) 2018, 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 + ros_console_bridge + VERSION + 0.4.0-p0 + URL + "https://github.com/hunter-packages/ros_console_bridge/archive/v0.4.0-p0.tar.gz" + SHA1 + "0ed03b76b1289b5399b5dfdd4a4002596239a06f" +) + +hunter_add_version( + PACKAGE_NAME + ros_console_bridge + VERSION + 0.4.3-p0 + URL + "https://github.com/hunter-packages/ros_console_bridge/archive/v0.4.3-p0.tar.gz" + SHA1 + "9c1827626891522b626059d66cd3f32d9e99c931" +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(ros_console_bridge) +hunter_download(PACKAGE_NAME ros_console_bridge) diff --git a/cmake/projects/ros_environment/hunter.cmake b/cmake/projects/ros_environment/hunter.cmake new file mode 100644 index 000000000..bbc606512 --- /dev/null +++ b/cmake/projects/ros_environment/hunter.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2017, Lukas Solanka +# 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 + ros_environment + VERSION + 1.2.0-p0 + URL + "https://github.com/hunter-packages/ros_environment/archive/v1.2.0-p0.tar.gz" + SHA1 + "01068d113b6517496027a01ca91c85030ae8638f" +) + +hunter_add_version( + PACKAGE_NAME + ros_environment + VERSION + 1.2.1-p0 + URL + "https://github.com/hunter-packages/ros_environment/archive/v1.2.1-p0.tar.gz" + SHA1 + "bbc8d15550fce1478748fadb9170d3a3e5e49460" +) + +hunter_cmake_args( + ros_environment + CMAKE_ARGS + CATKIN_ENABLE_TESTING:BOOL=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(ros_environment) +hunter_download(PACKAGE_NAME ros_environment) diff --git a/cmake/projects/ros_gencpp/hunter.cmake b/cmake/projects/ros_gencpp/hunter.cmake new file mode 100644 index 000000000..1611699ab --- /dev/null +++ b/cmake/projects/ros_gencpp/hunter.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2017, Lukas Solanka +# 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 + ros_gencpp + VERSION + 0.6.0-p0 + URL + "https://github.com/hunter-packages/ros_gencpp/archive/v0.6.0-p0.tar.gz" + SHA1 + "90c7728fae3f69c8072a9611b9ec1f92b3254bd1" +) + +hunter_add_version( + PACKAGE_NAME + ros_gencpp + VERSION + 0.6.2-p0 + URL + "https://github.com/hunter-packages/ros_gencpp/archive/v0.6.2-p0.tar.gz" + SHA1 + "be49ad6ad32cd8879fdd418fe2cc0c10db9a7d45" +) + +hunter_cmake_args( + ros_gencpp + CMAKE_ARGS + CATKIN_ENABLE_TESTING:BOOL=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(ros_gencpp) +hunter_download(PACKAGE_NAME ros_gencpp) diff --git a/cmake/projects/ros_geneus/hunter.cmake b/cmake/projects/ros_geneus/hunter.cmake new file mode 100644 index 000000000..d22717ac5 --- /dev/null +++ b/cmake/projects/ros_geneus/hunter.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2017, Lukas Solanka +# 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 + ros_geneus + VERSION + 2.2.6-p0 + URL + "https://github.com/hunter-packages/ros_geneus/archive/v2.2.6-p0.tar.gz" + SHA1 + "938a53b42aefca1a1d80384bc5f43ba83e4eed88" +) + +hunter_cmake_args( + ros_geneus + CMAKE_ARGS + CATKIN_ENABLE_TESTING:BOOL=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(ros_geneus) +hunter_download(PACKAGE_NAME ros_geneus) diff --git a/cmake/projects/ros_genlisp/hunter.cmake b/cmake/projects/ros_genlisp/hunter.cmake new file mode 100644 index 000000000..d77c84090 --- /dev/null +++ b/cmake/projects/ros_genlisp/hunter.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2017, Lukas Solanka +# 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 + ros_genlisp + VERSION + 0.4.16-p0 + URL + "https://github.com/hunter-packages/ros_genlisp/archive/v0.4.16-p0.tar.gz" + SHA1 + "5077d8b5cf48f4224fc13659eccd5d7b89062609" +) + +hunter_cmake_args( + ros_genlisp + CMAKE_ARGS + CATKIN_ENABLE_TESTING:BOOL=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(ros_genlisp) +hunter_download(PACKAGE_NAME ros_genlisp) diff --git a/cmake/projects/ros_genmsg/hunter.cmake b/cmake/projects/ros_genmsg/hunter.cmake new file mode 100644 index 000000000..d86145c8d --- /dev/null +++ b/cmake/projects/ros_genmsg/hunter.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2017, Lukas Solanka +# 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 + ros_genmsg + VERSION + 0.5.10-p0 + URL + "https://github.com/hunter-packages/ros_genmsg/archive/v0.5.10-p0.tar.gz" + SHA1 + "3003f752c6b9d5a6c5771dd1448b61011cfcc63d" +) + +hunter_add_version( + PACKAGE_NAME + ros_genmsg + VERSION + 0.5.12-p0 + URL + "https://github.com/hunter-packages/ros_genmsg/archive/v0.5.12-p0.tar.gz" + SHA1 + "e4009ea247bfb3683700f0e3097fc1b9a884a378" +) + +hunter_cmake_args( + ros_genmsg + CMAKE_ARGS + CATKIN_ENABLE_TESTING:BOOL=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(ros_genmsg) +hunter_download(PACKAGE_NAME ros_genmsg) diff --git a/cmake/projects/ros_gennodejs/hunter.cmake b/cmake/projects/ros_gennodejs/hunter.cmake new file mode 100644 index 000000000..1c0e33abc --- /dev/null +++ b/cmake/projects/ros_gennodejs/hunter.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2017, Lukas Solanka +# 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 + ros_gennodejs + VERSION + 2.0.1-p0 + URL + "https://github.com/hunter-packages/ros_gennodejs/archive/v2.0.1-p0.tar.gz" + SHA1 + "b8e6744d0aabd8422d4e367044093d8a3c122c50" +) + +hunter_cmake_args( + ros_gennodejs + CMAKE_ARGS + CATKIN_ENABLE_TESTING:BOOL=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(ros_gennodejs) +hunter_download(PACKAGE_NAME ros_gennodejs) diff --git a/cmake/projects/ros_genpy/hunter.cmake b/cmake/projects/ros_genpy/hunter.cmake new file mode 100644 index 000000000..1fc530f81 --- /dev/null +++ b/cmake/projects/ros_genpy/hunter.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2017, Lukas Solanka +# 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 + ros_genpy + VERSION + 0.6.7-p0 + URL + "https://github.com/hunter-packages/ros_genpy/archive/v0.6.7-p0.tar.gz" + SHA1 + "338e73155207774e6775cb6ed233cdced1606c16" +) + +hunter_add_version( + PACKAGE_NAME + ros_genpy + VERSION + 0.6.8-p0 + URL + "https://github.com/hunter-packages/ros_genpy/archive/v0.6.8-p0.tar.gz" + SHA1 + "a3bdd772aea7e621ff72ad0d1e4400eb46e03f39" +) + +hunter_cmake_args( + ros_genpy + CMAKE_ARGS + CATKIN_ENABLE_TESTING:BOOL=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(ros_genpy) +hunter_download(PACKAGE_NAME ros_genpy) diff --git a/cmake/projects/ros_message_generation/hunter.cmake b/cmake/projects/ros_message_generation/hunter.cmake new file mode 100644 index 000000000..86d4d97a0 --- /dev/null +++ b/cmake/projects/ros_message_generation/hunter.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2017, Lukas Solanka +# 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 + ros_message_generation + VERSION + 0.4.0-p0 + URL + "https://github.com/hunter-packages/ros_message_generation/archive/v0.4.0-p0.tar.gz" + SHA1 + "39b034628b13dbf1c7b601a9b2f8d768f776bf65" +) + +hunter_cmake_args( + ros_message_generation + CMAKE_ARGS + CATKIN_ENABLE_TESTING:BOOL=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(ros_message_generation) +hunter_download(PACKAGE_NAME ros_message_generation) diff --git a/cmake/projects/ros_message_runtime/hunter.cmake b/cmake/projects/ros_message_runtime/hunter.cmake new file mode 100644 index 000000000..92af1f060 --- /dev/null +++ b/cmake/projects/ros_message_runtime/hunter.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2017, Lukas Solanka +# 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 + ros_message_runtime + VERSION + 0.4.12-p0 + URL + "https://github.com/hunter-packages/ros_message_runtime/archive/v0.4.12-p0.tar.gz" + SHA1 + "54be9c1294b298388fc975fae73d5d155ca7e290" +) + +hunter_cmake_args( + ros_message_runtime + CMAKE_ARGS + CATKIN_ENABLE_TESTING:BOOL=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(ros_message_runtime) +hunter_download(PACKAGE_NAME ros_message_runtime) diff --git a/cmake/projects/ros_std_msgs/hunter.cmake b/cmake/projects/ros_std_msgs/hunter.cmake new file mode 100644 index 000000000..e73b66633 --- /dev/null +++ b/cmake/projects/ros_std_msgs/hunter.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2017, Lukas Solanka +# 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 + ros_std_msgs + VERSION + 0.5.11-p1 + URL + "https://github.com/hunter-packages/ros_std_msgs/archive/v0.5.11-p1.tar.gz" + SHA1 + "04ad9f0e155b27870c7ad2293ace496523f2e960" +) + +hunter_add_version( + PACKAGE_NAME + ros_std_msgs + VERSION + 0.5.12-p0 + URL + "https://github.com/hunter-packages/ros_std_msgs/archive/v0.5.12-p0.tar.gz" + SHA1 + "68f90e7d9611da0d18f3aab520d76b03e685e5a0" +) + +hunter_cmake_args( + ros_std_msgs + CMAKE_ARGS + CATKIN_ENABLE_TESTING:BOOL=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(ros_std_msgs) +hunter_download(PACKAGE_NAME ros_std_msgs) diff --git a/cmake/projects/rosconsole/hunter.cmake b/cmake/projects/rosconsole/hunter.cmake new file mode 100644 index 000000000..90484d075 --- /dev/null +++ b/cmake/projects/rosconsole/hunter.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2016-2019, 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) +include(hunter_cmake_args) + +hunter_add_version( + PACKAGE_NAME + rosconsole + VERSION + 1.13.10-p0 + URL + "https://github.com/hunter-packages/rosconsole/archive/v1.13.10-p0.tar.gz" + SHA1 + 293826e85d2f22677ea3a738c0d1d28ca18334ca +) + +hunter_cmake_args( + rosconsole + CMAKE_ARGS + CATKIN_ENABLE_TESTING:BOOL=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(rosconsole) +hunter_download(PACKAGE_NAME rosconsole) diff --git a/cmake/projects/roscpp_core/hunter.cmake b/cmake/projects/roscpp_core/hunter.cmake new file mode 100644 index 000000000..3548acb2e --- /dev/null +++ b/cmake/projects/roscpp_core/hunter.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2017, Lukas Solanka +# 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 + roscpp_core + VERSION + 0.6.9-p0 + URL + "https://github.com/hunter-packages/roscpp_core/archive/v0.6.9-p0.tar.gz" + SHA1 + "22a95f07bc397c188eba1b578ddbbe5ae114c82c" +) + +hunter_add_version( + PACKAGE_NAME + roscpp_core + VERSION + 0.6.12-p0 + URL + "https://github.com/hunter-packages/roscpp_core/archive/v0.6.12-p0.tar.gz" + SHA1 + "1d45d6ddc003f81a8390d618a471842383fd2047" +) + +hunter_cmake_args( + roscpp_core + CMAKE_ARGS + CATKIN_ENABLE_TESTING:BOOL=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(roscpp_core) +hunter_download(PACKAGE_NAME roscpp_core) diff --git a/cmake/projects/rospack/hunter.cmake b/cmake/projects/rospack/hunter.cmake new file mode 100644 index 000000000..7a3098c3d --- /dev/null +++ b/cmake/projects/rospack/hunter.cmake @@ -0,0 +1,42 @@ +# Copyright (c) 2017, Lukas Solanka +# 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 + rospack + VERSION + 2.5.0-p0 + URL + "https://github.com/hunter-packages/rospack/archive/v2.5.0-p0.tar.gz" + SHA1 + "3ed739a889b0a17f3ece52b7910e221c1f002de9" +) + +hunter_add_version( + PACKAGE_NAME + rospack + VERSION + 2.5.3-p0 + URL + "https://github.com/hunter-packages/rospack/archive/v2.5.3-p0.tar.gz" + SHA1 + "6f233779d0540a45dfe6f88b25fd740d03db9ade" +) + +hunter_cmake_args( + rospack + CMAKE_ARGS + CATKIN_ENABLE_TESTING:BOOL=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(rospack) +hunter_download(PACKAGE_NAME rospack) diff --git a/cmake/projects/s3/hunter.cmake b/cmake/projects/s3/hunter.cmake new file mode 100644 index 000000000..0efd7b2a0 --- /dev/null +++ b/cmake/projects/s3/hunter.cmake @@ -0,0 +1,35 @@ +# Copyright (c) 2016-2019, 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 + s3 + VERSION + 0.0.0-287e4be-p0 + URL + "https://github.com/hunter-packages/libs3/archive/v0.0.0-287e4be-p0.tar.gz" + SHA1 + da8fae10bcda3126b0847b2a255e62435afc313e +) + +hunter_add_version( + PACKAGE_NAME + s3 + VERSION + 0.0.0-287e4be-p1 + URL + "https://github.com/hunter-packages/libs3/archive/v0.0.0-287e4be-p1.tar.gz" + SHA1 + 908d859fcde3424ee5e3226288d2604c2419d996 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(s3) +hunter_download(PACKAGE_NAME s3) diff --git a/cmake/projects/sds/hunter.cmake b/cmake/projects/sds/hunter.cmake new file mode 100644 index 000000000..f027d783c --- /dev/null +++ b/cmake/projects/sds/hunter.cmake @@ -0,0 +1,19 @@ +# !!! 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 sds + VERSION "2.0.0" + URL "https://github.com/hunter-packages/sds/archive/v2.0.0.tar.gz" + SHA1 "afbfd0c74a4130166e7b18d3f088e38bed7583d3") + +hunter_cmake_args(sds CMAKE_ARGS BUILD_TESTING=OFF) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(sds) +hunter_download(PACKAGE_NAME sds) diff --git a/cmake/projects/sentencepiece/hunter.cmake b/cmake/projects/sentencepiece/hunter.cmake new file mode 100644 index 000000000..6cc74fe08 --- /dev/null +++ b/cmake/projects/sentencepiece/hunter.cmake @@ -0,0 +1,47 @@ +# Copyright (c) 2016-2018, 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 + sentencepiece + VERSION + 0.1.8-p1 + URL + "https://github.com/hunter-packages/sentencepiece/archive/v0.1.8-p1.tar.gz" + SHA1 + 00e5a16ce6af6a4148cd9541c7ff26b9d5e58972 +) + +set(_hunter_spm_cmake_args "") +if(IOS) + list( + APPEND + _hunter_spm_cmake_args + SPM_NO_THREADLOCAL=YES + ) +endif() + +list( + APPEND + _hunter_spm_cmake_args + SPM_USE_BUILTIN_PROTOBUF=OFF + SPM_ENABLE_SHARED=OFF +) + +hunter_cmake_args( + sentencepiece + CMAKE_ARGS + ${_hunter_spm_cmake_args} +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(sentencepiece) +hunter_download(PACKAGE_NAME sentencepiece) diff --git a/cmake/projects/shaka_player_embedded/hunter.cmake b/cmake/projects/shaka_player_embedded/hunter.cmake new file mode 100644 index 000000000..94af01409 --- /dev/null +++ b/cmake/projects/shaka_player_embedded/hunter.cmake @@ -0,0 +1,35 @@ +# Copyright (c) 2016-2019, 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 + shaka_player_embedded + VERSION + 0.1.0-beta-p0 + URL + "https://github.com/hunter-packages/shaka-player-embedded/archive/v0.1.0-beta-p0.tar.gz" + SHA1 + a0d991550e12ba8e55c3731b250d7100e637b39f +) + +hunter_add_version( + PACKAGE_NAME + shaka_player_embedded + VERSION + 0.1.0-beta-p1 + URL + "https://github.com/hunter-packages/shaka-player-embedded/archive/v0.1.0-beta-p1.tar.gz" + SHA1 + 012e02170e2ce43165909de0ee4b264fd72d6727 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(shaka_player_embedded) +hunter_download(PACKAGE_NAME shaka_player_embedded) diff --git a/cmake/projects/sleef/hunter.cmake b/cmake/projects/sleef/hunter.cmake new file mode 100644 index 000000000..b68d75d46 --- /dev/null +++ b/cmake/projects/sleef/hunter.cmake @@ -0,0 +1,27 @@ +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_download) +include(hunter_pick_scheme) +include(hunter_cmake_args) + +hunter_add_version( + PACKAGE_NAME + sleef + VERSION + "3.3.1-p1" + URL + "https://github.com/hunter-packages/sleef/archive/v3.3.1-p1.tar.gz" + SHA1 + f6b40d51d72dc32ef7124b3564c334da5122d9c4 +) + +hunter_cmake_args( + sleef + CMAKE_ARGS + BUILD_GNUABI_LIBS=OFF + BUILD_TESTS=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(sleef) +hunter_download(PACKAGE_NAME sleef) diff --git a/cmake/projects/sm/hunter.cmake b/cmake/projects/sm/hunter.cmake index 3f051b063..b13598a84 100644 --- a/cmake/projects/sm/hunter.cmake +++ b/cmake/projects/sm/hunter.cmake @@ -22,6 +22,17 @@ hunter_add_version( 8d354a165e330022ffd3606aba562b8c8154213d ) +hunter_add_version( + PACKAGE_NAME + sm + VERSION + "1.2.3" + URL + "https://www.x.org/releases/individual/lib/libSM-1.2.3.tar.bz2" + SHA1 + 437d7b13fa2eba325df3a106f177df46ccec6546 +) + hunter_configuration_types(sm CONFIGURATION_TYPES Release) hunter_pick_scheme(DEFAULT url_sha1_autotools) set(sm_dependencies @@ -37,7 +48,7 @@ hunter_cmake_args( hunter_cacheable(sm) hunter_download( PACKAGE_NAME sm - PACKAGE_INTERNAL_DEPS_ID "2" + PACKAGE_INTERNAL_DEPS_ID "4" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/libSM.la" "lib/pkgconfig/sm.pc" diff --git a/cmake/projects/soil/hunter.cmake b/cmake/projects/soil/hunter.cmake new file mode 100644 index 000000000..347412da4 --- /dev/null +++ b/cmake/projects/soil/hunter.cmake @@ -0,0 +1,19 @@ +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_download) +include(hunter_pick_scheme) + +hunter_add_version( + PACKAGE_NAME + soil + VERSION + 1.0.4 + URL + "https://github.com/frequem/Simple-OpenGL-Image-Library/archive/v1.0.4.tar.gz" + SHA1 + b973e0c0ebf461abd897eb2c2dbf5590a01ef7a4 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(soil) +hunter_download(PACKAGE_NAME soil) diff --git a/cmake/projects/sources_for_android_sdk_packer/hunter.cmake b/cmake/projects/sources_for_android_sdk_packer/hunter.cmake new file mode 100644 index 000000000..c28ad5780 --- /dev/null +++ b/cmake/projects/sources_for_android_sdk_packer/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2018, 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 + sources_for_android_sdk_packer + VERSION + 1.0.0 + URL + "https://github.com/hunter-packages/sources_for_android_sdk_packer/archive/v1.0.0.tar.gz" + SHA1 + 161c2f0952874f6850478446660990d8ca33f667 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(sources_for_android_sdk_packer) +hunter_download(PACKAGE_NAME sources_for_android_sdk_packer) diff --git a/cmake/projects/sparsehash/hunter.cmake b/cmake/projects/sparsehash/hunter.cmake index bd7a4fce6..729f55a48 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 7b99f6419..3d4d07a13 100644 --- a/cmake/projects/spdlog/hunter.cmake +++ b/cmake/projects/spdlog/hunter.cmake @@ -5,6 +5,7 @@ include(hunter_add_version) include(hunter_cacheable) +include(hunter_cmake_args) include(hunter_download) include(hunter_pick_scheme) @@ -30,6 +31,82 @@ hunter_add_version( 199c1a19bcdd6fc75faa61263a267805c05e4060 ) +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 + 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.16.3-p1" + URL + "https://github.com/hunter-packages/spdlog/archive/v0.16.3-p1.tar.gz" + SHA1 + 1400ca456ad7c5ba89491f0dd3cd8935a16fe65c +) + +hunter_add_version( + PACKAGE_NAME + spdlog + VERSION + "1.2.1-p0" + URL + "https://github.com/hunter-packages/spdlog/archive/v1.2.1-p0.tar.gz" + SHA1 + 8bebf25ee48fba4f0c341954b50d26e8292e9f8f +) + +hunter_add_version( + PACKAGE_NAME + spdlog + VERSION + "1.3.1-p0" + URL + "https://github.com/hunter-packages/spdlog/archive/v1.3.1-p0.tar.gz" + SHA1 + 3d0538af5ea93995ff417faa979f309f834fa352 +) + +hunter_cmake_args( + spdlog + CMAKE_ARGS + SPDLOG_EXTERNAL_TOOLCHAIN=ON # tell spdlog not to modify cxxflags + SPDLOG_BUILD_EXAMPLES=OFF + SPDLOG_BUILD_TESTING=OFF + SPDLOG_BUILD_TESTS=OFF + SPDLOG_BUILD_BENCH=OFF +) + hunter_pick_scheme(DEFAULT url_sha1_cmake) hunter_cacheable(spdlog) hunter_download(PACKAGE_NAME spdlog) diff --git a/cmake/projects/spirv-cross/hunter.cmake b/cmake/projects/spirv-cross/hunter.cmake new file mode 100644 index 000000000..fefb2bfac --- /dev/null +++ b/cmake/projects/spirv-cross/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2018, 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 + spirv-cross + VERSION + 20190220 + URL + "https://github.com/KhronosGroup/SPIRV-Cross/archive/2019-02-20.tar.gz" + SHA1 + 16a27e770f5774e2c354b182af928d876161cae7 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(spirv-cross) +hunter_download(PACKAGE_NAME spirv-cross) diff --git a/cmake/projects/sqlite3/hunter.cmake b/cmake/projects/sqlite3/hunter.cmake new file mode 100644 index 000000000..b1915f188 --- /dev/null +++ b/cmake/projects/sqlite3/hunter.cmake @@ -0,0 +1,73 @@ +# Copyright (c) 2015, Ruslan Baratov, Alexandre Pretyman +# 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 + sqlite3 + VERSION + 3.21.0-p1 + URL + "https://github.com/hunter-packages/sqlite3/archive/v3.21.0-p1.tar.gz" + SHA1 + 5e2761ac6f94410da58d2cd00e64bda84f1a01aa +) + +hunter_add_version( + PACKAGE_NAME + sqlite3 + VERSION + 3.21.0-p2 + URL + "https://github.com/hunter-packages/sqlite3/archive/v3.21.0-p2.tar.gz" + SHA1 + 5742f5fcc0f84d87fcde746f66eadbbfd0dd0e15 +) + +hunter_add_version( + PACKAGE_NAME + sqlite3 + VERSION + 3.24.0-p0 + URL + "https://github.com/hunter-packages/sqlite3/archive/v3.24.0-p0.tar.gz" + SHA1 + e3f5b35543ee42afe2f89d0e1706d1b0ab66369e +) + +hunter_add_version( + PACKAGE_NAME + sqlite3 + VERSION + 3.24.0-p1 + URL + "https://github.com/hunter-packages/sqlite3/archive/v3.24.0-p1.tar.gz" + SHA1 + 126fa0efc44bd6aa1fe195fb00644b83ec91e5ac +) + +hunter_add_version( + PACKAGE_NAME + sqlite3 + VERSION + 3.27.2-p0 + URL + "https://github.com/hunter-packages/sqlite3/archive/v3.27.2-p0.tar.gz" + SHA1 + e4f2b69b5b9e5fe9797909abb51c1acaba25e4f2 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(sqlite3) +hunter_download( + PACKAGE_NAME sqlite3 + PACKAGE_UNRELOCATABLE_TEXT_FILES + "lib/pkgconfig/sqlite3.pc" + "lib/libsqlite3.la" +) diff --git a/cmake/projects/sse2neon/hunter.cmake b/cmake/projects/sse2neon/hunter.cmake new file mode 100644 index 000000000..1c872fab3 --- /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/stanhull/hunter.cmake b/cmake/projects/stanhull/hunter.cmake new file mode 100644 index 000000000..ac38ec8da --- /dev/null +++ b/cmake/projects/stanhull/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 + stanhull + VERSION + 0.0.1 + URL + "https://github.com/hunter-packages/stanhull/archive/v0.0.1.tar.gz" + SHA1 + df0a99f598ba46f7dfa9e017bc043d62828ebc55 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(stanhull) +hunter_download(PACKAGE_NAME stanhull) diff --git a/cmake/projects/state_machine/hunter.cmake b/cmake/projects/state_machine/hunter.cmake new file mode 100644 index 000000000..446a85276 --- /dev/null +++ b/cmake/projects/state_machine/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 + state_machine + VERSION + 1.1 + URL + "https://github.com/NukeBird/state_machine/archive/1.1.tar.gz" + SHA1 + 43F37F8D0EF067ED6F853D11F5875A4D83A06756 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(state_machine) +hunter_download(PACKAGE_NAME state_machine) diff --git a/cmake/projects/stb/hunter.cmake b/cmake/projects/stb/hunter.cmake new file mode 100644 index 000000000..90e6b7fa9 --- /dev/null +++ b/cmake/projects/stb/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 + stb + VERSION + 0.0.1 + URL + "https://github.com/hunter-packages/stb/archive/v0.0.1.tar.gz" + SHA1 + 270aefc345550c229507b37c35b9d5de7ba3a052 +) + +hunter_add_version( + PACKAGE_NAME + stb + VERSION + 0.0.0-e6afb9c-p0 + URL + "https://github.com/hunter-packages/stb/archive/v0.0.0-e6afb9c-p0.tar.gz" + SHA1 + abc0d6a68c5bfb1efdf40a76c6c9f646e4f722ef +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(stb) +hunter_download(PACKAGE_NAME stb) diff --git a/cmake/projects/stdext-path/hunter.cmake b/cmake/projects/stdext-path/hunter.cmake new file mode 100644 index 000000000..067c88ad7 --- /dev/null +++ b/cmake/projects/stdext-path/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2018, 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 + stdext-path + VERSION + 0.0.1-p0 + URL + "https://github.com/hunter-packages/stdext-path/archive/v0.0.1-p0.tar.gz" + SHA1 + 154e7497854fc8fa6e604d4b351902f69824e110 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(stdext-path) +hunter_download(PACKAGE_NAME stdext-path) diff --git a/cmake/projects/stormlib/hunter.cmake b/cmake/projects/stormlib/hunter.cmake new file mode 100644 index 000000000..cb96b0794 --- /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/sugar/hunter.cmake b/cmake/projects/sugar/hunter.cmake new file mode 100644 index 000000000..052da4dfa --- /dev/null +++ b/cmake/projects/sugar/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2013-2018, 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 + sugar + VERSION + "1.3.0" + URL + "https://github.com/ruslo/sugar/archive/v1.3.0.tar.gz" + SHA1 + 155a48bbb588c34afc73dbc6ee87737b8f53f749 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(sugar) +hunter_download(PACKAGE_NAME sugar) diff --git a/cmake/projects/tacopie/hunter.cmake b/cmake/projects/tacopie/hunter.cmake new file mode 100644 index 000000000..944b0f107 --- /dev/null +++ b/cmake/projects/tacopie/hunter.cmake @@ -0,0 +1,42 @@ +# 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 +) + +hunter_add_version( + PACKAGE_NAME + tacopie + VERSION + "3.2.0-h1" + URL + "https://github.com/hunter-packages/tacopie/archive/3.2.0-h1.tar.gz" + SHA1 + 04a8953bf69f1fa26b68dd76df4b4baea291ab34 +) + +# 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/taocpp-json/hunter.cmake b/cmake/projects/taocpp-json/hunter.cmake new file mode 100644 index 000000000..c9619c336 --- /dev/null +++ b/cmake/projects/taocpp-json/hunter.cmake @@ -0,0 +1,31 @@ +# !!! 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 + taocpp-json + VERSION + 1.0.0-beta.11-e0895587 + URL + "https://github.com/taocpp/json/archive/e08955875acc5853d31aa5ccd4b918726d20847f.zip" + SHA1 + 916357f4325fa15de32ba15f3b78e89d6308b920 +) + +hunter_cmake_args( + taocpp-json + CMAKE_ARGS + TAOCPP_JSON_BUILD_TESTS=OFF + TAOCPP_JSON_BUILD_EXAMPLES=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(taocpp-json) +hunter_download( + PACKAGE_NAME taocpp-json +) diff --git a/cmake/projects/tcl/hunter.cmake b/cmake/projects/tcl/hunter.cmake new file mode 100644 index 000000000..7914652b6 --- /dev/null +++ b/cmake/projects/tcl/hunter.cmake @@ -0,0 +1,23 @@ +include(hunter_add_version) +include(hunter_configuration_types) +include(hunter_pick_scheme) +include(hunter_cacheable) +include(hunter_download) + +hunter_add_version( + PACKAGE_NAME + tcl + VERSION + "core8.6.8" + URL + "https://downloads.sourceforge.net/project/tcl/Tcl/8.6.8/tcl-core8.6.8-src.tar.gz" + SHA1 + e13199c76a7d1eae02f35cc9a20fabded6f815f5 +) + +hunter_configuration_types(tcl CONFIGURATION_TYPES Release) +hunter_pick_scheme(DEFAULT url_sha1_tcl_autotools) +hunter_cacheable(tcl) +hunter_download(PACKAGE_NAME tcl + PACKAGE_INTERNAL_DEPS_ID "1" +) diff --git a/cmake/projects/tcl/schemes/url_sha1_tcl_autotools.cmake.in b/cmake/projects/tcl/schemes/url_sha1_tcl_autotools.cmake.in new file mode 100644 index 000000000..8aebfdd68 --- /dev/null +++ b/cmake/projects/tcl/schemes/url_sha1_tcl_autotools.cmake.in @@ -0,0 +1,103 @@ +# Copyright (c) 2013, 2015 Ruslan Baratov, Alexandre Pretyman +# All rights reserved. + +cmake_minimum_required(VERSION 3.0) +project(Hunter) + +include("@HUNTER_SELF@/cmake/Hunter") + +include(hunter_user_error) +include(hunter_status_debug) +include(hunter_assert_not_empty_string) +include(hunter_autotools_project) + +hunter_status_debug("Scheme: url_sha1_autotools") + +if("@MSVC@") + hunter_user_error("Autotools scheme not supported with Visual Studio") +endif() + +foreach(dependency ${DEPENDS_ON_PACKAGES}) + hunter_add_package(${dependency}) +endforeach() + +# Check preconditions +hunter_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_BUILD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_INSTALL_PREFIX@") + +set(cflags) +set(extra_flags) +set(patch_command + ${CMAKE_COMMAND} -E copy "@HUNTER_PACKAGE_SCRIPT_DIR@/configure" "@HUNTER_PACKAGE_SOURCE_DIR@" +) + +if(ANDROID) + set(KERNEL_VERSION 3) # API 14-23 + if (${CMAKE_SYSTEM_VERSION} GREATER_EQUAL "24") + set(KERNEL_VERSION 4) # API 24-x + endif() + configure_file("@HUNTER_PACKAGE_SCRIPT_DIR@/android_uname.in" "@HUNTER_PACKAGE_DOWNLOAD_DIR@/uname" @ONLY) + + list(APPEND cflags "--include android_def.h") + list(APPEND extra_flags "--enable-langinfo=no") + list(APPEND patch_command + COMMAND ${CMAKE_COMMAND} -E copy "@HUNTER_PACKAGE_SCRIPT_DIR@/android_def.h" "@HUNTER_PACKAGE_SOURCE_DIR@" + COMMAND ${CMAKE_COMMAND} -E copy "@HUNTER_PACKAGE_DOWNLOAD_DIR@/uname" "@HUNTER_PACKAGE_SOURCE_DIR@" + ) +elseif(APPLE) + list(APPEND extra_flags "--enable-corefoundation=no") +endif() + +hunter_autotools_project("@HUNTER_EP_NAME@" + HUNTER_SELF + "@HUNTER_SELF@" + URL + @HUNTER_PACKAGE_URL@ + URL_HASH + SHA1=@HUNTER_PACKAGE_SHA1@ + DOWNLOAD_DIR + "@HUNTER_PACKAGE_DOWNLOAD_DIR@" + SOURCE_DIR + "@HUNTER_PACKAGE_SOURCE_DIR@" + BUILD_DIR + "@HUNTER_PACKAGE_BUILD_DIR@" + INSTALL_DIR + "@HUNTER_PACKAGE_INSTALL_PREFIX@" + GLOBAL_INSTALL_DIR + "@HUNTER_INSTALL_PREFIX@" + PARALLEL_JOBS + "@HUNTER_JOBS_OPTION@" + PACKAGE_CONFIGURATION_TYPES + "@HUNTER_PACKAGE_CONFIGURATION_TYPES@" + CFLAGS + ${cflags} + EXTRA_FLAGS + ${extra_flags} + PATCH_COMMAND + ${patch_command} +) + +string(COMPARE EQUAL "${DEPENDS_ON_PKGCONFIGS}" "" default_pkgconfig) +if(NOT default_pkgconfig) + set(DEPENDS_ON_PACKAGES ${DEPENDS_ON_PKGCONFIGS}) +endif() + +set(PKG_GENERATE_SHARED "${BUILD_SHARED_LIBS}") + +foreach(PKG_CONFIG_MODULE ${PKGCONFIG_EXPORT_TARGETS}) + # Use: + # * DEPENDS_ON_PACKAGES + # * PKG_GENERATE_SHARED + 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/projects/tcl/scripts/android_def.h b/cmake/projects/tcl/scripts/android_def.h new file mode 100644 index 000000000..6d5a8e26e --- /dev/null +++ b/cmake/projects/tcl/scripts/android_def.h @@ -0,0 +1,3 @@ +#if __ANDROID_API__ < 21 +#undef HAVE_STRUCT_DIRENT64 +#endif diff --git a/cmake/projects/tcl/scripts/android_uname.in b/cmake/projects/tcl/scripts/android_uname.in new file mode 100755 index 000000000..24b6cc2d3 --- /dev/null +++ b/cmake/projects/tcl/scripts/android_uname.in @@ -0,0 +1,20 @@ +#!/bin/sh + +case $1 in + -m) + echo "@ANDROID_ABI@" + ;; + -n) + echo "@ANDROID_PLATFORM@" + ;; + -p) + echo "@CMAKE_SYSTEM_PROCESSOR@" + ;; + -r) + echo "@KERNEL_VERSION@" + ;; + *) + echo "Linux" + ;; +esac + diff --git a/cmake/projects/tcl/scripts/configure b/cmake/projects/tcl/scripts/configure new file mode 100755 index 000000000..a13732eae --- /dev/null +++ b/cmake/projects/tcl/scripts/configure @@ -0,0 +1,3 @@ +#!/bin/sh + +PATH=".:$PATH" unix/configure "$@" diff --git a/cmake/projects/termcolor/hunter.cmake b/cmake/projects/termcolor/hunter.cmake new file mode 100644 index 000000000..345d11500 --- /dev/null +++ b/cmake/projects/termcolor/hunter.cmake @@ -0,0 +1,26 @@ +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_cmake_args) +include(hunter_download) +include(hunter_pick_scheme) +include(hunter_report_broken_package) +include(hunter_status_debug) + +hunter_add_version( + PACKAGE_NAME + termcolor + VERSION + "1.0.0" + URL + "https://github.com/ikalnytskyi/termcolor/archive/v1.0.0.tar.gz" + SHA1 + 3ecab2daf39f118bff2244f51760dfd32ab7a3d1 +) + +hunter_cmake_args(termcolor CMAKE_ARGS ENABLE_TESTING=OFF) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(termcolor) +hunter_download(PACKAGE_NAME termcolor) diff --git a/cmake/projects/tf/hunter.cmake b/cmake/projects/tf/hunter.cmake new file mode 100644 index 000000000..0588c5928 --- /dev/null +++ b/cmake/projects/tf/hunter.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2016-2019, 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) +include(hunter_cmake_args) + +hunter_add_version( + PACKAGE_NAME + tf + VERSION + 1.12.0-p0 + URL + "https://github.com/hunter-packages/tf/archive/v1.12.0-p0.tar.gz" + SHA1 + 349b34bc9fe31e2f372d52e8b0b03002e229cc2c +) + +hunter_cmake_args( + tf + CMAKE_ARGS + CATKIN_ENABLE_TESTING:BOOL=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(tf) +hunter_download(PACKAGE_NAME tf) diff --git a/cmake/projects/tf2/hunter.cmake b/cmake/projects/tf2/hunter.cmake new file mode 100644 index 000000000..a703fb002 --- /dev/null +++ b/cmake/projects/tf2/hunter.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2016-2019, 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) +include(hunter_cmake_args) + +hunter_add_version( + PACKAGE_NAME + tf2 + VERSION + 0.6.5-p0 + URL + "https://github.com/hunter-packages/tf2/archive/v0.6.5-p0.tar.gz" + SHA1 + ac8e28968074c6c386be8ecd2ac5ece29f5b0e06 +) + +hunter_cmake_args( + tf2 + CMAKE_ARGS + CATKIN_ENABLE_TESTING:BOOL=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(tf2) +hunter_download(PACKAGE_NAME tf2) diff --git a/cmake/projects/thread-pool-cpp/hunter.cmake b/cmake/projects/thread-pool-cpp/hunter.cmake index cd9e63a0e..b80d0d66c 100644 --- a/cmake/projects/thread-pool-cpp/hunter.cmake +++ b/cmake/projects/thread-pool-cpp/hunter.cmake @@ -8,6 +8,28 @@ 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 + VERSION + 1.0.0-p3 + URL + "https://github.com/hunter-packages/thread-pool-cpp/archive/v1.0.0-p3.tar.gz" + SHA1 + 475c0492013a46dc2a98ee6cb854dcfb2cda3807 +) + hunter_add_version( PACKAGE_NAME thread-pool-cpp diff --git a/cmake/projects/thrift/hunter.cmake b/cmake/projects/thrift/hunter.cmake new file mode 100644 index 000000000..d7f82a0fd --- /dev/null +++ b/cmake/projects/thrift/hunter.cmake @@ -0,0 +1,76 @@ +# !!! 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 thrift + VERSION "0.12.0-p0" + URL "https://github.com/hunter-packages/thrift/archive/v0.12.0-p0.tar.gz" + SHA1 "dafb78da4a6f711819a1962c883b64272a34364c") + +hunter_add_version( + PACKAGE_NAME thrift + VERSION "0.11.0-p0" + URL "https://github.com/hunter-packages/thrift/archive/v0.11.0-p0.tar.gz" + SHA1 "1dff5a2a26de3bd9d4bc8c68db09215c95874001") + +hunter_add_version( + PACKAGE_NAME thrift + VERSION "0.10.0" + URL "https://github.com/hunter-packages/thrift/archive/v0.10.0-p0.tar.gz" + SHA1 "e346fd04d2228e4d08df363b4f260d92d12e7b67") + +hunter_add_version( + PACKAGE_NAME thrift + VERSION "0.10.0-p1" + URL "https://github.com/hunter-packages/thrift/archive/v0.10.0-p1.tar.gz" + SHA1 "7ac349820b9abe5d613f32474e4e1efb41d2b536") + +hunter_add_version( + PACKAGE_NAME thrift + VERSION "0.10.0-p2" + URL "https://github.com/hunter-packages/thrift/archive/v0.10.0-p2.tar.gz" + SHA1 "9060fe039f57ea11d1143299b456ff98d4cc56c2") + +hunter_add_version( + PACKAGE_NAME thrift + VERSION "0.9.2" + URL "https://github.com/hunter-packages/thrift/archive/v0.9.2-p0.tar.gz" + SHA1 "a53f54ca03e4535b45f74bb71b07f82e0dda6640") + +hunter_add_version( + PACKAGE_NAME thrift + VERSION "0.9.2-p1" + URL "https://github.com/hunter-packages/thrift/archive/v0.9.2-p1.tar.gz" + SHA1 "b097d5df29681d57c2b75ecfc4400b5ab28252ba") + +hunter_add_version( + PACKAGE_NAME thrift + VERSION "0.9.2-p2" + URL "https://github.com/hunter-packages/thrift/archive/v0.9.2-p2.tar.gz" + SHA1 "0dba938473a718a547b0f21ad3bd6eda2a2574ac") + +hunter_cmake_args(thrift CMAKE_ARGS + BUILD_TESTING=OFF + BUILD_TUTORIALS=OFF + BUILD_COMPILER=OFF + BUILD_C_GLIB=OFF + BUILD_CPP=ON + BUILD_HASKELL=OFF + BUILD_JAVA=OFF + BUILD_PYTHON=OFF + WITH_QT4=OFF + WITH_QT5=OFF + WITH_SHARED_LIB=OFF + WITH_PLUGIN=OFF + WITH_LIBEVENT=OFF + WITH_OPENSSL=OFF + WITH_ZLIB=OFF) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(thrift) +hunter_download(PACKAGE_NAME thrift) diff --git a/cmake/projects/tinyxml2/hunter.cmake b/cmake/projects/tinyxml2/hunter.cmake new file mode 100755 index 000000000..26fa16f1d --- /dev/null +++ b/cmake/projects/tinyxml2/hunter.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2014-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 + tinyxml2 + VERSION + "6.2.0-p1" + URL + "https://github.com/hunter-packages/tinyxml2/archive/v6.2.0-p1.tar.gz" + SHA1 + "a457140cf6d889d71280433127eaac89cf04c94a" +) + +hunter_cmake_args( + tinyxml2 + CMAKE_ARGS + BUILD_TESTING:BOOL=false +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(tinyxml2) +hunter_download(PACKAGE_NAME tinyxml2) diff --git a/cmake/projects/tmxparser/hunter.cmake b/cmake/projects/tmxparser/hunter.cmake new file mode 100644 index 000000000..16fea83fe --- /dev/null +++ b/cmake/projects/tmxparser/hunter.cmake @@ -0,0 +1,34 @@ +# Copyright (c) 2016-2019, 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 + tmxparser + VERSION + 2.1.0-ab4125b-p1 + URL + "https://github.com/hunter-packages/tmxparser/archive/v2.1.0-ab4125b-p1.tar.gz" + SHA1 + 2f8cb2fba7b4241fbadc54f2f1928f72fb84cade +) + +hunter_cmake_args( + tmxparser + CMAKE_ARGS + USE_MINIZ=OFF + BUILD_TINYXML2=OFF + BUILD_TESTS=OFF + BUILD_DOCS=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(tmxparser) +hunter_download(PACKAGE_NAME tmxparser) diff --git a/cmake/projects/toluapp/hunter.cmake b/cmake/projects/toluapp/hunter.cmake new file mode 100644 index 000000000..8f4724f02 --- /dev/null +++ b/cmake/projects/toluapp/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 + toluapp + VERSION + 1.0.93-p0 + URL + "https://github.com/hunter-packages/toluapp/archive/v1.0.93-p0.tar.gz" + SHA1 + 851dabf207286e232c7e9eb1c92c7e62314c0202 +) + +hunter_add_version( + PACKAGE_NAME + toluapp + VERSION + 1.0.93-p1 + URL + "https://github.com/hunter-packages/toluapp/archive/v1.0.93-p1.tar.gz" + SHA1 + 39429ce1b90ad12ed34aa366db587514a96c0c9d +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(toluapp) +hunter_download(PACKAGE_NAME toluapp) diff --git a/cmake/projects/tomcrypt/hunter.cmake b/cmake/projects/tomcrypt/hunter.cmake new file mode 100644 index 000000000..8b29b7f1f --- /dev/null +++ b/cmake/projects/tomcrypt/hunter.cmake @@ -0,0 +1,58 @@ +# 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 +) +hunter_add_version( + PACKAGE_NAME + tomcrypt + VERSION + "1.18.2-p1" + URL + "https://github.com/hunter-packages/libtomcrypt/archive/v1.18.2-p1.tar.gz" + SHA1 + 15a37f1bb33b8dd0d2c568c2cec32966def681ef +) +# 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/tommath/hunter.cmake b/cmake/projects/tommath/hunter.cmake new file mode 100644 index 000000000..ddbd04d61 --- /dev/null +++ b/cmake/projects/tommath/hunter.cmake @@ -0,0 +1,36 @@ +# 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 + tommath + VERSION + "1.0-p2" + URL + "https://github.com/hunter-packages/libtommath/archive/v1.0-p2.tar.gz" + SHA1 + 733e4644a0b01260830a402b457ca82064fe30cd +) +hunter_add_version( + PACKAGE_NAME + tommath + VERSION + "1.0.1-p0" + URL + "https://github.com/hunter-packages/libtommath/archive/v1.0.1-p0.tar.gz" + SHA1 + 6270ff3c125d0c513aeb10f62ef25d4eb341af37 +) +# Pick a download scheme +hunter_pick_scheme(DEFAULT url_sha1_cmake) # use scheme for cmake projects + +hunter_cacheable(tommath) +hunter_download(PACKAGE_NAME tommath) diff --git a/cmake/projects/tvm/hunter.cmake b/cmake/projects/tvm/hunter.cmake new file mode 100644 index 000000000..0846afbec --- /dev/null +++ b/cmake/projects/tvm/hunter.cmake @@ -0,0 +1,124 @@ +# Copyright (c) 2016-2018, 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 + tvm + VERSION + 0.4-0f053c8-p0 + URL + "https://github.com/hunter-packages/tvm/archive/v0.4-0f053c8-p0.tar.gz" + SHA1 + 1c28b3246e3f5ecb6f985899a5b078a1cb81f85b +) + +hunter_add_version( + PACKAGE_NAME + tvm + VERSION + 0.4-0f053c8-p3 + URL + "https://github.com/hunter-packages/tvm/archive/v0.4-0f053c8-p3.tar.gz" + SHA1 + 7c721091b437ccbe20c706f194b68dbff3acd712 +) + +hunter_add_version( + PACKAGE_NAME + tvm + VERSION + 0.4-0f053c8-p4 + URL + "https://github.com/hunter-packages/tvm/archive/v0.4-0f053c8-p4.tar.gz" + SHA1 + 3cdbec21b8766f7f51abc78d957fe398c70470a5 +) + +hunter_add_version( + PACKAGE_NAME + tvm + VERSION + 0.5-p2 + URL + "https://github.com/hunter-packages/tvm/archive/v0.5-p2.tar.gz" + SHA1 + f050a50ade4e1508621d5138b6edf8b09d9bbcc5 +) + +hunter_add_version( + PACKAGE_NAME + tvm + VERSION + 0.5-p3 + URL + "https://github.com/hunter-packages/tvm/archive/v0.5-p3.tar.gz" + SHA1 + ddc16b4125b7eafbe34b63da50e7622fe961787e +) + +hunter_add_version( + PACKAGE_NAME + tvm + VERSION + 0.5-p4 + URL + "https://github.com/hunter-packages/tvm/archive/v0.5-p4.tar.gz" + SHA1 + f62ace1e9515799de83b29c6325588e48fc76479 +) + +hunter_add_version( + PACKAGE_NAME + tvm + VERSION + 0.5-p5 + URL + "https://github.com/hunter-packages/tvm/archive/v0.5-p5.tar.gz" + SHA1 + bd53c022d5c39f93ad696828479f463cf39706ba +) + +hunter_add_version( + PACKAGE_NAME + tvm + VERSION + 0.5-a4bc50e-p0 + URL + "https://github.com/hunter-packages/tvm/archive/v0.5-a4bc50e-p0.tar.gz" + SHA1 + 0ccc5ef771fcddf8e3ce4534f60917a3c8838fb2 +) + +set( + __hunter_tvm_cmake_args + INSTALL_DEV=ON + INSTALL_NNVM_SOURCES=ON +) + +if(IOS OR ANDROID OR WIN32) + list(APPEND __hunter_tvm_cmake_args TVM_BUILD_RUNTIME_ONLY=ON) +else() + list(APPEND __hunter_tvm_cmake_args USE_GRAPH_RUNTIME_DEBUG=ON USE_LLVM=ON) + + if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") + list(APPEND __hunter_tvm_cmake_args USE_CUDA=ON) + endif() + + if(APPLE) + list(APPEND __hunter_tvm_cmake_args USE_METAL=ON) + endif() +endif() + +hunter_cmake_args(tvm CMAKE_ARGS ${__hunter_tvm_cmake_args}) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(tvm) +hunter_download(PACKAGE_NAME tvm) diff --git a/cmake/projects/type_safe/hunter.cmake b/cmake/projects/type_safe/hunter.cmake new file mode 100644 index 000000000..375324cd0 --- /dev/null +++ b/cmake/projects/type_safe/hunter.cmake @@ -0,0 +1,81 @@ +# 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 + type_safe + VERSION + "0.1" + URL + "https://github.com/hunter-packages/type_safe/archive/v0.1-p.tar.gz" + SHA1 + 57e426af70791485e2a209c602ce9d71e9d52ab7 +) + +hunter_add_version( + PACKAGE_NAME + type_safe + VERSION + "0.1-p2" + URL + "https://github.com/hunter-packages/type_safe/archive/0.1-p2.tar.gz" + SHA1 + 6a1fa6f3926a5d0175890647ff0f419ba4c562f4 +) + +hunter_add_version( + PACKAGE_NAME + type_safe + VERSION + "0.2" + URL + "https://github.com/hunter-packages/type_safe/archive/v0.2-p.tar.gz" + SHA1 + 7f8ba49a04f04d7f121ec358521a5d7a8f5039dd +) + +hunter_add_version( + PACKAGE_NAME + type_safe + VERSION + "0.2-p1" + URL + "https://github.com/hunter-packages/type_safe/archive/v0.2-p1.tar.gz" + SHA1 + d051bec1db05d0623b6e8a6fd2805e70ba914713 +) + +hunter_add_version( + PACKAGE_NAME + type_safe + VERSION + "0.2.1-p1" + URL + "https://github.com/hunter-packages/type_safe/archive/v0.2.1-p1.zip" + SHA1 + 6d583f877cce781ff472f1a0a2d56af68afa5ff1 +) + +hunter_add_version( + PACKAGE_NAME + type_safe + VERSION + "0.2.1-p2" + URL + "https://github.com/hunter-packages/type_safe/archive/v0.2.1-p2.zip" + SHA1 + 09a76b0668cd7bf6c6b590c80e64cb2745a32bb9 +) + +# Pick a download scheme +hunter_pick_scheme(DEFAULT url_sha1_cmake) # use scheme for cmake projects +hunter_cacheable(type_safe) +hunter_download(PACKAGE_NAME type_safe) diff --git a/cmake/projects/units/hunter.cmake b/cmake/projects/units/hunter.cmake new file mode 100644 index 000000000..8e06558d1 --- /dev/null +++ b/cmake/projects/units/hunter.cmake @@ -0,0 +1,43 @@ +# Copyright (c) 2016-2018, 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) +include(hunter_cmake_args) + +hunter_add_version( + PACKAGE_NAME + units + VERSION + 3.0.0.alpha-2 + URL + "https://github.com/nholthaus/units/archive/v3.0.0.alpha-2.tar.gz" + SHA1 + 7e0835b63683836249d533820f59c6c6b36a3230 +) + +hunter_add_version( + PACKAGE_NAME + units + VERSION + 2.3.1 + URL + "https://github.com/nholthaus/units/archive/v2.3.1.tar.gz" + SHA1 + bfb1ee5ba349ec53fc6d664b887d5beb111e938e +) + +hunter_cmake_args( + units + CMAKE_ARGS + BUILD_TESTS=OFF + BUILD_DOCS=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(units) +hunter_download(PACKAGE_NAME units) diff --git a/cmake/projects/utf8/hunter.cmake b/cmake/projects/utf8/hunter.cmake new file mode 100644 index 000000000..3d06c4837 --- /dev/null +++ b/cmake/projects/utf8/hunter.cmake @@ -0,0 +1,35 @@ +# Copyright (c) 2016-2018, 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 + utf8 + VERSION + 2.3.4-p1 + URL + "https://github.com/hunter-packages/utf8/archive/v2.3.4-p1.tar.gz" + SHA1 + 438b70b0c6ee3f674e068ebbc19a4d04a5a4ca56 +) + +hunter_add_version( + PACKAGE_NAME + utf8 + VERSION + 2.3.4-p0 + URL + "https://github.com/hunter-packages/utf8/archive/v2.3.4-p0.tar.gz" + SHA1 + 73116d453d4fb2ab4b46159095baeeb319f1ae28 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(utf8) +hunter_download(PACKAGE_NAME utf8) diff --git a/cmake/projects/util_linux/hunter.cmake b/cmake/projects/util_linux/hunter.cmake new file mode 100644 index 000000000..8b239356a --- /dev/null +++ b/cmake/projects/util_linux/hunter.cmake @@ -0,0 +1,49 @@ +# Copyright (c) 2016 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) + +hunter_add_version( + PACKAGE_NAME + util_linux + VERSION + "2.30.1" + URL + "https://www.kernel.org/pub/linux/utils/util-linux/v2.30/util-linux-2.30.1.tar.xz" + SHA1 + 030b92cede3d68816d3206645c4262599175ec8a +) + +hunter_configuration_types(util_linux CONFIGURATION_TYPES Release) +hunter_pick_scheme(DEFAULT url_sha1_autotools) + +hunter_cmake_args( + util_linux + CMAKE_ARGS + EXTRA_FLAGS=--disable-makeinstall-chown + PKGCONFIG_EXPORT_TARGETS=blkid;fdisk;mount;smartcols;uuid +) + +hunter_cacheable(util_linux) +hunter_download( + PACKAGE_NAME util_linux + PACKAGE_INTERNAL_DEPS_ID "2" + PACKAGE_UNRELOCATABLE_TEXT_FILES + "lib/libblkid.la" + "lib/libfdisk.la" + "lib/libmount.la" + "lib/libsmartcols.la" + "lib/libuuid.la" + "lib/pkgconfig/blkid.pc" + "lib/pkgconfig/fdisk.pc" + "lib/pkgconfig/mount.pc" + "lib/pkgconfig/smartcols.pc" + "lib/pkgconfig/uuid.pc" +) diff --git a/cmake/projects/v8/hunter.cmake b/cmake/projects/v8/hunter.cmake new file mode 100644 index 000000000..702421cf3 --- /dev/null +++ b/cmake/projects/v8/hunter.cmake @@ -0,0 +1,57 @@ +# Copyright (c) 2016-2019, 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 + v8 + VERSION + 7.4.98-p1 + URL + "https://github.com/hunter-packages/v8/archive/v7.4.98-p1.tar.gz" + SHA1 + 44805a2abbfc65fa73dbbfaa0383135dae9d05af +) + +hunter_add_version( + PACKAGE_NAME + v8 + VERSION + 7.4.98-p2 + URL + "https://github.com/hunter-packages/v8/archive/v7.4.98-p2.tar.gz" + SHA1 + 7b165ee53bf804ce543880e21954b6d000053571 +) + +hunter_add_version( + PACKAGE_NAME + v8 + VERSION + 7.4.98-p3 + URL + "https://github.com/hunter-packages/v8/archive/v7.4.98-p3.tar.gz" + SHA1 + 397f1fcc8a65c278ac118e1f34e16f8347fb2be5 +) + +hunter_add_version( + PACKAGE_NAME + v8 + VERSION + 3.29.86-90da229-p0 + URL + "https://github.com/hunter-packages/v8/archive/v3.29.86-90da229-p0.tar.gz" + SHA1 + 57efac9bc2e7a774fdf2437c403c8ed9642ec5b7 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(v8) +hunter_download(PACKAGE_NAME v8) diff --git a/cmake/projects/vectorial/hunter.cmake b/cmake/projects/vectorial/hunter.cmake new file mode 100644 index 000000000..2db6d4b7c --- /dev/null +++ b/cmake/projects/vectorial/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2018, 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 + vectorial + VERSION + 0.0.0-ae7dc88-p0 + URL + "https://github.com/hunter-packages/vectorial/archive/v0.0.0-ae7dc88-p0.tar.gz" + SHA1 + e48cfd17f5cfad979b1d0272d3f7012b3ea5dbf2 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(vectorial) +hunter_download(PACKAGE_NAME vectorial) diff --git a/cmake/projects/vorbis/hunter.cmake b/cmake/projects/vorbis/hunter.cmake new file mode 100644 index 000000000..42a0a1314 --- /dev/null +++ b/cmake/projects/vorbis/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2018, 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 + vorbis + VERSION + 1.3.6-p1 + URL + "https://github.com/hunter-packages/vorbis/archive/v1.3.6-p1.tar.gz" + SHA1 + 51cdcdbd872d85f3cf2d5515baf9ccaa13690d1a +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(vorbis) +hunter_download(PACKAGE_NAME vorbis) diff --git a/cmake/projects/websocketpp/hunter.cmake b/cmake/projects/websocketpp/hunter.cmake index af1f958a5..934e62c04 100644 --- a/cmake/projects/websocketpp/hunter.cmake +++ b/cmake/projects/websocketpp/hunter.cmake @@ -5,6 +5,17 @@ include(hunter_cacheable) include(hunter_download) include(hunter_pick_scheme) +hunter_add_version( + PACKAGE_NAME + websocketpp + VERSION + "0.7.0" + URL + "https://github.com/hunter-packages/websocketpp/archive/0.7.0-hunter-p1.tar.gz" + SHA1 + 266c5a3c1b37eed2e49b8bc2ab42e77f97e95c3d + ) + hunter_add_version( PACKAGE_NAME websocketpp @@ -16,16 +27,26 @@ hunter_add_version( 5c3abdee5d735a0beab65980cd432c33d935d792 ) +hunter_add_version( + PACKAGE_NAME + websocketpp + VERSION + "0.7.0-p3" + URL + "https://github.com/hunter-packages/websocketpp/archive/v0.7.0-p3.tar.gz" + SHA1 + 8ca868bd8c5290643574632aa72931280e497ce6 + ) hunter_add_version( PACKAGE_NAME websocketpp VERSION - "0.7.0" + "0.8.1-p0" URL - "https://github.com/hunter-packages/websocketpp/archive/0.7.0-hunter-p1.tar.gz" + "https://github.com/hunter-packages/websocketpp/archive/v0.8.1-p0.tar.gz" SHA1 - 266c5a3c1b37eed2e49b8bc2ab42e77f97e95c3d + def22a3337b9f4022b7ad3004782be4be38f17e3 ) hunter_pick_scheme(DEFAULT url_sha1_cmake) diff --git a/cmake/projects/wt/hunter.cmake b/cmake/projects/wt/hunter.cmake new file mode 100644 index 000000000..06ef25ab8 --- /dev/null +++ b/cmake/projects/wt/hunter.cmake @@ -0,0 +1,39 @@ +# !!! 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 + wt + VERSION + "4.0.4-p0" + URL + "https://github.com/hunter-packages/wt/archive/v4.0.4-p0.tar.gz" + SHA1 + 5bdfd4787fc1733d2696e9dd17d334270941a91f +) + +hunter_cmake_args( + wt + CMAKE_ARGS + BUILD_EXAMPLES=OFF + ENABLE_HARU=OFF + ENABLE_PANGO=OFF + ENABLE_POSTGRES=OFF + ENABLE_FIREBIRD=OFF + ENABLE_QT4=OFF + ENABLE_LIBWTTEST=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) + +# FIXME: https://github.com/ruslo/hunter/pull/1655#issuecomment-446963534 +# hunter_cacheable(wt) + +hunter_download(PACKAGE_NAME wt) diff --git a/cmake/projects/wyrm/hunter.cmake b/cmake/projects/wyrm/hunter.cmake new file mode 100644 index 000000000..d2faeac95 --- /dev/null +++ b/cmake/projects/wyrm/hunter.cmake @@ -0,0 +1,33 @@ +# Copyright (c) 2016-2019, 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) +include(hunter_cmake_args) + +hunter_add_version( + PACKAGE_NAME + wyrm + VERSION + 0.1.0 + URL + "https://gitlab.obspm.fr/greenflash/wyrm/-/archive/v0.1.0/wyrm-v0.1.0.tar.gz" + SHA1 + 2d2c6b23b3b78f289ff515d76a99bcc8a773213e +) + +hunter_cmake_args( + wyrm + CMAKE_ARGS + WYRM_BUILD_EXAMPLES=OFF + WYRM_BUILD_TESTS=OFF + WYRM_BUILD_DOCUMENTATION=OFF +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(wyrm) +hunter_download(PACKAGE_NAME wyrm) diff --git a/cmake/projects/x11/hunter.cmake b/cmake/projects/x11/hunter.cmake index 446c2c605..0bb5735f9 100644 --- a/cmake/projects/x11/hunter.cmake +++ b/cmake/projects/x11/hunter.cmake @@ -22,6 +22,18 @@ hunter_add_version( 8177535c9c59d8c3ab98d55ce53520b5737ccd1a ) +# https://www.x.org/releases/individual/lib/ +hunter_add_version( + PACKAGE_NAME + x11 + VERSION + "1.6.7" + URL + "https://www.x.org/releases/individual/lib/libX11-1.6.7.tar.bz2" + SHA1 + 5076f7853713d7db958a05f6fd1c18f7e111a0ad +) + hunter_configuration_types(x11 CONFIGURATION_TYPES Release) hunter_pick_scheme(DEFAULT url_sha1_autotools) set(x11_dependencies @@ -36,11 +48,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 "7" 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 000000000..bba098573 --- /dev/null +++ b/cmake/projects/x264/hunter.cmake @@ -0,0 +1,41 @@ +# 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_add_version( + PACKAGE_NAME + x264 + VERSION + "snapshot-20190513-2245" + URL + "https://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20190513-2245-stable.tar.bz2" + SHA1 + 2e6faf305fb48a1449bdb61fe219b0c4d9501c36 +) + +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_INTERNAL_DEPS_ID "3" + 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 000000000..eaba4f6f4 --- /dev/null +++ b/cmake/projects/x264/schemes/url_sha1_x264.cmake.in @@ -0,0 +1,351 @@ +# 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_assert_not_empty_string) + +hunter_status_debug("Scheme: url_sha1_x264") + +# Check preconditions +hunter_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_CONFIGURATION_TYPES@") +hunter_assert_not_empty_string("@HUNTER_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_GLOBAL_SCRIPT_DIR@") +hunter_assert_not_empty_string("@HUNTER_TLS_VERIFY@") + +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@" + TLS_VERIFY + "@HUNTER_TLS_VERIFY@" + 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 + "" + TLS_VERIFY + "@HUNTER_TLS_VERIFY@" + 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} ") + else() + set(arch_flags "-arch ${ios_architecture} -isysroot ${IPHONEOS_SDK_ROOT} ") + 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@" + TLS_VERIFY + "@HUNTER_TLS_VERIFY@" + 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() + +set(PKG_GENERATE_SHARED "${BUILD_SHARED_LIBS}") + +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 98e18f570..b2155e9ed 100644 --- a/cmake/projects/xau/hunter.cmake +++ b/cmake/projects/xau/hunter.cmake @@ -22,6 +22,18 @@ hunter_add_version( 29c47207fd246425b906f525b2220235ce4cd0f6 ) +# https://www.x.org/releases/individual/lib/ +hunter_add_version( + PACKAGE_NAME + xau + VERSION + "1.0.9" + URL + "https://www.x.org/releases/individual/lib/libXau-1.0.9.tar.bz2" + SHA1 + ef9b1ad00f958c8b6e30a1bbc11fdfac311c9733 +) + hunter_configuration_types(xau CONFIGURATION_TYPES Release) hunter_pick_scheme(DEFAULT url_sha1_autotools) set(xau_dependencies @@ -32,10 +44,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 "8" 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 0c0ee8cab..fb51a1483 100644 --- a/cmake/projects/xcb-proto/hunter.cmake +++ b/cmake/projects/xcb-proto/hunter.cmake @@ -5,11 +5,23 @@ include(hunter_add_version) include(hunter_cacheable) +include(hunter_cmake_args) include(hunter_configuration_types) include(hunter_download) include(hunter_pick_scheme) # https://xcb.freedesktop.org/dist/ +hunter_add_version( + PACKAGE_NAME + xcb-proto + VERSION + "1.13" + URL + "https://xcb.freedesktop.org/dist/xcb-proto-1.13.tar.bz2" + SHA1 + f7fa35ab59af18cecadbe83fe705281dcfd82ffd +) + hunter_add_version( PACKAGE_NAME xcb-proto @@ -35,9 +47,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 "3" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/xcb-proto.pc" ) diff --git a/cmake/projects/xcb/hunter.cmake b/cmake/projects/xcb/hunter.cmake index f139840b5..7b1a194f3 100644 --- a/cmake/projects/xcb/hunter.cmake +++ b/cmake/projects/xcb/hunter.cmake @@ -10,6 +10,17 @@ include(hunter_download) include(hunter_pick_scheme) # https://xcb.freedesktop.org/dist/ +hunter_add_version( + PACKAGE_NAME + xcb + VERSION + "1.13" + URL + "https://xcb.freedesktop.org/dist/libxcb-1.13.tar.bz2" + SHA1 + 212ad5f1f80def80536d78e3d20354a0370e7fe9 +) + hunter_add_version( PACKAGE_NAME xcb @@ -34,8 +45,14 @@ hunter_add_version( 98199b6054750a06cddd4e77baa4354af547ce6f ) +set(_xcb_text_file_tpl composite damage dpms dri2 dri3 glx present randr record render res screensaver shape shm sync xf86dri xfixes xinerama xkb xtest xv xvmc) + +if(HUNTER_xcb_VERSION VERSION_LESS "1.13") + list(APPEND _xcb_text_file_tpl xevie xprint) +endif() + set(_xcb_text_files "") -foreach(_x composite damage dpms dri2 dri3 glx present randr record render res screensaver shape shm sync xevie xf86dri xfixes xinerama xkb xprint xtest xv xvmc) +foreach(_x ${_xcb_text_file_tpl}) list(APPEND _xcb_text_files "lib/libxcb-${_x}.la" "lib/pkgconfig/xcb-${_x}.pc") endforeach() @@ -46,6 +63,6 @@ hunter_pick_scheme(DEFAULT xcb) hunter_cacheable(xcb) hunter_download( PACKAGE_NAME xcb - PACKAGE_INTERNAL_DEPS_ID "2" + PACKAGE_INTERNAL_DEPS_ID "6" 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 654dc62e0..2691e18da 100644 --- a/cmake/projects/xcb/schemes/xcb.cmake.in +++ b/cmake/projects/xcb/schemes/xcb.cmake.in @@ -9,7 +9,7 @@ include("@HUNTER_SELF@/cmake/Hunter") include(hunter_autotools_project) include(hunter_fatal_error) include(hunter_status_debug) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) hunter_status_debug("Scheme: xcb") @@ -17,20 +17,28 @@ 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@") -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_BUILD_DIR@") -hunter_test_string_not_empty("@HUNTER_PACKAGE_INSTALL_PREFIX@") -hunter_test_string_not_empty("@HUNTER_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_BUILD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_GLOBAL_SCRIPT_DIR@") hunter_autotools_project( "@HUNTER_EP_NAME@" @@ -58,3 +66,17 @@ hunter_autotools_project( --without-doxygen --disable-devel-docs ) + +set(PKG_CONFIG_MODULE xcb) + +set(PKG_GENERATE_SHARED "${BUILD_SHARED_LIBS}") + +# Use: +# * PKG_CONFIG_MODULE +# * DEPENDS_ON_PACKAGES +# * PKG_GENERATE_SHARED +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 fa732e76b..aa5e6d1b8 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 "2" 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 1d9c5c381..f651fa3d8 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 "4" 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 be14f8bd2..2a31b8644 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 "4" 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 a08e50e05..393298b51 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) @@ -21,11 +22,28 @@ hunter_add_version( f969e02009adf2d51fd1ba4583a859984728a461 ) +# https://www.x.org/releases/individual/proto/ +hunter_add_version( + PACKAGE_NAME + xextproto + VERSION + "7.3.0" + URL + "https://www.x.org/releases/individual/proto/xextproto-7.3.0.tar.bz2" + SHA1 + b8d736342dcb73b71584d99a1cb9806d93c25ff8 +) + 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 "3" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/xextproto.pc" ) diff --git a/cmake/projects/xf86vidmodeproto/hunter.cmake b/cmake/projects/xf86vidmodeproto/hunter.cmake index a854a1f5a..6ca659a0c 100644 --- a/cmake/projects/xf86vidmodeproto/hunter.cmake +++ b/cmake/projects/xf86vidmodeproto/hunter.cmake @@ -29,12 +29,14 @@ set(xf86vidmodeproto_dependencies ) hunter_cmake_args( xf86vidmodeproto - CMAKE_ARGS # do not use double quotes on CMAKE_ARGS - DEPENDS_ON_PACKAGES=${xf86vidmodeproto_dependencies} + CMAKE_ARGS + DEPENDS_ON_PACKAGES=${xf86vidmodeproto_dependencies} + PKGCONFIG_EXPORT_TARGETS=xf86vidmodeproto ) hunter_cacheable(xf86vidmodeproto) hunter_download( PACKAGE_NAME xf86vidmodeproto + PACKAGE_INTERNAL_DEPS_ID "2" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/xf86vidmodeproto.pc" ) diff --git a/cmake/projects/xfixes/hunter.cmake b/cmake/projects/xfixes/hunter.cmake index c3aafb162..25f383b75 100644 --- a/cmake/projects/xfixes/hunter.cmake +++ b/cmake/projects/xfixes/hunter.cmake @@ -10,7 +10,7 @@ include(hunter_configuration_types) include(hunter_download) include(hunter_pick_scheme) -# http://www.x.org/releases/individual/proto/ +# https://www.x.org/releases/individual/lib/ hunter_add_version( PACKAGE_NAME xfixes @@ -22,6 +22,17 @@ hunter_add_version( e14fa072bd70b30eef47391cac637bdb4de9e8a3 ) +hunter_add_version( + PACKAGE_NAME + xfixes + VERSION + "5.0.3" + URL + "https://www.x.org/releases/individual/lib/libXfixes-5.0.3.tar.bz2" + SHA1 + ca86342d129c02435a9ee46e38fdf1a04d6b4b91 +) + hunter_configuration_types(xfixes CONFIGURATION_TYPES Release) hunter_pick_scheme(DEFAULT url_sha1_autotools) set(xfixes_dependencies @@ -34,12 +45,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 "4" 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 61289ff79..1efe7c86e 100644 --- a/cmake/projects/xgboost/hunter.cmake +++ b/cmake/projects/xgboost/hunter.cmake @@ -1,4 +1,5 @@ # Copyright (c) 2016, Ruslan Baratov +# Copyright (c) 2018, David Hirvonen # All rights reserved. # !!! DO NOT PLACE HEADER GUARDS HERE !!! @@ -8,6 +9,83 @@ include(hunter_cacheable) include(hunter_download) include(hunter_pick_scheme) +hunter_add_version( + PACKAGE_NAME + xgboost + VERSION + 0.7.0-p4 + URL + "https://github.com/hunter-packages/xgboost/archive/v0.7.0-p4.tar.gz" + SHA1 + 40b8b7d4ee7e3a8e96a52283e6a5b6a9a91865a4 +) + +hunter_add_version( + PACKAGE_NAME + xgboost + VERSION + 0.7.0-p3 + URL + "https://github.com/hunter-packages/xgboost/archive/v0.7.0-p3.tar.gz" + SHA1 + 7ebadc3214efedced7efa9eb1d79428595bf6b36 +) + +hunter_add_version( + PACKAGE_NAME + xgboost + VERSION + 0.7.0-p2 + URL + "https://github.com/hunter-packages/xgboost/archive/v0.7.0-p2.tar.gz" + SHA1 + 3dd1b94b940548e69ff9be5453af80e011a5a080 +) + +hunter_add_version( + PACKAGE_NAME + xgboost + VERSION + 0.7.0-p1 + URL + "https://github.com/hunter-packages/xgboost/archive/v0.7.0-p1.tar.gz" + SHA1 + 8d8f8597aa5464be7af52e36a20321e5ece1e84a +) + +hunter_add_version( + PACKAGE_NAME + xgboost + VERSION + 0.7.0-p0 + URL + "https://github.com/hunter-packages/xgboost/archive/v0.7.0-p0.tar.gz" + SHA1 + fc3f861acd16599b38d0c84a071f3098f9b1f629 +) + +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 + VERSION + 0.40-p5 + URL + "https://github.com/hunter-packages/xgboost/archive/v0.40-p5.tar.gz" + SHA1 + 14586ddbc9c4cd6b90d0e0afba2e443446c39f4c +) + hunter_add_version( PACKAGE_NAME xgboost @@ -41,6 +119,17 @@ hunter_add_version( dc1e21d0b023df87915c0140999286afed064c50 ) +hunter_add_version( + PACKAGE_NAME + xgboost + VERSION + 0.40-p10 + URL + "https://github.com/hunter-packages/xgboost/archive/v0.40-p10.tar.gz" + SHA1 + d51da15945bd10e964384278862473ad8e5dcbc7 +) + hunter_pick_scheme(DEFAULT url_sha1_cmake) hunter_cacheable(xgboost) hunter_download(PACKAGE_NAME xgboost) diff --git a/cmake/projects/xi/hunter.cmake b/cmake/projects/xi/hunter.cmake new file mode 100644 index 000000000..98f81f5c4 --- /dev/null +++ b/cmake/projects/xi/hunter.cmake @@ -0,0 +1,52 @@ +# 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_INTERNAL_DEPS_ID "1" + 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 5b37a675c..8f141cc3f 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 "2" 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 8e7e5a7b0..c99a36b8c 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 "2" 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 03aa2732d..847f61d6b 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) @@ -21,11 +22,28 @@ hunter_add_version( c424a09fa6f628e24eff74496acebef13e8093b9 ) +# https://www.x.org/releases/individual/util/ +hunter_add_version( + PACKAGE_NAME + xorg-macros + VERSION + "1.19.2" + URL + "https://www.x.org/releases/individual/util/util-macros-1.19.2.tar.bz2" + SHA1 + e8b3a6f2bfde22440fca0974da53da18821a4ee6 +) + 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 "3" PACKAGE_UNRELOCATABLE_TEXT_FILES "share/pkgconfig/xorg-macros.pc" ) diff --git a/cmake/projects/xproto/hunter.cmake b/cmake/projects/xproto/hunter.cmake index 4410f19a5..29a4a8504 100644 --- a/cmake/projects/xproto/hunter.cmake +++ b/cmake/projects/xproto/hunter.cmake @@ -22,16 +22,29 @@ hunter_add_version( 5d7f00d1dbe6cf8e725841ef663f0ee2491ba5b2 ) +# https://www.x.org/releases/individual/proto/ +hunter_add_version( + PACKAGE_NAME + xproto + VERSION + "7.0.31" + URL + "https://www.x.org/releases/individual/proto/xproto-7.0.31.tar.bz2" + SHA1 + 779fa333c5522cca40ca810c25a8fa60b6ccedfb +) + hunter_configuration_types(xproto CONFIGURATION_TYPES Release) hunter_pick_scheme(DEFAULT url_sha1_autotools) 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 "4" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/xproto.pc" ) diff --git a/cmake/projects/xrandr/hunter.cmake b/cmake/projects/xrandr/hunter.cmake index 0721bc567..ab94a08f2 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 "3" 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 e483f14ad..83d0bdb1e 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 "4" 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 b2e270449..50c41a374 100644 --- a/cmake/projects/xshmfence/hunter.cmake +++ b/cmake/projects/xshmfence/hunter.cmake @@ -22,6 +22,17 @@ hunter_add_version( a2ebe90e5595afca4db93a4359732af43b2b8c69 ) +hunter_add_version( + PACKAGE_NAME + xshmfence + VERSION + "1.3" + URL + "http://www.x.org/releases/individual/lib/libxshmfence-1.3.tar.bz2" + SHA1 + 3472218fc0e8ee8183533d22dbcd4bbe90bf3ab8 +) + hunter_configuration_types(xshmfence CONFIGURATION_TYPES Release) hunter_pick_scheme(DEFAULT url_sha1_autotools) set(xshmfence_dependencies @@ -35,7 +46,7 @@ hunter_cmake_args( hunter_cacheable(xshmfence) hunter_download( PACKAGE_NAME xshmfence - PACKAGE_INTERNAL_DEPS_ID "2" + PACKAGE_INTERNAL_DEPS_ID "4" 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 5020103ac..f8bcf4e54 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) @@ -21,11 +22,28 @@ hunter_add_version( b6ed421edf577816f6e641e1846dc0bff337676c ) +# https://www.x.org/releases/individual/lib/ +hunter_add_version( + PACKAGE_NAME + xtrans + VERSION + "1.4.0" + URL + "https://www.x.org/releases/individual/lib/xtrans-1.4.0.tar.bz2" + SHA1 + 7c490026efb450798e02b040c05eba5212291c08 +) + 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 "3" PACKAGE_UNRELOCATABLE_TEXT_FILES "share/pkgconfig/xtrans.pc" ) diff --git a/cmake/projects/xxf86vm/hunter.cmake b/cmake/projects/xxf86vm/hunter.cmake index 2e8b8b06d..7f2d33270 100644 --- a/cmake/projects/xxf86vm/hunter.cmake +++ b/cmake/projects/xxf86vm/hunter.cmake @@ -34,12 +34,14 @@ set(xxf86vm_dependencies ) hunter_cmake_args( xxf86vm - CMAKE_ARGS # do not use double quotes on CMAKE_ARGS - DEPENDS_ON_PACKAGES=${xxf86vm_dependencies} + CMAKE_ARGS + DEPENDS_ON_PACKAGES=${xxf86vm_dependencies} + PKGCONFIG_EXPORT_TARGETS=xxf86vm ) hunter_cacheable(xxf86vm) hunter_download( PACKAGE_NAME xxf86vm + PACKAGE_INTERNAL_DEPS_ID "2" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/libXxf86vm.la" "lib/pkgconfig/xxf86vm.pc" diff --git a/cmake/projects/xxhash/hunter.cmake b/cmake/projects/xxhash/hunter.cmake new file mode 100644 index 000000000..aba3e9fc6 --- /dev/null +++ b/cmake/projects/xxhash/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2018, 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 + xxhash + VERSION + 0.6.5-p0 + URL + "https://github.com/hunter-packages/xxHash/archive/0.6.5-p0.tar.gz" + SHA1 + 7d84575a45360d5c5c075ceb3fc1eb6b334aa5a4 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(xxhash) +hunter_download(PACKAGE_NAME xxhash) diff --git a/cmake/projects/yaml-cpp/hunter.cmake b/cmake/projects/yaml-cpp/hunter.cmake new file mode 100644 index 000000000..47d6aa71a --- /dev/null +++ b/cmake/projects/yaml-cpp/hunter.cmake @@ -0,0 +1,72 @@ +# !!! 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 + yaml-cpp + VERSION + "0.5.3" + URL + "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 + ) + +hunter_add_version( + PACKAGE_NAME + yaml-cpp + VERSION + "0.5.3-plus-p0" + URL + "https://github.com/hunter-packages/yaml-cpp/archive/release-0.5.3-plus-p0.zip" + SHA1 + 3f612ceea5c983748368b6a543678f3d77e5ecc8 + ) + +hunter_add_version( + PACKAGE_NAME + yaml-cpp + VERSION + "0.5.3-p4" + URL + "https://github.com/hunter-packages/yaml-cpp/archive/v0.5.3-p4.zip" + SHA1 + b8de7495113c6462216ebb6b123f1b71ea761bc9 + ) + +hunter_add_version( + PACKAGE_NAME + yaml-cpp + VERSION + "0.6.2-p0" + URL + "https://github.com/hunter-packages/yaml-cpp/archive/v0.6.2-p0.zip" + SHA1 + d024c6ecd7b2466f134353d99e9a1e08eb9f95c4 + ) + +hunter_add_version( + PACKAGE_NAME + yaml-cpp + VERSION + "0.6.2-0f9a586-p1" + URL + "https://github.com/hunter-packages/yaml-cpp/archive/v0.6.2-0f9a586-p1.zip" + SHA1 + 956C2B5FBF5AA0EB8EF5EF890C0328B3AA357A13 + ) + +hunter_cmake_args( + yaml-cpp + CMAKE_ARGS + YAML_CPP_BUILD_TESTS=OFF + YAML_CPP_BUILD_TOOLS=OFF + ) +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(yaml-cpp) +hunter_download(PACKAGE_NAME yaml-cpp) diff --git a/cmake/projects/zip/hunter.cmake b/cmake/projects/zip/hunter.cmake new file mode 100644 index 000000000..b85535811 --- /dev/null +++ b/cmake/projects/zip/hunter.cmake @@ -0,0 +1,31 @@ +# Copyright (c) 2016-2019, 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 + zip + VERSION + 0.1.15 + URL + "https://github.com/kuba--/zip/archive/v0.1.15.tar.gz" + SHA1 + f65b4fde71963de6c019413628022d316098c8d1 +) + +hunter_cmake_args( + zip + CMAKE_ARGS + CMAKE_DISABLE_TESTING=ON +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(zip) +hunter_download(PACKAGE_NAME zip) diff --git a/cmake/projects/zookeeper/hunter.cmake b/cmake/projects/zookeeper/hunter.cmake new file mode 100644 index 000000000..fdf935e2e --- /dev/null +++ b/cmake/projects/zookeeper/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 + zookeeper + VERSION + "3.4.9-p2" + URL + "https://github.com/hunter-packages/zookeeper/archive/3.4.9-p2.tar.gz" + SHA1 + ed8167bdc0eb08b967e091a4503f3373aad5dddc +) + +# Pick a download scheme +hunter_pick_scheme(DEFAULT url_sha1_cmake) # use scheme for cmake projects + +hunter_cacheable(zookeeper) +hunter_download(PACKAGE_NAME zookeeper) diff --git a/cmake/schemes/url_sha1_autogen_autotools.cmake.in b/cmake/schemes/url_sha1_autogen_autotools.cmake.in index 5f5164d9b..3cf7afbd5 100644 --- a/cmake/schemes/url_sha1_autogen_autotools.cmake.in +++ b/cmake/schemes/url_sha1_autogen_autotools.cmake.in @@ -8,7 +8,7 @@ list(APPEND CMAKE_MODULE_PATH "@HUNTER_SELF@/cmake/modules") include(hunter_user_error) include(hunter_status_debug) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) include(hunter_autotools_project) hunter_status_debug("Scheme: url_sha1_autogen_autotools") @@ -18,15 +18,19 @@ if("@MSVC@") endif() # 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_BUILD_DIR@") -hunter_test_string_not_empty("@HUNTER_PACKAGE_INSTALL_PREFIX@") -hunter_test_string_not_empty("@HUNTER_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_BUILD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_INSTALL_PREFIX@") + +foreach(dependency ${DEPENDS_ON_PACKAGES}) + hunter_add_package(${dependency}) +endforeach() hunter_autotools_project("@HUNTER_EP_NAME@" HUNTER_SELF @@ -52,3 +56,21 @@ hunter_autotools_project("@HUNTER_EP_NAME@" BOOTSTRAP "./autogen.sh" ) + +string(COMPARE EQUAL "${DEPENDS_ON_PKGCONFIGS}" "" default_pkgconfig) +if(NOT default_pkgconfig) + set(DEPENDS_ON_PACKAGES ${DEPENDS_ON_PKGCONFIGS}) +endif() + +set(PKG_GENERATE_SHARED "${BUILD_SHARED_LIBS}") + +foreach(PKG_CONFIG_MODULE ${PKGCONFIG_EXPORT_TARGETS}) + # Use: + # * DEPENDS_ON_PACKAGES + # * PKG_GENERATE_SHARED + 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_autotools.cmake.in b/cmake/schemes/url_sha1_autotools.cmake.in index 0792715b0..daacd8fff 100644 --- a/cmake/schemes/url_sha1_autotools.cmake.in +++ b/cmake/schemes/url_sha1_autotools.cmake.in @@ -8,7 +8,7 @@ include("@HUNTER_SELF@/cmake/Hunter") include(hunter_user_error) include(hunter_status_debug) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) include(hunter_autotools_project) hunter_status_debug("Scheme: url_sha1_autotools") @@ -22,15 +22,20 @@ foreach(dependency ${DEPENDS_ON_PACKAGES}) endforeach() # 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_BUILD_DIR@") -hunter_test_string_not_empty("@HUNTER_PACKAGE_INSTALL_PREFIX@") -hunter_test_string_not_empty("@HUNTER_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_BUILD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_INSTALL_PREFIX@") + +set( + HUNTER_PACKAGE_UNRELOCATABLE_TEXT_FILES + "@HUNTER_PACKAGE_UNRELOCATABLE_TEXT_FILES@" +) hunter_autotools_project("@HUNTER_EP_NAME@" HUNTER_SELF @@ -58,3 +63,21 @@ hunter_autotools_project("@HUNTER_EP_NAME@" BOOTSTRAP "${BOOTSTRAP}" ) + +string(COMPARE EQUAL "${DEPENDS_ON_PKGCONFIGS}" "" default_pkgconfig) +if(NOT default_pkgconfig) + set(DEPENDS_ON_PACKAGES ${DEPENDS_ON_PKGCONFIGS}) +endif() + +set(PKG_GENERATE_SHARED "${BUILD_SHARED_LIBS}") + +foreach(PKG_CONFIG_MODULE ${PKGCONFIG_EXPORT_TARGETS}) + # Use: + # * DEPENDS_ON_PACKAGES + # * PKG_GENERATE_SHARED + 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 49465d16b..4f489ec68 100644 --- a/cmake/schemes/url_sha1_cmake.cmake.in +++ b/cmake/schemes/url_sha1_cmake.cmake.in @@ -18,25 +18,26 @@ include(ExternalProject) # ExternalProject_Add list(APPEND CMAKE_MODULE_PATH "@HUNTER_SELF@/cmake/modules") include(hunter_status_debug) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) include(hunter_user_error) hunter_status_debug("Scheme: url_sha1_cmake") # 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_CACHE_FILE@") -hunter_test_string_not_empty("@HUNTER_ARGS_FILE@") -hunter_test_string_not_empty("@HUNTER_PACKAGE_LICENSE_FILE@") -hunter_test_string_not_empty("@CMAKE_GENERATOR@") -hunter_test_string_not_empty("${CMAKE_TOOLCHAIN_FILE}") +hunter_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_CONFIGURATION_TYPES@") +hunter_assert_not_empty_string("@HUNTER_CACHE_FILE@") +hunter_assert_not_empty_string("@HUNTER_ARGS_FILE@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_LICENSE_DIR@") +hunter_assert_not_empty_string("@CMAKE_GENERATOR@") +hunter_assert_not_empty_string("${CMAKE_TOOLCHAIN_FILE}") +hunter_assert_not_empty_string("@HUNTER_TLS_VERIFY@") if(IOS) if(CMAKE_VERSION VERSION_LESS 3.5) @@ -51,6 +52,22 @@ else() set(ios_opts "") endif() +# https://cmake.org/cmake/help/v3.4/release/3.4.html#modules +# https://cmake.org/cmake/help/v3.4/module/ExternalProject.html +if(CMAKE_VERSION VERSION_LESS 3.4) + set(uses_terminal "") +else() + set( + uses_terminal + USES_TERMINAL_DOWNLOAD 1 + USES_TERMINAL_UPDATE 1 + USES_TERMINAL_CONFIGURE 1 + USES_TERMINAL_BUILD 1 + USES_TERMINAL_TEST 1 + USES_TERMINAL_INSTALL 1 + ) +endif() + string(COMPARE NOTEQUAL "@HUNTER_JOBS_OPTION@" "" have_jobs) if(have_jobs) string(COMPARE NOTEQUAL "@XCODE_VERSION@" "" is_xcode) @@ -73,12 +90,32 @@ 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) endif() +string(COMPARE EQUAL "@HUNTER_PACKAGE_PROTECTED_SOURCES@" "" is_empty) +if(is_empty) + set(http_credentials "") +else() + set( + http_credentials + HTTP_USERNAME "@HUNTER_PACKAGE_HTTP_USERNAME@" + HTTP_PASSWORD "@HUNTER_PACKAGE_HTTP_PASSWORD@" + ) +endif() + +string(COMPARE NOTEQUAL "${CMAKE_MAKE_PROGRAM}" "" has_make) +if(has_make) + set(make_args "-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}") +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 @@ -94,47 +131,61 @@ foreach(configuration @HUNTER_PACKAGE_CONFIGURATION_TYPES@) 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}" URL @HUNTER_PACKAGE_URL@ URL_HASH SHA1=@HUNTER_PACKAGE_SHA1@ + ${http_credentials} DOWNLOAD_DIR "@HUNTER_PACKAGE_DOWNLOAD_DIR@" + TLS_VERIFY + "@HUNTER_TLS_VERIFY@" SOURCE_DIR "@HUNTER_PACKAGE_SOURCE_DIR@" 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}" ${ios_opts} INSTALL_COMMAND "@CMAKE_COMMAND@" --build . --target install --config ${configuration} - -- - ${jobs_option} COMMAND # Copy license files "@CMAKE_COMMAND@" + "-C@HUNTER_ARGS_FILE@" # for 'HUNTER_INSTALL_LICENSE_FILES' "-Dsrcdir=@HUNTER_PACKAGE_SOURCE_DIR@" - "-Ddstfile=@HUNTER_PACKAGE_LICENSE_FILE@" + "-Ddstdir=@HUNTER_PACKAGE_LICENSE_DIR@" -P "@HUNTER_SELF@/scripts/try-copy-license.cmake" LOG_BUILD ${log_build} LOG_INSTALL ${log_install} + ${uses_terminal} ) # Each external project must depends on previous one since they all use diff --git a/cmake/schemes/url_sha1_download.cmake.in b/cmake/schemes/url_sha1_download.cmake.in index f38a00e2e..49e7d446f 100644 --- a/cmake/schemes/url_sha1_download.cmake.in +++ b/cmake/schemes/url_sha1_download.cmake.in @@ -7,19 +7,21 @@ project(Hunter) list(APPEND CMAKE_MODULE_PATH "@HUNTER_SELF@/cmake/modules") include(hunter_fatal_error) +include(hunter_user_error) include(hunter_status_debug) include(hunter_status_print) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) hunter_status_debug("Scheme: url_sha1_download") # Check preconditions -hunter_test_string_not_empty("@HUNTER_EP_NAME@") -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_SHA1@") -hunter_test_string_not_empty("@HUNTER_PACKAGE_URL@") -hunter_test_string_not_empty("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") +hunter_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_TLS_VERIFY@") get_filename_component(filename "@HUNTER_PACKAGE_URL@" NAME) set(dest "@HUNTER_PACKAGE_DOWNLOAD_DIR@/${filename}") @@ -35,7 +37,7 @@ set(counter "") while(TRUE) string(COMPARE EQUAL "${counter}" "xxx" stop) if(stop) - hunter_fatal_error("Download failed") + hunter_user_error("Download failed") endif() if(EXISTS "${dest}") @@ -52,6 +54,7 @@ while(TRUE) SHOW_PROGRESS STATUS status LOG log + TLS_VERIFY "@HUNTER_TLS_VERIFY@" ) list(GET status 0 status_code) list(GET status 1 status_string) diff --git a/cmake/schemes/url_sha1_ios_sim.cmake.in b/cmake/schemes/url_sha1_ios_sim.cmake.in index 0261c906c..18d22fb43 100644 --- a/cmake/schemes/url_sha1_ios_sim.cmake.in +++ b/cmake/schemes/url_sha1_ios_sim.cmake.in @@ -10,19 +10,20 @@ list(APPEND CMAKE_MODULE_PATH "@HUNTER_SELF@/cmake/modules") include(hunter_fatal_error) include(hunter_status_debug) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) hunter_status_debug("Scheme: url_sha1_ios_sim") # 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_LICENSE_FILE@") +hunter_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_LICENSE_DIR@") +hunter_assert_not_empty_string("@HUNTER_TLS_VERIFY@") string(COMPARE NOTEQUAL "@HUNTER_JOBS_OPTION@" "" have_jobs) if(have_jobs) @@ -41,7 +42,7 @@ execute_process( if(NOT result EQUAL 0) hunter_fatal_error( "'xcrun -f clang++' failed" - WIKI "error.xcrun.clang" + ERROR_PAGE "error.xcrun.clang" ) endif() @@ -53,6 +54,8 @@ ExternalProject_Add( SHA1=@HUNTER_PACKAGE_SHA1@ DOWNLOAD_DIR "@HUNTER_PACKAGE_DOWNLOAD_DIR@" + TLS_VERIFY + "@HUNTER_TLS_VERIFY@" SOURCE_DIR "@HUNTER_PACKAGE_SOURCE_DIR@" INSTALL_DIR @@ -69,8 +72,9 @@ ExternalProject_Add( "@CMAKE_COMMAND@" -E copy build/Release/ios-sim "@HUNTER_PACKAGE_INSTALL_PREFIX@" COMMAND # Copy license files "@CMAKE_COMMAND@" + "-C@HUNTER_ARGS_FILE@" # for 'HUNTER_INSTALL_LICENSE_FILES' "-Dsrcdir=@HUNTER_PACKAGE_SOURCE_DIR@" - "-Ddstfile=@HUNTER_PACKAGE_LICENSE_FILE@" + "-Ddstdir=@HUNTER_PACKAGE_LICENSE_DIR@" -P "@HUNTER_SELF@/scripts/try-copy-license.cmake" ) diff --git a/cmake/schemes/url_sha1_pip.cmake.in b/cmake/schemes/url_sha1_pip.cmake.in new file mode 100644 index 000000000..4b1028f44 --- /dev/null +++ b/cmake/schemes/url_sha1_pip.cmake.in @@ -0,0 +1,147 @@ +# Copyright (c) 2019 Ruslan Baratov +# All rights reserved. + +cmake_minimum_required(VERSION 3.12) +project(Hunter) + +include(ExternalProject) + +include("@HUNTER_SELF@/cmake/Hunter") + +include(hunter_add_package) +include(hunter_assert_not_empty_string) +include(hunter_status_debug) + +hunter_status_debug("Scheme: url_sha1_pip") + +foreach(dependency ${DEPENDS_ON_PACKAGES}) + hunter_add_package(${dependency}) +endforeach() + +hunter_add_package(hunter_venv) +find_package(hunter_venv CONFIG REQUIRED) + +find_package(Python REQUIRED) +hunter_status_debug("Using Python: ${Python_EXECUTABLE}") +hunter_status_debug("Python_SITELIB: ${Python_SITELIB}") +hunter_status_debug("Root: ${HUNTER_VENV_ROOT}") + +hunter_status_debug("'pip' install suffix: ${HUNTER_VENV_INSTALL_SUFFIX}") + +# Check preconditions +hunter_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_LICENSE_DIR@") + +string(COMPARE EQUAL "@HUNTER_PACKAGE_PROTECTED_SOURCES@" "" is_empty) +if(is_empty) + set(http_credentials "") +else() + set( + http_credentials + HTTP_USERNAME "@HUNTER_PACKAGE_HTTP_USERNAME@" + HTTP_PASSWORD "@HUNTER_PACKAGE_HTTP_PASSWORD@" + ) +endif() + +if("@HUNTER_PACKAGE_LOG_BUILD@") + set(log_build 1) +else() + set(log_build 0) +endif() + +if("@HUNTER_PACKAGE_LOG_INSTALL@" OR "@HUNTER_SUPPRESS_LIST_OF_FILES@") + set(log_install 1) +else() + set(log_install 0) +endif() + +# Introduce variables: +# * CMAKE_INSTALL_LIBDIR +# * CMAKE_INSTALL_BINDIR +# * CMAKE_INSTALL_INCLUDEDIR +include(GNUInstallDirs) + +include(CMakePackageConfigHelpers) + +set(PROJECT_NAME "@HUNTER_EP_NAME@") +set(config_install_dir "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") + +set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated") +set(project_config "${generated_dir}/${PROJECT_NAME}Config.cmake") + +# Use variables: +# - PROJECT_NAME +configure_package_config_file( + "@HUNTER_SELF@/cmake/templates/pip_config.cmake.in" + "${project_config}" + INSTALL_DESTINATION "${config_install_dir}" +) + +if(HUNTER_STATUS_DEBUG) + set(pip_verbose "-vvv") +else() + set(pip_verbose "") +endif() + +ExternalProject_Add( + "@HUNTER_EP_NAME@" + URL + @HUNTER_PACKAGE_URL@ + URL_HASH + SHA1=@HUNTER_PACKAGE_SHA1@ + ${http_credentials} + DOWNLOAD_DIR + "@HUNTER_PACKAGE_DOWNLOAD_DIR@" + TLS_VERIFY + "@HUNTER_TLS_VERIFY@" + SOURCE_DIR + "@HUNTER_PACKAGE_SOURCE_DIR@" + INSTALL_DIR + "@HUNTER_PACKAGE_INSTALL_PREFIX@" + # not used, just avoid creating Install/ empty directory + CONFIGURE_COMMAND + "@CMAKE_COMMAND@" -E echo "Dummy configure step" + BUILD_COMMAND + "@CMAKE_COMMAND@" + -E + env + --unset=__PYVENV_LAUNCHER__ # macOS problems + ${Python_EXECUTABLE} + -m + pip + install + ${pip_verbose} + --target + "@HUNTER_PACKAGE_INSTALL_PREFIX@/${HUNTER_VENV_INSTALL_SUFFIX}" + --no-cache-dir # Do not touch user's '~/.cache/pip' + --no-deps # Dependencies managed by Hunter + --isolated # Run pip in an isolated mode, ignoring environment variables and user configuration. + "@HUNTER_PACKAGE_SOURCE_DIR@" + INSTALL_COMMAND + "@CMAKE_COMMAND@" + -E + make_directory + "@HUNTER_PACKAGE_INSTALL_PREFIX@/${config_install_dir}" + COMMAND + "@CMAKE_COMMAND@" + -E + copy + "${project_config}" + "@HUNTER_PACKAGE_INSTALL_PREFIX@/${config_install_dir}" + 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" + LOG_BUILD ${log_build} + LOG_INSTALL ${log_install} +) diff --git a/cmake/schemes/url_sha1_unpack.cmake.in b/cmake/schemes/url_sha1_unpack.cmake.in index 543aa3caa..b280c8c4d 100644 --- a/cmake/schemes/url_sha1_unpack.cmake.in +++ b/cmake/schemes/url_sha1_unpack.cmake.in @@ -21,17 +21,30 @@ include(ExternalProject) # ExternalProject_Add list(APPEND CMAKE_MODULE_PATH "@HUNTER_SELF@/cmake/modules") include(hunter_status_debug) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) hunter_status_debug("Scheme: url_sha1_unpack") # 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_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_LICENSE_DIR@") +hunter_assert_not_empty_string("@HUNTER_TLS_VERIFY@") + +string(COMPARE EQUAL "@HUNTER_PACKAGE_PROTECTED_SOURCES@" "" is_empty) +if(is_empty) + set(http_credentials "") +else() + set( + http_credentials + HTTP_USERNAME "@HUNTER_PACKAGE_HTTP_USERNAME@" + HTTP_PASSWORD "@HUNTER_PACKAGE_HTTP_PASSWORD@" + ) +endif() ExternalProject_Add( "@HUNTER_EP_NAME@" @@ -39,8 +52,11 @@ ExternalProject_Add( @HUNTER_PACKAGE_URL@ URL_HASH SHA1=@HUNTER_PACKAGE_SHA1@ + ${http_credentials} DOWNLOAD_DIR "@HUNTER_PACKAGE_DOWNLOAD_DIR@" + TLS_VERIFY + "@HUNTER_TLS_VERIFY@" SOURCE_DIR "@HUNTER_PACKAGE_SOURCE_DIR@" INSTALL_DIR @@ -50,5 +66,11 @@ ExternalProject_Add( BUILD_COMMAND "" INSTALL_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/schemes/url_sha1_unpack_bin_install.cmake.in b/cmake/schemes/url_sha1_unpack_bin_install.cmake.in new file mode 100644 index 000000000..a80cbe576 --- /dev/null +++ b/cmake/schemes/url_sha1_unpack_bin_install.cmake.in @@ -0,0 +1,50 @@ +# 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_assert_not_empty_string) + +hunter_status_debug("Scheme: url_sha1_unpack_bin_install") + +# Check preconditions +hunter_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_TLS_VERIFY@") + +ExternalProject_Add( + "@HUNTER_EP_NAME@" + URL + "@HUNTER_PACKAGE_URL@" + URL_HASH + SHA1=@HUNTER_PACKAGE_SHA1@ + DOWNLOAD_DIR + "@HUNTER_PACKAGE_DOWNLOAD_DIR@" + TLS_VERIFY + "@HUNTER_TLS_VERIFY@" + 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/schemes/url_sha1_unpack_install.cmake.in b/cmake/schemes/url_sha1_unpack_install.cmake.in index 360a169a1..8837966ae 100644 --- a/cmake/schemes/url_sha1_unpack_install.cmake.in +++ b/cmake/schemes/url_sha1_unpack_install.cmake.in @@ -8,19 +8,20 @@ cmake_minimum_required(VERSION 3.0) list(APPEND CMAKE_MODULE_PATH "@HUNTER_SELF@/cmake/modules") include(hunter_status_debug) -include(hunter_test_string_not_empty) +include(hunter_assert_not_empty_string) hunter_status_debug("Scheme: url_sha1_unpack_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@") -hunter_test_string_not_empty("@HUNTER_PACKAGE_LICENSE_FILE@") +hunter_assert_not_empty_string("@HUNTER_SELF@") +hunter_assert_not_empty_string("@HUNTER_EP_NAME@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_INSTALL_PREFIX@") +hunter_assert_not_empty_string("@HUNTER_PACKAGE_LICENSE_DIR@") +hunter_assert_not_empty_string("@HUNTER_TLS_VERIFY@") include(ExternalProject) # ExternalProject_Add @@ -32,6 +33,8 @@ ExternalProject_Add( SHA1=@HUNTER_PACKAGE_SHA1@ DOWNLOAD_DIR "@HUNTER_PACKAGE_DOWNLOAD_DIR@" + TLS_VERIFY + "@HUNTER_TLS_VERIFY@" SOURCE_DIR "@HUNTER_PACKAGE_SOURCE_DIR@" INSTALL_DIR @@ -47,8 +50,9 @@ ExternalProject_Add( -P "@HUNTER_SELF@/scripts/copy-files.cmake" COMMAND # Copy license files "@CMAKE_COMMAND@" + "-C@HUNTER_ARGS_FILE@" # for 'HUNTER_INSTALL_LICENSE_FILES' "-Dsrcdir=@HUNTER_PACKAGE_SOURCE_DIR@" - "-Ddstfile=@HUNTER_PACKAGE_LICENSE_FILE@" + "-Ddstdir=@HUNTER_PACKAGE_LICENSE_DIR@" -P "@HUNTER_SELF@/scripts/try-copy-license.cmake" ) diff --git a/cmake/templates/BoostConfig.cmake.in b/cmake/templates/BoostConfig.cmake.in index 9c3b8c6c9..039647b0f 100644 --- a/cmake/templates/BoostConfig.cmake.in +++ b/cmake/templates/BoostConfig.cmake.in @@ -1,6 +1,8 @@ # Copyright (c) 2015, Ruslan Baratov # All rights reserved. +include(hunter_check_toolchain_definition) + if(HUNTER_ENABLED) include(hunter_internal_error) include(hunter_status_debug) @@ -34,9 +36,18 @@ endfunction(hunter_add_rt_library) hunter_status_debug("Boost find config") -set(Boost_USE_STATIC_LIBS ON) +set(Boost_USE_STATIC_LIBS @BOOST_BUILD_STATIC@) set(Boost_NO_BOOST_CMAKE YES) +if(MSVC) + hunter_check_toolchain_definition(NAME "_DLL" DEFINED _hunter_vs_md) + if(_hunter_vs_md) + set(Boost_USE_STATIC_RUNTIME NO) + else() + set(Boost_USE_STATIC_RUNTIME YES) + endif() +endif() + find_package(Boost MODULE REQUIRED ${Boost_FIND_COMPONENTS}) get_filename_component( @@ -51,11 +62,18 @@ if(NOT TARGET "Boost::boost") INTERFACE_INCLUDE_DIRECTORIES "${_root_path}/include" ) if(MSVC) + #stop MSVC from trying to auto-link libs + set(compile_definitions "BOOST_ALL_NO_LIB=1") + if(@BOOST_ALL_DYN_LINK@) #required for MSVC when using shared libs + list(APPEND compile_definitions "BOOST_ALL_DYN_LINK") + endif() + set_target_properties( - "Boost::boost" - PROPERTIES - INTERFACE_COMPILE_DEFINITIONS "BOOST_ALL_NO_LIB=1" + "Boost::boost" + PROPERTIES + INTERFACE_COMPILE_DEFINITIONS "${compile_definitions}" ) + endif() endif() @@ -113,6 +131,15 @@ foreach(_boost_component ${Boost_FIND_COMPONENTS}) IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX" IMPORTED_LOCATION_RELEASE "${_lib_release}" ) + + # Use Release version of library for MinSizeRel/RelWithDebInfo. + # TODO: how to deal with other (custom) build types? + set_target_properties( + "${_boost_lib}" + PROPERTIES + MAP_IMPORTED_CONFIG_MINSIZEREL Release + MAP_IMPORTED_CONFIG_RELWITHDEBINFO Release + ) endif() endforeach() @@ -134,3 +161,10 @@ endif() if(TARGET Boost::chrono) hunter_add_rt_library(Boost::chrono) endif() + +if(TARGET Boost::log AND "@BUILD_SHARED_LIBS@") + set_property( + TARGET "Boost::log" + APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS BOOST_LOG_DYN_LINK + ) +endif() diff --git a/cmake/templates/libxml2Config.cmake.in b/cmake/templates/libxml2Config.cmake.in new file mode 100644 index 000000000..cda4229ea --- /dev/null +++ b/cmake/templates/libxml2Config.cmake.in @@ -0,0 +1,29 @@ +if(HUNTER_ENABLED) + include(hunter_internal_error) + include(hunter_status_debug) +else() + function(hunter_internal_error) + message(FATAL_ERROR ${ARGV}) + endfunction() + + function(hunter_status_debug) + message(${ARGV}) + endfunction() +endif() + +get_filename_component(_install_dir "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE) + +add_library("libxml2::libxml2" STATIC IMPORTED) +set_target_properties(libxml2::libxml2 PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_install_dir}/include/libxml2" + @TARGET_INTERFACE_COMPILE_DEFINITIONS@ +) + +# Get all libxml2Targets-*.cmake files +get_filename_component(_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) +file(GLOB TARGET_FILES "${_DIR}/libxml2Targets-*.cmake") +foreach(file ${TARGET_FILES}) + include(${file}) +endforeach() + +set(LIBXML2_LIBRARIES libxml2::libxml2) diff --git a/cmake/templates/libxml2Targets.cmake.in b/cmake/templates/libxml2Targets.cmake.in new file mode 100644 index 000000000..6f2bb1f96 --- /dev/null +++ b/cmake/templates/libxml2Targets.cmake.in @@ -0,0 +1,15 @@ +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +get_filename_component(_install_dir "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE) + +set_property(TARGET libxml2::libxml2 APPEND PROPERTY IMPORTED_CONFIGURATIONS @TARGET_CONFIGURATION@) +set_target_properties(libxml2::libxml2 PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_@TARGET_CONFIGURATION@ "C" + IMPORTED_LOCATION_@TARGET_CONFIGURATION@ "${_install_dir}/lib/@TARGET_LIB_FILE@" +) + +set(LIBXML2_LIBRARY_@TARGET_CONFIGURATION@ "${_install_dir}/lib/@TARGET_LIB_FILE@") + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) diff --git a/cmake/templates/pip_config.cmake.in b/cmake/templates/pip_config.cmake.in new file mode 100644 index 000000000..8feb3234e --- /dev/null +++ b/cmake/templates/pip_config.cmake.in @@ -0,0 +1,5 @@ +@PACKAGE_INIT@ + +find_package(hunter_venv CONFIG REQUIRED) + +check_required_components("@PROJECT_NAME@") diff --git a/docs/conf.py b/docs/conf.py index 279995dee..0fad198a8 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-2019, 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. @@ -100,7 +100,7 @@ #show_authors = False # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' +pygments_style = 'default' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] diff --git a/docs/contacts.rst b/docs/contacts.rst index c4906a542..7efb1baf9 100644 --- a/docs/contacts.rst +++ b/docs/contacts.rst @@ -1,26 +1,30 @@ -.. Copyright (c) 2016, Ruslan Baratov +.. Copyright (c) 2016-2019, Ruslan Baratov .. All rights reserved. +.. spelling:: + + Gitter + refactor + spam + Contacts -------- Public ====== -Feel free to open new `issue`_ if you want to ask any questions. - -Public chat room: |gitter| +* Project is **closed** for public contributions Private ======= -You can write me to ``ruslan_baratov@yahoo.com`` or contact me using `Tox`_: - -* ``7EBD836B7690C3742E6F3632742BEB00283529E06D76E06F7065544A5F9C6F37D948FB0F754B`` -* ``4EED21EA40B0351D8BFC85A69499A3F7CFEDA6844DA39FF1783A4D9827423F075D7194707C43`` +* Write me at ruslan_baratov@yahoo.com +* Private chat room on Gitter: https://gitter.im/ruslo -.. _issue: https://github.com/ruslo/hunter/issues/new -.. _Tox: https://tox.chat +Hire +==== -.. |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 +I’m available for hire as a freelance developer for all types of Hunter +development (add/maintain/update package, fix bugs, design/implement +new features, etc.) or CMake development (introduce configuration from +scratch, refactor existing code, hunterize, etc.). diff --git a/docs/contributing.rst b/docs/contributing.rst index f9e3e1011..360818a0e 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -1,7 +1,116 @@ .. 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. + +.. note:: + + If you're planning to introduce nontrivial feature it's better to + discuss design first, it will save a lot of time for both you and developers. + +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. + E.g. 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; + } + +* If you are experiencing some download error please check F.A.Q.: + :doc:`How to fix download error? ` + +If everything seems OK: + +* Run build again with :ref:`HUNTER_STATUS_DEBUG=ON ` +* Make sure you're not using :ref:`HUNTER_NO_TOOLCHAIN_ID_RECALCULATION ` +* 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 +* Check this document if the first error you see is ``external.build.failed``: + + * https://docs.hunter.sh/en/latest/reference/errors/error.external.build.failed.html +* Remove irrelevant code from your example and report one problem at a time. + Try to construct `SSCCE `__. If you need more files + than just ``CMakeLists.txt`` it's better to create separate GitHub repository + for easy copying of your example. It will be nice if you can reproduce the + issue with the CI system like AppVeyor/Travis. + +* **Do not remove** ``~/.hunter`` repository to try to fix the issue! Hunter + designed to be correct and reproducible, there should be no stale/rotten + artifacts inside that can affect his work. If the ``rm -rf ~/.hunter`` step + fix the issue for you it means that either you are using Hunter wrongly or + there is a bug somewhere. If you want to figure out what is the origin + of the problem please do keep ``~/.hunter`` directory. + +* 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. + + .. code-block:: none + + cmake -H. -B_builds "-GVisual Studio 14 2015" + + * Are you using toolchain? + * Add log until **first error** reported by Hunter diff --git a/docs/creating-new.rst b/docs/creating-new.rst index 2f3e58bd7..ad3aa6828 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 008ac4115..000000000 --- a/docs/creating-new/cmake-dependencies.rst +++ /dev/null @@ -1,109 +0,0 @@ -.. Copyright (c) 2016, Ruslan Baratov -.. All rights reserved. - -CMake (with dependencies) -------------------------- - -If your project use external packages (i.e. has command ``find_package(Foo)``) -you need to patch it first so this packages can be found in Hunter root -directory instead of standard one: - -.. code-block:: cmake - :emphasize-lines: 1 - - hunter_add_package(Foo) - find_package(Foo) - -.. _dependencies conflict: - -Conflict -======== - -The reason is that if one package will be found in standard location and other -in Hunter they may conflict with each other. - -Consider next example. Project ``Roo`` is not aware about Hunter custom -locations. It just using regular ``find_package``: - -.. code-block:: cmake - - # Roo/CMakeLists.txt - - find_package(ZLIB) - -Project ``Bar`` depends on ``ZLIB`` and ``Roo``. Both packages 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 ``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 SHA1 of Hunter archive in ``HunterGate`` commands of ``Bar`` and -``Roo`` can be different. Same location will be set automatically internally -you don't have to manage it manually. - -Maintenance -=========== - -On practice patching require to have a fork of a project. In general it -doesn't matter where fork is located but 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 corresponding issue -with `"new package" label`_, I will create a new team and add you so you can -push changed. New branch ``hunter`` will be created 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 contains 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 do maintain all packages on practice so -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 designed to have **zero maintenance** for such task 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 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 774a1b246..000000000 --- a/docs/creating-new/cmake.rst +++ /dev/null @@ -1,9 +0,0 @@ -.. Copyright (c) 2016, Ruslan Baratov -.. All rights reserved. - -CMake (no dependencies) ------------------------ - -* How to add a new `CMake project`_ - -.. _CMake project: https://github.com/ruslo/hunter/wiki/usr.adding.new.package diff --git a/docs/creating-new/create.rst b/docs/creating-new/create.rst new file mode 100644 index 000000000..b946279a8 --- /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 000000000..71c3a9d8f --- /dev/null +++ b/docs/creating-new/create/autotools.rst @@ -0,0 +1,146 @@ +.. 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) + +Extra flags for configure +------------------------- + +It is possible to add extra flags for ``./configure`` step both globally +in ``cmake/projects//hunter.cmake``: + +.. code-block:: cmake + + hunter_cmake_args( + foo + CMAKE_ARGS + EXTRA_FLAGS=--enable-x + ) + +and locally in ``cmake/Hunter/config.cmake``: + +.. code-block:: cmake + + hunter_config( + foo + VERSION + ${HUNTER_foo_VERSION} + CMAKE_ARGS + EXTRA_FLAGS=--enable-y + ) + +If you use local approach then any flags from global configuration will be +ignored, i.e. if you want to have both global ``--enable-x`` and local +``--enable-y`` then you have to set them explicitly: + +.. code-block:: cmake + + hunter_config( + foo + VERSION + ${HUNTER_foo_VERSION} + CMAKE_ARGS + EXTRA_FLAGS=--enable-x --enable-y + ) 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 000000000..4c8bef587 --- /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 000000000..b63a034e5 --- /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 000000000..ed6a98fc7 --- /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 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 000000000..f5c43b4f5 --- /dev/null +++ b/docs/creating-new/create/cmake.rst @@ -0,0 +1,982 @@ +.. Copyright (c) 2016, Ruslan Baratov +.. All rights reserved. + +.. _cmake-simple: + +CMake (no dependencies) +----------------------- + +If your CMake code is correctly written and has no dependencies then release +with sources can be used **as is** in Hunter. There is no need to have +``HunterGate``/``hunter_add_package`` calls and no need to have a maintenance fork. + +Examples of such packages: + +* :ref:`pkg.flatbuffers` + + * https://github.com/google/flatbuffers + * See `flatbuffers/hunter.cmake `__ + * Testing table: `AppVeyor `__, `Travis `__ + +* :ref:`pkg.rocksdb` + + * https://github.com/facebook/rocksdb + * See `rocksdb/hunter.cmake `__ + * Testing table: `Travis `__ + +* :ref:`pkg.nlohmann_json` + + * https://github.com/nlohmann/json + * See `nlohmann_json/hunter.cmake `__ + * Testing table: `AppVeyor `__, `Travis `__ + +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 `__ + +.. _create new install xxxconfig: + +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) + +Consistency +=========== + +Please keep Git tag and ``VERSION`` in consistent state. +For example if ``URL`` is: + +.. code-block:: cmake + :emphasize-lines: 3-4 + + hunter_add_version( + # ... + URL + "https://github.com/hunterbox/hunter_box_1/archive/v1.3.15-da39a3e-p6.tar.gz" + # ... + ) + +Then ``VERSION`` should be: + +.. code-block:: cmake + :emphasize-lines: 3-4 + + hunter_add_version( + # ... + VERSION + 1.3.15-da39a3e-p6 + URL + "https://github.com/hunterbox/hunter_box_1/archive/v1.3.15-da39a3e-p6.tar.gz" + # ... + ) + +CMake options +============= + +Note that it does not make sense to build and install stuff like examples, +tests or documentation. Please check that your package has CMake options to +disable those. If such an option is not disabled by default use +``hunter_cmake_args``: + +.. code-block:: cmake + :emphasize-lines: 1, 6, 9-11 + + include(hunter_cmake_args) + + # ... + + # 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 a build type explicitly. If the package does not + work with default ``Debug`` + ``Release`` it means something is wrong with + the 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_default_version`` directive with default version to +``cmake/configs/default.cmake``: + +.. code-block:: cmake + + hunter_default_version(hunter_box_1 VERSION 1.0.0) + +Create example +============== + + To test the integration of the package into another project a simple example will be used. + Copy the 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 +names of imported targets. + +Add documentation +================= + +Each package should have a +:doc:`page with information and usage example `. + +To create such a page copy the template file and substitute all strings ``foo`` with +the project name (for example ``hunter_box_1``): + +.. 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 +``single: unsorted ; foo``. This tag will be used on +:ref:`this page `. + +If you want to have two tags add another line with ``single``: + +.. code-block:: none + + .. index:: + single: category_1 ; foo + single: category_2 ; foo + +.. seealso:: + + * `Gentoo packages `__ + * `Ubuntu packages `__ + +.. note:: + + Since you don't know the pull request number a priori leave it as ``N`` for now. + You can update it later. + +To locally check if the documentation is still building you can run: + +.. code-block:: none + + [hunter]> cd docs + [hunter/docs]> source ./jenkins.sh + (_venv) [hunter/docs]> ./make.sh + +If the documentation contains spelling errors or unrecognized names, the +documentation test build will fail and report the unrecognized strings. Fix +any spelling errors and test the build again. Any remaining errors can be +fixed by adding all correct but unrecognized names, string, or terms to the +``spelling`` header at the top of the document entry +``docs/packages/pkg/bar-baz.rst``. In this example, +``bar-baz`` would be a package name that is not in the dictionary. + +.. code-block:: none + :emphasize-lines: 1-4 + + .. spelling:: + + bar + baz + + .. index:: + single: unsorted ; bar-baz + + .. _pkg.bar-baz: + +Add entries for each term until the test build completes successfully. + +Common mistake +============== + +Please do not forget to substitute ``===``. + +Good: + +.. code-block:: none + + hunter_box_1 + ============ + +Bad: + +.. code-block:: none + + hunter_box_1 + === + +Commit +====== + +Now save all changes by doing a 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: + +Testing locally +=============== + +This step is optional since we will run tests on the CI server. However it's the +fastest way to check that everything is ready and working correctly. + +Script ``jenkins.py`` will package a temporary Hunter archive based on current +state and build the specified example. This script uses +`Polly `__ toolchains. + +Check you have Python 3 installed, clone Polly, add its ``bin`` folder to +``PATH`` environment variable, go back to Hunter repository and run test. + +On Linux: + +.. code-block:: none + + > which python3 + /usr/bin/python3 + + > git clone https://github.com/ruslo/polly + > cd polly + [polly]> export PATH="`pwd`/bin:$PATH" + + > cd hunter + [hunter]> which polly.py + /.../bin/polly.py + + [hunter]> polly.py --help + Python version: 3.5 + usage: polly.py [-h] + ... + + [hunter]> TOOLCHAIN=gcc PROJECT_DIR=examples/hunter_box_1 ./jenkins.py + +On Windows: + +.. code-block:: none + + > git clone https://github.com/ruslo/polly + > cd polly + [polly]> set PATH=%CD%\bin;%PATH% + + > cd hunter + [hunter]> where polly.py + C:\...\bin\polly.py + + [hunter]> polly.py --help + Python version: 3.5 + usage: polly.py [-h] + ... + + [hunter]> set TOOLCHAIN=vs-12-2013 + [hunter]> set PROJECT_DIR=examples\hunter_box_1 + [hunter]> .\jenkins.py + +.. admonition:: Stackoverflow + + * `How to execute Python scripts in Windows? `__ + +.. _ci testing: + +CI testing +========== + +Now let's run tests on continuous integration servers with various toolchains +and platforms. Hunter uses `AppVeyor `__ to test for +Windows (Visual Studio, NMake, Ninja, MinGW, MSYS) and +`Travis `__ to test +for Linux (GCC, Clang, Android, Clang Analyzer, Sanitize Address, Sanitize Leak) +and for macOS (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 the ``.travis.yml`` file which will only check +if the documentation is building: + +* https://github.com/ruslo/hunter/blob/ea9de264d6c1b05484bdc16a9967c3cb8cca9048/.travis.yml#L57-L59 + +When you open a pull request to ``ruslo/hunter`` this test will automatically run. + +Branch pkg.template +=================== + +* Name: ``pkg.template`` +* Repository: https://github.com/ingenue/hunter +* Testing: *Nothing* + +In branch ``pkg.template`` of the repository ``ingenue/hunter`` there are +the **template** files ``.travis.yml`` and ``appveyor.yml``: + +* 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 differences +between ``master`` and ``pkg.template`` are the files ``.travis.yml``/``appveyor.yml``. + +Branch pkg. +================= + +Branch for testing package ````. + +* Name: ``pkg.`` +* Repository: https://github.com/ingenue/hunter +* Testing: Package ```` on Windows/Linux/macOS 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 differences between ``pkg.template`` and ``pkg.`` are +the files ``travis.yml``/``appveyor.yml``. + +Branch upload. +==================== + +Branch for uploads. + +* Name: ``upload.`` +* Repository: https://github.com/ingenue/hunter +* Testing: Upload archives with binaries to cache-server + +After successful tests on ``pkg.`` the 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 +the build command: ``jenkins.py`` vs. ``jenkins.py --upload``. + +Branches structure +================== + +Here is an image showing the structure of the branches: + +.. image:: /creating-new/images/branches.png + :align: center + :alt: Branches + +Fetch CI configs +================ + +Since we are adding a new package we have to create new CI configs for it. +Fetch the branch ``pkg.template`` 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 +================ + +Currently we have two new branches: + +* ``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 + +Fix AppVeyor path too long error +================================ + +If you see error + +.. code-block:: none + + -- The C compiler identification is unknown + -- The CXX compiler identification is unknown + +or + +.. code-block:: none + + ...: error MSB3491: Could not write lines to file "...". + The specified path, file name, or both are too long. The fully qualified file + name must be less than 260 characters, and the directory name must be less than + 248 characters + +on Windows build, adding :ref:`HUNTER_BINARY_DIR ` +environment variable should help: + +.. code-block:: yaml + :emphasize-lines: 4 + + - TOOLCHAIN: "vs-15-2017-win64-cxx17" + PROJECT_DIR: examples\SuiteSparse + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + HUNTER_BINARY_DIR: C:\__BIN + +Example: + +* https://github.com/ingenue/hunter/blob/05bd9cdbd03a5772302c65abb9119722b9b8e08c/appveyor.yml#L21-L24 + +Fix Travis log too long error +============================= + +If you see error + +.. code-block:: none + + The job exceeded the maximum log length, and has been terminated. + +Adding ``VERBOSE=0`` environment variable should help: + +.. code-block:: yaml + :emphasize-lines: 5 + + - os: linux + env: > + TOOLCHAIN=android-ndk-r17-api-24-arm64-v8a-clang-libcxx14 + PROJECT_DIR=examples/OpenCV + VERBOSE=0 + +Example: + +* https://github.com/ingenue/hunter/blob/92cb26bd0bc5eeb14525f56b3a068fb072e2e5a1/.travis.yml#L55-L59 + +Workaround for GCC internal error +================================= + +Travis machines have 32 logical cores and Hunter will use all of them by default +(e.g. build with ``make -j32``). Because of this system may run out of memory +and GCC may get killed: + +.. code-block:: none + + g++-7: internal compiler error: Killed (program cc1plus) + +As a workaround you can limit number of jobs explicitly by adding +the :ref:`HUNTER_JOBS_NUMBER ` environment variable: + +.. code-block:: yaml + :emphasize-lines: 5 + + - os: linux + env: > + TOOLCHAIN=gcc-7-cxx17 + PROJECT_DIR=examples/mkldnn + HUNTER_JOBS_NUMBER=4 + +Example: + +* https://github.com/ingenue/hunter/blob/c1e12ba21940b8418d1e3d596b653ad3bf588e11/.travis.yml#L41-L45 + +.. admonition:: Stackoverflow + + * https://stackoverflow.com/a/35011967 + +Excluding tests +=============== + +If all tests passed you can skip this section. + +If some toolchains are working and some toolchains failed it means the 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 +toolchains and you or somebody else can apply fixes later. + +Please follow these guidelines when disabling toolchains: + +- **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 toolchain is left for ``.travis.yml`` or ``appveyor.yml`` then +comment out everything and add ``TOOLCHAIN=dummy`` test (see +`example `__). + +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 all tests pass the 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 + +Badge +===== + +Badge in ``README.rst`` can signal that package ``hunter_box_1`` is available +via Hunter: + +.. code-block:: none + + |hunter| + + .. |hunter| image:: https://img.shields.io/badge/hunter-hunter_box_1-blue.svg + :target: https://docs.hunter.sh/en/latest/packages/pkg/hunter_box_1.html + :alt: Hunter + +Example: + +* https://github.com/hunter-packages/gauze/blob/master/README.rst diff --git a/docs/creating-new/create/custom.rst b/docs/creating-new/create/custom.rst new file mode 100644 index 000000000..95fa7a6dd --- /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_assert_not_empty_string) + + # print this message if HUNTER_STATUS_DEBUG option is ON + hunter_status_debug("Scheme: url_sha1_ios_sim") + + # Check variables is not empty + hunter_assert_not_empty_string("@HUNTER_SELF@") + hunter_assert_not_empty_string("@HUNTER_EP_NAME@") + hunter_assert_not_empty_string("@HUNTER_PACKAGE_URL@") + hunter_assert_not_empty_string("@HUNTER_PACKAGE_SHA1@") + hunter_assert_not_empty_string("@HUNTER_PACKAGE_DOWNLOAD_DIR@") + hunter_assert_not_empty_string("@HUNTER_PACKAGE_SOURCE_DIR@") + hunter_assert_not_empty_string("@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_default_version(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 323a697b1..000000000 --- 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 000000000..875c6d358 --- /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_default_version(Foo VERSION 1.0.0) +# hunter_default_version(Boo VERSION 1.2.3z CMAKE_ARGS BOO_WITH_A=ON) + +# Wiki: +# * https://github.com/ruslo/hunter/wiki/dev.modules#hunter_default_version + +include(hunter_default_version) +include(hunter_user_error) + +# NOTE: no names with spaces! + +hunter_default_version(AllTheFlopsThreads VERSION 0.1-p0) +hunter_default_version(Android-Apk VERSION 1.1.13) +hunter_default_version(Android-Build-Tools VERSION 22.0.1) +hunter_default_version(Android-Google-Repository VERSION 47) +hunter_default_version(Android-Modules VERSION 1.0.0) +hunter_default_version(Android-SDK VERSION 0.0.5) +hunter_default_version(Android-SDK-Platform-tools VERSION r25.0.5) +hunter_default_version(Android-SDK-Tools VERSION 25.2.5) +hunter_default_version(Android-Support-Repository VERSION 47) +hunter_default_version(ARM_NEON_2_x86_SSE VERSION 1.0.0-p0) +hunter_default_version(ArrayFire VERSION 3.3.1-p0) +hunter_default_version(Assimp VERSION 3.2-p1) +hunter_default_version(Async++ VERSION 0.0.3-hunter) +hunter_default_version(Avahi VERSION 0.6.31) +hunter_default_version(Beast VERSION 1.0.0-b84-hunter-0) +hunter_default_version(BZip2 VERSION 1.0.6-p3) +if(MSVC OR MINGW) + # FIXME: https://ci.appveyor.com/project/ingenue/hunter/build/1.0.2229 + hunter_default_version(Boost VERSION 1.64.0) +else() + hunter_default_version(Boost VERSION 1.65.0) +endif() +hunter_default_version(BoostCompute VERSION 0.5-p0) +hunter_default_version(BoostProcess VERSION 0.5) +hunter_default_version(CapnProto VERSION 0.6.1) +hunter_default_version(CLAPACK VERSION 3.2.1) +hunter_default_version(CURL VERSION 7.49.1-DEV-v8) +hunter_default_version(Clang VERSION 4.0.1-p0) +hunter_default_version(ClangToolsExtra VERSION 4.0.1) # Clang +hunter_default_version(Comet VERSION 4.0.2) +hunter_default_version(CppNetlib VERSION 0.10.1-hunter-3) +hunter_default_version(CppNetlibUri VERSION 1.0.4-hunter) +hunter_default_version(CsvParserCPlusPlus VERSION 1.0.1) +hunter_default_version(Eigen VERSION 3.3.4-p0) +hunter_default_version(enet VERSION 1.3.13-p1) +hunter_default_version(Expat VERSION 2.1.1) +if(MSVC) + hunter_default_version(getopt VERSION 1.0.0-p0) +endif() +hunter_default_version(GPUImage VERSION 0.1.6-p6) +hunter_default_version(GSL VERSION 2.1.0-p2) +hunter_default_version(Igloo VERSION 1.1.1-hunter) +hunter_default_version(intsizeof VERSION 2.0.1) +hunter_default_version(Jpeg VERSION 9b-p3) +hunter_default_version(JsonSpirit VERSION 0.0.4-hunter) +if(MSVC_VERSION LESS 1600) + # for VS10 - version without support C++11 + hunter_default_version(jsoncpp VERSION 0.7.0) +else() + hunter_default_version(jsoncpp VERSION 1.8.0) +endif() +hunter_default_version(LAPACK VERSION 3.7.1) +hunter_default_version(LLVM VERSION 4.0.1-p0) # Clang +hunter_default_version(LLVMCompilerRT VERSION 4.0.1-patched) # Clang +hunter_default_version(Leathers VERSION 0.1.6) +hunter_default_version(Leptonica VERSION 1.74.2-p4) +hunter_default_version(Libcxx VERSION 3.6.2) # Clang +hunter_default_version(Libcxxabi VERSION 3.6.2) # Clang +hunter_default_version(librtmp VERSION 2.4.0-p0) +hunter_default_version(Libssh2 VERSION 1.7.0) +hunter_default_version(Lua VERSION 5.3.2) +hunter_default_version(MySQL-client VERSION 6.1.9-p0) +hunter_default_version(NASM VERSION 2.12.02) +hunter_default_version(OpenBLAS VERSION 0.2.20-p0) +hunter_default_version(OpenCL VERSION 2.1-p3) +hunter_default_version(OpenCL-cpp VERSION 2.0.10-p0) +hunter_default_version(OpenCV VERSION 3.3.0-p2) +hunter_default_version(OpenCV-Extra VERSION 3.3.0) +hunter_default_version(OpenNMTTokenizer VERSION 0.2.0-p1) +if(MSVC) + # FIXME: https://ci.appveyor.com/project/ingenue/hunter/build/1.0.1470 + hunter_default_version(OpenSSL VERSION 1.0.2l) +else() + hunter_default_version(OpenSSL VERSION 1.1.0f) +endif() +hunter_default_version(PNG VERSION 1.6.26-p1) +hunter_default_version(PocoCpp VERSION 1.7.8-p0) +hunter_default_version(PostgreSQL VERSION 9.6.3) +hunter_default_version(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_default_version(Qt VERSION 5.5.1-cvpixelbuffer-2-p9) +else() + hunter_default_version(Qt VERSION 5.9.1-p0) +endif() + +hunter_default_version(QtAndroidCMake VERSION 1.0.9) +hunter_default_version(QtCMakeExtra VERSION 1.0.27) +hunter_default_version(QtQmlManager VERSION 1.0.0) +hunter_default_version(RapidJSON VERSION 1.0.2-p2) +hunter_default_version(RapidXML VERSION 1.13) +hunter_default_version(SDL2 VERSION 2.0.4-p4) +hunter_default_version(SDL_image VERSION 2.0.1-p1) +hunter_default_version(SDL_mixer VERSION 2.0.1-p1) +hunter_default_version(SQLite3 VERSION autoconf-3080803) #R-Tree enabled +hunter_default_version(Sober VERSION 0.1.3) +hunter_default_version(stormlib VERSION 9.21-p1) +hunter_default_version(Sugar VERSION 1.2.2) +hunter_default_version(SuiteSparse VERSION 4.5.1-p1) +hunter_default_version(TIFF VERSION 4.0.2-p3) +hunter_default_version(tommath VERSION 1.0-p2) +hunter_default_version(tomcrypt VERSION 1.17-p3) +hunter_default_version(WTL VERSION 9.1.5321) +hunter_default_version(WDC VERSION 1.1.1) +hunter_default_version(Washer VERSION 0.1.2) +hunter_default_version(WinSparkle VERSION 0.4.0) +hunter_default_version(ZLIB VERSION 1.2.8-p3) +hunter_default_version(ZMQPP VERSION 4.1.2) +hunter_default_version(ZeroMQ VERSION 4.1.4-p2) +hunter_default_version(caffe VERSION rc3-p2) +hunter_default_version(Catch VERSION 1.8.2-p0) +hunter_default_version(aes VERSION 0.0.1-p1) +hunter_default_version(aglet VERSION 1.2.0) +hunter_default_version(autobahn-cpp VERSION 0.2.0) +hunter_default_version(boost-pba VERSION 1.0.0-p0) +hunter_default_version(ccv VERSION 0.7-p6) +hunter_default_version(cereal VERSION 1.2.2-p0) +hunter_default_version(ceres-solver VERSION 1.12.0-p2) +hunter_default_version(clBLAS VERSION 2.10.0-p0) +hunter_default_version(convertutf VERSION 1.0.1) +hunter_default_version(crashpad VERSION v0.0.1-p0) +hunter_default_version(crashup VERSION 0.0.2) +hunter_default_version(cvmatio VERSION 1.0.27-p3) +hunter_default_version(cxxopts VERSION 1.0.0-p0) +hunter_default_version(czmq VERSION 4.0.2-p1) +hunter_default_version(damageproto VERSION 1.2.1) +hunter_default_version(dbus VERSION 1.10.0-hunter-4) +hunter_default_version(dest VERSION 0.8.0-p4) +hunter_default_version(dlib VERSION 19.6-p0) +hunter_default_version(doctest VERSION 1.2.0) +hunter_default_version(double-conversion VERSION 3.0.0) +hunter_default_version(dri2proto VERSION 2.8) +hunter_default_version(dri3proto VERSION 1.0) +hunter_default_version(drishti_assets VERSION 1.8) +hunter_default_version(drishti_faces VERSION 1.2) +hunter_default_version(drm VERSION 2.4.67) +hunter_default_version(eigen3-nnls VERSION 1.0.0) +hunter_default_version(eos VERSION 0.12.1) +hunter_default_version(FakeIt VERSION 2.0.3) +hunter_default_version(fixesproto VERSION 5.0) +hunter_default_version(flatbuffers VERSION 1.3.0-p3) +hunter_default_version(flex VERSION 2.6.4) +hunter_default_version(fmt VERSION 4.0.0) +hunter_default_version(freetype VERSION 2.6.2) +hunter_default_version(gauze VERSION 0.1.1) +hunter_default_version(geos VERSION 3.4.2) +hunter_default_version(gflags VERSION 2.2.1) +hunter_default_version(glew VERSION 2.0.0) +hunter_default_version(glfw VERSION 3.3.0-p4) +hunter_default_version(glm VERSION 0.9.8.5) +hunter_default_version(glog VERSION 0.3.5-p1) +hunter_default_version(glproto VERSION 1.4.17) +hunter_default_version(half VERSION 1.1.0-p1) +hunter_default_version(hdf5 VERSION 1.8.15-p1) +hunter_default_version(hunter_box_1 VERSION 1.0.1) +hunter_default_version(ice VERSION 1.0.8) +hunter_default_version(imshow VERSION 1.0.0-p0) +hunter_default_version(inputproto VERSION 2.2) +hunter_default_version(intltool VERSION 0.51.0) +hunter_default_version(ios_sim VERSION 3.1.1) +hunter_default_version(ippicv VERSION 20151201) +hunter_default_version(irrXML VERSION 1.2) +hunter_default_version(kbproto VERSION 1.0.6) +hunter_default_version(libdaemon VERSION 0.14) +hunter_default_version(libjson-rpc-cpp VERSION 0.7.0-p3) +hunter_default_version(libogg VERSION 1.3.2-cmake3) +hunter_default_version(libsodium VERSION 1.0.10) +hunter_default_version(libuv VERSION 1.14.0-p1) +hunter_default_version(libxml2 VERSION 2.9.4) +hunter_default_version(libyuv VERSION 1514-p3) +hunter_default_version(log4cplus VERSION 1.2.0-p0) +hunter_default_version(lzma VERSION 5.2.3-p4) +hunter_default_version(mini_chromium VERSION 0.0.1-p2) +hunter_default_version(minizip VERSION 1.0.1-p1) +hunter_default_version(mpark_variant VERSION 1.0.0) +hunter_default_version(msgpack VERSION 1.4.1-p2) +hunter_default_version(mtplz VERSION 0.1-p3) +hunter_default_version(nanoflann VERSION 1.2.3-p0) +hunter_default_version(nlohmann_json VERSION 2.1.1-p1) +hunter_default_version(odb VERSION 2.4.0) +hunter_default_version(odb-boost VERSION 2.4.0) +hunter_default_version(odb-compiler VERSION 2.4.0) +hunter_default_version(odb-mysql VERSION 2.4.0) +hunter_default_version(odb-pgsql VERSION 2.4.0) +hunter_default_version(odb-sqlite VERSION 2.4.0) +hunter_default_version(ogles_gpgpu VERSION 0.2.1) +hunter_default_version(onmt VERSION 0.4.1-p2) +hunter_default_version(openddlparser VERSION 0.1.0-p2) +hunter_default_version(pciaccess VERSION 0.13.4) +hunter_default_version(poly2tri VERSION 1.0.0) +hunter_default_version(polyclipping VERSION 4.8.8-p0) # for Assimp +hunter_default_version(presentproto VERSION 1.0) +hunter_default_version(pthread-stubs VERSION 0.3) +hunter_default_version(pugixml VERSION 1.8.1) +hunter_default_version(rabbitmq-c VERSION 0.7.0-p1) +hunter_default_version(randrproto VERSION 1.3.2) +hunter_default_version(renderproto VERSION 0.11.1) +hunter_default_version(sm VERSION 1.2.1) +hunter_default_version(Snappy VERSION 1.1.6-p0) +hunter_default_version(sse2neon VERSION 1.0.0-p0) +hunter_default_version(sparsehash VERSION 2.0.2) +if(MSVC_VERSION LESS 1800) + # for VS12 - version without support C++11 + hunter_default_version(spdlog VERSION 1.0.0-p0) +else() + hunter_default_version(spdlog VERSION 0.13.0-p1) +endif() +hunter_default_version(szip VERSION 2.1.0-p1) +hunter_default_version(Tesseract VERSION 3.05.01-hunter-3) +hunter_default_version(thread-pool-cpp VERSION 1.1.0) +hunter_default_version(tinydir VERSION 1.2-p0) +hunter_default_version(websocketpp VERSION 0.7.0-p2) +hunter_default_version(wxWidgets VERSION 3.0.2) +hunter_default_version(x11 VERSION 1.5.0) +hunter_default_version(x264 VERSION snapshot-20170420-2245) +hunter_default_version(xau VERSION 1.0.7) +hunter_default_version(xcb VERSION 1.11.1) +hunter_default_version(xcb-proto VERSION 1.11) +hunter_default_version(xcursor VERSION 1.1.13) +hunter_default_version(xdamage VERSION 1.1.4) +hunter_default_version(xext VERSION 1.3.1) +hunter_default_version(xextproto VERSION 7.2.1) +hunter_default_version(xf86vidmodeproto VERSION 2.3.1) +hunter_default_version(xfixes VERSION 5.0.1) +hunter_default_version(xgboost VERSION 0.40-p9) +hunter_default_version(xi VERSION 1.6.1) +hunter_default_version(xinerama VERSION 1.1.2) +hunter_default_version(xineramaproto VERSION 1.1.2) +hunter_default_version(xorg-macros VERSION 1.17) +hunter_default_version(xproto VERSION 7.0.23) +hunter_default_version(xrandr VERSION 1.3.2) +hunter_default_version(xrender VERSION 0.9.7) +hunter_default_version(xshmfence VERSION 1.2) +hunter_default_version(xtrans VERSION 1.2.7) +hunter_default_version(xxf86vm VERSION 1.1.2) +hunter_default_version(yaml-cpp VERSION 0.5.3) + +if(MSVC80) + hunter_default_version(GTest VERSION 1.7.0-hunter-6) +else() + hunter_default_version(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_default_version(Android-Google-APIs VERSION 21_r01) + hunter_default_version(Android-Google-APIs-Intel-x86-Atom-System-Image VERSION 21_r10) + hunter_default_version(Android-Intel-x86-Atom-System-Image VERSION 21) + hunter_default_version(Android-SDK-Platform VERSION 21_r02) + hunter_default_version(Sources-for-Android-SDK VERSION 21) + hunter_default_version(Android-ARM-EABI-v7a-System-Image VERSION 21_r04) + elseif(_is_api_19) + hunter_default_version(Android-Google-APIs VERSION 19_r18) + hunter_default_version(Android-Intel-x86-Atom-System-Image VERSION 19) + hunter_default_version(Android-SDK-Platform VERSION 19_r04) + hunter_default_version(Sources-for-Android-SDK VERSION 19) + hunter_default_version(Android-ARM-EABI-v7a-System-Image VERSION 19_r05) + elseif(_is_api_16) + hunter_default_version(Android-Google-APIs VERSION 16_r04) + hunter_default_version(Android-Intel-x86-Atom-System-Image VERSION 16) + hunter_default_version(Android-SDK-Platform VERSION 16_r05) + hunter_default_version(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_default_version(zookeeper VERSION 3.4.9-p2) +hunter_default_version(tacopie VERSION 2.4.0-h1) +hunter_default_version(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 000000000..c6451c76d --- /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_default_version(Foo VERSION 1.0.0) +# hunter_default_version(Boo VERSION 1.2.3z CMAKE_ARGS BOO_WITH_A=ON) + +# Wiki: +# * https://github.com/ruslo/hunter/wiki/dev.modules#hunter_default_version + +include(hunter_default_version) +include(hunter_user_error) + +# NOTE: no names with spaces! + +hunter_default_version(AllTheFlopsThreads VERSION 0.1-p0) +hunter_default_version(Android-Apk VERSION 1.1.13) +hunter_default_version(Android-Build-Tools VERSION 22.0.1) +hunter_default_version(Android-Google-Repository VERSION 47) +hunter_default_version(Android-Modules VERSION 1.0.0) +hunter_default_version(Android-SDK VERSION 0.0.5) +hunter_default_version(Android-SDK-Platform-tools VERSION r25.0.5) +hunter_default_version(Android-SDK-Tools VERSION 25.2.5) +hunter_default_version(Android-Support-Repository VERSION 47) +hunter_default_version(ARM_NEON_2_x86_SSE VERSION 1.0.0-p0) +hunter_default_version(ArrayFire VERSION 3.3.1-p0) +hunter_default_version(Assimp VERSION 3.2-p1) +hunter_default_version(Async++ VERSION 0.0.3-hunter) +hunter_default_version(Avahi VERSION 0.6.31) +hunter_default_version(Beast VERSION 1.0.0-b84-hunter-0) +hunter_default_version(BZip2 VERSION 1.0.6-p3) +if(MSVC OR MINGW) + # FIXME: https://ci.appveyor.com/project/ingenue/hunter/build/1.0.2229 + hunter_default_version(Boost VERSION 1.64.0) +else() + hunter_default_version(Boost VERSION 1.65.0) +endif() +hunter_default_version(BoostCompute VERSION 0.5-p0) +hunter_default_version(BoostProcess VERSION 0.5) +hunter_default_version(CapnProto VERSION 0.6.1) +hunter_default_version(CLAPACK VERSION 3.2.1) +hunter_default_version(CURL VERSION 7.49.1-DEV-v8) +hunter_default_version(Clang VERSION 4.0.1-p0) +hunter_default_version(ClangToolsExtra VERSION 4.0.1) # Clang +hunter_default_version(Comet VERSION 4.0.2) +hunter_default_version(CppNetlib VERSION 0.10.1-hunter-3) +hunter_default_version(CppNetlibUri VERSION 1.0.4-hunter) +hunter_default_version(CsvParserCPlusPlus VERSION 1.0.1) +hunter_default_version(Eigen VERSION 3.3.4-p0) +hunter_default_version(enet VERSION 1.3.13-p1) +hunter_default_version(Expat VERSION 2.1.1) +if(MSVC) + hunter_default_version(getopt VERSION 1.0.0-p0) +endif() +hunter_default_version(GPUImage VERSION 0.1.6-p6) +hunter_default_version(GSL VERSION 2.1.0-p2) +hunter_default_version(Igloo VERSION 1.1.1-hunter) +hunter_default_version(intsizeof VERSION 2.0.1) +hunter_default_version(Jpeg VERSION 9b-p3) +hunter_default_version(JsonSpirit VERSION 0.0.4-hunter) +if(MSVC_VERSION LESS 1600) + # for VS10 - version without support C++11 + hunter_default_version(jsoncpp VERSION 0.7.0) +else() + hunter_default_version(jsoncpp VERSION 1.8.0) +endif() +hunter_default_version(LAPACK VERSION 3.7.1) +hunter_default_version(LLVM VERSION 4.0.1-p0) # Clang +hunter_default_version(LLVMCompilerRT VERSION 4.0.1-patched) # Clang +hunter_default_version(Leathers VERSION 0.1.6) +hunter_default_version(Leptonica VERSION 1.74.2-p4) +hunter_default_version(Libcxx VERSION 3.6.2) # Clang +hunter_default_version(Libcxxabi VERSION 3.6.2) # Clang +hunter_default_version(librtmp VERSION 2.4.0-p0) +hunter_default_version(Libssh2 VERSION 1.7.0) +hunter_default_version(Lua VERSION 5.3.2) +hunter_default_version(MySQL-client VERSION 6.1.9-p0) +hunter_default_version(NASM VERSION 2.12.02) +hunter_default_version(OpenBLAS VERSION 0.2.20-p0) +hunter_default_version(OpenCL VERSION 2.1-p3) +hunter_default_version(OpenCL-cpp VERSION 2.0.10-p0) +hunter_default_version(OpenCV VERSION 3.3.0-p2) +hunter_default_version(OpenCV-Extra VERSION 3.3.0) +hunter_default_version(OpenNMTTokenizer VERSION 0.2.0-p1) +if(MSVC) + # FIXME: https://ci.appveyor.com/project/ingenue/hunter/build/1.0.1470 + hunter_default_version(OpenSSL VERSION 1.0.2l) +else() + hunter_default_version(OpenSSL VERSION 1.1.0f) +endif() +hunter_default_version(PNG VERSION 1.6.26-p1) +hunter_default_version(PocoCpp VERSION 1.7.8-p0) +hunter_default_version(PostgreSQL VERSION 9.6.3) +hunter_default_version(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_default_version(Qt VERSION 5.5.1-cvpixelbuffer-2-p9) +else() + hunter_default_version(Qt VERSION 5.9.1-p0) +endif() + +hunter_default_version(QtAndroidCMake VERSION 1.0.9) +hunter_default_version(QtCMakeExtra VERSION 1.0.27) +hunter_default_version(QtQmlManager VERSION 1.0.0) +hunter_default_version(RapidJSON VERSION 1.0.2-p2) +hunter_default_version(RapidXML VERSION 1.13) +hunter_default_version(SDL2 VERSION 2.0.4-p4) +hunter_default_version(SDL_image VERSION 2.0.1-p1) +hunter_default_version(SDL_mixer VERSION 2.0.1-p1) +hunter_default_version(SQLite3 VERSION autoconf-3080803) #R-Tree enabled +hunter_default_version(Sober VERSION 0.1.3) +hunter_default_version(stormlib VERSION 9.21-p1) +hunter_default_version(Sugar VERSION 1.2.2) +hunter_default_version(SuiteSparse VERSION 4.5.1-p1) +hunter_default_version(TIFF VERSION 4.0.2-p3) +hunter_default_version(tommath VERSION 1.0-p2) +hunter_default_version(tomcrypt VERSION 1.17-p3) +hunter_default_version(WTL VERSION 9.1.5321) +hunter_default_version(WDC VERSION 1.1.1) +hunter_default_version(Washer VERSION 0.1.2) +hunter_default_version(WinSparkle VERSION 0.4.0) +hunter_default_version(ZLIB VERSION 1.2.8-p3) +hunter_default_version(ZMQPP VERSION 4.1.2) +hunter_default_version(ZeroMQ VERSION 4.1.4-p2) +hunter_default_version(caffe VERSION rc3-p2) +hunter_default_version(Catch VERSION 1.8.2-p0) +hunter_default_version(aes VERSION 0.0.1-p1) +hunter_default_version(aglet VERSION 1.2.0) +hunter_default_version(autobahn-cpp VERSION 0.2.0) +hunter_default_version(boost-pba VERSION 1.0.0-p0) +hunter_default_version(ccv VERSION 0.7-p6) +hunter_default_version(cereal VERSION 1.2.2-p0) +hunter_default_version(ceres-solver VERSION 1.12.0-p2) +hunter_default_version(clBLAS VERSION 2.10.0-p0) +hunter_default_version(convertutf VERSION 1.0.1) +hunter_default_version(crashpad VERSION v0.0.1-p0) +hunter_default_version(crashup VERSION 0.0.2) +hunter_default_version(cvmatio VERSION 1.0.27-p3) +hunter_default_version(cxxopts VERSION 1.0.0-p0) +hunter_default_version(czmq VERSION 4.0.2-p1) +hunter_default_version(damageproto VERSION 1.2.1) +hunter_default_version(dbus VERSION 1.10.0-hunter-4) +hunter_default_version(dest VERSION 0.8.0-p4) +hunter_default_version(dlib VERSION 19.6-p0) +hunter_default_version(doctest VERSION 1.2.0) +hunter_default_version(double-conversion VERSION 3.0.0) +hunter_default_version(dri2proto VERSION 2.8) +hunter_default_version(dri3proto VERSION 1.0) +hunter_default_version(drishti_assets VERSION 1.8) +hunter_default_version(drishti_faces VERSION 1.2) +hunter_default_version(drm VERSION 2.4.67) +hunter_default_version(eigen3-nnls VERSION 1.0.0) +hunter_default_version(eos VERSION 0.12.1) +hunter_default_version(FakeIt VERSION 2.0.3) +hunter_default_version(fixesproto VERSION 5.0) +hunter_default_version(flatbuffers VERSION 1.3.0-p3) +hunter_default_version(flex VERSION 2.6.4) +hunter_default_version(fmt VERSION 4.0.0) +hunter_default_version(freetype VERSION 2.6.2) +hunter_default_version(gauze VERSION 0.1.1) +hunter_default_version(geos VERSION 3.4.2) +hunter_default_version(gflags VERSION 2.2.1) +hunter_default_version(glew VERSION 2.0.0) +hunter_default_version(glfw VERSION 3.3.0-p4) +hunter_default_version(glm VERSION 0.9.8.5) +hunter_default_version(glog VERSION 0.3.5-p1) +hunter_default_version(glproto VERSION 1.4.17) +hunter_default_version(half VERSION 1.1.0-p1) +hunter_default_version(hdf5 VERSION 1.8.15-p1) +hunter_default_version(hunter_box_1 VERSION 1.0.0) +hunter_default_version(ice VERSION 1.0.8) +hunter_default_version(imshow VERSION 1.0.0-p0) +hunter_default_version(inputproto VERSION 2.2) +hunter_default_version(intltool VERSION 0.51.0) +hunter_default_version(ios_sim VERSION 3.1.1) +hunter_default_version(ippicv VERSION 20151201) +hunter_default_version(irrXML VERSION 1.2) +hunter_default_version(kbproto VERSION 1.0.6) +hunter_default_version(libdaemon VERSION 0.14) +hunter_default_version(libjson-rpc-cpp VERSION 0.7.0-p3) +hunter_default_version(libogg VERSION 1.3.2-cmake3) +hunter_default_version(libsodium VERSION 1.0.10) +hunter_default_version(libuv VERSION 1.14.0-p1) +hunter_default_version(libxml2 VERSION 2.9.4) +hunter_default_version(libyuv VERSION 1514-p3) +hunter_default_version(log4cplus VERSION 1.2.0-p0) +hunter_default_version(lzma VERSION 5.2.3-p4) +hunter_default_version(mini_chromium VERSION 0.0.1-p2) +hunter_default_version(minizip VERSION 1.0.1-p1) +hunter_default_version(mpark_variant VERSION 1.0.0) +hunter_default_version(msgpack VERSION 1.4.1-p2) +hunter_default_version(mtplz VERSION 0.1-p3) +hunter_default_version(nanoflann VERSION 1.2.3-p0) +hunter_default_version(nlohmann_json VERSION 2.1.1-p1) +hunter_default_version(odb VERSION 2.4.0) +hunter_default_version(odb-boost VERSION 2.4.0) +hunter_default_version(odb-compiler VERSION 2.4.0) +hunter_default_version(odb-mysql VERSION 2.4.0) +hunter_default_version(odb-pgsql VERSION 2.4.0) +hunter_default_version(odb-sqlite VERSION 2.4.0) +hunter_default_version(ogles_gpgpu VERSION 0.2.1) +hunter_default_version(onmt VERSION 0.4.1-p2) +hunter_default_version(openddlparser VERSION 0.1.0-p2) +hunter_default_version(pciaccess VERSION 0.13.4) +hunter_default_version(poly2tri VERSION 1.0.0) +hunter_default_version(polyclipping VERSION 4.8.8-p0) # for Assimp +hunter_default_version(presentproto VERSION 1.0) +hunter_default_version(pthread-stubs VERSION 0.3) +hunter_default_version(pugixml VERSION 1.8.1) +hunter_default_version(rabbitmq-c VERSION 0.7.0-p1) +hunter_default_version(randrproto VERSION 1.3.2) +hunter_default_version(renderproto VERSION 0.11.1) +hunter_default_version(sm VERSION 1.2.1) +hunter_default_version(Snappy VERSION 1.1.6-p0) +hunter_default_version(sse2neon VERSION 1.0.0-p0) +hunter_default_version(sparsehash VERSION 2.0.2) +if(MSVC_VERSION LESS 1800) + # for VS12 - version without support C++11 + hunter_default_version(spdlog VERSION 1.0.0-p0) +else() + hunter_default_version(spdlog VERSION 0.13.0-p1) +endif() +hunter_default_version(szip VERSION 2.1.0-p1) +hunter_default_version(Tesseract VERSION 3.05.01-hunter-3) +hunter_default_version(thread-pool-cpp VERSION 1.1.0) +hunter_default_version(tinydir VERSION 1.2-p0) +hunter_default_version(websocketpp VERSION 0.7.0-p2) +hunter_default_version(wxWidgets VERSION 3.0.2) +hunter_default_version(x11 VERSION 1.5.0) +hunter_default_version(x264 VERSION snapshot-20170420-2245) +hunter_default_version(xau VERSION 1.0.7) +hunter_default_version(xcb VERSION 1.11.1) +hunter_default_version(xcb-proto VERSION 1.11) +hunter_default_version(xcursor VERSION 1.1.13) +hunter_default_version(xdamage VERSION 1.1.4) +hunter_default_version(xext VERSION 1.3.1) +hunter_default_version(xextproto VERSION 7.2.1) +hunter_default_version(xf86vidmodeproto VERSION 2.3.1) +hunter_default_version(xfixes VERSION 5.0.1) +hunter_default_version(xgboost VERSION 0.40-p9) +hunter_default_version(xi VERSION 1.6.1) +hunter_default_version(xinerama VERSION 1.1.2) +hunter_default_version(xineramaproto VERSION 1.1.2) +hunter_default_version(xorg-macros VERSION 1.17) +hunter_default_version(xproto VERSION 7.0.23) +hunter_default_version(xrandr VERSION 1.3.2) +hunter_default_version(xrender VERSION 0.9.7) +hunter_default_version(xshmfence VERSION 1.2) +hunter_default_version(xtrans VERSION 1.2.7) +hunter_default_version(xxf86vm VERSION 1.1.2) +hunter_default_version(yaml-cpp VERSION 0.5.3) + +if(MSVC80) + hunter_default_version(GTest VERSION 1.7.0-hunter-6) +else() + hunter_default_version(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_default_version(Android-Google-APIs VERSION 21_r01) + hunter_default_version(Android-Google-APIs-Intel-x86-Atom-System-Image VERSION 21_r10) + hunter_default_version(Android-Intel-x86-Atom-System-Image VERSION 21) + hunter_default_version(Android-SDK-Platform VERSION 21_r02) + hunter_default_version(Sources-for-Android-SDK VERSION 21) + hunter_default_version(Android-ARM-EABI-v7a-System-Image VERSION 21_r04) + elseif(_is_api_19) + hunter_default_version(Android-Google-APIs VERSION 19_r18) + hunter_default_version(Android-Intel-x86-Atom-System-Image VERSION 19) + hunter_default_version(Android-SDK-Platform VERSION 19_r04) + hunter_default_version(Sources-for-Android-SDK VERSION 19) + hunter_default_version(Android-ARM-EABI-v7a-System-Image VERSION 19_r05) + elseif(_is_api_16) + hunter_default_version(Android-Google-APIs VERSION 16_r04) + hunter_default_version(Android-Intel-x86-Atom-System-Image VERSION 16) + hunter_default_version(Android-SDK-Platform VERSION 16_r05) + hunter_default_version(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_default_version(zookeeper VERSION 3.4.9-p2) +hunter_default_version(tacopie VERSION 2.4.0-h1) +hunter_default_version(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 000000000..05c7b14eb --- /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 000000000..3253e79fa --- /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 000000000..3ee14b802 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 000000000..90e7dbc12 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 000000000..81aace052 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 000000000..9791ba5d7 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 000000000..36a4fad87 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 000000000..8c3e47a73 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 000000000..ac7e9213e 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 000000000..6e6e9455a 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 000000000..f7998e3c1 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 000000000..7bf8332ad 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 000000000..e964d1266 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 000000000..4eebcb3bb --- /dev/null +++ b/docs/creating-new/patch.rst @@ -0,0 +1,63 @@ +.. Copyright (c) 2017-2018, 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. + +* **Rebase** your changes, check that history has not merge commits. In this + case it will be easier to do review and reuse your work in future. + +* Start working on patches from latest stable upstream tag. I.e. if latest + release is ``v1.3.15`` then create branch ``hunter-1.3.15`` and add + patches there. If you want to have version that is not released yet, say + ``da39a3e``, then create branch ``hunter-1.3.15-da39a3e``. If there are not + tags in upstream then start with dummy ``v0.0.0`` version to avoid conflict + with future releases, i.e. create branch ``hunter-0.0.0-da39a3e``. + +* 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 `__) + +* **Test** your changes. Add temporary release to Hunter system and + check that ``hunter_add_package(foo)`` is actually working. Do it at least + for one toolchain :ref:`locally ` but of course it will be + better if you test all of them :ref:`remotely `. + +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 000000000..15ee620b4 --- /dev/null +++ b/docs/creating-new/update.rst @@ -0,0 +1,136 @@ +.. Copyright (c) 2017, Ruslan Baratov +.. All rights reserved. + +.. spelling:: + + diff + +Update package +-------------- + +.. note:: + + If package lives in https://github.com/hunter-packages, it should be + released there first. Check :doc:`Patch sources ` + section. + +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 +======= + +.. note:: + + Check :ref:`Create package: CI testing ` page for registering + services and branches/remotes description. + +Fetch latest CI configs, you may need to run ``git pull`` if you have +``pkg.hunter_box_1`` locally: + +.. code-block:: none + + [hunter]> git fetch ci + [hunter]> git checkout pkg.hunter_box_1 + [hunter]> git pull + +If the package has not been updated in some time, the CI toolchains +may have fallen out of date. It is preferable to keep the CI +configuration in sync with the working defaults from ``pkg.template`` +to make sure the package will build with recent compilers and to help +ensure cache hits for any required Hunter managed dependencies. + +.. code-block:: none + + [hunter]> git checkout pkg.template + [hunter]> git pull + [hunter]> git checkout pkg.hunter_box_1 + [hunter]> git merge pkg.template + +Create temporary branch ``test.hunter_box_1`` for testing basing on +``pkg.hunter_box_1``: + +.. code-block:: none + + [hunter]> git checkout -b test.hunter_box_1 + +Merge it with ``hunter_box_1`` package updates: + +.. code-block:: none + + [hunter]> git merge pr.hunter_box_1 + +Push changes to your Hunter fork 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 + +Submit the pull request to Hunter +================================= + +Once the tests are passing, and all required toolchain modifications have been applied to the ``ci`` fork in ``pkg.hunter_box_1`` via pull requests (see above), the original package update in ``pr.hunter_box_1`` should then be pushed to your Hunter fork (``origin`` in above discussions): + +.. code-block:: none + + [hunter]> git push -u origin pr.hunter_box_1 + +Finally, a pull request should be opened to send the package update to the main Hunter repository, as illustrated in the previous section pull request `screen shot `__ (see `example `__). diff --git a/docs/creating-new/yed/branches.graphml b/docs/creating-new/yed/branches.graphml new file mode 100644 index 000000000..331084a82 --- /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 000000000..e99e76877 --- /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 000000000..006bfe830 --- /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 000000000..6a38275c4 --- /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 deleted file mode 100644 index ea7bafc06..000000000 --- a/docs/donations.rst +++ /dev/null @@ -1,7 +0,0 @@ -.. Copyright (c) 2016, Ruslan Baratov -.. All rights reserved. - -Donations ---------- - -* `Donations `_ diff --git a/docs/faq/android-studio-breakpoint.png b/docs/faq/android-studio-breakpoint.png new file mode 100644 index 000000000..db5a90eff Binary files /dev/null and b/docs/faq/android-studio-breakpoint.png differ diff --git a/docs/faq/android-studio-debugger.png b/docs/faq/android-studio-debugger.png new file mode 100644 index 000000000..79de2d18e Binary files /dev/null and b/docs/faq/android-studio-debugger.png differ diff --git a/docs/faq/android-studio-hello-jni.png b/docs/faq/android-studio-hello-jni.png new file mode 100644 index 000000000..1d1ce09ae Binary files /dev/null and b/docs/faq/android-studio-hello-jni.png differ diff --git a/docs/faq/android-studio.rst b/docs/faq/android-studio.rst new file mode 100644 index 000000000..575cfda05 --- /dev/null +++ b/docs/faq/android-studio.rst @@ -0,0 +1,374 @@ +.. Copyright (c) 2018-2019, Ruslan Baratov +.. All rights reserved. + +.. spelling:: + + Gradle + md + +How to use Hunter in Android Studio? +------------------------------------ + +CMake can be used as a build tool for native C/C++ libraries in Android Studio. +If CMake project has third party dependencies these dependencies can be managed +by Hunter. + +Example +======= + +As an example let's take a look at a simple project with one tiny +:doc:`md5 package ` dependency. The project is a slight +modification of the +`HelloJni sample `__. + +.. admonition:: Examples on GitHub + + * `Android Studio with Hunter `__ + +.. note:: + + The code was tested with Android Studio: 3.3, 3.4.1, 3.5 beta 2 + +Check you have at least CMake 3.9.2. Such a requirement needed to work with +`Android NDK r16+ `__: + +.. code-block:: none + :emphasize-lines: 1, 3 + + > cmake --version + + cmake version 3.9.2 + + CMake suite maintained and supported by Kitware (kitware.com/cmake). + +Check you have Ninja build tool installed: + +.. code-block:: none + + > which ninja + /usr/bin/ninja + +You can use your system package manager +(e.g., on Ubuntu do ``sudo apt-get install ninja-build``) +or download it from GitHub releases, unpack and add to ``PATH``: + +* https://github.com/ninja-build/ninja/releases + +Get the sources: + +.. code-block:: none + :emphasize-lines: 1 + + > git clone https://github.com/forexample/android-studio-with-hunter + > cd android-studio-with-hunter + [android-studio-with-hunter]> + +Android Studio project configuration files reside in the ``android-studio`` +directory but before opening it you have to create the ``local.properties`` file +and add the ``cmake.dir`` entry there. + +.. seealso:: + + * `Android Studio: Use CMake 3.7 or higher `__ + +You may want to add the paths to Android NDK/SDK as well (if ``ndk.dir`` and +``sdk.dir`` not present in ``local.properties`` then they will be set by +Android Studio to default locations): + +.. code-block:: none + :emphasize-lines: 6 + + [android-studio-with-hunter]> cd android-studio + [android-studio-with-hunter/android-studio]> cat local.properties + + ndk.dir=/home/your/path/to/android-sdk/ndk-bundle + sdk.dir=/home/your/path/to/android-sdk + cmake.dir=/home/your/path/to/cmake + +.. hint:: + + Since ``local.properties`` contains information about a local machine + you should add it to + `.gitignore `__. + +.. warning:: + + Android NDK r19+ is :ref:`not supported `. You **have to** + switch to a lower version explicitly, e.g. to NDK r18b. + +Please check that ``cmake.dir`` has such value that ``/bin/cmake`` +executable exists. + +At this moment you can launch Android Studio and open your project but +note that Gradle will start configuring, it will trigger CMake configuration +which will trigger Hunter builds for 3 architectures: + +.. code-block:: none + :emphasize-lines: 11 + + [android-studio-with-hunter/android-studio]> cat app/build.gradle + + android { + ... + defaultConfig { + ... + abi { + enable true + + reset() + include 'x86_64', 'armeabi-v7a', 'arm64-v8a' + + universalApk false + } + } + ... + } + +As an alternative, you are able to build one architecture at a +time using ``-Parch=``: + +.. code-block:: none + :emphasize-lines: 1 + + [android-studio-with-hunter/android-studio]> ./gradlew asDebug -Parch=arm64-v8a + + > Task :app:externalNativeBuildDebug + Build hello-jni arm64-v8a + [1/2] Building CXX object CMakeFiles/hello-jni.dir/hello-jni.cpp.o + [2/2] Linking CXX shared library ../../../../build/intermediates/cmake/debug/obj/arm64-v8a/libhello-jni.so + + BUILD SUCCESSFUL in 4s + 30 actionable tasks: 2 executed, 28 up-to-date + +CMake binary directory will be set to +``app/.externalNativeBuild/cmake/debug/arm64-v8a/``, you can find CMake logs +there: + +.. code-block:: none + + [android-studio-with-hunter/android-studio]> grep 'Hunter-ID' app/.externalNativeBuild/cmake/debug/arm64-v8a/cmake_build_output.txt + + [hunter] [ Hunter-ID: 4959eb9 | Toolchain-ID: 8e0b164 | Config-ID: 48b836e ] + +Or even start CMake build without using Gradle: + +.. code-block:: none + :emphasize-lines: 2 + + [android-studio-with-hunter/android-studio]> touch ../CMakeLists.txt + [android-studio-with-hunter/android-studio]> cmake --build app/.externalNativeBuild/cmake/debug/arm64-v8a + [1/1] Re-running CMake... + -- [hunter *** DEBUG *** 2018-07-25T19:52:14] HUNTER_ROOT set using HOME environment variable + ... + -- [hunter] [ Hunter-ID: 4959eb9 | Toolchain-ID: 8e0b164 | Config-ID: 48b836e ] + ... + -- Configuring done + -- Generating done + -- Build files have been written to: /.../android-studio-with-hunter/android-studio/app/.externalNativeBuild/cmake/debug/arm64-v8a + [1/1] Linking CXX shared library ../../../../build/intermediates/cmake/debug/obj/arm64-v8a/libhello-jni.so + +Issues +====== + +Detached CMake +~~~~~~~~~~~~~~ + +If Gradle build fails the underlying CMake process will **keep running**. + +.. code-block:: none + + > ./gradlew assembleDebug -Parch=armeabi-v7a + ... + + * What went wrong: + Execution failed for task ':app:generateJsonModelDebug'. + > Format specifier '%s' + +CMake is active: + +.. code-block:: none + + > ps aux | grep cmake + + ... cmake -E server --experimental --debug + ... cmake --build /.../__HUNTER/_Base/87420eb/2e091e5/84f821a/Build/OpenCV/Build + ... cmake -E touch /.../__HUNTER/_Base/87420eb/2e091e5/84f821a/Build/OpenCV/Build/OpenCV-Release-prefix/src/OpenCV-Release-stamp/OpenCV-Release-download + ... cmake -P /.../__HUNTER/_Base/87420eb/2e091e5/84f821a/Build/OpenCV/Build/OpenCV-Release-prefix/src/OpenCV-Release-stamp/download-OpenCV-Release.cmake + +Internal files locked: + +.. code-block:: none + + > lslocks | grep cmake.lock + + cmake ... /.../__HUNTER/_Base/Download/OpenCV/4.0.0-p0/90680ea/cmake.lock + cmake ... /.../__HUNTER/_Base/87420eb/2e091e5/84f821a/cmake.lock + +You **should not** run Gradle build again, wait for CMake job to finish +or force it to stop (e.g., ``kill -9``). + +See issues: + +- https://issuetracker.google.com/issues/123895238 +- https://issuetracker.google.com/issues/75268076 + +No CMake files +~~~~~~~~~~~~~~ + +Not all CMake files necessary for the build will be created if the initial +configure step will fail. In this case, you can add ``return()`` command +right **after the first hunter_add_package** call (this is where initialization +is happening and all ``*-ID`` calculated) to mimic successful CMake +configure step: + +.. code-block:: cmake + :emphasize-lines: 3 + + # ... + hunter_add_package(md5) + return() # Early exit + +Run Gradle again: + +.. code-block:: none + + [android-studio-with-hunter/android-studio]> ./gradlew asDebug -Parch=arm64-v8a + +Remove ``return()`` from CMake code, now you will be able to run CMake: + +.. code-block:: none + + [android-studio-with-hunter/android-studio]> cmake --build app/.externalNativeBuild/cmake/debug/arm64-v8a + +Example of how it can be done in a continuous integration build: + +- `CMakeLists.txt `__ +- `Testing script `__ + +.. _android ndk r19: + +Android NDK r19+ +~~~~~~~~~~~~~~~~ + +Android NDK r19 is not supported by built-in CMake modules +(which is a requirement). The workaround is to download and use Android +NDK r18 or lower: + +- https://developer.android.com/ndk/downloads/older_releases.html + +and add path to NDK to ``local.properties``: + +.. code-block:: none + :emphasize-lines: 1 + + ndk.dir=/home/your/path/to/android-ndk-r18 + sdk.dir=/home/your/path/to/android-sdk + cmake.dir=/home/your/path/to/cmake + +.. seealso:: + + - https://gitlab.kitware.com/cmake/cmake/issues/18739 + - https://gitlab.kitware.com/cmake/cmake/issues/18787 + + +Project +======= + +Open Android Studio project, connect your device and click +``Run 'app' (Shift + F10)``. You should see ``HelloJni`` based application +started: + +.. image:: android-studio-hello-jni.png + :align: center + :alt: HelloJni screenshot + :width: 80% + +If you take a look at ``CMakeLists.txt`` of the project you will find +the option for keeping third party sources: + +.. code-block:: cmake + + option(HUNTER_KEEP_PACKAGE_SOURCES "Keep third party sources" ON) + +.. warning:: + + Please make sure to read documentation about + :ref:`HUNTER_KEEP_PACKAGE_SOURCES ` + before adding it to your project. + +It means that debugger can be used to step into md5 package source code. +Open ``hello-jni.cpp`` file and set the breakpoint to ``md5_append`` call: + +.. image:: android-studio-breakpoint.png + :align: center + :alt: HelloJni breakpoint + +Click ``Debug 'app' (Shift + F9)`` to run an application in Debug mode. +After the application started click ``CALCULATE`` button on the device. +When debugger will reach ``md5_append`` call click ``Step Into (F7)``. +As you can see debugger stepped into the ``md5.c`` source code of third party +md5 package and "data" with value "Some string" passed to "md5_append" function: + +.. image:: android-studio-debugger.png + :align: center + :alt: HelloJni debugger + +Integration +=========== + +Here is a description of the integration approach. + +:doc:`CMake toolchain file ` used to +customize third party packages builds in Hunter. And since Android Studio +provides it's own toolchain for a build such action do introduce a little quirk. +Some of the variables like ``ANDROID_ABI`` was read from a command line and is +not part of the toolchain, hence Hunter will not forward them to third parties. +A user also may want to add extra settings to the toolchain. And one more problem is +that variables provided by Android Studio toolchain little bit differ from +ones expected by a project that relies on ``CMAKE_ANDROID_*`` conventions +(introduced in CMake 3.7). + +As a workaround for all the issues above, we can inject our own toolchain with +``FORCE``. + +Add extra CMake argument to ``build.gradle`` configuration: + +.. code-block:: none + :emphasize-lines: 4-6 + + externalNativeBuild { + cmake { + arguments '-DANDROID_STL=c++_static', + // Extra custom variable to + // trigger workaround code. + '-DHELLOJNI_ANDROID_STUDIO=1' + } + } + +.. note:: + + Please name this variable next to your project to avoid clashes with + other projects that can be added by ``add_subdirectory``. + +Use this variable for triggering CMake workaround code, note that toolchain +should be set **before** first ``project`` command: + +.. code-block:: cmake + + if(HELLOJNI_ANDROID_STUDIO) + set(gen_toolchain "${CMAKE_CURRENT_BINARY_DIR}/generated/toolchain.cmake") + configure_file( + "${CMAKE_CURRENT_LIST_DIR}/cmake/template/toolchain.cmake.in" + "${gen_toolchain}" + @ONLY + ) + set(CMAKE_TOOLCHAIN_FILE "${gen_toolchain}" CACHE PATH "" FORCE) + endif() + + # ... + + project(...) + +The content of the latest ``toolchain.cmake.in`` template can be found here: + +* https://github.com/forexample/android-studio-with-hunter/blob/master/cmake/template/toolchain.cmake.in diff --git a/docs/faq/foo-v1.0-hunter.cmake b/docs/faq/foo-v1.0-hunter.cmake new file mode 100644 index 000000000..b121cfb8e --- /dev/null +++ b/docs/faq/foo-v1.0-hunter.cmake @@ -0,0 +1,7 @@ +if(WIN32) + hunter_add_package(boo) + find_package(boo CONFIG REQUIRED) +endif() + +hunter_add_package(bar) +find_package(bar CONFIG REQUIRED) diff --git a/docs/faq/foo-v1.0.cmake b/docs/faq/foo-v1.0.cmake new file mode 100644 index 000000000..f62469c72 --- /dev/null +++ b/docs/faq/foo-v1.0.cmake @@ -0,0 +1,5 @@ +if(WIN32) + find_package(boo CONFIG REQUIRED) +endif() + +find_package(bar CONFIG REQUIRED) diff --git a/docs/faq/foo-v2.0-hunter.cmake b/docs/faq/foo-v2.0-hunter.cmake new file mode 100644 index 000000000..f8d169025 --- /dev/null +++ b/docs/faq/foo-v2.0-hunter.cmake @@ -0,0 +1,7 @@ +if(FOO_WITH_BAZ) + hunter_add_package(baz) + find_package(baz CONFIG REQUIRED) +endif() + +hunter_add_package(bar) +find_package(bar CONFIG REQUIRED) diff --git a/docs/faq/foo-v2.0.cmake b/docs/faq/foo-v2.0.cmake new file mode 100644 index 000000000..1751d6206 --- /dev/null +++ b/docs/faq/foo-v2.0.cmake @@ -0,0 +1,5 @@ +if(FOO_WITH_BAZ) + find_package(baz CONFIG REQUIRED) +endif() + +find_package(bar CONFIG REQUIRED) diff --git a/docs/faq/how-to-download-private-github-asset.rst b/docs/faq/how-to-download-private-github-asset.rst new file mode 100644 index 000000000..bc6af24e9 --- /dev/null +++ b/docs/faq/how-to-download-private-github-asset.rst @@ -0,0 +1,67 @@ +.. Copyright (c) 2018, Ruslan Baratov +.. All rights reserved. + +How to download private GitHub asset? +------------------------------------- + +If you want to download private GitHub asset you have to use GitHub API. +First you have to find out URL with asset id. For example get info about tag +``v3.2.1`` using ``curl`` command: + +.. code-block:: none + + > curl -s -u \ + ${username}:${token} \ + https://api.github.com/repos/${orgname}/${reponame}/releases/tags/v3.2.1 + +Name, id and URL of asset: + +.. code-block:: none + :emphasize-lines: 6, 8 + + > curl -s -u \ + ${username}:${token} \ + https://api.github.com/repos/${orgname}/${reponame}/releases/tags/v3.2.1 \ + | grep -A3 '"url":.*assets' + + "url": "https://api.github.com/repos/.../.../releases/assets/7654321", + "id": 7654321, + "name": "hello.txt", + "label": null, + +Use asset URL in +:doc:`hunter_private_data ` and +add extra ``Accept:application/octet-stream`` header: + +.. code-block:: cmake + :emphasize-lines: 4, 7 + + # CMakeLists.txt + + hunter_private_data( + URL "https://api.github.com/repos/${orgname}/${reponame}/releases/assets/7654321" + SHA1 "..." + CREDENTIALS "github" + HTTPHEADER "Accept:application/octet-stream" + FILE hello.txt + LOCATION myfile + ) + +Add GitHub credentials using +:doc:`hunter_private_data_password `: + +.. code-block:: cmake + :emphasize-lines: 4 + + # ~/.config/Hunter/passwords.cmake + + hunter_private_data_password( + CREDENTIALS "github" + USERNAME "${username}" + PASSWORD "${github_token}" + ) + +.. seealso:: + + * `GitHub API: Get release by tag name `__ + * `GitHub API: Get a single release asset `__ diff --git a/docs/faq/how-to-fix-download-error.rst b/docs/faq/how-to-fix-download-error.rst new file mode 100644 index 000000000..5be86e81b --- /dev/null +++ b/docs/faq/how-to-fix-download-error.rst @@ -0,0 +1,57 @@ +.. Copyright (c) 2018, Ruslan Baratov +.. All rights reserved. + +How to fix download error? +-------------------------- + +Unsupported protocol +==================== + +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 `__ + +You can check that everything is fine by invoking this script: + +.. code-block:: cmake + + # script.cmake + + cmake_minimum_required(VERSION 3.2) + + file( + DOWNLOAD + "https://github.com/ruslo/hunter/archive/v0.23.13.tar.gz" + "${CMAKE_CURRENT_LIST_DIR}/hunter-archive.tar.gz" + EXPECTED_HASH SHA1=ef7d6ac5a4ba88307b2bea3e6ed7206c69f542e8 + SHOW_PROGRESS + TLS_VERIFY ON + ) + +.. code-block:: none + + > cmake -P script.cmake + +TLS issues +========== + +.. admonition:: TODO + + Real fix instructions here + +If you have any problems with TLS verification you can suppress TLS checks +by setting :ref:`HUNTER_TLS_VERIFY ` to ``OFF``. diff --git a/docs/faq/how-to-fix-hash-mismatch-error.rst b/docs/faq/how-to-fix-hash-mismatch-error.rst new file mode 100644 index 000000000..882b4451a --- /dev/null +++ b/docs/faq/how-to-fix-hash-mismatch-error.rst @@ -0,0 +1,66 @@ +.. Copyright (c) 2018, Ruslan Baratov +.. All rights reserved. + +.. spelling:: + + da + ee + bfef + afd + +How to fix hash mismatch error? +------------------------------- + +da39a3ee5e6b4b0d3255bfef95601890afd80709 +======================================== + +If you see error like this: + +.. code-block:: none + + does not match expected value + expected: '...' + actual: 'da39a3ee5e6b4b0d3255bfef95601890afd80709' + +It means you're experiencing some +:doc:`download error `. + +``da39a3ee5e6b4b0d3255bfef95601890afd80709`` is a hash of an empty file: + +.. code-block:: none + + > echo -n "" | openssl sha1 + (stdin)= da39a3ee5e6b4b0d3255bfef95601890afd80709 + +Other +===== + +GitHub creates release archives on-the-fly and they are not guaranteed to be +stable. This fact was discovered after few years of relying on the assumption +of stability of such archives :) + +In most cases the problem can be solved just by updating Hunter to latest +version and using latest packages version in case you have saved non-default +versions in ``LOCAL``. + +There will be no automatic update of hashes introduced since it affects binary +cache, hence all the packages should be re-uploaded. And upload procedure is not +automatic yet. Instead update will be introduced on demand. + +The best solution is to find archive with old SHA1 in local +:ref:`Download directory `. Then upload it as asset +attached to the same release tag and add new URL to Hunter. In this case it +will fix new builds and keep old cache binaries, feel free to open new issue +and provide the link to old archive. + +.. seealso:: + + * https://github.com/ruslo/hunter/issues/1032 + +.. note:: + + It's not a Hunter specific issue. All tools that rely on the stability of + GitHub archives was affected, as an example: + + * https://github.com/Homebrew/homebrew-core/issues/18044 + * https://github.com/libgit2/libgit2/issues/4343 diff --git a/docs/faq/interaction-with-other-package-managers.rst b/docs/faq/interaction-with-other-package-managers.rst index 0a673e655..a89e7f26d 100644 --- a/docs/faq/interaction-with-other-package-managers.rst +++ b/docs/faq/interaction-with-other-package-managers.rst @@ -23,7 +23,3 @@ and upload binaries to public. So the question ``How to make Hunter interact with system libraries?`` should really be ``How to improve Hunter so it behaves like system package manager?``, e.g. add new packages that are currently missing. - -.. seealso:: - - * `Feature requests: use system packages `__ diff --git a/docs/faq/why-binaries-from-server-not-used.rst b/docs/faq/why-binaries-from-server-not-used.rst index 55755676e..d1b4d6e92 100644 --- a/docs/faq/why-binaries-from-server-not-used.rst +++ b/docs/faq/why-binaries-from-server-not-used.rst @@ -4,7 +4,11 @@ Why binaries from server not used? ================================== -If settings and environment of your local project doesn't match environment +.. seealso:: + + * :ref:`Using GitHub cache server ` + +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 +49,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 +137,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 +163,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 @@ -174,114 +178,3 @@ Compare both files to figure out what's wrong: > #define __GNUG__ 5 It means that local GCC version is ``5.4.0`` and server version is ``4.8.1``. - -.. _uploading to server: - -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 -matter) and all small text files with meta information uploaded directly to -branch ``master`` (directory layout matters) (see -`hunter-cache `__ as example). - -.. note:: - - If you have shared folder in your network there is no need to use - any scripts, you can just set ``HUNTER_ROOT`` variable to location of this - directory. - -This job can be -done using Python script ``maintenance/upload-cache-to-github.py`` (which may be -called by ``jenkins.py --upload``). Note that downloading from server done by -``file(DOWNLOAD ...)`` CMake commands, so client is still CMake-only based. - -Extra servers can be added by modifying variable -`HUNTER_CACHE_SERVERS `__ -before ``HunterGate`` command: - -.. code-block:: cmake - - list(APPEND HUNTER_CACHE_SERVERS "https://github.com/ingenue/hunter-cache") - HunterGate(URL ... SHA1 ...) - -If you want to check that there is no 3rd party builds triggered by CMake and -all packages downloaded from server you can use -`HUNTER_DISABLE_BUILDS `__ -variable. Also variable -`HUNTER_USE_CACHE_SERVERS `__ -can be used to specify downloading policy. - -Uploading from CI servers like Travis or AppVeyor require to store password as -an environment variable ``GITHUB_USER_PASSWORD`` (note that you can create -separate "bot" account to manage all this stuff). - -Travis CI -~~~~~~~~~ - -Excerpts from documentation (`1 `__ -and `2 `__) -for OS X (see also `this repo `__): - -.. code-block:: shell - - > git clone https://github.com/ingenue/hunter # your repository here - # note that this is repository where password **will be used** in .travis.yml - # this repository is a fork of https://github.com/ruslo/hunter - > cd hunter - > gem install travis - > travis encrypt GITHUB_USER_PASSWORD=very-secured-password - ... - Please add the following to your .travis file: - - secure: "..." - -If you have problems with installing ``travis`` try to install -`ruby from brew `__: - -.. code-block:: shell - - > brew install ruby - -Now you can add secure variable to ``.travis.yml`` matrix: - -.. code-block:: yaml - - env: - global: - - secure: "uTvW...TAE=" - matrix: - - PROJECT_DIR=... TOOLCHAIN=... - - PROJECT_DIR=... TOOLCHAIN=... - -.. seealso:: - - * `.travis.yml example `__ - -AppVeyor -~~~~~~~~ - -Use `this form `__ to encrypt your -password. I.e. put ``very-secured-password`` to this form, run ``Encrypt`` and -copy/paste results into your ``appveyor.yml`` (note that you should be logged in -as an **owner** of repository): - -.. code-block:: yaml - - environment: - global: - GITHUB_USER_PASSWORD: - secure: 2Sd...g== - matrix: - - TOOLCHAIN=... - PROJECT_DIR=... - - - TOOLCHAIN=... - PROJECT_DIR=... - -.. seealso:: - - * `appveyor.yml example `__ - diff --git a/docs/faq/why-do-we-need-forks.rst b/docs/faq/why-do-we-need-forks.rst new file mode 100644 index 000000000..18e4df2e5 --- /dev/null +++ b/docs/faq/why-do-we-need-forks.rst @@ -0,0 +1,174 @@ +.. spelling:: + + rebase + +Why do we need forks? +--------------------- + +:doc:`Forks ` put the burden of pushing new +branches/releases from upstream, merging and resolving conflicts by maintainers +and at the first view look like a bad, aggressively intrusive choice. But in +practice it's the clearest, robust and universal solution for all the issues +related to integration of package into Hunter. + +.. note:: + + Forks are not requirement. Hunterization changes can be pushed upstream + without affecting main functionality, see + :doc:`compatibility ` for details. And if package + has no dependencies it **can be used as is** in Hunter, + see :doc:`examples `. + +.. note:: + + As already noted :doc:`here ` all the issues that are + not related to hunterization should be pushed upstream. Including most of + the issues described in this section. + +Solution for bundled sources +============================ + +Take a look at this example: + +* https://github.com/dmlc/rabit/tree/0759d5ed2bfa1ecfc8f00ab955d8618db474f280/include + +Here package ``rabit`` has bundled dependencies ``dmlc``. In fact ``dmlc`` +folder is a separated project and lives here: + +* https://github.com/dmlc/dmlc-core/tree/c0871823b518093a0d04d6cba0a3291bc7b31401/include + +Assuming that we can't change the order of include paths (local includes +should have higher priority than external because different version of same +package itself can be installed in system) there is no "soft" solution here +and the only way to integrate package is **to remove** ``dmlc`` folder from +sources. In practice it means forking the project and applying "remove folder" +patch. Note that it really doesn't depend on the package manager, build system +or C++ compiler. All C++ compilers works similar to + +.. code-block:: none + + > c++ -I/path/to/local -I/path/to/external ... + +Meaning ``#include `` will always fall to the choice of picking +local files. + +Set of patch files +================== + +Another way to avoid forks is to keep needed ``*.patch`` files in Hunter and +apply them to upstream releases before running build instructions. Such approach +used by `Homebrew `__ and `Gentoo `__ +for example. In practice such set of patches can be quite big, e.g. 19 commits +for package ``OpenCV`` (add ``HunterGate`` module, lock version in +``HunterGate``, adding ``hunter_add_package`` calls, applying ``ANDROID_*`` +variables introduced by new CMake version and general improvements): + +* https://github.com/hunter-packages/opencv/pull/21/commits + +Note that Hunter keep all available ``OpenCV`` versions in +``cmake/projects/OpenCV/hunter.cmake`` file: + +* https://github.com/ruslo/hunter/blob/e412a3a1e9d58056efb56cb75440aead83f2e9e5/cmake/projects/OpenCV/hunter.cmake + +At this moment there are 29 versions of ``OpenCV`` available for users, hence +it will be 19 x 29 = 551 ``*.patch`` files to maintain. Some of them can be +shared between versions, some of them can be fused with each other, etc. +If such approach will be chosen we will end up with system for maintaining +patches, but there is no need to reinvent the wheel, such system already +exist and called ``Git``. Assuming the fact that Hunter project hosted on +GitHub and GitHub offer free unlimited repositories for public projects there +are no real reasons to choose ``*.patch`` approach over forks. The use of +the forks allow us to rebase, merge, cherry-pick, discuss and review the patches +easily. + +High cohesion +============= + +High cohesion means that you should keep parts of a code base that are related +to each other in a single place [1]_. The fact that version ``v1.0`` of package +``Foo`` works fine with Hunter archive ``v0.10`` is perfectly expressed by +adding child commit ``Add Hunter v0.10`` to parent commit ``Foo v1.0``. Change +of dependencies from version to version is another example. + +``Foo`` version ``v1.0``: + +.. literalinclude:: foo-v1.0.cmake + :language: cmake + +``Foo`` version ``v2.0``: + +.. literalinclude:: foo-v2.0.cmake + :language: cmake + +It's hard to make a mistake in both cases: + +.. literalinclude:: foo-v1.0-hunter.cmake + :diff: foo-v1.0.cmake + +.. literalinclude:: foo-v2.0-hunter.cmake + :diff: foo-v2.0.cmake + +It will be much easier to miss something while trying to support any +fork-free approach: + +.. code-block:: cmake + + if(FOO_VERSION VERSION_EQUAL 1.0 AND WIN32) + magic_download(boo) + endif() + + if(FOO_VERSION VERSION_EQUAL 2.0 AND FOO_WITH_BAZ) + magic_download(baz) + endif() + + magic_download(bar) + +Any non-CMake custom build scheme suffers from this problem since build +instructions have to know everything about all versions available, +e.g. see +`Boost components `__ +. + +.. [1] http://enterprisecraftsmanship.com/2015/09/02/cohesion-coupling-difference/ + +Rejected/pending CMake patches +============================== + +Having CMake build instructions in package is the easiest way to integrate +package into Hunter (but not the only one) however +`not all developers of the upstream projects are ready to accept CMake code `__ +because it may put burden +on maintaining another build system (if CMake added as extra build system), +learning new build system (if you want to substitute existing system with CMake) +or increase CMake minimum version to introduce new code. +https://github.com/hunter-packages is a central place where CMake friendly code +can leave and shared with others. + +Removing usage of FindXXX.cmake +=============================== + +Overwhelming majority of projects use ``FindXXX.cmake`` (or even something like +``find_library``) instead of recommended ``XXXConfig.cmake`` approach, +effectively making project non-relocatable. It's not a problem for the package +managers that are using single-root directory (e.g. ``/usr/lib`` for +``apt-get`` on Ubuntu and ``/usr/local/lib`` for ``brew`` on OSX) but since +Hunter allow to have +:doc:`multiple custom configurations ` +it will not work. + +.. seealso:: + + * :ref:`Creating new package: Install XXXConfig.cmake ` + +.. admonition:: CGold + + * `Rejected: FindXXX.cmake `__ + +Lock URL/SHA1 in HunterGate +=========================== + +Even if all the issues will be resolved and +:doc:`'hunter_add_package' will be called by hook inside 'find_package' ` +it's still will be convenient to save latest successful 3rd parties +configuration for debugging purposes. In terms of Hunter it means attaching +URL/SHA1 arguments of ``HunterGate`` to some commit. diff --git a/docs/faq/why-do-we-need-hunter-add-package.rst b/docs/faq/why-do-we-need-hunter-add-package.rst new file mode 100644 index 000000000..096d7babf --- /dev/null +++ b/docs/faq/why-do-we-need-hunter-add-package.rst @@ -0,0 +1,89 @@ +Why do we need hunter_add_package? +---------------------------------- + +Usually ``hunter_add_package(foo)`` call placed right before similar +``find_package(foo ...)`` call, hence it raise the question: "If most of the +information is inside ``find_package`` already will it be possible to get rid +of the ``hunter_add_package``?". + +TL;DR It is possible but implementation will be tricky and usefulness of such +feature in practice is quite questionable. + +* Not all type of packages does found by ``find_package``. For example extra + sources or data for testing use ``*_ROOT`` variables which added to the + current scope by ``hunter_add_package``: + + .. code-block:: cmake + + hunter_add_package(foo_extra) + add_subdirectory(${FOO_EXTRA_ROOT}) + + hunter_add_package(foo_data) + add_test(NAME foo_test COMMAND foo --use-data "${FOO_DATA_ROOT}/pic.png") + + Meaning that ``hunter_add_package`` will still exist and user will have to + remember that sometimes magical download hook is inside ``find_package`` and + sometimes ``hunter_add_package`` have to be called explicitly. + +* Mixing unrelated functionality. ``hunter_add_package(foo)`` will download + and install ``foo`` package while ``find_package(foo)`` should only look up + for files in read-only mode. When user see the code like this: + + .. code-block:: cmake + + hunter_add_package(foo) + find_package(foo 1.22 CONFIG REQUIRED) + + It's clear here that version ``1.22`` will not be used while downloading + package since it goes **after** ``hunter_add_package`` call and result of + ``hunter_add_package`` call is an installed package. If package will be + installed by hook in ``find_package``: + + .. code-block:: cmake + + find_package(foo 1.22 CONFIG REQUIRED) + + User might got a feeling that version ``1.22`` is installed, which is not + guaranteed - version of the package locked before, after + first ``HunterGate`` call + (see :doc:`Config-ID `). + + +* The change of ``find_package`` behavior will have fragile implementation. As + an example: you can introduce custom macro ``find_package`` and call standard + CMake instructions by using ``_find_package``. It's undocumented CMake + feature of saving previous function under underscore starting name. + Overwriting standard CMake calls simply look like a hack in my opinion. I + think if you have an idea that can be solved this way, then it make sense to + either design and implement it in CMake itself or don't touch original code + and wrap your extra functionality in separate function. As you understand + Hunter pick the latter. Also this approach will not work if user will + introduce his own custom ``find_package`` hook, or will use + ``include(FindXXX)``/``find_library``. All this are errors that should be + fixed anyway but it just show an example that you will have to patch the + original code effectively nullifying the benefits of this hook. + +* As showed in :doc:`F.A.Q.: Why do we need forks? ` + the adding of ``hunter_add_package`` is a relatively quite small amount of + code comparing to the rest of the patch needed in practice. Such optimization + is only look useful at the first glance. If you try to do few practical + examples you will see that it's not a big deal and not worth optimization at + all, at least for now. + +So the choice here is between a clean, simple and universal solution introduced +by ``hunter_add_package`` and tricky, undocumented, surprising for user +implementation that will still not cover all the scenarios. + +Some important notes: + +- Adding the ``hunter_add_package`` to your project **do not force you** to + always use only Hunter for dependency management. + See :doc:`Backward compatibility ` for details. + +- Package with CMake and without dependencies can be used **as is** in Hunter. + See :ref:`examples `. + +- If you want to support ``DEB`` packaging in your project you have to modify + CMake code: + + - https://github.com/opencv/opencv/blob/4.0.1/cmake/OpenCVPackaging.cmake#L58-L116 diff --git a/docs/faq/why-hunter-is-slow.rst b/docs/faq/why-hunter-is-slow.rst new file mode 100644 index 000000000..84987ec8e --- /dev/null +++ b/docs/faq/why-hunter-is-slow.rst @@ -0,0 +1,305 @@ +.. Copyright (c) 2018, Ruslan Baratov +.. All rights reserved. + +.. spelling:: + + tl + dr + +Why Hunter is slow? +------------------- + +tl;dr It's not. + +General notes +============= + +If package is already installed then overhead for each ``hunter_add_package`` +call is a check of one ``DONE`` stamp file, +e.g. is equal to ``if(EXISTS "/path/to/DONE")``. Penalty for such action is +hardly measurable. + +If package is not installed then an archive with binaries can be +:ref:`downloaded from server `. There will be no source +download step performed for package or dependencies, and of course there will be +no configure/build/install steps. + +If binaries for the package are not available on server then we have to build +package from sources. Archive with sources will be downloaded once, +configure/build/install steps will be performed once too. Results will be +:doc:`shared between several local projects `. + +By default :ref:`HUNTER_STATUS_DEBUG ` option is ``OFF`` +and you may not see some Hunter activity. If you think that Hunter hangs at +some point then this option is probably need to be set to ``ON``. + +Variable :ref:`HUNTER_CONFIGURATION_TYPES ` by +default set to ``Release`` + ``Debug``, meaning that build time is longer about +twice compared to a single ``Release`` build. Final size of the package usually +will be more than twice. + +Use latest +========== + +Prefer latest Hunter version and default package version. E.g. Windows platform +is known to have performance issues while unpacking big archives. On Windows +with default anti-virus turned on Boost 1.66.0 archive took more than 4 minutes +to unpack, if anti-virus turned off it's about 30 (!) seconds (on Linux machine +with the weaker hardware it took less than 10 seconds). Hunter by default used +1.66.0-p0 patched archive with removed examples, tests and documentation. This +reduce the size from 70.7 MB to 17.7 MB, the unpack time dropped to 8 seconds. +As usual downloading from cache is the best option, e.g. Boost.system Release ++ Debug archive has 154 KB size: + +* https://github.com/ingenue/hunter-cache/releases/download/cache-234d975/234d9755a85b09bcd2f266d2620707ccd514020e.tar.bz2 + +.. _id calculation: + +\*-ID calculation +================= + +Each CMake configure step will trigger calculation of +``Hunter-ID``/``Config-ID``/``Toolchain-ID`` triple. While ``Hunter-ID`` and +``Config-ID`` have small overhead, the calculation of ``Toolchain-ID`` for +some generators can be noticeable. To calculate ``Toolchain-ID`` Hunter will +create isolated project with one C++ file, and for example with Xcode generator +it may take much longer then with Makefile generator: + +.. code-block:: none + + > rm -rf _builds + +.. code-block:: cmake + + # CMakeLists.txt + + cmake_minimum_required(VERSION 3.2) + project(foo) + +.. code-block:: none + :emphasize-lines: 1, 8 + + > time cmake -H. -B_builds -GXcode + -- The C compiler identification is AppleClang ... + -- The CXX compiler identification is AppleClang ... + ... + -- Configuring done + -- Generating done + -- Build files have been written to: /.../_builds + cmake -H. -B_builds -GXcode ... 18.305 total + +Same test but Makefile generator: + +.. code-block:: none + :emphasize-lines: 1, 8 + + > time cmake -H. -B_builds + -- The C compiler identification is AppleClang ... + -- The CXX compiler identification is AppleClang ... + ... + -- Configuring done + -- Generating done + -- Build files have been written to: /.../_builds + cmake -H. -B_builds ... 2.400 total + +To skip ``Toolchain-ID`` calculation each time CMake code changed user can add +:ref:`HUNTER_NO_TOOLCHAIN_ID_RECALCULATION=ON ` +option: + +.. code-block:: none + + > rm -rf _builds + +.. code-block:: cmake + :emphasize-lines: 5-9 + + # CMakeLists.txt + + cmake_minimum_required(VERSION 3.2) + + option( + HUNTER_NO_TOOLCHAIN_ID_RECALCULATION + "No Toolchain-ID recalculation" + ON + ) + + include("cmake/HunterGate.cmake") + HunterGate( + URL "https://github.com/ruslo/hunter/archive/v0.22.22.tar.gz" + SHA1 "83f7dd182930dee784fafd29745f55e7cd06ca34" + ) + project(foo) + + hunter_add_package(md5) + +Initial ``Toolchain-ID``: + +.. code-block:: none + :emphasize-lines: 3 + + > cmake -H. -B_builds -DHUNTER_STATUS_DEBUG=ON + ... + -- [hunter] Calculating Toolchain-SHA1 + ... + +Reuse: + +.. code-block:: none + :emphasize-lines: 3 + + > cmake -H. -B_builds -DHUNTER_STATUS_DEBUG=ON + ... + -- [hunter *** DEBUG *** ...] Toolchain-ID recalculation will be skipped + ... + +When this option is ``ON`` user is responsible for correctness of +``Toolchain-ID`` value on updates of compiler and compiler flags. E.g. you have +to set this option to ``OFF`` explicitly for every local project when you do +change ``CXX`` environment variable, upgrade compiler, update or switch Xcode +version, when you change ``CMAKE_TOOLCHAIN_FILE`` path or content of CMake +toolchain. Violation of this rule can lead to invalid unrecoverable cache state. +Because of this it's highly recommended not to use this option on machine +which can be used to build and upload binaries. Note that Hunter will upload +all archives from ``Cache`` directory, not only packages build by current +local project. + +As an example here are actions that can lead to incorrect cache state: + +.. code-block:: cmake + + # CMakeLists.txt + + cmake_minimum_required(VERSION 3.2) + + option( + HUNTER_NO_TOOLCHAIN_ID_RECALCULATION + "No Toolchain-ID recalculation" + ON + ) + + set( + CMAKE_TOOLCHAIN_FILE + "${CMAKE_CURRENT_LIST_DIR}/toolchain.cmake" + CACHE + FILEPATH + "Default toolchain" + ) + + include("cmake/HunterGate.cmake") + HunterGate( + URL "https://github.com/ruslo/hunter/archive/v0.22.22.tar.gz" + SHA1 "83f7dd182930dee784fafd29745f55e7cd06ca34" + ) + project(foo) + + hunter_add_package(gflags) + +.. code-block:: cmake + + # toolchain.cmake + + set(CMAKE_CXX_STANDARD 11) + +Run configure stage to build ``gflags``: + +.. code-block:: none + + > cmake -H. -B_builds -DHUNTER_STATUS_DEBUG=ON + ... + -- [hunter] [ Hunter-ID: 83f7dd1 | Toolchain-ID: 385a6e9 | Config-ID: 2b427be ] + ... + /usr/bin/g++-7 ... -std=gnu++11 -c /.../gflags_completions.cc + +Toolchain with C++11 standard will have ID ``385a6e9``. + +Now set standard to 14: + +.. code-block:: cmake + + # toolchain.cmake + + set(CMAKE_CXX_STANDARD 14) + +And add "GTest" to CMakeLists.txt: + +.. code-block:: cmake + :emphasize-lines: 27 + + # CMakeLists.txt + + cmake_minimum_required(VERSION 3.2) + + option( + HUNTER_NO_TOOLCHAIN_ID_RECALCULATION + "No Toolchain-ID recalculation" + ON + ) + + set( + CMAKE_TOOLCHAIN_FILE + "${CMAKE_CURRENT_LIST_DIR}/toolchain.cmake" + CACHE + FILEPATH + "Default toolchain" + ) + + include("cmake/HunterGate.cmake") + HunterGate( + URL "https://github.com/ruslo/hunter/archive/v0.22.22.tar.gz" + SHA1 "83f7dd182930dee784fafd29745f55e7cd06ca34" + ) + project(foo) + + hunter_add_package(gflags) + hunter_add_package(GTest) + +Run build: + +.. code-block:: none + + > cmake --build _builds + ... + -- [hunter *** DEBUG *** ...] Toolchain-ID recalculation will be skipped + ... + -- [hunter] [ Hunter-ID: 83f7dd1 | Toolchain-ID: 385a6e9 | Config-ID: 2b427be ] + ... + /usr/bin/g++-7 ... -std=gnu++14 -c /.../gtest-all.cc + ... + +As you can see C++14 flag used while building new package however +``Toolchain-ID`` remains the same, archive with invalid information saved +in cache now! + +The real ``Toolchain-ID`` for C++14 flag is ``b92ba0d``: + +.. code-block:: none + + > cmake -H. -B_builds -DHUNTER_NO_TOOLCHAIN_ID_RECALCULATION=OFF + ... + -- [hunter] Calculating Toolchain-SHA1 + ... + -- [hunter] [ Hunter-ID: 83f7dd1 | Toolchain-ID: b92ba0d | Config-ID: 2b427be ] + ... + +Option can be limited only for problematic generators, e.g. apply it to +Xcode generator only: + +.. code-block:: cmake + :emphasize-lines: 3-9 + + cmake_minimum_required(VERSION 3.2) + + if(CMAKE_GENERATOR STREQUAL "Xcode") + option( + HUNTER_NO_TOOLCHAIN_ID_RECALCULATION + "No Toolchain-ID recalculation" + ON + ) + endif() + + include("cmake/HunterGate.cmake") + HunterGate( + URL "https://github.com/ruslo/hunter/archive/v0.22.22.tar.gz" + SHA1 "83f7dd182930dee784fafd29745f55e7cd06ca34" + ) + project(foo) diff --git a/docs/index.rst b/docs/index.rst index 7f983088b..2abe3e43c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -4,40 +4,39 @@ Hunter: organize freedom ======================== -.. warning:: +Welcome to the Hunter package manager documentation! - Documentation is in process of migrating from - `GitHub wiki `_. - Some information may be missing: blank pages, broken links, etc. - Will be fixed soon... +Hunter is a CMake driven cross-platform package manager for C/C++ [1]_ projects. +With the help of Hunter you can organize builds for **Linux**, **Windows**, +**macOS**, **iOS**, **Android**, **Raspberry Pi** and other platforms. +Third-party external projects are highly customizable, effectively allowing you +to have myriad variants of directories with them based on combinations of +version to build, static/shared, CMake ``-D`` options, Release/Debug, etc. -Welcome to the Hunter package manager documentation! +Separate root directories will be created for each variant, so they all +can be used simultaneously on one machine without conflicts +(just like `virtualenv`_ but automatically). +Going further: each such root directory can be shared between several +local projects if configuration of externals matches. +So when you are starting another project from scratch and use the same external +packages, there will be no additional copy or build triggered; the only +overhead is checking the existence of a ``DONE`` stamp file for each package. +In case your local environment is similar enough to the continuous integration +environment of Travis/AppVeyor service, then build will not be triggered at all +- cached binaries will be downloaded from GitHub server instead. + +Mainly Hunter is designed to manage packages with CMake build system under the +hood and existing CMake packages can be quite easily integrated into system, +but non-CMake packages are also supported too using custom templates +(build schemes) with ``ExternalProject_Add`` command(s). -Hunter is CMake-driven cross-platform package manager for C++ [1]_ projects. -With the help of Hunter you can organize builds for **Linux**, **OS X**, -**Windows**, **iOS**, **Android**, **Raspberry Pi**. Third party external -projects are highly customizable effectively allowing you to have myriad -variants of directories with them based on combinations of version to build, -static/shared, CMake ``-D`` options, Release/Debug etc. Separate root -directory will be created for each variant so they all can be used -simultaneously on one machine without conflicts (just like `virtualenv`_ but -automatically). Going further: each such root directory can be shared between -several local projects if configuration of externals matches. So when you are -starting project from scratch and use same external packages there will be no -additional copy or build triggered, the only overhead is checking existence of -one ``DONE`` stamp file for each package. In case your local environment is -similar enough to continuous integration environment of Travis/AppVeyor -services then build will not be triggered at all - cached binaries will be -downloaded from GitHub server instead. Mainly Hunter designed to manage -packages with CMake build system under the hood and existing CMake package can -be quite easily integrated into system but non-CMake packages supported too -using custom templates (build schemes) with ``ExternalProject_Add`` command(s). -Client is a collection of CMake only modules (i.e. it's **not a binary** like -``apt-get`` or script like ``brew``) so it supports from the box all -platforms/generators/IDEs which CMake can handle like Visual Studio, Xcode, -QtCreator, NMake, Ninja, Cygwin or MinGW. Works fine with CMake-GUI too. +The Hunter client is a collection of CMake-only modules +(i.e. it's **not a binary** like ``apt-get`` or script like ``brew``) +so it supports out-of-the-box all platforms/generators/IDEs which CMake can +handle, like Visual Studio, Xcode, :doc:`Android Studio `, +QtCreator, NMake, Ninja, Cygwin or MinGW. It works fine with CMake-GUI too. -Prime directive used for adding package to the current root is +The prime directive used for adding package to the current root is ``hunter_add_package`` which companioning CMake's ``find_package``. For example: @@ -59,7 +58,6 @@ Sounds interesting? Keep reading! Frequently Asked Questions /contributing /contacts - /donations /reference .. [1] C++ is the main goal, works for other types as well. See :ref:`Manage anything `. diff --git a/docs/jenkins.sh b/docs/jenkins.sh index a9a273bd8..3428035f9 100755 --- a/docs/jenkins.sh +++ b/docs/jenkins.sh @@ -31,4 +31,4 @@ rm -rf _build _static _spelling mkdir _static sphinx-build -v -W . _build -sphinx-build -b spelling . _spelling +sphinx-build -b spelling -W . _spelling diff --git a/docs/make.sh b/docs/make.sh index 01f12d8bd..7cae09339 100755 --- a/docs/make.sh +++ b/docs/make.sh @@ -4,7 +4,7 @@ set -x mkdir -p _static -sphinx-build -v . _build +sphinx-build -W -v . _build set +x diff --git a/docs/old-wiki/Home.md b/docs/old-wiki/Home.md new file mode 100644 index 000000000..63975e315 --- /dev/null +++ b/docs/old-wiki/Home.md @@ -0,0 +1,19 @@ +Cross-platform package manager for C++ (based on CMake ExternalProject). + +### Usage +* Package customization + * [Version and options](https://github.com/ruslo/hunter/wiki/example.custom.config.id) + * [Build type](https://github.com/ruslo/hunter/wiki/example.hunter_configuration_types) +* [Uploading binaries to server](https://docs.hunter.sh/en/latest/faq/why-binaries-from-server-not-used.html#uploading-to-server) +* [Multiple HunterGate commands (e.g. projects/subprojects)] +(https://github.com/ruslo/hunter/wiki/usr.multiple.huntergate) + +### Tutorials +* [Adding new package](https://docs.hunter.sh/en/latest/creating-new/cmake.html) +* [Adding new package (custom download scheme)] +(https://github.com/ruslo/hunter/wiki/usr.adding.new.package.custom.scheme) + +### Develop +* [Variables (Dev)](https://github.com/ruslo/hunter/wiki/dev.variables) +* [Build schemes](https://github.com/ruslo/hunter/wiki/dev.build.schemes) +* [Scheme variables](https://github.com/ruslo/hunter/wiki/dev.scheme_variables) diff --git a/docs/old-wiki/Pitfalls.md b/docs/old-wiki/Pitfalls.md new file mode 100644 index 000000000..ba5a9ae9c --- /dev/null +++ b/docs/old-wiki/Pitfalls.md @@ -0,0 +1,46 @@ +#### file DOWNLOAD HASH mismatch + +Build failed with next message: +``` + for file: [/.../_3rdParty/Download/OpenSSL_1_0_1e.tar.gz] + expected hash: [4e8e2b21899f0dab567def50680dfd02a7acbb1a] + actual hash: [da39a3ee5e6b4b0d3255bfef95601890afd80709] +``` + +Something went wrong. `da39...` is a hash of an empty file: +```bash +> touch x +> openssl sha1 x +SHA1(x)= da39a3ee5e6b4b0d3255bfef95601890afd80709 +``` + +If error is stable you can try to rebuild cmake with system curl: +``` +> cmake -H. -B_builds -DCMAKE_INSTALL_PREFIX=/path/to/install/cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_USE_SYSTEM_CURL=YES +``` + +If error is sporadic, well, C’est la vie, hit rebuild again (TODO retry parameter?) + +### *_ROOT modification + +`HunterGate` function (master file `/cmake/Hunter` to be precise) clears all `*_ROOT` variables of internal packages (i.e. packages that installed by hunter). So if you set `_ROOT` variable +between `HunterGate` and `hunter_add_package` calls hunter will not work correctly. + +### include priority + +If your package can be installed by hunter and use hunter, then you can be trapped by including +headers from hunter root instead of local path: + +``` +# hunter root +/include/some-dep # mypackage use it +/include/mypackage # ... and mypackage is in the hunter too (somebody already install it) + +# mypackage/CMakeLists.txt +find_package(some-dep) +include_directories(${SOME_DEP_DIRECTORIES}) # Surprise, now /include/mypackage has priority! +include_directories(sources/include) # and this will be ignored... +``` + +Rule: local directories has **higher** priority then a system. Use `BEFORE` and `AFTER` suboptions of [include_directories](http://www.cmake.org/cmake/help/v3.0/command/include_directories.html) command to +avoid such kind of situations. \ No newline at end of file diff --git a/docs/old-wiki/Rationale.md b/docs/old-wiki/Rationale.md new file mode 100644 index 000000000..fa20001fe --- /dev/null +++ b/docs/old-wiki/Rationale.md @@ -0,0 +1,11 @@ +* TODO +* [Toolchain verification](https://github.com/ruslo/hunter/wiki/Rationale-%28toolchain-verification%29) + +### X + +* download before first command parsed (need for proper `find_package` command work or external cmake libs) +* internal projects must see each other (forward `_ROOT` variable) + +### Synchronization + +* TODO \ No newline at end of file diff --git a/docs/old-wiki/Requirements.md b/docs/old-wiki/Requirements.md new file mode 100644 index 000000000..2698741a4 --- /dev/null +++ b/docs/old-wiki/Requirements.md @@ -0,0 +1,86 @@ +### CMake 3.0 + +* http://www.cmake.org/cmake/resources/software.html +* For iOS build download and install [patched](https://github.com/ruslo/CMake/releases/tag/v3.0.0-ios-universal) +cmake version + +### HUNTER_ROOT + +This environment variable will point to working directory of hunter package manager. This is where all +downloaded archives and installed libraries will reside. It's recommended to use environment variable, but +also see [alternatives](https://github.com/hunter-packages/gate#effects). +For UNIX-family (Linux, Mac, Cygwin) users it propably +will be `export HUNTER_ROOT=/path/to/hunter/root` in `.bashrc` file, for Windows users: +`Control Panel` -> `System` -> `Advanced System Settings` -> `Environment Variables`. Do not forget to restart +all terminals/CMake-GUIs to apply changes in both cases. Note that all libraries will be installed in +two variants: `Debug` and `Release`. Check that there are enough disk space available (directory can +easily exceed 1 GB). + +For example windows (VS 64/32 + cygwin): +* HUNTER_ROOT (> 5 GB) + * HUNTER_ROOT/Downloads (~ 100 MB) + * HUNTER_ROOT/Base/Build (~ 1 GB) + * HUNTER_ROOT/Base/Source/Boost (> 2 GB) # boost builds in-source + * HUNTER_ROOT/Base/Install (> 1 GB) + +### Toolchains + +Projects that uses different toolchains can be build in one HUNTER_ROOT directory if each toolchain +define `HUNTER_INSTALL_TAG` variable. +For example if [clang_libstdcxx](https://github.com/ruslo/polly/wiki/Toolchain-list#clang_libstdcxx) +and [gcc](https://github.com/ruslo/polly/wiki/Toolchain-list#gcc) toolchain used: + +* HUNTER_ROOT/Base/Install/clang_libstdcxx +* HUNTER_ROOT/Base/Install/gcc + +For each build `*_Dir` variables will be modified so standard `find_package` command will pick appropriate +include directories and libraries: + +```cmake +find_package(Boost REQUIRED ...) + +include_directories(${Boost_INCLUDE_DIR}) + # HUNTER_ROOT/Base/Install/clang_libstdcxx/include for clang_libstdcxx toolchain + # HUNTER_ROOT/Base/Install/gcc/include for gcc toolchain + +target_link_libraries(... PUBLIC ${Boost_LIBRARIES}) + # HUNTER_ROOT/Base/Install/clang_libstdcxx/lib/libboost_... for clang_libstdcxx toolchain + # HUNTER_ROOT/Base/Install/gcc/lib/libboost_... for gcc toolchain +``` + +### Toolchains example (polly) + +* Download archive, unpack it and set `POLLY_ROOT` environment variable. Unix-style: +``` +> POLLY_VERSION="0.4.4" +> wget "https://github.com/ruslo/polly/archive/v${POLLY_VERSION}.tar.gz" +> tar xf "v${POLLY_VERSION}.tar.gz" +> export POLLY_ROOT="`pwd`/polly-${POLLY_VERSION}" +> export PATH="${POLLY_ROOT}/bin:${PATH}" # If you want to use build.py script +``` + +Now toolchains can be used: + +``` +> cmake -H. -B_builds -DCMAKE_TOOLCHAIN_FILE=${POLLY_ROOT}/sanitize_address.cmake +... +-- [polly] Used toolchain: Clang address sanitizer / c++11 support +... +> cmake --build _builds +... +clang++ -std=c++11 -fsanitize=address ... +... +``` + +Or using `build.py` script (generate and build, see `build.py --help` for all options): +``` +> build.py --toolchain sanitize_address --verbose +... +-- [polly] Used toolchain: Clang address sanitizer / c++11 support +... +clang++ -std=c++11 -fsanitize=address ... +... +``` + +* https://github.com/ruslo/polly + diff --git a/docs/old-wiki/Used-variables.md b/docs/old-wiki/Used-variables.md new file mode 100644 index 000000000..e4cdbd32b --- /dev/null +++ b/docs/old-wiki/Used-variables.md @@ -0,0 +1,17 @@ +### HUNTER_STATUS_PRINT + +If this variable is set to `TRUE` process information will be printed + +### HUNTER_STATUS_DEBUG + +Like `HUNTER_STATUS_PRINT` (more verbose). Additionally set `CMAKE_VERBOSE_MAKEFILE=YES` for external projects. + +### HUNTER_ROOT + +This variable setted automatically after incuding master `Hunter` file. + +### HUNTER_BASE + +This variable setted automatically after including master `Hunter` file. This variable will set `EP_BASE` property for current directory. See [documentation][link_documentation]. + +[link_documentation]: http://www.cmake.org/cmake/help/v2.8.12/cmake.html#module:ExternalProject \ No newline at end of file diff --git a/docs/old-wiki/dev.build.schemes.md b/docs/old-wiki/dev.build.schemes.md new file mode 100644 index 000000000..311765efb --- /dev/null +++ b/docs/old-wiki/dev.build.schemes.md @@ -0,0 +1,46 @@ +Since not every package use CMake as a build tool there are templates for [ExternalProject_Add][1] command. These templates called [build schemes][2] and allow usage of custom build tools. For example see [tutorial][3] how to trigger `xcodebuild` instead of CMake. Command [hunter_pick_scheme][6] will help you to choose appropriate scheme if there are several of them. + +## General + +#### url_sha1_download.cmake.in +* [Scheme][4] used for downloading only. I.e. when you need to download something that is not an unpackable archive or archive that you don't want to unpack for any reason + +#### url_sha1_unpack.cmake.in + +* [Scheme][5] download and unpack archive without triggering any build commands. Examples: [CMake modules][8], [Clang tools extra][9] which is used as a subdirectory to [LLVM][10] project. Note that a header library can be installed as a regular project even if it has no binaries. See [Interface Libraries][13] and [example][14]. + +#### url_sha1_cmake.cmake.in + +* [Scheme][7] used to build CMake projects. + +## Package special + +Also refer to [Useful variables while building schemes](https://github.com/ruslo/hunter/wiki/dev.scheme_variables) + +### Boost +* [url_sha1_boost.cmake.in](https://github.com/ruslo/hunter/blob/master/cmake/schemes/url_sha1_boost.cmake.in) +* [url_sha1_boost_ios_library.cmake.in](https://github.com/ruslo/hunter/blob/master/cmake/schemes/url_sha1_boost_ios_library.cmake.in) +* [url_sha1_boost_library.cmake.in](https://github.com/ruslo/hunter/blob/master/cmake/schemes/url_sha1_boost_library.cmake.in) + +### OpenSSL +* [url_sha1_openssl.cmake.in](https://github.com/ruslo/hunter/blob/master/cmake/schemes/url_sha1_openssl.cmake.in) +* [url_sha1_openssl_ios.cmake.in][12] +* [url_sha1_openssl_windows.cmake.in][11] + +### iOS-Sim +* [url_sha1_ios_sim.cmake.in](https://github.com/ruslo/hunter/blob/master/cmake/schemes/url_sha1_ios_sim.cmake.in) + +[1]: http://www.cmake.org/cmake/help/v3.0/module/ExternalProject.html +[2]: https://github.com/ruslo/hunter/tree/master/cmake/schemes +[3]: https://github.com/ruslo/hunter/wiki/usr.adding.new.package.custom.scheme +[4]: https://github.com/ruslo/hunter/blob/master/cmake/schemes/url_sha1_download.cmake.in +[5]: https://github.com/ruslo/hunter/blob/master/cmake/schemes/url_sha1_unpack.cmake.in +[6]: https://github.com/ruslo/hunter/wiki/dev.modules#hunter_pick_scheme +[7]: https://github.com/ruslo/hunter/blob/master/cmake/schemes/url_sha1_cmake.cmake.in +[8]: https://github.com/ruslo/hunter/wiki/pkg.sugar +[9]: https://github.com/ruslo/hunter/blob/develop/cmake/projects/ClangToolsExtra/hunter.cmake +[10]: https://github.com/ruslo/hunter/blob/23a5a8342a4bdd81da336bc449e7e8707d77df18/cmake/config.cmake#L36 +[11]: https://github.com/ruslo/hunter/blob/master/cmake/schemes/url_sha1_openssl_windows.cmake.in +[12]: https://github.com/ruslo/hunter/blob/master/cmake/schemes/url_sha1_openssl_ios.cmake.in +[13]: http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html#interface-libraries +[14]: https://github.com/ruslo/hunter/wiki/pkg.leathers \ No newline at end of file diff --git a/docs/old-wiki/dev.hunter.root.md b/docs/old-wiki/dev.hunter.root.md new file mode 100644 index 000000000..2873a1464 --- /dev/null +++ b/docs/old-wiki/dev.hunter.root.md @@ -0,0 +1,91 @@ +### Automatic download + +As you probably have [noticed][1] there is no need to clone [this][3] repository to use Hunter since all packages will be downloaded automatically by [HunterGate][2] module. The fact that `URL`/`SHA1` arguments used by `HunterGate` can be checked by finding next lines in log: + +``` +-- [hunter] Initializing Hunter workspace (a98628627c4f4c3ce11ac250fde31a7dbd264a15) +-- [hunter] /.../hunter.tar.gz +-- [hunter] -> /.../_Base/Download/Hunter/.../a986286 +... +-- [hunter] [ Hunter-ID: a986286 | Config-ID: 496782c | Toolchain-ID: 5a219cb ] +``` + +Where `hunter-id` is the first 7 digits of `SHA1` of archive (i.e. first 7 digits of `SHA1` argument). + +### Git clone + +However for development purposes like [adding new package][4] there is git-based functionality in `HunterGate`. Do clone and set [HUNTER_ROOT][5] environment variable: +```bash +> git clone https://github.com/ruslo/hunter +> export HUNTER_ROOT="`pwd`/hunter" +``` + +In this case `URL`/`SHA1` of `HunterGate` **will not** be used! + +Check logs: +``` +-- [hunter] [ Hunter-ID: xxxxxxx | Config-ID: 496782c | Toolchain-ID: 5a219cb ] +``` + +Hence for example you need to do `git pull` to download new changes since modifying `HunterGate` arguments will not have any effects for you (but will have for non-git users, so may be needed too). There are other peculiarities with such approach so probably it make sense to not mix "user" and "development" versions of Hunter. You can achieve this by setting `HUNTER_ROOT` environment variable to an empty directory, do the clone to another one and use `jenkins.py` script for testing (see section below). + +### jenkins.py + +Using git-based version may be quite tricky for the beginners, have some pitfalls and require basic understanding of how Hunter works. Here are some scenarios: + +##### scenario 1 +1. Add package `Foo` with version `1.2.3` to Hunter modules +2. Build package `Foo` (`DONE` stamp saved in Hunter working directory `_Base`) +3. Change `URL` of `Foo` package but keep version the same (i.e. `1.2.3`) +4. Run build -> Hunter see `DONE` stamp for version `1.2.3` and doesn't run rebuild! +5. Change both `URL` and version of package Foo (e.g. `1.2.4`) +6. Run build -> Hunter don't see `DONE` stamp for version `1.2.4`, build Foo and save new `DONE` stamp + +##### scenario 2 +1. Build [cacheable][6] package `Foo` -> Hunter save `DONE` stamp and `*.tar.gz` archive with packed installated files +2. Change internal files like schemes or other CMake modules which should update build instructions of `Foo` +3. Run build -> Hunter see `DONE` stamp for `Foo` and will do nothing +4. Remove `DONE` stamp +5. Run build -> Hunter don't see `DONE` stamp but found `*.tar.gz` in cache so will just unpack archive without triggering build (your updates not applied!) +6. Remove `DONE` stamp and metadata from Cache +7. Run build -> Hunter will rebuild `Foo` with new instructions + +To avoid such problems script `jenkins.py` can be used. This script will pack current Hunter directory and run build instructions for project specified by `PROJECT_DIR` environment variable. Note that this script will create his own `HUNTER_ROOT` directory (i.e. environment variable `HUNTER_ROOT` will not be used): +```bash +# check you have python3 +> python3 --version +Python 3.4.3 + +# download build.py script +> git clone https://github.com/ruslo/polly +> export PATH="`pwd`/polly/bin:$PATH" +> which build.py +/.../polly/bin/build.py + +# clone Hunter repository +> git clone https://github.com/ruslo/hunter +> cd hunter + +# run build for some package, like GTest +# environment variable TOOLCHAIN will be used as an argument for `build.py --toolchain` +[hunter]> TOOLCHAIN=default PROJECT_DIR=examples/GTest ./jenkins.py --verbose + +# script will pack current archive in `_testing` directory +-- [hunter] Initializing Hunter workspace (f0550216489047a310a27c2b5ac95c70e7e878bf) +-- [hunter] /.../hunter/_testing/hunter.tar.gz +-- [hunter] -> /.../_testing/Hunter/_Base/Download/Hunter/unknown/f055021 +``` + +About `build.py` and toolchains: [link](https://github.com/ruslo/polly#buildpy) + +See `jenkins.py --help` for more options: +* `--nocreate` will not pack new Hunter archive but reuse old one (`_testing/hunter.tar.gz`). This may be useful for testing several packages one-by-one. Also it means that any new changes in Hunter internal modules will not be used. +* `--clear` remove **all** testing directories, i.e. `_testing` directory +* `--clear-except-download` remove `_Base/` and `_Base/Cache` directories but keep `_Base/Download`. This may be helpful for doing cleanup but will save archives with sources for future testing. Note that there is no need to enter full option name, i.e. `./jenkins.py --clear-except` will work fine too + +[1]: https://github.com/ruslo/hunter#first-step +[2]: https://github.com/hunter-packages/gate +[3]: https://github.com/ruslo/hunter +[4]: https://github.com/ruslo/hunter/wiki/usr.adding.new.package +[5]: https://github.com/hunter-packages/gate#effects +[6]: https://github.com/ruslo/hunter/wiki/dev.modules#hunter_cacheable \ No newline at end of file diff --git a/docs/old-wiki/dev.scheme_variables.md b/docs/old-wiki/dev.scheme_variables.md new file mode 100644 index 000000000..4ce272266 --- /dev/null +++ b/docs/old-wiki/dev.scheme_variables.md @@ -0,0 +1,48 @@ +# Global Variables + +### HUNTER_GATE_SHA1 +The SHA1 value of the downloaded tar of hunter + +### HUNTER_GATE_VERSION +Set to the used version of hunter. + +### HUNTER_SELF +To access the location of downloaded and extracted hunter package. For examples the projects folder can be accessed in the folder +`${HUNTER_SELF}/cmake/projects` +The Variable is set in module hunter_finalize and computed with HUNTER_GATE_VERSION and HUNTER_GATE_SHA1 + +### HUNTER_INSTALL_PREFIX +The default install location + +# Package Specific +Package specific variables are available in configuring schemes in the form of @variable_name@ + +### HUNTER_PACKAGE_NAME +Set to the package being installed without the version or component. For example, while installing component 'test' of Boost, HUNTER_PACKAGE_NAME will be set to 'Boost'. + +### HUNTER_PACKAGE_DOWNLOAD_DIR +Location where the package will be downloaded. + +### HUNTER_PACKAGE_HOME_DIR +Home directory for the package. This directory will contain the source, build and install directories. While installing component of the package HUNTER_PACKAGE_HOME_DIR will be set to HUNTER_PACKAGE_HOME_DIR(of parent)/_componentName + +### HUNTER_PACKAGE_SOURCE_DIR +Directory where the source of the package will be extracted. + +### HUNTER_PACKAGE_BUILD_DIR +Build directory of the package. + +### HUNTER_PACKAGE_VERSION +Set to the version of package being installed. + +### HUNTER_PACKAGE_COMPONENT +Set to the component being installed without the version. For example, while installing component 'test' of Boost, HUNTER_PACKAGE_COMPONENT is set to 'test'. + +### HUNTER_EP_NAME +Set to the project being installed. For example, while installing component 'test' of Boost, HUNTER_PACKAGE_COMPONENT will be set to 'Boost-test' and while installing the Boost as a parent package it will be set to 'Boost'. + +### HUNTER_[PACKAGE_NAME]_VERSION +Set to the version of package being installed. For example, while installing component 'test' of Boost with version 1.49.0, HUNTER_Boost_VERSION is set to '1.49.0'. + +### HUNTER_PACKAGE_INSTALL_PREFIX +The location where the current package will be installed. Based on the cacheable property this location may differ from the default HUNTER_INSTALL_PREFIX location. Always use the project specific HUNTER_PACKAGE_INSTALL_PREFIX in schemes. diff --git a/docs/old-wiki/dev.variables.md b/docs/old-wiki/dev.variables.md new file mode 100644 index 000000000..8a4e94404 --- /dev/null +++ b/docs/old-wiki/dev.variables.md @@ -0,0 +1,68 @@ +# HunterGate.cmake + +#### HUNTER_ROOT + +* Set by `hunter_gate_detect_root` function (if already defined by user, this variable leaved as is). See [layout of directories](https://github.com/ruslo/hunter/wiki/EP_BASE-layout). + +#### HUNTER_ROOT_INFO + +* Set by `hunter_gate_detect_root` function + +#### HUNTER_URL + +* Hunter archive download URL. Set by `HunterGate` macro to current scope and cache if not already set by other `HunterGate`. This variable defined once for the whole project. +See [example] +(https://github.com/ruslo/hunter/wiki/Multiple-HunterGate-commands-%28e.g.-projects-subprojects%29). + +#### HUNTER_SHA1 + +* Hunter archive SHA1. Set by `HunterGate`. Same behaviour as `HUNTER_URL`. + +#### HUNTER_BASE + +* Set by `HunterGate` (usually `${HUNTER_ROOT}/_Base/${HUNTER_SHA1}`). This is the directory where all packages that belongs to given SHA1 resides. See [layout] +(https://github.com/ruslo/hunter/wiki/EP_BASE-layout). +* This variable is customizable if used without gate, e.g. for testing hunter itself: +``` +cmake -H./examples/Sugar/ -B./_builds -DHUNTER_ROOT="`pwd`" -DHUNTER_BASE="`pwd`/_builds/_Base" +``` + +#### HUNTER_SELF + +* Set by `HunterGate` (usually `${HUNTER_BASE}/Self`). Directory with unpacked hunter archive sources. This is the place where master file, config, download schemes, recipies etc. lives. + +#### HUNTER_LOCK_PATH + +* Synchronization directory. Only one process that successfully create that directory allowed to init `HUNTER_BASE`. Usually `${HUNTER_BASE}/directory-lock`. + +#### HUNTER_LOCK_INFO + +* Information about locked directory. File with `PROJECT_BINARY_DIR` string. Created by `hunter_gate_try_lock` function. Set to `${HUNTER_LOCK_PATH}/info`. + +#### HUNTER_LOCK_FULL_INFO + +* Information about locked directory. File with `PROJECT_BINARY_DIR` and timestamp of creation. Created by `hunter_gate_try_lock` function. Set to `${HUNTER_LOCK_PATH}/fullinfo`. + +#### HUNTER_GATE_INSTALL_DONE + +* Synchronization file. If multiple processes simultaniously try to init `HUNTER_BASE` directory (by `HunterGate` command) only one of them will do it, other will wait until `HUNTER_GATE_INSTALL_DONE` file created. Usually `${HUNTER_BASE}/install-gate-done`. + +#### HUNTER_IGNORE_BROKEN_PACKAGE_ERROR + +* Ignore error [broken package](https://github.com/ruslo/hunter/wiki/Error-%28broken-package%29). Used to test fixes of broken packages. + +#### HUNTER_SKIP_LOCK + +* When `HUNTER_SKIP_LOCK` is `TRUE` the locking ignored. This variable is used as a workaround for error ["can't lock"](https://github.com/ruslo/hunter/wiki/error.can.not.lock). + +# cmake/Hunter + +#### HUNTER_PACKAGE_DOWNLOAD_DIR + +* Directory with downloaded archives. Usually `${HUNTER_BASE}/Download/`. Can be customized by user for testing purpose. + +# *External* + +#### HUNTER_CMAKE_GENERATOR + +* Set by [toolchain](https://github.com/ruslo/polly/blob/master/utilities/polly_init.cmake). This generator used for all the projects in superbuild (optimization possible, like `NMake` -> `Visual Studio`) \ No newline at end of file diff --git a/docs/old-wiki/example.custom.config.id.md b/docs/old-wiki/example.custom.config.id.md new file mode 100644 index 000000000..494500768 --- /dev/null +++ b/docs/old-wiki/example.custom.config.id.md @@ -0,0 +1,201 @@ +Package version and extra CMake options can be set in user's `config.cmake` file (see also [how to specify custom config location](https://github.com/hunter-packages/gate#usage-custom-config)). + +### Custom package version + +```cmake +# CMakeLists.txt +HunterGate( + URL "https://github.com/ruslo/hunter/archive/v0.8.10.tar.gz" + SHA1 "9308d01ea52c7b8cf1347073c982c679dbac3c09" + LOCAL # <----- Use local config.cmake +) +... +hunter_add_package(GTest) +``` + +```cmake +# cmake/Hunter/config.cmake +hunter_config(GTest VERSION 1.7.0-hunter-9) +hunter_config(ZLIB VERSION 1.2.8-hunter-1) +``` + +### Custom CMake options + +```cmake +# cmake/Hunter/config.cmake +hunter_config(GTest VERSION 1.7.0-hunter-9 CMAKE_ARGS GTEST_SUPER_MODE=ON) +hunter_config(ZLIB VERSION 1.2.8-hunter-1 CMAKE_ARGS ZLIB_FEATURES=FEATURE1;FEATURE2) +``` + +If you set [HUNTER_STATUS_DEBUG=ON](https://github.com/ruslo/hunter/wiki/usr.variables#hunter_status_debug) you can see that options added to build: +``` +-- [hunter *** DEBUG *** 2015-04-20T15:40:12] Add extra CMake args: 'GTEST_SUPER_MODE' = 'ON' +-- [hunter *** DEBUG *** 2015-04-20T15:40:12] Add package: GTest +-- [hunter *** DEBUG *** 2015-04-20T15:40:12] Download scheme: url_sha1_release_debug +-- [hunter *** DEBUG *** 2015-04-20T15:40:12] Url: https://github.com/hunter-packages/gtest/archive/v1.7.0-hunter-9.tar.gz +-- [hunter *** DEBUG *** 2015-04-20T15:40:12] SHA1: 8a47fe9c4e550f4ed0e2c05388dd291a059223d9 +``` + +``` +-- [hunter *** DEBUG *** 2015-04-20T15:40:54] Add extra CMake args: 'ZLIB_FEATURES' = 'FEATURE1' +-- [hunter *** DEBUG *** 2015-04-20T15:40:54] Add extra CMake args: 'ZLIB_FEATURES' += 'FEATURE2' +-- [hunter *** DEBUG *** 2015-04-20T15:40:54] Add package: ZLIB +-- [hunter *** DEBUG *** 2015-04-20T15:40:54] Download scheme: url_sha1_release_debug +-- [hunter *** DEBUG *** 2015-04-20T15:40:54] Url: https://github.com/hunter-packages/zlib/archive/v1.2.8-hunter-1.tar.gz +-- [hunter *** DEBUG *** 2015-04-20T15:40:54] SHA1: 24c89e4b193a56bb411fa9878968002ebe2c6209 +``` + +### Order + +There are several places where configuration of package can be modified : +* First default global config parsed: `${HUNTER_SELF}/cmake/config/default.cmake`. This file contains only `hunter_config` commands so it will set version, cmake arguments and configuration types of each package +* Then user's local config parsed (e.g. `${CMAKE_CURRENT_LIST_DIR}/cmake/Hunter/config.cmake`). This file can make additional calls to `hunter_config` command and **rewrite** version, cmake arguments and configuration types of package. Note that there is no need to specify all packages that you're planning to use, only packages you want to customize +* Additional arguments can be added in `${HUNTER_SELF}/cmake/project//hunter.cmake` file using `hunter_cmake_args` and `hunter_configuration_types` command (see [package defaults](https://github.com/ruslo/hunter/wiki/usr.adding.new.package#defaults)). `hunter_cmake_args` will push arguments **to the front** (i.e. with **low** priority). `hunter_configuration_types` will set configuration types only if they are empty (i.e. not set by global default config or local user's config). + +Only version field in default global config is mandatory, other fields and user's local config are optional. + +#### Example + +##### Version + +```cmake +# global default ${HUNTER_SELF}/cmake/configs/default.cmake +hunter_package(Foo VERSION 1.2) + +# CMakeLists.txt +hunter_add_package(Foo) # default version 1.2 used +``` + +```cmake +# global default ${HUNTER_SELF}/cmake/configs/default.cmake +hunter_package(Foo VERSION 1.2) + +# user's local ${CMAKE_CURRENT_LIST_DIR}/cmake/Hunter/config.cmake +hunter_package(Foo VERSION 2.0) + +# CMakeLists.txt +hunter_add_package(Foo) # user's custom version 2.0 used +``` + +##### Arguments + +```cmake +# global default ${HUNTER_SELF}/cmake/configs/default.cmake +hunter_package(Foo VERSION 1.2) # no additional arguments + +# user's local ${CMAKE_CURRENT_LIST_DIR}/cmake/Hunter/config.cmake +hunter_package(Foo VERSION 2.0 CMAKE_ARGS FOO_FEATURE=ON) + +# CMakeLists.txt +hunter_add_package(Foo) # user's custom version 2.0 + additional FOO_FEATURE=ON used +``` + +```cmake +# global default ${HUNTER_SELF}/cmake/configs/default.cmake +hunter_package(Foo VERSION 1.2) # no additional arguments + +# user's local ${CMAKE_CURRENT_LIST_DIR}/cmake/Hunter/config.cmake +hunter_package(Foo VERSION 2.0 CMAKE_ARGS FOO_FEATURE=ON) + +# global default additional cmake arguments from ${HUNTER_SELF}/cmake/projects/Foo/hunter.cmake +hunter_cmake_args(Foo CMAKE_ARGS FOO_WITH_BOO=ON) + +# CMakeLists.txt +hunter_add_package(Foo) # user's custom version 2.0 + arguments: +# * FOO_WITH_BOO=ON from default hunter.cmake +# * FOO_FEATURE=ON from user's config +``` + +```cmake +# global default ${HUNTER_SELF}/cmake/configs/default.cmake +hunter_package(Foo VERSION 1.2) # no additional arguments + +# user's local ${CMAKE_CURRENT_LIST_DIR}/cmake/Hunter/config.cmake +hunter_package(Foo VERSION 2.0 CMAKE_ARGS FOO_WITH_BOO=OFF) + +# global default additional cmake arguments from ${HUNTER_SELF}/cmake/projects/Foo/hunter.cmake +hunter_cmake_args(Foo CMAKE_ARGS FOO_WITH_BOO=ON) + +# CMakeLists.txt +hunter_add_package(Foo) # user's custom version 2.0 + arguments: +# * FOO_WITH_BOO=ON from default hunter.cmake +# * FOO_WITH_BOO=OFF from user's config +# Since user's config has high priority effectively arguments will be: FOO_WITH_BOO=OFF +``` + +##### Configuration types + +```cmake +# global default ${HUNTER_SELF}/cmake/configs/default.cmake +hunter_package(Foo VERSION 1.2) # no configuration types + +# user's local ${CMAKE_CURRENT_LIST_DIR}/cmake/Hunter/config.cmake +hunter_package(Foo VERSION 2.0) # no configuration types + +# global default additional cmake arguments from ${HUNTER_SELF}/cmake/projects/Foo/hunter.cmake +hunter_configuration_types(Foo CONFIGURATION_TYPES Debug) + +# CMakeLists.txt +hunter_add_package(Foo) # user's custom version 2.0 + default configuration type `Debug` from hunter.cmake +``` + +```cmake +# global default ${HUNTER_SELF}/cmake/configs/default.cmake +hunter_package(Foo VERSION 1.2) # no configuration types + +# user's local ${CMAKE_CURRENT_LIST_DIR}/cmake/Hunter/config.cmake +hunter_package(Foo VERSION 2.0 CONFIGURATION_TYPES Release) + +# global default additional cmake arguments from ${HUNTER_SELF}/cmake/projects/Foo/hunter.cmake +hunter_configuration_types(Foo CONFIGURATION_TYPES Debug) + +# CMakeLists.txt +hunter_add_package(Foo) # user's custom version 2.0 + configuration type Release from user's config +``` + +##### Version inheriting + +Since default config parsed first you can use variable `HUNTER__VERSION` to inherit version: +```cmake +# default config from ${HUNTER_SELF}/cmake/config/default.cmake +hunter_config(Foo VERSION 1.2.3) + +# user's local ${CMAKE_CURRENT_LIST_DIR}/cmake/Hunter/config.cmake +hunter_config(Foo VERSION ${HUNTER_Foo_VERSION} CMAKE_ARGS FOO_WITH_BOO=ON) +``` + +### No effects on CMakeLists.txt + +Note that this file configured internally in Hunter. E.g. variable from `config.cmake` will not be visible in CMakeLists.txt: +```cmake +# cmake/Hunter/config.cmake +hunter_config(GTest VERSION 1.7.0-hunter-9 CMAKE_ARGS GTEST_SUPER_MODE=ON) +set(HELLO_FROM_CONFIG "Hello") +``` + +```cmake +# CMakeLists.txt +HunterGate(...) +message("Config say: '${HELLO_FROM_CONFIG}'") +``` + +```bash +> cmake -H. -B_builds +Config say: '' +``` + +### CMake conditions + +`config.cmake` is a usual CMake-code file, so such commands like `if` and global variables like `WIN32` can be used: + +```cmake +if(WIN32) + hunter_config(GTest VERSION 1.7.0-hunter-9 CMAKE_ARGS GTEST_SUPER_MODE=ON) +endif() +``` + +### Links + +* [HunterGate](https://github.com/hunter-packages/gate#usage-custom-config) +* [hunter_config](https://github.com/ruslo/hunter/wiki/dev.modules#hunter_config) +* [Custom build types](https://github.com/ruslo/hunter/wiki/example.hunter_configuration_types) (e.g. Release/Debug) \ No newline at end of file diff --git a/docs/old-wiki/example.find_package.config.md b/docs/old-wiki/example.find_package.config.md new file mode 100644 index 000000000..a780dbcc1 --- /dev/null +++ b/docs/old-wiki/example.find_package.config.md @@ -0,0 +1,107 @@ +### MODULE vs. CONFIG + +Usually a package can be added to project using one of the `Find.cmake` standard CMake modules, e.g. [Boost](http://www.cmake.org/cmake/help/v3.2/module/FindBoost.html): + +```cmake +set(Boost_USE_STATIC_LIBS ON) +find_package(Boost REQUIRED) +if(WIN32) + add_definitions(-DBOOST_ALL_NO_LIB=1) + add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS}) +endif() + +include_directories(${Boost_INCLUDE_DIRS}) +add_executable(foo foo.cpp) +``` + +Using CONFIG-mode of the `find_package` command will allow all this code to be substituted with literally two lines (see [Boost](https://github.com/ruslo/hunter/wiki/pkg.boost)): +```cmake +find_package(Boost CONFIG REQUIRED) +target_link_libraries(... Boost::boost) + # include dirs (Boost_INCLUDE_DIRS) added automatically + # definition BOOST_ALL_NO_LIB=1 added automatically too +``` +effectively this will add a new [interface imported](http://www.cmake.org/cmake/help/v3.2/command/add_library.html#interface-libraries) target `Boost::boost` to your project. + +* [Documentation](http://www.cmake.org/cmake/help/v3.0/manual/cmake-packages.7.html#config-file-packages) +* [Stackoverflow question](http://stackoverflow.com/a/20857070/2288008) + +### Relocation challenge + +Note that when your dependency is found by `Find.cmake` and then installed with CMake config, the public libraries will be linked with hardcoded paths. For instance: + +```cmake +# CMakeLists.txt +find_package(Boost REQUIRED) +target_include_directories(foo PUBLIC ${Boost_INCLUDE_DIRS}) +``` + +```bash +> cmake --build _builds --target install +Install the project... +-- Install configuration: "Release" +... +-- Installing: //lib/cmake//Targets.cmake +-- Installing: //lib/cmake//Targets-release.cmake +``` +```bash +> grep -i interface_include //lib/cmake//Targets.cmake + INTERFACE_INCLUDE_DIRECTORIES "//include" +``` + +The bad thing about this is that when you pack your code and try to use it on another machine there will be no such directory like `//include/`. The solution to this problem is to use config-mode imported targets: +```cmake +# CMakeLists.txt +find_package(Boost CONFIG REQUIRED) +target_link_libraries(... PUBLIC Boost::boost) +``` + +```cmake +# Config.cmake.in +# template file that will be installed with your library +# i.e. user don't need to call find_package(Boost CONFIG) explicitly +find_dependency(Boost CONFIG) +... +``` + +```bash +> cmake --build _builds --target install +> grep -i boost //lib/cmake//Targets.cmake + INTERFACE_LINK_LIBRARIES "Boost::boost" +``` + +As you can see now the hardcoded paths go away and the [find_dependency](http://www.cmake.org/cmake/help/v3.2/module/CMakeFindDependencyMacro.html) command will locate new paths when the package is moved to machine with a different ``. Target `Boost::boost` will be linked automatically on `find_package`: + +```cmake +# User's CMakeLists.txt +find_package( CONFIG REQUIRED) + +# find_package(Boost CONFIG REQUIRED) # not needed! +# target_link_libraries(... Boost::boost) # not needed! + +target_link_libraries(... ::) +# add Boost::boost automatically with new +``` + +Note that Hunter will download transitively as well: +```cmake +hunter_add_package() +# hunter_add_package(Boost) # not needed! + +find_package( CONFIG REQUIRED) +target_link_libraries(... ::) +``` + +### CMake + +There is quite a lot of boilerplate code that you need to add, but the core of feature is these two lines (`Foo` is the project, `boo` is the target): +```cmake +install(TARGETS boo EXPORT FooTargets ...) # FooTarget.cmake now know about boo +install(EXPORT FooTargets ...) # install FooTarget.cmake +``` + +Next see real examples to run and documenation: + +* [CMake documentation](http://www.cmake.org/cmake/help/v3.2/manual/cmake-packages.7.html#creating-packages) +* [Example](https://github.com/forexample/package-example) +* [Header-only library example](https://github.com/ruslo/leathers/blob/master/CMakeLists.txt) (see `install` section) \ No newline at end of file diff --git a/docs/old-wiki/example.hunter.run.install.md b/docs/old-wiki/example.hunter.run.install.md new file mode 100644 index 000000000..cbf5322f4 --- /dev/null +++ b/docs/old-wiki/example.hunter.run.install.md @@ -0,0 +1,40 @@ +Example to show the usefulness of [HUNTER_RUN_INSTALL](https://github.com/ruslo/hunter/wiki/usr.variables#hunter_run_install) option. + +#### Example 1 +Assume you usually use `/home/username/tools/hunter` directory to install packages by specifying `HUNTER_ROOT` environment variable. Lets guess one time for any reason this variable is accidentially empty. Hunter will report this error while trying to find master file in default `/home/username/.hunter` location and when nothing found it will offer you to run auto-install explicitly: +```bash +> echo $HUNTER_ROOT + +# ooops, something wrong - nothing in output +> cmake -H. -B_builds +[hunter ** FATAL ERROR **] Hunter not found in '/home/username/.hunter/_Base/Download/Hunter/0.8.3/1eae623' +[hunter ** FATAL ERROR **] Set HUNTER_RUN_INSTALL=ON to auto-install it from 'https://.../v0.8.3.tar.gz' +[hunter ** FATAL ERROR **] Settings: +[hunter ** FATAL ERROR **] HUNTER_ROOT: /home/username/.hunter +[hunter ** FATAL ERROR **] HUNTER_SHA1: 1eae623cb5ce9da39c8c3e1b0f6e452f244ddc17 +``` + +#### Example 2 +Guess you want to remove old Hunter version `0.8.2`/`353b0b89bb838b9437a1082aa708b1ab7b3ab77b` from `HUNTER_ROOT` completely and use `0.8.3`/`1eae623cb5ce9da39c8c3e1b0f6e452f244ddc17` in every package (note that in general you can use both versions simultaneously without any limitations): +```bash +> rm -rf $HUNTER_ROOT/_Base/353b0b8 # Remove installed packages +> rm -rf $HUNTER_ROOT/_Base/Download/Hunter/0.8.2/353b0b8 # Remove Hunter archive +> grep SHA1 CMakeLists.txt # project with new 0.8.3 + SHA1 "1eae623cb5ce9da39c8c3e1b0f6e452f244ddc17" +> cmake -H. -B_builds -DHUNTER_RUN_INSTALL=ON +-- [hunter] Initializing Hunter workspace (1eae623cb5ce9da39c8c3e1b0f6e452f244ddc17) +-- [hunter] https://.../v0.8.3.tar.gz +-- [hunter] -> /.../_Base/Download/Hunter/0.8.3/1eae623 +``` + +Guess you forget to update one project and it still using `0.8.2`. Instead of silently install all packages to `HUNTER_ROOT` the error will be reported: +```bash +> grep SHA1 CMakeLists.txt # ooops, old version 0.8.2! + SHA1 "353b0b89bb838b9437a1082aa708b1ab7b3ab77b" +> cmake -H. -B_builds +[hunter ** FATAL ERROR **] Hunter not found in '/.../_Base/Download/Hunter/0.8.2/353b0b8' +[hunter ** FATAL ERROR **] Set HUNTER_RUN_INSTALL=ON to auto-install it from 'https://.../v0.8.2.tar.gz' +[hunter ** FATAL ERROR **] Settings: +[hunter ** FATAL ERROR **] HUNTER_ROOT: /.../ +[hunter ** FATAL ERROR **] HUNTER_SHA1: 353b0b89bb838b9437a1082aa708b1ab7b3ab77b +``` \ No newline at end of file diff --git a/docs/old-wiki/example.hunter_configuration_types.md b/docs/old-wiki/example.hunter_configuration_types.md new file mode 100644 index 000000000..95ed1fc96 --- /dev/null +++ b/docs/old-wiki/example.hunter_configuration_types.md @@ -0,0 +1,98 @@ +You got full control over what build type (Release/Debug) will be used while building your 3rd party packages. + +### HUNTER_CONFIGURATION_TYPES (global) + +Set [HUNTER_CONFIGURATION_TYPES][hunter-configuration-types] CMake variable to specify the list of build types to use while building **all** packages. Default value is `Release` + `Debug`: +```bash +> cmake -H. -B_builds -DHUNTER_STATUS_DEBUG=ON +... +-- [hunter *** DEBUG *** 2015-04-22T12:05:34] HUNTER_CONFIGURATION_TYPES: Release;Debug +``` + +Set your option via command line: +```bash +> cmake -H. -B_builds -DHUNTER_STATUS_DEBUG=ON -DHUNTER_CONFIGURATION_TYPES=SuperRelease +... +-- [hunter *** DEBUG *** 2015-04-22T12:08:56] HUNTER_CONFIGURATION_TYPES: SuperRelease +``` + +Note that `HUNTER_CONFIGURATION_TYPES` now is in CMake cache, so if you run this configure again variable will be used from cache even if it's not set by user: +```bash +> cmake -H. -B_builds -DHUNTER_STATUS_DEBUG=ON +... +-- [hunter *** DEBUG *** 2015-04-22T12:11:22] HUNTER_CONFIGURATION_TYPES: SuperRelease +``` +```bash +> grep HUNTER_CONFIGURATION_TYPES _builds/CMakeCache.txt +HUNTER_CONFIGURATION_TYPES:STRING=SuperRelease +``` + +You can remove cache to use defaults: +```bash +> rm _builds/CMakeCache.txt +> cmake -H. -B_builds -DHUNTER_STATUS_DEBUG=ON +... +-- [hunter *** DEBUG *** 2015-04-22T12:13:28] HUNTER_CONFIGURATION_TYPES: Release;Debug +``` + +Or using `-U` option: +```bash +> rm -rf _builds +> cmake -H. -B_builds -DHUNTER_STATUS_DEBUG=ON -DHUNTER_CONFIGURATION_TYPES=SuperRelease +... +-- [hunter *** DEBUG *** 2015-04-22T12:16:04] HUNTER_CONFIGURATION_TYPES: SuperRelease +``` +```bash +> cmake -H. -B_builds -DHUNTER_STATUS_DEBUG=ON +... +-- [hunter *** DEBUG *** 2015-04-22T12:16:43] HUNTER_CONFIGURATION_TYPES: SuperRelease +``` +```bash +> cmake -H. -B_builds -DHUNTER_STATUS_DEBUG=ON -UHUNTER_CONFIGURATION_TYPES +... +-- [hunter *** DEBUG *** 2015-04-22T12:17:32] HUNTER_CONFIGURATION_TYPES: Release;Debug +``` + +*See CMake [documentation](http://www.cmake.org/cmake/help/v3.2/command/set.html) about variables' types.* + +Also you can set this option to your `CMakeLists.txt` (do it **before** command `HunterGate`): +```cmake +# CMakeLists.txt +set(HUNTER_CONFIGURATION_TYPES MyRelease SuperDebug) +HunterGate(...) +``` + +```bash +> cmake -H. -B_builds -DHUNTER_STATUS_DEBUG=ON +... +-- [hunter *** DEBUG *** 2015-04-22T12:25:22] HUNTER_CONFIGURATION_TYPES: MyRelease;SuperDebug +``` + +### Per package + +You can customize package using `hunter_config` command (see also other [customizations](https://github.com/ruslo/hunter/wiki/example.custom.config.id)): + +```cmake +# CMakeLists.txt +HunterGate( + URL "https://github.com/ruslo/hunter/archive/v0.8.10.tar.gz" + SHA1 "9308d01ea52c7b8cf1347073c982c679dbac3c09" + LOCAL # <----- Use local config.cmake +) +... +hunter_add_package(GTest) +``` + +```cmake +# cmake/Hunter/config.cmake +hunter_config(GTest VERSION 1.7.0-hunter-9 CONFIGURATION_TYPES Release Debug) +hunter_config(ZLIB VERSION 1.2.8-hunter-1 CONFIGURATION_TYPES Release SuperRelease) +``` + +### Links + +* [CMAKE_BUILD_TYPE](http://www.cmake.org/cmake/help/v3.2/variable/CMAKE_BUILD_TYPE.html) +* [CMAKE_CONFIGURATION_TYPES](http://www.cmake.org/cmake/help/v3.2/variable/CMAKE_CONFIGURATION_TYPES.html) +* [Difference between CMAKE_BUILD_TYPE and CMAKE_CONFIGURATION_TYPES](http://stackoverflow.com/a/24470998/2288008) + +[hunter-configuration-types]: https://github.com/ruslo/hunter/wiki/usr.variables#hunter_configuration_types \ No newline at end of file diff --git a/docs/old-wiki/jenkins-pitfalls.md b/docs/old-wiki/jenkins-pitfalls.md new file mode 100644 index 000000000..6743d3089 --- /dev/null +++ b/docs/old-wiki/jenkins-pitfalls.md @@ -0,0 +1,53 @@ +### Fetch failed (windows) #1 + +* Error message + +``` +hudson.plugins.git.GitException: Failed to fetch from ... +Caused by: hudson.plugins.git.GitException: Command "git.exe clean -fdx" returned status code 1: +``` + +* Reason + +Possible reason is that some internal paths from build directory is too long for windows + +* Solution + +Use native windows command `rmdir` before git checkout, for example python script which remove `_builds` directory +([plugin used](https://wiki.jenkins-ci.org/display/JENKINS/pre-scm-buildstep)): +```python +import os + +if os.name == 'nt': + # Fix windows error: `path too long` + os.system('rmdir _builds /s /q') +``` + +### Fetch failed (windows) #2 + +* Same reason but another solution. Tune git: [windows path too long for git](http://stackoverflow.com/a/22831095/2288008) + +### Path too long (windows) + +* Reason + +Path too long somewhere in a build step. + +* Solution (`HUNTER_JUNCTIONS`) + +Create a directory with a short path (like: `C:\jenkins\junctions`) and set an environment variable `HUNTER_JUNCTIONS` to point to this directory. Hunter will detect this variable and use this directory + to create [junction point](http://en.wikipedia.org/wiki/NTFS_junction_point). +You can verify that directory used by adding cmake variable `HUNTER_STATUS_DEBUG=ON`: + +``` +-- [hunter *** DEBUG ***] HUNTER_JUNCTIONS: C:/jenkins/junctions +-- [hunter *** DEBUG ***] Create windows junction: +-- [hunter *** DEBUG ***] from: C:/jenkins/home/workspace/HunterGate/CONFIG/Debug/TOOLCHAIN/nmake-vs2013-x64/label/windows/_builds/nmake-vs2013-x64-Debug/_3rdParty/hunter/external +-- [hunter *** DEBUG ***] to: C:/jenkins/junctions/lL1Pzqi5vb +Junction created for C:\jenkins\junctions\lL1Pzqi5vb <<===>> C:\jenkins\home\workspace\HunterGate\CONFIG\Debug\TOOLCHAIN\nmake-vs2013-x64\label\windows\_builds\nmake-vs2013-x64-Debug\_3rdParty\hunter\external +... +-- [hunter *** DEBUG ***] Generate step successful (dir: C:/jenkins/junctions/lL1Pzqi5vb) +... +-- [hunter *** DEBUG ***] Run build +-- [hunter *** DEBUG ***] Build step successful (dir: C:/jenkins/junctions/lL1Pzqi5vb) +``` \ No newline at end of file diff --git a/docs/old-wiki/rationale-toolchain-verification.md b/docs/old-wiki/rationale-toolchain-verification.md new file mode 100644 index 000000000..41d96a531 --- /dev/null +++ b/docs/old-wiki/rationale-toolchain-verification.md @@ -0,0 +1 @@ +* TODO \ No newline at end of file diff --git a/docs/old-wiki/usr.adding.new.package.custom.scheme.md b/docs/old-wiki/usr.adding.new.package.custom.scheme.md new file mode 100644 index 000000000..c7c3a71c5 --- /dev/null +++ b/docs/old-wiki/usr.adding.new.package.custom.scheme.md @@ -0,0 +1,167 @@ +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](https://github.com/ruslo/hunter/blob/master/cmake/projects/OpenSSL/hunter.cmake)). In general it's better to apply patch with CMake build and use [regular](https://github.com/ruslo/hunter/wiki/usr.adding.new.package) add instruction. Anyway here is a guide how to add a project with custom build: + +### 01. Test it manually +```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 +``` + +### 02. Test it using ExternalProject_Add +```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 +``` +### 03. Add new package +First, custom build scheme need to be added to `cmake/schemes` directory +(*Note*: about directories [layout](https://github.com/ruslo/hunter/wiki/dev.layout)): +```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 [simple CMake-based](https://github.com/ruslo/hunter/wiki/usr.adding.new.package) +project add: +``` +> 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) +``` +``` +> grep ios_sim cmake/config/default.cmake +hunter_config(ios_sim VERSION 1.8.2) +``` + +### 04. Using +Now package ready to be used: +```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 behaviour + +Note that such CMake variables like: +* [CMAKE_{C,CXX}_FLAGS](http://www.cmake.org/cmake/help/v3.2/variable/CMAKE_LANG_FLAGS.html) +* [CMAKE_{C,CXX}_COMPILER](http://www.cmake.org/cmake/help/v3.2/variable/CMAKE_LANG_FLAGS.html) +* [CMAKE_CONFIGURATION_TYPES](http://www.cmake.org/cmake/help/v3.2/variable/CMAKE_CONFIGURATION_TYPES.html) +* [BUILD_SHARED_LIBS](http://www.cmake.org/cmake/help/v3.2/variable/BUILD_SHARED_LIBS.html) + +must to be checked manually for each custom build scheme (see [CMake package default behaviour](https://github.com/ruslo/hunter/wiki/usr.adding.new.package#default-behaviour)) \ No newline at end of file diff --git a/docs/overview.rst b/docs/overview.rst index 15bca4a3c..109c354d4 100644 --- a/docs/overview.rst +++ b/docs/overview.rst @@ -5,8 +5,10 @@ Brief overview -------------- This is a brief overview of big picture. It takes about 5 minutes of reading -but will show you the main features/aspects of using Hunter. Avoid running -real code for now, it will be covered in next :ref:`Quick start ` section. +but will show you the main features/aspects of using Hunter. Please **don't make +any assumptions** about how Hunter works without reading this part. Also avoid +running real code for now, it will be covered in next +:ref:`Quick start ` section. .. toctree:: :maxdepth: 1 diff --git a/docs/overview/anything.rst b/docs/overview/anything.rst index c762b3d29..21cfe524d 100644 --- a/docs/overview/anything.rst +++ b/docs/overview/anything.rst @@ -6,7 +6,7 @@ Manage anything .. _manage-anything: -You can manage anything that can be downloaded by ``URL`` and checked with +You can manage anything that can be downloaded by ``URL`` and checked with an ``SHA1`` hash: * C/C++ packages @@ -23,12 +23,11 @@ You can manage anything that can be downloaded by ``URL`` and checked with * CMake modules .. code-block:: cmake - :emphasize-lines: 2 + :emphasize-lines: 4 - hunter_add_package(Sugar) - include("${SUGAR_ROOT}/cmake/Sugar") + hunter_add_package(sugar) + find_package(sugar CONFIG REQUIRED) - include(sugar_files) sugar_files(...) * Additional sources (`OpenCV example `__): @@ -52,3 +51,7 @@ You can manage anything that can be downloaded by ``URL`` and checked with add_test(NAME FooTest1 COMMAND foo --use-data "${MYDATA_ROOT}/case-1.png") add_test(NAME FooTest2 COMMAND foo --use-data "${MYDATA_ROOT}/case-2.png") # ... + +.. note:: + + * See :doc:`alternative approach ` diff --git a/docs/overview/automatic.rst b/docs/overview/automatic.rst index f83b35c28..45c4958db 100644 --- a/docs/overview/automatic.rst +++ b/docs/overview/automatic.rst @@ -11,8 +11,8 @@ Automatic builds No dependencies in README ========================= -Build instructions from Hunter archive triggered automatically when -``hunter_add_package`` function called. Hence there is no need to specify +Build instructions from the Hunter archive are triggered automatically when +the ``hunter_add_package`` function called, hence there is no need to specify dependencies in a raw ``README`` file like: .. code-block:: none @@ -40,7 +40,7 @@ Now it's simply: Optional dependencies ===================== -Optional dependency? No problems, expressed in a pretty clean way: +Optional dependency? No problem, optional dependencies are expressed in a straightforward way: .. code-block:: cmake :emphasize-lines: 4 @@ -52,13 +52,7 @@ Optional dependency? No problems, expressed in a pretty clean way: hunter_add_package(bar) endif() -Same commands: - -:: - - > cmake -H. -B_builds -DBUILD_WITH_BAR=YES # + install bar - -instead of: +Now instead of: .. code-block:: none :emphasize-lines: 2, 3, 6 @@ -70,17 +64,23 @@ instead of: Then run build: > cmake -H. -B_builds -DBUILD_WITH_BAR=YES -Vs. 'requirements.txt' style -============================ +It's simply: + +:: + + > cmake -H. -B_builds -DBUILD_WITH_BAR=YES # + install bar + +Compared to a 'requirements.txt' style approach +=============================================== -Note that such approach differs from +Note that Hunter's approach differs from a `requirements.txt-like approach `__ -(i.e. when external packages specified by separate file). This allow to avoid -duplication of logic in many cases even if ``requirements.txt`` do downloads -automatically too. +(i.e. when external packages are specified in a separate file). This allows Hunter to avoid +duplication of logic in many cases, even if the ``requirements.txt`` style approach also automatically downloads +dependencies too. -Imagine we have to specify dependencies in some kind of ``requirements.cmake`` -file and there is user's option: +Imagine that we have to specify dependencies in some kind of ``requirements.cmake`` +file and there is a user option ``BUILD_WITH_BAR``: .. code-block:: cmake :emphasize-lines: 3 @@ -91,7 +91,7 @@ file and there is user's option: command_to_install(Bar) endif() -In case it's not CMake code this will look even fancy, say ``requirements.json``: +Or, in the case that it isn't CMake code, this might by something fancy like ``requirements.json``: .. code-block:: json @@ -104,7 +104,7 @@ In case it's not CMake code this will look even fancy, say ``requirements.json`` } } -You have to repeat same condition in ``CMakeLists.txt`` file: +You would have to repeat the same condition in the ``CMakeLists.txt`` file: .. code-block:: cmake :emphasize-lines: 3 @@ -125,8 +125,8 @@ You have to repeat same condition in ``CMakeLists.txt`` file: target_compile_definitions(... PUBLIC "WITH_BAR") endif() -In case when this part will change you must not to forget to modify ``requirements`` -accordingly too. And real world libraries can have nontrivial chain of conditions, e.g. +Later, when you need to change this dependency in ``CMakeLists.txt``, you'd better not forget to also modify ``requirements.cmake`` +accordingly. Remember real world libraries can have nontrivial chain of conditions, e.g. `OpenCV components `__. .. admonition:: Stackoverflow diff --git a/docs/overview/binaries.rst b/docs/overview/binaries.rst index f5799ac09..1e8cdd5f8 100644 --- a/docs/overview/binaries.rst +++ b/docs/overview/binaries.rst @@ -8,13 +8,13 @@ Binaries from server -------------------- -Hunter has internal mechanism of saving binaries of installed packages along -with meta information about toolchain, build options and dependencies. -This allow to not trigger same build on creation of new root directory. -For example when user change version of ``OpenSSL`` from ``1.0.1`` to ``1.0.2`` -it does affect ``Config-ID`` so new root will be created. But it will not affect -how ``GTest`` builds (if it's not a dependency) so ``GTest`` archive can be -unpacked from cache. Such cache can be used locally or uploaded to server. +Hunter has an internal mechanism that saves the binaries of installed packages along +with meta-data about the toolchain, build options, and dependencies. +This allows Hunter to avoid triggering the same build when a new root directory is created. +For example, when a user changes the version of ``OpenSSL`` from ``1.0.1`` to ``1.0.2`` +it will affect ``Config-ID``, so a new root will be created. However, it will not affect +how ``GTest`` builds (if it's not a dependency), so the ``GTest`` archive can be +unpacked from the local cache. The cache can be kept local or uploaded to a Hunter cache server. .. seealso:: @@ -24,25 +24,26 @@ unpacked from cache. Such cache can be used locally or uploaded to server. Details ======= -Default server with binaries is +The default server with cached binaries is `ingenue/hunter-cache `__. -Archives saved as assets to `cache tag `__. -Uploaded packages can be found by ``upload.*`` query on page with branches: +Archives are saved as GitHub `release assets `__ +and each is associated with a git `tag `__. +Available packages can be queried using an ``upload.*`` HTTP query from the GitHub branches URL: * `ingenue/hunter@upload. `__ -Note that some toolchains may not work for the specific packages. Check -status in job details. E.g. Qt is broken for iOS armv7s architecture, so -we have to use ``ios-*-wo-armv7s`` toolchains: +Note that some toolchains may not work for specific packages. Check the +status in the Travis CI job details. For example, Qt is broken for the iOS armv7s architecture, so +we have to use the ``ios-*-wo-armv7s`` toolchains: * https://travis-ci.org/ingenue/hunter/builds/140158080 -Binaries/headers stored in archives. Archives are the result of packing -``CMAKE_INSTALL_PREFIX`` directory produced by -``cmake --build _builds --target install`` command. Idea is similar to CPack -functionality but extended for non-CMake packages too. +Binaries/headers are stored in archives and archives are the result of packing the +``CMAKE_INSTALL_PREFIX`` directory produced by the +``cmake --build _builds --target install`` command. The idea is similar to CPack +functionality but is extended for non-CMake packages too. -.. code-block:: shell +.. code-block:: none :emphasize-lines: 3, 6, 8 > mkdir temp-dir diff --git a/docs/overview/compatibility.rst b/docs/overview/compatibility.rst index 8038de0c8..b2176516f 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: @@ -35,7 +33,7 @@ by default this code will trigger download and build of OpenSSL: /.../_Base/a9bd96a/e8394c3/dd69ac4/Install/lib/libcrypto.a -ldl -but adding ``HUNTER_ENABLED=NO`` make it skip all Hunter instructions and +but adding ``HUNTER_ENABLED=NO`` make it **skip all Hunter instructions** and system library will be used instead: .. code-block:: bash @@ -49,8 +47,21 @@ 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 + +.. note:: + + As you can see ``hunter_add_package`` has no effect when ``HUNTER_ENABLED`` + is ``OFF`` hence such code is redundant: + + .. code-block:: cmake + + if(HUNTER_ENABLED) + hunter_add_package(foo) + endif() + + It will behave in the same way as just ``hunter_add_package(foo)`` alone. ``HUNTER_ENABLED=NO`` can be set by default using CMake ``option``: @@ -71,8 +82,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 a53f2d036..aa925da8b 100644 --- a/docs/overview/customization.rst +++ b/docs/overview/customization.rst @@ -4,14 +4,14 @@ Customization ------------- -You got full control of how packages will be built. You can create your own -mapping ``version`` -> ``URL``, add globals like compiler and flags or add -new build option to external package. +You have full control of how packages will be built. You can create your own +mapping of ``version`` -> ``URL``, add globals like compiler and flags, or add +new build options to external packages. .. toctree:: :maxdepth: 1 Hunter-ID - Config-ID Toolchain-ID - Build types + Config-ID + Build Types diff --git a/docs/overview/customization/build-types.rst b/docs/overview/customization/build-types.rst index 54fd57286..49b58b224 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 243c59166..211b72291 100644 --- a/docs/overview/customization/config-id.rst +++ b/docs/overview/customization/config-id.rst @@ -1,4 +1,4 @@ -.. Copyright (c) 2016, Ruslan Baratov +.. Copyright (c) 2016-2019, Ruslan Baratov .. All rights reserved. Config-ID @@ -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,40 +19,42 @@ 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:: * `Example `_ + * :ref:`HUNTER_BUILD_SHARED_LIBS ` + * :ref:`HUNTER_CONFIGURATION_TYPES ` .. _HunterGate options: https://github.com/hunter-packages/gate#usage-custom-config diff --git a/docs/overview/customization/hunter-id.rst b/docs/overview/customization/hunter-id.rst index 008f4223a..ef7676473 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 942f58bc1..8180dc1b9 100644 --- a/docs/overview/customization/toolchain-id.rst +++ b/docs/overview/customization/toolchain-id.rst @@ -8,60 +8,62 @@ 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 -in Hunter. Only CMAKE_TOOLCHAIN_FILE will be forwarded for all packages, +**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 +76,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 @@ -89,3 +91,28 @@ Message in logs: .. admonition:: Polly * `Collection of toolchains `__ + +.. _simple toolchains: + +Simple toolchains +================= + +Building with ``-fPIC``: + +.. code-block:: cmake + + # toolchain.cmake + set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) + +Building with ``-std=c++11``: + +.. code-block:: cmake + + # toolchain.cmake + set(CMAKE_CXX_STANDARD 11) + set(CMAKE_CXX_STANDARD_REQUIRED YES) + +.. admonition:: CGold + + * `C++11 toolchain `__ + * `Set default toolchain `__ diff --git a/docs/overview/dry.rst b/docs/overview/dry.rst index a49f15e0f..66fd8bdcd 100644 --- a/docs/overview/dry.rst +++ b/docs/overview/dry.rst @@ -4,17 +4,17 @@ Don't Repeat Yourself --------------------- -If you already familiar with `ExternalProject_Add`_ and have wrote some -super-build projects before you probably already aware that writing complete +If you are already familiar with `ExternalProject_Add`_ and have written some +super-build projects before, you are probably already aware that writing a complete solution with toolchains, build types, build options, parallel jobs, -forwarding of compiler flags and making it works correctly for all generators +forwarding of compiler flags, and making it work correctly for all generators is not a trivial task. -Hunter store `ExternalProject_Add`_ recipes as a set of templates. Once -written formula (`build scheme`_) can be reused by other projects without -copying of collection of super-build files (`DRY principle`_). -When new package with new scheme introduced all you need to do is just update -``SHA1``/``URL`` of ``HunterGate`` command. +Hunter stores `ExternalProject_Add`_ recipes as a set of templates. Once +written, formula (`build scheme`_) can be reused by other projects without +copying the collection of super-build files (`DRY principle`_). +When a new package with a new scheme is introduced, all you need to do is just update +the ``SHA1``/``URL`` of ``HunterGate`` command. .. admonition:: Stackoverflow diff --git a/docs/overview/everywhere.rst b/docs/overview/everywhere.rst index 96aa8e13f..062d1ce71 100644 --- a/docs/overview/everywhere.rst +++ b/docs/overview/everywhere.rst @@ -6,3 +6,7 @@ Works everywhere! Hunter works everywhere: CMake-GUI, Qt Creator, Visual Studio, Xcode, Cygwin, MinGW, Jenkins, Travis etc. + +.. seealso:: + + * :doc:`F.A.Q.: How to use Hunter in Android Studio? ` diff --git a/docs/overview/shareable.rst b/docs/overview/shareable.rst index 3113d076b..e5ca1085a 100644 --- a/docs/overview/shareable.rst +++ b/docs/overview/shareable.rst @@ -4,16 +4,16 @@ Shareable --------- -Root directory with installed packages can be shared between several local -projects. In case if one local project trigger installing of some new third -party package then root directory will be locked for modifications until install -finished or interrupted. Other local project that will try to run -``hunter_add_package`` in same root will be automatically paused and spin -waiting for unlock. Note that different root directories do different locks, -e.g. triggering build of ``OpenSSL`` for ``iOS`` will not pause building of -``GTest`` for ``Android``. Internally this is done by ``file(LOCK ...)`` CMake +A root directory with installed packages can be shared between several local +projects. If one local project triggers installation of a new third +party package, then the root directory will be locked against modifications until the install +has either finished or interrupted (i.e. Ctrl-C). Other local projects that try to run +``hunter_add_package`` for the same root at the same time will automatically wait for the root +to be unlocked. Note that different root directories have independent locks, +e.g. triggering a build of ``OpenSSL`` for ``iOS`` will not delay building of +``GTest`` for ``Android``. Internally this is done using the ``file(LOCK ...)`` CMake command (available since ``3.2``). -Same synchronization done for the initializing Hunter by ``HunterGate`` command. -This is very handy feature for the CI systems with environment which is shared +Similar synchronization is done when initializing Hunter using the ``HunterGate`` command. +This is a very handy feature for CI systems where an environment is shared between several jobs, e.g. Jenkins. diff --git a/docs/overview/what-is-it.rst b/docs/overview/what-is-it.rst index 84c77c4ee..2ef01d2a1 100644 --- a/docs/overview/what-is-it.rst +++ b/docs/overview/what-is-it.rst @@ -5,9 +5,9 @@ What is it? ----------- Every Hunter `release`_ (`Atom feed`_) archive is a meta-package with build -instructions and URLs of real packages. Archive will be downloaded and -unpacked automatically by ``HunterGate`` CMake module. You only need to set -``URL`` and ``SHA1``: +instructions and URLs of real packages. The archive will be downloaded and +unpacked automatically by the ``HunterGate`` CMake module. You only need to set +the ``URL`` and ``SHA1``: .. code-block:: cmake :emphasize-lines: 2-3 @@ -17,7 +17,7 @@ unpacked automatically by ``HunterGate`` CMake module. You only need to set SHA1 "f2c3de6d13baf8c5d2aa77bdc47c516e668c677e" ) -Here is content of the archive in simplified form: +Here is the content of the archive in simplified form: .. code-block:: none @@ -29,7 +29,7 @@ Here is content of the archive in simplified form: ... } -If you download and unpack it you can view some internals. Let's see OpenSSL +If you download and unpack it, you can view some internals. Let's look at the OpenSSL package properties: .. literalinclude:: what-is-it.sh @@ -37,7 +37,7 @@ package properties: :start-after: # doc: download-start :end-before: # doc: download-end -`hunter.cmake`_ holds list of available versions: +`hunter.cmake`_ holds the list of available versions: .. literalinclude:: what-is-it.sh :language: shell @@ -83,7 +83,12 @@ Default version from `default.cmake`_ .. code-block:: cmake - hunter_config(OpenSSL VERSION 1.0.2g) + hunter_default_version(OpenSSL VERSION 1.0.2g) + +.. 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 9e6854e50..be75f4d78 100644 --- a/docs/packages.rst +++ b/docs/packages.rst @@ -4,11 +4,50 @@ Packages -------- -List of packages and usage instructions for each package can be found in `wiki sidebar`_. +List of packages and usage instructions for each package. + +.. sidebar:: All packages + + * :doc:`Alphabetically ` + * :ref:`Index ` + +.. toctree:: + :hidden: + + /packages/all .. toctree:: :maxdepth: 1 - /packages/all-packages.rst + /packages/cmake_modules + /packages/concurrency + /packages/containers + /packages/commandline + /packages/compiler + /packages/computer-vision + /packages/compression + /packages/crypto + /packages/database + /packages/datetime + /packages/graphics + /packages/testing + /packages/logging + /packages/frameworks + /packages/filesystem + /packages/machine-learning + /packages/messaging + /packages/math + /packages/media + /packages/networking + /packages/random + /packages/regex + /packages/robotics + /packages/scripting + /packages/serialize + /packages/terminal + /packages/os + +.. note:: -.. _wiki sidebar: https://github.com/ruslo/hunter/wiki + * Don't see packages you need? Feel free to leave a package + `request `__. diff --git a/docs/packages/all-packages.rst b/docs/packages/all-packages.rst deleted file mode 100644 index f9a25b309..000000000 --- a/docs/packages/all-packages.rst +++ /dev/null @@ -1,5 +0,0 @@ -.. Copyright (c) 2016, Ruslan Baratov -.. All rights reserved. - -All packages ------------- diff --git a/docs/packages/all.rst b/docs/packages/all.rst new file mode 100644 index 000000000..e7da2cf36 --- /dev/null +++ b/docs/packages/all.rst @@ -0,0 +1,12 @@ +.. spelling:: + + wiki + +All packages +------------ + +.. toctree:: + :maxdepth: 1 + :glob: + + pkg/* diff --git a/docs/packages/cmake_modules.rst b/docs/packages/cmake_modules.rst new file mode 100644 index 000000000..6bd5992d5 --- /dev/null +++ b/docs/packages/cmake_modules.rst @@ -0,0 +1,10 @@ +.. spelling:: + + autotools + +CMake Modules +------------- + + - :ref:`pkg.autoutils` - CMake utilities to imitate autotools functions + - :ref:`pkg.CreateLaunchers` - CMake module to create command line and debug launchers, including MSVC ".user" file. + - :ref:`pkg.Sugar` - CMake tools and examples diff --git a/docs/packages/commandline.rst b/docs/packages/commandline.rst new file mode 100644 index 000000000..db3c2e9ac --- /dev/null +++ b/docs/packages/commandline.rst @@ -0,0 +1,12 @@ +.. spelling:: + + Commandline + commandline + +Commandline Tools +----------------- + + - :ref:`pkg.gflags` - contains a C++ library that implements commandline flags processing + - :ref:`pkg.cxxopts` - Lightweight C++ command line option parser + - :ref:`pkg.CLI11` - command line parser for C++11 and beyond that provides a rich feature set with a simple and intuitive interface + - :ref:`pkg.readline` - command line editor diff --git a/docs/packages/compiler.rst b/docs/packages/compiler.rst new file mode 100644 index 000000000..46ce0641c --- /dev/null +++ b/docs/packages/compiler.rst @@ -0,0 +1,7 @@ +Compiler +-------- + + - :ref:`pkg.ctti` - Compile Time Type Information for the C++ programming language. + - :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 new file mode 100644 index 000000000..d7ee790c6 --- /dev/null +++ b/docs/packages/compression.rst @@ -0,0 +1,9 @@ +Compression +----------- + + - :ref:`pkg.BZip2` - high-quality data compressor. + - :ref:`pkg.lz4` - Extremely Fast Compression algorithm + - :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 new file mode 100644 index 000000000..5aff2ed87 --- /dev/null +++ b/docs/packages/computer-vision.rst @@ -0,0 +1,22 @@ +.. spelling:: + + Matlab + Morphable + Adelson + +Computer Vision +--------------- + + - :ref:`pkg.acf` - Aggregated Channel Feature object detection in C++ and OpenGL ES 2.0. + - :ref:`pkg.ccv` - A Modern Computer Vision Library + - :ref:`pkg.cvmatio` - Matlab Mat file read and write C++ class with OpenCV bindings. + - :ref:`pkg.cvsteer` - A concise implementation of separable steerable filters + via Freeman and Adelson, including second derivative of Gaussian and its + Hilbert transform, implemented with the OpenCV C++ API + - :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.drishti` - Real time eye tracking for embedded and mobile devices. + - :ref:`pkg.eos` - A lightweight 3D Morphable Face Model fitting library in modern C++11/14 + - :ref:`pkg.Leptonica` - Open source library containing software that is broadly useful for image processing and image analysis applications + - :ref:`pkg.OpenCV` - Open Source Computer Vision Library + - :ref:`pkg.Tesseract` - Open Source OCR Engine diff --git a/docs/packages/concurrency.rst b/docs/packages/concurrency.rst new file mode 100644 index 000000000..ea292c110 --- /dev/null +++ b/docs/packages/concurrency.rst @@ -0,0 +1,24 @@ +.. spelling:: + + MultiThreading + HPC + GPGPU + GPU + LibCDS + libdill + libmill + +Concurrency +----------- + + - :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.LibCDS` - C++ library of Concurrent Data Structures + - :ref:`pkg.libdill` - C library that makes writing structured concurrent programs easy + - :ref:`pkg.libmill` - Go-style concurrency in C + - :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 new file mode 100644 index 000000000..e49dab928 --- /dev/null +++ b/docs/packages/containers.rst @@ -0,0 +1,5 @@ +Containers +---------- + + * :ref:`pkg.sparsehash` - C++ associative containers + * :ref:`pkg.sds` - Simple Dynamic Strings library for C diff --git a/docs/packages/crypto.rst b/docs/packages/crypto.rst new file mode 100644 index 000000000..c508f0bcf --- /dev/null +++ b/docs/packages/crypto.rst @@ -0,0 +1,11 @@ +.. spelling:: + + Crypto + CRC32C + CPU + +Crypto +------ + + - :ref:`pkg.crc32c` - CRC32C implementation with support for CPU-specific acceleration instructions + - :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 new file mode 100644 index 000000000..fb02d48f4 --- /dev/null +++ b/docs/packages/database.rst @@ -0,0 +1,18 @@ +.. spelling:: + + lmdb + LMDB + lmdbxx + +Database +-------- + + - :ref:`pkg.leveldb` - a fast key-value storage library + - :ref:`pkg.lmdb` - Lightning Memory-Mapped Database Manager + - :ref:`pkg.lmdbxx` - C++11 wrapper for the LMDB embedded B+ tree database library + - :ref:`pkg.MySQL-client` + - :ref:`pkg.odb-mysql` + - :ref:`pkg.odb-pgsql` + - :ref:`pkg.odb-sqlite` + - :ref:`pkg.PostgreSQL` + - :ref:`pkg.rocksdb` - an embeddable persistent key-value store for fast storage diff --git a/docs/packages/datetime.rst b/docs/packages/datetime.rst new file mode 100644 index 000000000..a817a4012 --- /dev/null +++ b/docs/packages/datetime.rst @@ -0,0 +1,9 @@ +.. spelling:: + + cctz + Datetime + +Datetime +-------- + + - :ref:`pkg.cctz` - library for translating between absolute and civil times using the rules of a time zone diff --git a/docs/packages/filesystem.rst b/docs/packages/filesystem.rst new file mode 100644 index 000000000..37d635956 --- /dev/null +++ b/docs/packages/filesystem.rst @@ -0,0 +1,9 @@ +.. spelling:: + + Filesystem + +Filesystem +---------- + + - :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 new file mode 100644 index 000000000..6274083e0 --- /dev/null +++ b/docs/packages/frameworks.rst @@ -0,0 +1,16 @@ +.. spelling:: + + OpenTracing + Jaeger + +Frameworks +---------- + + - :ref:`pkg.Boost` - peer-reviewed portable C++ source libraries. + - :ref:`pkg.BoostProcess` + - :ref:`pkg.jaegertracing` - Jaeger C++ tracing implementation + - :ref:`pkg.opentracing-cpp` - OpenTracing API for C++ + - :ref:`pkg.Qt` + - :ref:`pkg.QtQmlManager` + - :ref:`pkg.wt` - Wt is a web GUI library in modern C++. + - :ref:`pkg.wxWidgets` - Cross-Platform GUI Library diff --git a/docs/packages/graphics.rst b/docs/packages/graphics.rst new file mode 100644 index 000000000..aa2263c0e --- /dev/null +++ b/docs/packages/graphics.rst @@ -0,0 +1,18 @@ +.. spelling:: + + freetype + shaders + +Graphics 2D/3D +-------------- + + - :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.glew` - The OpenGL Extension Wrangler Library + - :ref:`pkg.imgui` - Immediate-mode, bloat-free graphical user interface library for C++ + - :ref:`pkg.mojoshader` - MojoShader is a library to work with Direct3D shaders on alternate 3D APIs and non-Windows platforms + - :ref:`pkg.ogles_gpgpu` - GPGPU for mobile devices and embedded systems using OpenGL ES 2.0 + - :ref:`pkg.SDL2` - A cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. + - :ref:`pkg.SDL_ttf` - Sample library which allows to use TrueType fonts in SDL applications + - :ref:`pkg.Urho3D` - Cross-platform 2D and 3D game engine diff --git a/docs/packages/logging.rst b/docs/packages/logging.rst new file mode 100644 index 000000000..1d01e1612 --- /dev/null +++ b/docs/packages/logging.rst @@ -0,0 +1,7 @@ +Logging +------- + + - :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/machine-learning.rst b/docs/packages/machine-learning.rst new file mode 100644 index 000000000..3f999db8a --- /dev/null +++ b/docs/packages/machine-learning.rst @@ -0,0 +1,11 @@ +.. spelling:: + + Keras + +Machine Learning +---------------- + + - :ref:`pkg.caffe` - fast open framework for deep learning. + - :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.xgboost` - Scalable, Portable and Distributed Gradient Boosting (GBDT, GBRT or GBM>`_ Library + - :ref:`pkg.frugally-deep` - Header-only library for using Keras models in C++ diff --git a/docs/packages/math.rst b/docs/packages/math.rst new file mode 100644 index 000000000..1961a9c6a --- /dev/null +++ b/docs/packages/math.rst @@ -0,0 +1,19 @@ +.. spelling:: + + Delaunay + +Math +---- + + - :ref:`pkg.CLAPACK` + - :ref:`pkg.Eigen` - C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms. + - :ref:`pkg.GSL` - GNU Scientific Library + - :ref:`pkg.HastyNoise` - SIMD open source noise generation library with a large collection of different noise algorithms. + - :ref:`pkg.OpenBLAS` - OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version + - :ref:`pkg.double-conversion` - provides binary-decimal and decimal-binary routines for IEEE doubles. + - :ref:`pkg.gemmlowp` - Low-precision matrix multiplication. + - :ref:`pkg.glm` - header only C++ mathematics library for graphics software based on the OpenGL Shading Language (GLSL) specifications. + - :ref:`pkg.half` - Half-precision floating point library + - :ref:`pkg.h3` - Hexagonal hierarchical geospatial indexing system + - :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 new file mode 100644 index 000000000..c58f0303c --- /dev/null +++ b/docs/packages/media.rst @@ -0,0 +1,17 @@ +.. spelling:: + + OpenAL + gif + WebP + +Media +----- + + - :ref:`pkg.Jpeg` - library for JPEG image compression. + - :ref:`pkg.OpenAL` - software implementation of the OpenAL 3D audio API. + - :ref:`pkg.PNG` - library for use in applications that read, create, and manipulate PNG (Portable Network Graphics) raster image files. + - :ref:`pkg.SDL_mixer` - A sample multi-channel audio mixer library for SDL. + - :ref:`pkg.TIFF` + - :ref:`pkg.giflib` - library for reading and writing gif images. + - :ref:`pkg.libyuv` - YUV scaling and conversion functionality. + - :ref:`pkg.WebP` - library to encode and decode images in WebP format. diff --git a/docs/packages/messaging.rst b/docs/packages/messaging.rst new file mode 100644 index 000000000..85e704854 --- /dev/null +++ b/docs/packages/messaging.rst @@ -0,0 +1,12 @@ +.. spelling:: + + IPC + +IPC/Messaging +------------- + + - :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/networking.rst b/docs/packages/networking.rst new file mode 100644 index 000000000..709a5d531 --- /dev/null +++ b/docs/packages/networking.rst @@ -0,0 +1,30 @@ +.. spelling:: + + c-ares + gRPC + mDNS + DNS + websocket + Asio + scalable + +Networking +---------- + + - :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.c-ares` - A C library for asynchronous DNS requests + - :ref:`pkg.CppNetlibUri` - C++ Network URI + - :ref:`pkg.civetweb` - Embedded C/C++ web server + - :ref:`pkg.cpr` - C++ Requests: Curl for People, a spiritual port of Python Requests + - :ref:`pkg.CURL` - A command line tool and library for transferring data with URL syntax + - :ref:`pkg.gRPC` - A high performance, open-source universal RPC framework + - :ref:`pkg.http-parser` - HTTP request/response parser for C + - :ref:`pkg.Libevent` - An event notification library for developing scalable network servers. + - :ref:`pkg.libevhtp` - Extremely-fast and secure embedded HTTP server library + - :ref:`pkg.kNet` - Low-level networking protocol library. + - :ref:`pkg.mongoose` - Embedded Web Server Library. + - :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/os.rst b/docs/packages/os.rst new file mode 100644 index 000000000..634c12be7 --- /dev/null +++ b/docs/packages/os.rst @@ -0,0 +1,10 @@ +OS +-- + + * :ref:`pkg.Android-Apk` + * :ref:`pkg.Android-Modules` + * :ref:`pkg.Android-SDK` + * :ref:`pkg.ios_sim` + * :ref:`pkg.QtAndroidCMake` + * :ref:`pkg.Washer` - Lightweight, header-only, C++ wrapper around the Windows API + * :ref:`pkg.WTL` - Windows Template Library (WTL) is a C++ library for developing Windows applications and UI components. 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 000000000..d3319370f --- /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 000000000..b716f6460 --- /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 000000000..87b67efef --- /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-ARM64-v8a-System-Image.rst b/docs/packages/pkg/Android-ARM64-v8a-System-Image.rst new file mode 100644 index 000000000..283127e6a --- /dev/null +++ b/docs/packages/pkg/Android-ARM64-v8a-System-Image.rst @@ -0,0 +1,21 @@ +.. spelling:: + + Android + ARM64 + v8a + System + Image + +.. index:: android_sdk_component ; Android-ARM64-v8a-System-Image + +.. _pkg.Android-ARM64-v8a-System-Image: + +Android-ARM64-v8a-System-Image +============================== + +- `Example `__ + +.. literalinclude:: /../examples/Android-ARM64-v8a-System-Image/CMakeLists.txt + :language: cmake + :start-after: # DOCUMENTATION_START { + :end-before: # DOCUMENTATION_END } diff --git a/docs/packages/pkg/Android-Apk.rst b/docs/packages/pkg/Android-Apk.rst new file mode 100644 index 000000000..4b89b463a --- /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 000000000..422ba14de --- /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 000000000..7b9977919 --- /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 000000000..215ca5990 --- /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 000000000..809acea01 --- /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 000000000..be8d2f7af --- /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-MIPS-System-Image.rst b/docs/packages/pkg/Android-MIPS-System-Image.rst new file mode 100644 index 000000000..1c1752911 --- /dev/null +++ b/docs/packages/pkg/Android-MIPS-System-Image.rst @@ -0,0 +1,20 @@ +.. spelling:: + + Android + MIPS + System + Image + +.. index:: android_sdk_component ; Android-MIPS-System-Image + +.. _pkg.Android-MIPS-System-Image: + +Android-MIPS-System-Image +========================= + +- `Example `__ + +.. literalinclude:: /../examples/Android-MIPS-System-Image/CMakeLists.txt + :language: cmake + :start-after: # DOCUMENTATION_START { + :end-before: # DOCUMENTATION_END } diff --git a/docs/packages/pkg/Android-Modules.rst b/docs/packages/pkg/Android-Modules.rst new file mode 100644 index 000000000..518054536 --- /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 000000000..21c524417 --- /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 000000000..930e92886 --- /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 000000000..ff5c683e8 --- /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 000000000..3955b55bd --- /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 000000000..973f83f6c --- /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/AngelScript.rst b/docs/packages/pkg/AngelScript.rst new file mode 100644 index 000000000..e37f7f567 --- /dev/null +++ b/docs/packages/pkg/AngelScript.rst @@ -0,0 +1,20 @@ +.. spelling:: + + AngelScript + +.. index:: unsorted ; AngelScript + +.. _pkg.AngelScript: + +AngelScript +=========== + +- `Official `__ +- `Hunterized `__ +- `Example `__ + +.. code-block:: cmake + + hunter_add_package(AngelScript) + find_package(AngelScript CONFIG REQUIRED) + target_link_libraries(boo PUBLIC AngelScript::AngelScript) diff --git a/docs/packages/pkg/ArrayFire.rst b/docs/packages/pkg/ArrayFire.rst new file mode 100644 index 000000000..bd9d330ba --- /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 000000000..82b9d1a85 --- /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 000000000..5d2c1ba61 --- /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 000000000..f33141162 --- /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 000000000..58948df86 --- /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 000000000..c3b2d22fe --- /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 000000000..88b32a2fe --- /dev/null +++ b/docs/packages/pkg/Boost.rst @@ -0,0 +1,177 @@ +.. 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 `__ +- `Boost-math `__ +- `Boost-contract `__ +- `Boost-stacktrace `__ + +List of components and availability (other libraries are header-only): + +.. literalinclude:: /../cmake/modules/hunter_get_boost_libs.cmake + :language: cmake + :start-after: # DOCUMENTATION_START { + :end-before: # DOCUMENTATION_END } + +CMake options +------------- + +You can use ``CMAKE_ARGS`` feature +(see +`customization `__) +to pass options to boost build or to append config macros in the default boost user +config file (``boost/config/user.hpp``): + +- Options of special form ``_