aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/opencsg
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/opencsg')
-rw-r--r--vcpkg/ports/opencsg/CMakeLists.txt43
-rw-r--r--vcpkg/ports/opencsg/illegal_char.patch13
-rw-r--r--vcpkg/ports/opencsg/portfile.cmake25
-rw-r--r--vcpkg/ports/opencsg/vcpkg.json14
4 files changed, 95 insertions, 0 deletions
diff --git a/vcpkg/ports/opencsg/CMakeLists.txt b/vcpkg/ports/opencsg/CMakeLists.txt
new file mode 100644
index 0000000..e8300a7
--- /dev/null
+++ b/vcpkg/ports/opencsg/CMakeLists.txt
@@ -0,0 +1,43 @@
+cmake_minimum_required (VERSION 3.4)
+project (opencsg)
+
+set(HEADERS
+ include/opencsg.h
+)
+
+set(SRCS
+ src/area.cpp
+ src/batch.cpp
+ src/context.cpp
+ src/channelManager.cpp
+ src/frameBufferObject.cpp
+ src/frameBufferObjectExt.cpp
+ src/occlusionQuery.cpp
+ src/opencsgRender.cpp
+ src/openglHelper.cpp
+ src/primitive.cpp
+ src/primitiveHelper.cpp
+ src/renderGoldfeather.cpp
+ src/renderSCS.cpp
+ src/scissorMemo.cpp
+ src/settings.cpp
+)
+
+
+add_library(opencsg ${SRCS} ${HEADERS})
+
+include_directories(src include RenderTexture ".")
+find_package(GLEW REQUIRED)
+include_directories(${GLEW_INCLUDE_DIRS})
+target_link_libraries(opencsg PRIVATE GLEW::GLEW)
+
+install(
+ TARGETS opencsg
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+)
+
+if(NOT DISABLE_INSTALL_HEADERS)
+ install(FILES ${HEADERS} DESTINATION include/opencsg)
+endif()
diff --git a/vcpkg/ports/opencsg/illegal_char.patch b/vcpkg/ports/opencsg/illegal_char.patch
new file mode 100644
index 0000000..5c700fd
--- /dev/null
+++ b/vcpkg/ports/opencsg/illegal_char.patch
@@ -0,0 +1,13 @@
+diff --git a/include/opencsg.h b/include/opencsg.h
+index d753a0e..b482c40 100644
+--- a/include/opencsg.h
++++ b/include/opencsg.h
+@@ -156,7 +156,7 @@ namespace OpenCSG {
+ /// The DepthComplexityAlgorithm specifies the strategy for profiting
+ /// from depth complexity when performing the CSG rendering.
+ /// - NoDepthComplexitySampling: Does not employ the depth complexity.
+- /// This essentially makes the algorithm O(n²), but with
++ /// This essentially makes the algorithm O(n²), but with
+ /// low constant costs.
+ /// - DepthComplexitySampling: Calculates the depth complexity k using
+ /// the stencil buffer. This makes algorithm O(n*k), but
diff --git a/vcpkg/ports/opencsg/portfile.cmake b/vcpkg/ports/opencsg/portfile.cmake
new file mode 100644
index 0000000..31791ff
--- /dev/null
+++ b/vcpkg/ports/opencsg/portfile.cmake
@@ -0,0 +1,25 @@
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+string(REPLACE "." "-" VERSION_CSG "${VERSION}")
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO floriankirsch/OpenCSG
+ REF "opencsg-${VERSION_CSG}-release"
+ SHA512 9c674553ff0bccd35b34475019f53f4dda900c4b26635e6f52871b81e974a9c6319891c1d42e387606ccb0a890dcbb286baa424ce240f78493ef6f920c0bcb3a
+ HEAD_REF master
+ PATCHES
+ illegal_char.patch
+)
+
+file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS_DEBUG
+ -DDISABLE_INSTALL_HEADERS=ON
+)
+
+vcpkg_cmake_install()
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/doc/license/gpl-2.0.txt" "${SOURCE_PATH}/doc/license/gpl-3.0.txt")
diff --git a/vcpkg/ports/opencsg/vcpkg.json b/vcpkg/ports/opencsg/vcpkg.json
new file mode 100644
index 0000000..479776a
--- /dev/null
+++ b/vcpkg/ports/opencsg/vcpkg.json
@@ -0,0 +1,14 @@
+{
+ "name": "opencsg",
+ "version": "1.8.1",
+ "description": "OpenCSG is a library that does image-based CSG rendering using OpenGL. OpenCSG is written in C++ and supports most modern graphics hardware using Microsoft Windows or the Linux operating system.",
+ "homepage": "https://github.com/floriankirsch/OpenCSG",
+ "license": "GPL-2.0-or-later",
+ "dependencies": [
+ "glew",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ }
+ ]
+}