Skip to content

Commit

Permalink
Add 'vectorial' package (ruslo#1683)
Browse files Browse the repository at this point in the history
  • Loading branch information
rbsheth authored and ruslo committed Dec 20, 2018
1 parent 381290b commit 829df56
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmake/configs/default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ hunter_default_version(tvm VERSION 0.4-0f053c8-p4)
hunter_default_version(type_safe VERSION 0.2-p1)
hunter_default_version(units VERSION 3.0.0.alpha-2)
hunter_default_version(util_linux VERSION 2.30.1)
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)
Expand Down
24 changes: 24 additions & 0 deletions cmake/projects/vectorial/hunter.cmake
Original file line number Diff line number Diff line change
@@ -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)
21 changes: 21 additions & 0 deletions docs/packages/pkg/vectorial.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.. spelling::

vectorial

.. index::
single: math ; vectorial

.. _pkg.vectorial:

vectorial
=========

- `Official <https://github.com/scoopr/vectorial>`__
- `Hunterized <https://github.com/hunter-packages/vectorial>`__
- `Example <https://github.com/ruslo/hunter/blob/master/examples/vectorial/CMakeLists.txt>`__
- Added by `Rahul Sheth <https://github.com/rbsheth>`__ (`pr-1683 <https://github.com/ruslo/hunter/pull/1683>`__)

.. literalinclude:: /../examples/vectorial/CMakeLists.txt
:language: cmake
:start-after: # DOCUMENTATION_START {
:end-before: # DOCUMENTATION_END }
18 changes: 18 additions & 0 deletions examples/vectorial/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-vectorial)

# DOCUMENTATION_START {
hunter_add_package(vectorial)
find_package(vectorial CONFIG REQUIRED)

add_executable(boo boo.cpp)
target_link_libraries(boo PUBLIC vectorial::vectorial)
# DOCUMENTATION_END }
11 changes: 11 additions & 0 deletions examples/vectorial/boo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include <vectorial/vectorial.h>
#include <iostream>

int main(){
using vectorial::vec4f;
using vectorial::normalize;

vec4f v = normalize( vec4f(1,2,3,4));
float z = v.z();
std::cout << "z: " << z << std::endl;
}

0 comments on commit 829df56

Please sign in to comment.