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

Add glbinding 2.1.3-p0 package #1073

Merged
merged 2 commits into from
Oct 5, 2017
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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 @@ -178,6 +178,7 @@ hunter_config(freetype VERSION 2.6.2)
hunter_config(gauze VERSION 0.1.1)
hunter_config(geos VERSION 3.4.2)
hunter_config(gflags VERSION 2.2.1)
hunter_config(glbinding VERSION 2.1.3-p0)
hunter_config(glew VERSION 2.0.0)
hunter_config(glfw VERSION 3.3.0-p4)
hunter_config(glib VERSION 2.54.0)
Expand Down
42 changes: 42 additions & 0 deletions cmake/projects/glbinding/hunter.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# !!! 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
"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)

21 changes: 21 additions & 0 deletions docs/packages/pkg/glbinding.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.. spelling::

glbinding

.. index:: ui ; glbinding

.. _pkg.glbinding:

glbinding
=========

- `Official <https://github.com/cginternals/glbinding>`__
- `Hunterized <https://github.com/hunter-packages/glbinding>`__
- `Example <https://github.com/ruslo/hunter/blob/master/examples/glbinding/CMakeLists.txt>`__
- Added by `NeroBurner <https://github.com/NeroBurner>`__ (`pr-1073 <https://github.com/ruslo/hunter/pull/1073>`__)

.. code-block:: cmake

hunter_add_package(glbinding)
find_package(glbinding CONFIG REQUIRED)
target_link_libraries(glbinding glbinding::glbinding)
36 changes: 36 additions & 0 deletions examples/glbinding/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright (c) 2017, NeroBurner
# All rights reserved.

cmake_minimum_required(VERSION 3.1)

# Emulate HunterGate:
# * https://github.com/hunter-packages/gate
include("../common.cmake")

project(download-glbinding)

hunter_add_package(glbinding)

string(COMPARE EQUAL "${glbinding_LICENSES}" "" is_empty)
if(is_empty)
message(FATAL_ERROR "Licenses not found")
endif()

message("glbinding licenses:")
foreach(x ${glbinding_LICENSES})
message("* ${x}")
if(NOT EXISTS "${glbinding_LICENSES}")
message(FATAL_ERROR "File not found")
endif()
endforeach()

find_package(glbinding CONFIG REQUIRED)

# Test double library creation
find_package(glbinding CONFIG REQUIRED)

add_executable(foo foo.cpp)
target_link_libraries(foo glbinding::glbinding)

# glbinding needs at least this c++11 feature
target_compile_features(foo PRIVATE cxx_defaulted_move_initializers)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C++11 will be added by toolchain. Not needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to keep something in for future reference. When someone is using this package in his project he will need to enable this compile-feature or C++11. Not everyone is using a toolchain to enable C++11

9 changes: 9 additions & 0 deletions examples/glbinding/foo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include <glbinding/Version.h>
#include <iostream>

int main()
{
std::cout << "Latest available gl version: "
<< glbinding::Version::latest()
<< std::endl;
}