early-access version 2853
This commit is contained in:
72
externals/vcpkg/ports/nanogui/fix-cmakelists.patch
vendored
Executable file
72
externals/vcpkg/ports/nanogui/fix-cmakelists.patch
vendored
Executable file
@@ -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()
|
||||
23
externals/vcpkg/ports/nanogui/portfile.cmake
vendored
Executable file
23
externals/vcpkg/ports/nanogui/portfile.cmake
vendored
Executable file
@@ -0,0 +1,23 @@
|
||||
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}
|
||||
OPTIONS
|
||||
-DNANOGUI_EIGEN_INCLUDE_DIR=${CURRENT_INSTALLED_DIR}/include/eigen3
|
||||
-DEIGEN_INCLUDE_DIR=${CURRENT_INSTALLED_DIR}/include/eigen3
|
||||
)
|
||||
|
||||
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)
|
||||
13
externals/vcpkg/ports/nanogui/vcpkg.json
vendored
Executable file
13
externals/vcpkg/ports/nanogui/vcpkg.json
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "nanogui",
|
||||
"version-date": "2019-09-23",
|
||||
"port-version": 3,
|
||||
"description": "NanoGUI is a minimalistic cross-platform widget library for OpenGL 3.x or higher.",
|
||||
"homepage": "https://github.com/wjakob/nanogui",
|
||||
"supports": "!uwp",
|
||||
"dependencies": [
|
||||
"eigen3",
|
||||
"glfw3",
|
||||
"nanovg"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user