aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/nanogui/CONTROL5
-rw-r--r--ports/nanogui/fix-cmakelists.patch72
-rw-r--r--ports/nanogui/portfile.cmake26
-rw-r--r--ports/nanovg/CMakeLists.txt2
-rw-r--r--ports/nanovg/CONTROL2
5 files changed, 105 insertions, 2 deletions
diff --git a/ports/nanogui/CONTROL b/ports/nanogui/CONTROL
new file mode 100644
index 000000000..63b70db69
--- /dev/null
+++ b/ports/nanogui/CONTROL
@@ -0,0 +1,5 @@
+Source: nanogui
+Version: 2019-09-23
+Homepage: https://github.com/wjakob/nanogui
+Description: NanoGUI is a minimalistic cross-platform widget library for OpenGL 3.x or higher.
+Build-Depends: glfw3, nanovg, eigen3 \ No newline at end of file
diff --git a/ports/nanogui/fix-cmakelists.patch b/ports/nanogui/fix-cmakelists.patch
new file mode 100644
index 000000000..cc4aa05af
--- /dev/null
+++ b/ports/nanogui/fix-cmakelists.patch
@@ -0,0 +1,72 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 8c59277..3fe6f5d 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -11,11 +11,7 @@ if (POLICY CMP0058)
+ cmake_policy(SET CMP0058 NEW)
+ endif()
+
+-if (NOT IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/ext/glfw/src")
+- message(FATAL_ERROR "The NanoGUI dependency repositories (GLFW, etc.) are missing! "
+- "You probably did not clone the project with --recursive. It is possible to recover "
+- "by calling \"git submodule update --init --recursive\"")
+-endif()
++
+
+ if (WIN32)
+ set(NANOGUI_USE_GLAD_DEFAULT ON)
+@@ -78,13 +74,11 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-declarations")
+ endif()
+
+-add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/ext/glfw" "ext_build/glfw")
+ # Two targets have now been defined: `glfw_objects`, which will be merged into
+ # NanoGUI at the end, and `glfw`. The `glfw` target is the library itself
+ # (e.g., libglfw.so), but can be skipped as we do not need to link against it
+ # (because we merge `glfw_objects` into NanoGUI). Skipping is required for
+ # XCode, but preferable for all build systems (reduces build artifacts).
+-set_target_properties(glfw PROPERTIES EXCLUDE_FROM_ALL 1 EXCLUDE_FROM_DEFAULT_BUILD 1)
+
+ # Python support: add NANOGUI_PYTHON flag to all targets
+ if (NANOGUI_BUILD_PYTHON)
+@@ -310,7 +304,6 @@ add_definitions(${NANOGUI_EXTRA_DEFS})
+ # Compile main NanoGUI library
+ add_library(nanogui-obj OBJECT
+ # Merge NanoVG into the NanoGUI library
+- ext/nanovg/src/nanovg.c
+ # Merge GLAD into the NanoGUI library (only if needed)
+ ${LIBNANOGUI_EXTRA_SOURCE}
+ # Fonts etc.
+@@ -352,6 +345,11 @@ add_library(nanogui-obj OBJECT
+ src/serializer.cpp
+ )
+
++find_path(EIGEN_INCLUDE_DIR Eigen/Core)
++target_include_directories(nanogui-obj PRIVATE ${EIGEN_INCLUDE_DIR})
++find_path(STB_INCLUDE_DIR stb_image.h)
++target_include_directories(nanogui-obj PRIVATE ${STB_INCLUDE_DIR})
++
+ # XCode has a serious bug where the XCode project produces an invalid target
+ # that will not get linked if it consists only of objects from object libraries,
+ # it will not generate any products (executables, libraries). The only work
+@@ -363,15 +361,18 @@ if (CMAKE_GENERATOR STREQUAL Xcode)
+ add_library(nanogui ${NANOGUI_LIBRARY_TYPE}
+ ${XCODE_DUMMY}
+ $<TARGET_OBJECTS:nanogui-obj>
+- $<TARGET_OBJECTS:glfw_objects>
+ )
+ else()
+ add_library(nanogui ${NANOGUI_LIBRARY_TYPE}
+ $<TARGET_OBJECTS:nanogui-obj>
+- $<TARGET_OBJECTS:glfw_objects>
+ )
+ endif()
+
++find_package(nanovg CONFIG REQUIRED)
++find_package(Eigen3 CONFIG REQUIRED)
++find_package(glfw3 CONFIG REQUIRED)
++target_link_libraries(nanogui glfw nanovg::nanovg Eigen3::Eigen)
++
+ if (NANOGUI_BUILD_SHARED)
+ set_property(TARGET nanogui-obj PROPERTY POSITION_INDEPENDENT_CODE ON)
+ endif()
diff --git a/ports/nanogui/portfile.cmake b/ports/nanogui/portfile.cmake
new file mode 100644
index 000000000..bc868e549
--- /dev/null
+++ b/ports/nanogui/portfile.cmake
@@ -0,0 +1,26 @@
+include(vcpkg_common_functions)
+
+if(VCPKG_TARGET_IS_UWP)
+ message(FATAL_ERROR "nanogui doesn't support UWP.")
+endif()
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO wjakob/nanogui
+ REF e9ec8a1a9861cf578d9c6e85a6420080aa715c03 #Commits on Sep 23, 2019
+ SHA512 36c93bf977862ced2df4030211e2b83625e60a11fc9fdb6c1f2996bb234758331d3f41a7fbafd25a5bca0239ed9bac9c93446a4a7fac4c5e6d7943af2be3e14a
+ HEAD_REF master
+ PATCHES
+ fix-cmakelists.patch
+)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+)
+
+vcpkg_install_cmake()
+vcpkg_copy_pdbs()
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+
+# Handle copyright
+file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file
diff --git a/ports/nanovg/CMakeLists.txt b/ports/nanovg/CMakeLists.txt
index 87a7d3339..16d7afa4b 100644
--- a/ports/nanovg/CMakeLists.txt
+++ b/ports/nanovg/CMakeLists.txt
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.11)
project(nanovg C)
set(NANOVG_SOURCES src/nanovg.c)
-set(NANOVG_HEADERS src/nanovg.h src/nanovg_gl.h src/nanovg_gl_utils.h)
+set(NANOVG_HEADERS src/nanovg.h src/nanovg_gl.h src/nanovg_gl_utils.h src/stb_image.h)
add_library(nanovg STATIC ${NANOVG_SOURCES} ${NANOVG_HEADERS})
set_target_properties(nanovg PROPERTIES PUBLIC_HEADER "${NANOVG_HEADERS}")
target_include_directories(nanovg PRIVATE 3rdparty/nanovg/src)
diff --git a/ports/nanovg/CONTROL b/ports/nanovg/CONTROL
index b3dbdd251..5291576ac 100644
--- a/ports/nanovg/CONTROL
+++ b/ports/nanovg/CONTROL
@@ -1,4 +1,4 @@
Source: nanovg
-Version: 2019-8-30
+Version: 2019-8-30-1
Homepage: https://github.com/memononen/nanovg
Description: NanoVG is small antialiased vector graphics rendering library for OpenGL.