aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>2020-05-01 13:57:38 +0800
committerGitHub <noreply@github.com>2020-04-30 22:57:38 -0700
commit7db2ffa0b0aa36113a8c72f2e1815f540f4c2b92 (patch)
treefb05af72186a2f284fbd66bba7eeda8bb0fa28b6
parent28fc76e7332db04e253d861fb3e4f0e27949d9b1 (diff)
downloadvcpkg-7db2ffa0b0aa36113a8c72f2e1815f540f4c2b92.tar.gz
vcpkg-7db2ffa0b0aa36113a8c72f2e1815f540f4c2b92.zip
[imgui] Add feature bindings and remove feature example (#10253)
* [imgui] Separate feature tools from feature example * [imgui] Separate feature tools from feature example Co-authored-by: JackBoosY <yuzaiyang@microsoft.com>
-rw-r--r--ports/azure-kinect-sensor-sdk/CONTROL2
-rw-r--r--ports/azure-kinect-sensor-sdk/fix-dependency-imgui.patch45
-rw-r--r--ports/azure-kinect-sensor-sdk/portfile.cmake14
-rw-r--r--ports/imgui/CMakeLists.txt14
-rw-r--r--ports/imgui/CONTROL8
-rw-r--r--ports/imgui/portfile.cmake29
-rw-r--r--ports/libigl/CONTROL4
7 files changed, 88 insertions, 28 deletions
diff --git a/ports/azure-kinect-sensor-sdk/CONTROL b/ports/azure-kinect-sensor-sdk/CONTROL
index e062cbebf..0979028e7 100644
--- a/ports/azure-kinect-sensor-sdk/CONTROL
+++ b/ports/azure-kinect-sensor-sdk/CONTROL
@@ -9,4 +9,4 @@ Description: Build K4A doxygen documentation.
Feature: tool
Description: Build tools.
-Build-Depends: gl3w, imgui[example] \ No newline at end of file
+Build-Depends: gl3w, glew, imgui[bindings] \ No newline at end of file
diff --git a/ports/azure-kinect-sensor-sdk/fix-dependency-imgui.patch b/ports/azure-kinect-sensor-sdk/fix-dependency-imgui.patch
new file mode 100644
index 000000000..f997e71b5
--- /dev/null
+++ b/ports/azure-kinect-sensor-sdk/fix-dependency-imgui.patch
@@ -0,0 +1,45 @@
+diff --git a/tools/k4aviewer/CMakeLists.txt b/tools/k4aviewer/CMakeLists.txt
+index 6ab38d9..e0c5bad 100644
+--- a/tools/k4aviewer/CMakeLists.txt
++++ b/tools/k4aviewer/CMakeLists.txt
+@@ -35,6 +35,8 @@ set(SOURCE_FILES
+ k4awindowset.cpp
+ perfcounter.cpp
+ ${CMAKE_CURRENT_BINARY_DIR}/version.rc
++ ${IMGUI_EXTERNAL_PATH}/imgui_impl_glfw.cpp
++ ${IMGUI_EXTERNAL_PATH}/imgui_impl_opengl3.cpp
+ )
+
+ # Include ${CMAKE_CURRENT_BINARY_DIR}/version.rc in the target's sources
+@@ -54,6 +56,8 @@ include_directories(
+ ${CMAKE_CURRENT_LIST_DIR}
+ )
+
++find_package(GLEW REQUIRED)
++
+ set(EXTERNAL_LIBRARIES
+ k4a::k4a
+ k4a::k4arecord
+@@ -65,6 +69,7 @@ set(EXTERNAL_LIBRARIES
+ glfw
+ ${OPENGL_LIBRARIES}
+ unofficial::gl3w::gl3w
++ GLEW::GLEW
+ )
+
+ # On Windows, we need to call into setupapi to get USB container ID information
+diff --git a/tools/k4aviewer/k4aimgui_all.h b/tools/k4aviewer/k4aimgui_all.h
+index e40ccfb..756fb09 100644
+--- a/tools/k4aviewer/k4aimgui_all.h
++++ b/tools/k4aviewer/k4aimgui_all.h
+@@ -34,8 +34,8 @@
+ #include <GL/gl3w.h>
+ #include <GLFW/glfw3.h>
+ #include <imgui.h>
+-#include <imgui_impl_glfw.h>
+-#include <imgui_impl_opengl3.h>
++#include <bindings/imgui_impl_glfw.h>
++#include <bindings/imgui_impl_opengl3.h>
+
+ // For disabling buttons, which has not yet been promoted to the public API
+ //
diff --git a/ports/azure-kinect-sensor-sdk/portfile.cmake b/ports/azure-kinect-sensor-sdk/portfile.cmake
index d09d133d9..de279be39 100644
--- a/ports/azure-kinect-sensor-sdk/portfile.cmake
+++ b/ports/azure-kinect-sensor-sdk/portfile.cmake
@@ -7,6 +7,7 @@ vcpkg_from_github(
PATCHES
fix-builds.patch
disable-c4275.patch
+ fix-dependency-imgui.patch
)
vcpkg_find_acquire_program(PYTHON3)
@@ -26,6 +27,7 @@ vcpkg_configure_cmake(
-DK4A_MTE_VERSION=ON
-DBUILD_EXAMPLES=OFF
-DWITH_TEST=OFF
+ -DIMGUI_EXTERNAL_PATH=${CURRENT_INSTALLED_DIR}/include/bindings
)
vcpkg_install_cmake()
@@ -40,6 +42,18 @@ vcpkg_copy_pdbs()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+if ("tool" IN_LIST FEATURES)
+ if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL release)
+ file(GLOB AZURE_TOOLS ${CURRENT_PACKAGES_DIR}/bin/*${VCPKG_TARGET_EXECUTABLE_SUFFIX})
+ file(COPY ${AZURE_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools)
+ file(REMOVE ${AZURE_TOOLS})
+ endif()
+ if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL debug)
+ file(GLOB AZURE_TOOLS ${CURRENT_PACKAGES_DIR}/debug/bin/*${VCPKG_TARGET_EXECUTABLE_SUFFIX})
+ file(REMOVE ${AZURE_TOOLS})
+ endif()
+endif()
+
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
endif()
diff --git a/ports/imgui/CMakeLists.txt b/ports/imgui/CMakeLists.txt
index 4a2ce7628..a67aa5474 100644
--- a/ports/imgui/CMakeLists.txt
+++ b/ports/imgui/CMakeLists.txt
@@ -10,6 +10,7 @@ set(IMGUI_INCLUDES_PUBLIC
set(IMGUI_INCLUDES_PRIVATE
imgui_internal.h
+ imstb_textedit.h
)
set(IMGUI_SOURCES
@@ -25,6 +26,8 @@ add_library(${PROJECT_NAME}
${IMGUI_SOURCES}
)
+file(GLOB IMGUI_BINDINGS ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_* )
+
target_include_directories(${PROJECT_NAME} PUBLIC $<INSTALL_INTERFACE:include>)
install(TARGETS ${PROJECT_NAME}
@@ -42,3 +45,14 @@ if(NOT IMGUI_SKIP_HEADERS)
DESTINATION include
)
endif()
+
+if(IMGUI_COPY_BINDINGS)
+ install(
+ FILES ${IMGUI_INCLUDES_PRIVATE}
+ DESTINATION include
+ )
+ install(
+ FILES ${IMGUI_BINDINGS}
+ DESTINATION include/bindings
+ )
+endif() \ No newline at end of file
diff --git a/ports/imgui/CONTROL b/ports/imgui/CONTROL
index c1484ec8b..a4ffede60 100644
--- a/ports/imgui/CONTROL
+++ b/ports/imgui/CONTROL
@@ -1,8 +1,8 @@
Source: imgui
-Version: 1.74
+Version: 1.74-1
Homepage: https://github.com/ocornut/imgui
Description: Bloat-free Immediate Mode Graphical User interface for C++ with minimal dependencies.
-Feature: example
-Description: build with examples
-Build-Depends: glfw3, freeglut, opengl, sdl1
+Feature: bindings
+Description: make available bindings header and source files for supported implementations
+Build-Depends: glfw3, freeglut, opengl, sdl1, allegro5 \ No newline at end of file
diff --git a/ports/imgui/portfile.cmake b/ports/imgui/portfile.cmake
index b9cb4eda3..04916ff23 100644
--- a/ports/imgui/portfile.cmake
+++ b/ports/imgui/portfile.cmake
@@ -1,5 +1,3 @@
-include(vcpkg_common_functions)
-
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
@@ -12,34 +10,23 @@ vcpkg_from_github(
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ bindings IMGUI_COPY_BINDINGS # should only be copied once, at most
+)
+
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
+ OPTIONS_RELEASE
+ ${FEATURE_OPTIONS}
OPTIONS_DEBUG
+ -DIMGUI_COPY_BINDINGS=OFF
-DIMGUI_SKIP_HEADERS=ON
)
vcpkg_install_cmake()
-if ("example" IN_LIST FEATURES)
- if (NOT VCPKG_TARGET_IS_WINDOWS)
- message(FATAL_ERROR "Feature example only support windows.")
- endif()
- vcpkg_build_msbuild(
- USE_VCPKG_INTEGRATION
- PROJECT_PATH ${SOURCE_PATH}/examples/imgui_examples.sln
- )
-
- # Install headers
- file(GLOB IMGUI_EXAMPLE_INCLUDES ${SOURCE_PATH}/examples/*.h)
- file(INSTALL ${IMGUI_EXAMPLE_INCLUDES} DESTINATION ${CURRENT_PACKAGES_DIR}/include)
-
- # Install tools
- file(GLOB_RECURSE IMGUI_EXAMPLE_BINARIES ${SOURCE_PATH}/examples/*${VCPKG_TARGET_EXECUTABLE_SUFFIX})
- file(INSTALL ${IMGUI_EXAMPLE_BINARIES} DESTINATION ${CURRENT_PACKAGES_DIR}/tools)
-endif()
-
vcpkg_copy_pdbs()
vcpkg_fixup_cmake_targets()
-configure_file(${SOURCE_PATH}/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/imgui/copyright COPYONLY)
+file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
diff --git a/ports/libigl/CONTROL b/ports/libigl/CONTROL
index 93041cc4d..90c5313fb 100644
--- a/ports/libigl/CONTROL
+++ b/ports/libigl/CONTROL
@@ -1,5 +1,5 @@
Source: libigl
-Version: 2.1.0-1
+Version: 2.1.0-2
Homepage: https://github.com/libigl/libigl
Description: libigl is a simple C++ geometry processing library. We have a wide functionality including construction of sparse discrete differential geometry operators and finite-elements matrices such as the cotangent Laplacian and diagonalized mass matrix, simple facet and edge-based topology data structures, mesh-viewing utilities for OpenGL and GLSL, and many core functions for matrix manipulation which make Eigen feel a lot more like MATLAB.
Build-Depends: eigen3
@@ -18,7 +18,7 @@ Build-Depends: glfw3
Feature: imgui
Description: Build with imgui
-Build-Depends: imgui[example]
+Build-Depends: imgui[bindings]
Feature: png
Description: Build with libpng