diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/libqglviewer | |
Diffstat (limited to 'vcpkg/ports/libqglviewer')
| -rw-r--r-- | vcpkg/ports/libqglviewer/Add-compile-definitions.patch | 23 | ||||
| -rw-r--r-- | vcpkg/ports/libqglviewer/Fix-error-c2039.patch | 52 | ||||
| -rw-r--r-- | vcpkg/ports/libqglviewer/glu.patch | 14 | ||||
| -rw-r--r-- | vcpkg/ports/libqglviewer/portfile.cmake | 22 | ||||
| -rw-r--r-- | vcpkg/ports/libqglviewer/vcpkg.json | 28 |
5 files changed, 139 insertions, 0 deletions
diff --git a/vcpkg/ports/libqglviewer/Add-compile-definitions.patch b/vcpkg/ports/libqglviewer/Add-compile-definitions.patch new file mode 100644 index 0000000..addf619 --- /dev/null +++ b/vcpkg/ports/libqglviewer/Add-compile-definitions.patch @@ -0,0 +1,23 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -58,9 +58,19 @@ + "${PROJECT_SOURCE_DIR}/QGLViewer/quaternion.cpp" + "${PROJECT_SOURCE_DIR}/QGLViewer/saveSnapshot.cpp" + "${PROJECT_SOURCE_DIR}/QGLViewer/vec.cpp") +-add_library(QGLViewer SHARED ${QGLViewer_SRC}) ++add_library(QGLViewer ${QGLViewer_SRC}) + target_include_directories(QGLViewer INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) + target_link_libraries(QGLViewer PRIVATE ${QtLibs} OpenGL::GL OpenGL::GLU) ++if(MSVC) ++ target_compile_definitions(QGLViewer PRIVATE NOMINMAX) ++endif() ++if(WIN32) ++ if(BUILD_SHARED_LIBS) ++ target_compile_definitions(QGLViewer PRIVATE CREATE_QGLVIEWER_DLL) ++ else() ++ target_compile_definitions(QGLViewer PUBLIC QGLVIEWER_STATIC) ++ endif() ++endif() + + # Example: animation. + set(animation_SRC diff --git a/vcpkg/ports/libqglviewer/Fix-error-c2039.patch b/vcpkg/ports/libqglviewer/Fix-error-c2039.patch new file mode 100644 index 0000000..629380d --- /dev/null +++ b/vcpkg/ports/libqglviewer/Fix-error-c2039.patch @@ -0,0 +1,52 @@ +diff --git a/QGLViewer/VRender/NVector3.h b/QGLViewer/VRender/NVector3.h +index 40b7f98..f2d8305 100644 +--- a/QGLViewer/VRender/NVector3.h ++++ b/QGLViewer/VRender/NVector3.h +@@ -7,6 +7,8 @@ + namespace vrender + { + class Vector3; ++ class NVector3; ++ std::ostream& operator<<(std::ostream &out,const NVector3 &u); + + class NVector3 + { +diff --git a/QGLViewer/VRender/Primitive.h b/QGLViewer/VRender/Primitive.h +index 88ab11d..d38470d 100644 +--- a/QGLViewer/VRender/Primitive.h ++++ b/QGLViewer/VRender/Primitive.h +@@ -21,6 +21,7 @@ namespace vrender + { + class Feedback3DColor ; + class Primitive ; ++ std::ostream& operator<<(std::ostream&, const Feedback3DColor&) ; + + #define EPS_SMOOTH_LINE_FACTOR 0.06 /* Lower for better smooth lines. */ + +diff --git a/QGLViewer/VRender/Vector2.h b/QGLViewer/VRender/Vector2.h +index f6aaaf3..7b9b82a 100644 +--- a/QGLViewer/VRender/Vector2.h ++++ b/QGLViewer/VRender/Vector2.h +@@ -6,7 +6,9 @@ + + namespace vrender + { ++ class Vector2; + class Vector3; ++ std::ostream& operator<< (std::ostream&,const Vector2&); + + class Vector2 + { +diff --git a/QGLViewer/VRender/Vector3.h b/QGLViewer/VRender/Vector3.h +index 32597e8..f6d5099 100644 +--- a/QGLViewer/VRender/Vector3.h ++++ b/QGLViewer/VRender/Vector3.h +@@ -10,6 +10,8 @@ + namespace vrender + { + class NVector3; ++ class Vector3; ++ std::ostream& operator<< (std::ostream&, const Vector3&); + + class Vector3 + { diff --git a/vcpkg/ports/libqglviewer/glu.patch b/vcpkg/ports/libqglviewer/glu.patch new file mode 100644 index 0000000..7e38874 --- /dev/null +++ b/vcpkg/ports/libqglviewer/glu.patch @@ -0,0 +1,14 @@ +diff --git a/QGLViewer/config.h b/QGLViewer/config.h +index 25f0e95ef4..010c54168f 100644 +--- a/QGLViewer/config.h ++++ b/QGLViewer/config.h +@@ -53,6 +53,9 @@ Error : libQGLViewer requires a minimum Qt version of 5.4 Error + #ifdef Q_OS_MAC + # include <OpenGL/glu.h> + #else ++#if defined(Q_OS_WIN) ++# include <QtCore/qt_windows.h> ++#endif + # include <GL/glu.h> + #endif + diff --git a/vcpkg/ports/libqglviewer/portfile.cmake b/vcpkg/ports/libqglviewer/portfile.cmake new file mode 100644 index 0000000..b556610 --- /dev/null +++ b/vcpkg/ports/libqglviewer/portfile.cmake @@ -0,0 +1,22 @@ +vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO GillesDebunne/libQGLViewer
+ REF "v${VERSION}"
+ SHA512 09bfc5c0f07e51625a9af0094b83f40f84ead55a67c6e492c9702521f58c6b461bc840382fb73b64d16ad71a0a2a75d04aa12a77a78ced0a19e0e784e8d36bd7
+ PATCHES
+ Add-compile-definitions.patch
+ Fix-error-c2039.patch #https://github.com/GillesDebunne/libQGLViewer/pull/80
+ glu.patch
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+)
+
+vcpkg_cmake_install()
+
+vcpkg_fixup_pkgconfig()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENCE")
diff --git a/vcpkg/ports/libqglviewer/vcpkg.json b/vcpkg/ports/libqglviewer/vcpkg.json new file mode 100644 index 0000000..324bb76 --- /dev/null +++ b/vcpkg/ports/libqglviewer/vcpkg.json @@ -0,0 +1,28 @@ +{ + "name": "libqglviewer", + "version": "2.9.1", + "port-version": 4, + "description": [ + "libQGLViewer is an open source C++ library based on Qt that eases the creation of OpenGL 3D viewers.", + "Attention: Last upstream activity in December 2022." + ], + "homepage": "https://github.com/GillesDebunne/libQGLViewer", + "license": "GPL-2.0-or-later", + "supports": "!android & !xbox", + "dependencies": [ + "opengl", + { + "name": "qtbase", + "default-features": false, + "features": [ + "gui", + "opengl", + "widgets" + ] + }, + { + "name": "vcpkg-cmake", + "host": true + } + ] +} |