Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

Add 'NLopt' package #1617

Merged
merged 17 commits into from
Nov 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions cmake/configs/default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
36 changes: 36 additions & 0 deletions cmake/projects/NLopt/hunter.cmake
Original file line number Diff line number Diff line change
@@ -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)
21 changes: 21 additions & 0 deletions docs/packages/pkg/NLopt.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.. spelling::

NLopt

.. index::
single: unsorted ; NLopt

.. _pkg.NLopt:

NLopt
=====

- `Official <https://github.com/stevengj/nlopt>`__
- `Hunterized <https://github.com/hunter-packages/NLopt>`__
- `Example <https://github.com/ruslo/hunter/blob/master/examples/NLopt/CMakeLists.txt>`__
- Added by `t0p4 <https://github.com/t0p4>`__ (`pr-1617 <https://github.com/ruslo/hunter/pull/1617>`__)

.. literalinclude:: /../examples/NLopt/CMakeLists.txt
:language: cmake
:start-after: # DOCUMENTATION_START {
:end-before: # DOCUMENTATION_END }
18 changes: 18 additions & 0 deletions examples/NLopt/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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 }
4 changes: 4 additions & 0 deletions examples/NLopt/boo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#include <nlopt.hpp>

int main() {
}