From fbb659dcfe0176ee575c92d257d11852e554c765 Mon Sep 17 00:00:00 2001 From: Rahul Sheth Date: Mon, 26 Jul 2021 16:39:07 -0400 Subject: [PATCH 1/2] Add FreeGLUT package v3.2.1-349a23d-p0 --- cmake/configs/default.cmake | 1 + cmake/projects/FreeGLUT/hunter.cmake | 24 ++++++++++++++++++++++++ docs/packages/pkg/FreeGLUT.rst | 21 +++++++++++++++++++++ examples/FreeGLUT/CMakeLists.txt | 18 ++++++++++++++++++ examples/FreeGLUT/boo.cpp | 5 +++++ 5 files changed, 69 insertions(+) create mode 100644 cmake/projects/FreeGLUT/hunter.cmake create mode 100644 docs/packages/pkg/FreeGLUT.rst create mode 100644 examples/FreeGLUT/CMakeLists.txt create mode 100644 examples/FreeGLUT/boo.cpp diff --git a/cmake/configs/default.cmake b/cmake/configs/default.cmake index 5c38acdf89..cb4e523295 100644 --- a/cmake/configs/default.cmake +++ b/cmake/configs/default.cmake @@ -63,6 +63,7 @@ hunter_default_version(Expat VERSION 2.2.9-p0) hunter_default_version(FLAC VERSION 1.3.3-p0) hunter_default_version(FP16 VERSION 0.0.0-febbb1c-p0) hunter_default_version(FakeIt VERSION 2.0.3) +hunter_default_version(FreeGLUT VERSION 3.2.1-349a23d-p0) 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) diff --git a/cmake/projects/FreeGLUT/hunter.cmake b/cmake/projects/FreeGLUT/hunter.cmake new file mode 100644 index 0000000000..ffd2fd1332 --- /dev/null +++ b/cmake/projects/FreeGLUT/hunter.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2016-2020, Rahul Sheth, 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 + FreeGLUT + VERSION + 3.2.1-349a23d-p0 + URL + "https://github.com/cpp-pm/FreeGLUT/archive/refs/tags/v3.2.1-349a23d-p0.tar.gz" + SHA1 + b2841bf9697185b8c29adb56bb01d7a5668e9741 +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(FreeGLUT) +hunter_download(PACKAGE_NAME FreeGLUT) diff --git a/docs/packages/pkg/FreeGLUT.rst b/docs/packages/pkg/FreeGLUT.rst new file mode 100644 index 0000000000..dae4fbeedb --- /dev/null +++ b/docs/packages/pkg/FreeGLUT.rst @@ -0,0 +1,21 @@ +.. spelling:: + + FreeGLUT + +.. index:: + single: unsorted ; FreeGLUT + +.. _pkg.FreeGLUT: + +FreeGLUT +======== + +- `Official `__ +- `Hunterized `__ +- `Example `__ +- Added by `Rahul Sheth `__ (`pr-448 `__) + +.. literalinclude:: /../examples/FreeGLUT/CMakeLists.txt + :language: cmake + :start-after: # DOCUMENTATION_START { + :end-before: # DOCUMENTATION_END } diff --git a/examples/FreeGLUT/CMakeLists.txt b/examples/FreeGLUT/CMakeLists.txt new file mode 100644 index 0000000000..57fa00755d --- /dev/null +++ b/examples/FreeGLUT/CMakeLists.txt @@ -0,0 +1,18 @@ +# Copyright (c) 2016-2020, Rahul Sheth, Ruslan Baratov +# All rights reserved. + +cmake_minimum_required(VERSION 3.2) + +# Emulate HunterGate: +# * https://github.com/hunter-packages/gate +include("../common.cmake") + +project(download-FreeGLUT) + +# DOCUMENTATION_START { +hunter_add_package(FreeGLUT) +find_package(FreeGLUT CONFIG REQUIRED) + +add_executable(boo boo.cpp) +target_link_libraries(boo PUBLIC FreeGLUT::freeglut_static) +# DOCUMENTATION_END } diff --git a/examples/FreeGLUT/boo.cpp b/examples/FreeGLUT/boo.cpp new file mode 100644 index 0000000000..48eb7bf6e2 --- /dev/null +++ b/examples/FreeGLUT/boo.cpp @@ -0,0 +1,5 @@ +#include + +int main() { + int window = glutGetWindow () ; +} From a5d26879b8f903e59b62600f35248ca90bd948e9 Mon Sep 17 00:00:00 2001 From: Rahul Sheth Date: Mon, 26 Jul 2021 16:40:47 -0400 Subject: [PATCH 2/2] Add cmake_args --- cmake/projects/FreeGLUT/hunter.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmake/projects/FreeGLUT/hunter.cmake b/cmake/projects/FreeGLUT/hunter.cmake index ffd2fd1332..5f6a129312 100644 --- a/cmake/projects/FreeGLUT/hunter.cmake +++ b/cmake/projects/FreeGLUT/hunter.cmake @@ -5,6 +5,7 @@ include(hunter_add_version) include(hunter_cacheable) +include(hunter_cmake_args) include(hunter_download) include(hunter_pick_scheme) @@ -19,6 +20,13 @@ hunter_add_version( b2841bf9697185b8c29adb56bb01d7a5668e9741 ) +hunter_cmake_args( + FreeGLUT + CMAKE_ARGS + FREEGLUT_BUILD_SHARED_LIBS=OFF + FREEGLUT_REPLACE_GLUT=ON + FREEGLUT_BUILD_DEMOS=OFF) + hunter_pick_scheme(DEFAULT url_sha1_cmake) hunter_cacheable(FreeGLUT) hunter_download(PACKAGE_NAME FreeGLUT)