diff --git a/cmake/configs/default.cmake b/cmake/configs/default.cmake index 5c77f825a7..9d821788da 100644 --- a/cmake/configs/default.cmake +++ b/cmake/configs/default.cmake @@ -89,6 +89,7 @@ hunter_default_version(Lua VERSION 5.3.2-p2) hunter_default_version(Microsoft.GSL VERSION 2.0.0-p0) hunter_default_version(MySQL-client VERSION 6.1.9-p0) hunter_default_version(NASM VERSION 2.12.02) +hunter_default_version(NLopt VERSION 2.5.0-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) diff --git a/cmake/projects/NLopt/hunter.cmake b/cmake/projects/NLopt/hunter.cmake new file mode 100644 index 0000000000..9c4c3a93d4 --- /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/docs/packages/pkg/NLopt.rst b/docs/packages/pkg/NLopt.rst new file mode 100644 index 0000000000..67e8e4e08e --- /dev/null +++ b/docs/packages/pkg/NLopt.rst @@ -0,0 +1,21 @@ +.. spelling:: + + NLopt + +.. index:: + single: unsorted ; NLopt + +.. _pkg.NLopt: + +NLopt +===== + +- `Official `__ +- `Hunterized `__ +- `Example `__ +- Added by `t0p4 `__ (`pr-1617 `__) + +.. literalinclude:: /../examples/NLopt/CMakeLists.txt + :language: cmake + :start-after: # DOCUMENTATION_START { + :end-before: # DOCUMENTATION_END } diff --git a/examples/NLopt/CMakeLists.txt b/examples/NLopt/CMakeLists.txt new file mode 100644 index 0000000000..c48c45f443 --- /dev/null +++ b/examples/NLopt/CMakeLists.txt @@ -0,0 +1,18 @@ +# Copyright (c) 2016-2018, Ruslan Baratov +# All rights reserved. + +cmake_minimum_required(VERSION 3.2) + +# Emulate HunterGate: +# * https://github.com/hunter-packages/gate +include("../common.cmake") + +project(download-nlopt) + +# DOCUMENTATION_START { +hunter_add_package(NLopt) +find_package(NLopt CONFIG REQUIRED) + +add_executable(boo boo.cpp) +target_link_libraries(boo PUBLIC NLopt::nlopt) +# DOCUMENTATION_END } diff --git a/examples/NLopt/boo.cpp b/examples/NLopt/boo.cpp new file mode 100644 index 0000000000..2d25712a31 --- /dev/null +++ b/examples/NLopt/boo.cpp @@ -0,0 +1,4 @@ +#include + +int main() { +}