From 8e256b4717e2013925c945b0c49c0a68f42daf73 Mon Sep 17 00:00:00 2001 From: Lassi Helynranta Date: Mon, 25 Nov 2019 22:06:54 +0200 Subject: [PATCH 1/8] added features for vulkan and sdl2 --- ports/imgui/CMakeLists.txt | 27 ++++++++++++++++++++++++++- ports/imgui/CONTROL | 8 ++++++++ ports/imgui/portfile.cmake | 6 ++++-- 3 files changed, 38 insertions(+), 3 deletions(-) diff --git a/ports/imgui/CMakeLists.txt b/ports/imgui/CMakeLists.txt index 4a2ce76280e8a5..411055ef0ab2b3 100644 --- a/ports/imgui/CMakeLists.txt +++ b/ports/imgui/CMakeLists.txt @@ -19,13 +19,38 @@ set(IMGUI_SOURCES imgui_widgets.cpp ) +if (IMGUI_INCLUDE_IMPL_VULKAN) + find_package(vulkan) + + list (APPEND IMGUI_INCLUDES_PUBLIC examples/imgui_impl_vulkan.h) + list (APPEND IMGUI_SOURCES examples/imgui_impl_vulkan.cpp) +endif() + +if (IMGUI_INCLUDE_IMPL_SDL2) + find_package(SDL2 CONFIG REQUIRED) + + list (APPEND IMGUI_INCLUDES_PUBLIC examples/imgui_impl_sdl.h) + list (APPEND IMGUI_SOURCES examples/imgui_impl_sdl.cpp) +endif() + + add_library(${PROJECT_NAME} ${IMGUI_INCLUDES_PUBLIC} ${IMGUI_INCLUDES_PRIVATE} ${IMGUI_SOURCES} ) -target_include_directories(${PROJECT_NAME} PUBLIC $) +if (IMGUI_INCLUDE_IMPL_VULKAN) + target_link_libraries(${PROJECT_NAME} PUBLIC Vulkan::Vulkan) +endif() + +if (IMGUI_INCLUDE_IMPL_VULKAN) + target_link_libraries(${PROJECT_NAME} PUBLIC SDL2::SDL2main SDL2::SDL2-static) +endif() + +target_include_directories(${PROJECT_NAME} PUBLIC + $ + $) install(TARGETS ${PROJECT_NAME} EXPORT IMGUIExport diff --git a/ports/imgui/CONTROL b/ports/imgui/CONTROL index 6484a925ac79d1..2fc12f6ffbe6c8 100644 --- a/ports/imgui/CONTROL +++ b/ports/imgui/CONTROL @@ -3,6 +3,14 @@ Version: 1.73-1 Homepage: https://github.com/ocornut/imgui Description: Bloat-free Immediate Mode Graphical User interface for C++ with minimal dependencies. +Feature: vulkan +Description: vulkan implementation for imgui +Build-Depends: vulkan + +Feature: sdl2 +Description: sdl2 implementation for imgui +Build-Depends: sdl2 + Feature: example Description: build with examples Build-Depends: glfw3, freeglut, opengl, sdl1 diff --git a/ports/imgui/portfile.cmake b/ports/imgui/portfile.cmake index 62d674353859ac..09285de311dcba 100644 --- a/ports/imgui/portfile.cmake +++ b/ports/imgui/portfile.cmake @@ -17,6 +17,8 @@ vcpkg_configure_cmake( PREFER_NINJA OPTIONS_DEBUG -DIMGUI_SKIP_HEADERS=ON + -DIMGUI_INCLUDE_IMPL_VULKAN=ON + -DIMGUI_INCLUDE_IMPL_SDL2=ON ) vcpkg_install_cmake() @@ -29,11 +31,11 @@ if ("example" IN_LIST FEATURES) 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) From c76c4c4cbbaec3895a1f15d41b16efd90dc5b2bc Mon Sep 17 00:00:00 2001 From: Lassi Helynranta Date: Mon, 25 Nov 2019 22:06:54 +0200 Subject: [PATCH 2/8] added features for vulkan and sdl2 --- ports/imgui/CMakeLists.txt | 27 ++++++++++++++++++++++++++- ports/imgui/CONTROL | 8 ++++++++ ports/imgui/portfile.cmake | 8 ++++++-- 3 files changed, 40 insertions(+), 3 deletions(-) diff --git a/ports/imgui/CMakeLists.txt b/ports/imgui/CMakeLists.txt index 4a2ce76280e8a5..411055ef0ab2b3 100644 --- a/ports/imgui/CMakeLists.txt +++ b/ports/imgui/CMakeLists.txt @@ -19,13 +19,38 @@ set(IMGUI_SOURCES imgui_widgets.cpp ) +if (IMGUI_INCLUDE_IMPL_VULKAN) + find_package(vulkan) + + list (APPEND IMGUI_INCLUDES_PUBLIC examples/imgui_impl_vulkan.h) + list (APPEND IMGUI_SOURCES examples/imgui_impl_vulkan.cpp) +endif() + +if (IMGUI_INCLUDE_IMPL_SDL2) + find_package(SDL2 CONFIG REQUIRED) + + list (APPEND IMGUI_INCLUDES_PUBLIC examples/imgui_impl_sdl.h) + list (APPEND IMGUI_SOURCES examples/imgui_impl_sdl.cpp) +endif() + + add_library(${PROJECT_NAME} ${IMGUI_INCLUDES_PUBLIC} ${IMGUI_INCLUDES_PRIVATE} ${IMGUI_SOURCES} ) -target_include_directories(${PROJECT_NAME} PUBLIC $) +if (IMGUI_INCLUDE_IMPL_VULKAN) + target_link_libraries(${PROJECT_NAME} PUBLIC Vulkan::Vulkan) +endif() + +if (IMGUI_INCLUDE_IMPL_VULKAN) + target_link_libraries(${PROJECT_NAME} PUBLIC SDL2::SDL2main SDL2::SDL2-static) +endif() + +target_include_directories(${PROJECT_NAME} PUBLIC + $ + $) install(TARGETS ${PROJECT_NAME} EXPORT IMGUIExport diff --git a/ports/imgui/CONTROL b/ports/imgui/CONTROL index 6484a925ac79d1..2fc12f6ffbe6c8 100644 --- a/ports/imgui/CONTROL +++ b/ports/imgui/CONTROL @@ -3,6 +3,14 @@ Version: 1.73-1 Homepage: https://github.com/ocornut/imgui Description: Bloat-free Immediate Mode Graphical User interface for C++ with minimal dependencies. +Feature: vulkan +Description: vulkan implementation for imgui +Build-Depends: vulkan + +Feature: sdl2 +Description: sdl2 implementation for imgui +Build-Depends: sdl2 + Feature: example Description: build with examples Build-Depends: glfw3, freeglut, opengl, sdl1 diff --git a/ports/imgui/portfile.cmake b/ports/imgui/portfile.cmake index 62d674353859ac..69e3107b06b59a 100644 --- a/ports/imgui/portfile.cmake +++ b/ports/imgui/portfile.cmake @@ -15,8 +15,12 @@ file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA + OPTIONS + -DIMGUI_INCLUDE_IMPL_VULKAN=ON + -DIMGUI_INCLUDE_IMPL_SDL2=ON OPTIONS_DEBUG -DIMGUI_SKIP_HEADERS=ON + ) vcpkg_install_cmake() @@ -29,11 +33,11 @@ if ("example" IN_LIST FEATURES) 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) From bdb103e076383a93d0d01c0be98523d3f713ce83 Mon Sep 17 00:00:00 2001 From: Lassi Helynranta Date: Tue, 26 Nov 2019 07:29:17 +0200 Subject: [PATCH 3/8] updated version --- ports/imgui/CONTROL | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/imgui/CONTROL b/ports/imgui/CONTROL index 2fc12f6ffbe6c8..75caffb34dcf45 100644 --- a/ports/imgui/CONTROL +++ b/ports/imgui/CONTROL @@ -1,5 +1,5 @@ Source: imgui -Version: 1.73-1 +Version: 1.74 Homepage: https://github.com/ocornut/imgui Description: Bloat-free Immediate Mode Graphical User interface for C++ with minimal dependencies. @@ -12,5 +12,5 @@ Description: sdl2 implementation for imgui Build-Depends: sdl2 Feature: example -Description: build with examples +Description: build with all examples Build-Depends: glfw3, freeglut, opengl, sdl1 From 04fedf6cd61e97ec682522a76ec9e85a07c04449 Mon Sep 17 00:00:00 2001 From: Lassi Helynranta Date: Tue, 26 Nov 2019 09:10:13 +0200 Subject: [PATCH 4/8] fixes on handling features and upgrade version --- ports/imgui/CMakeLists.txt | 2 +- ports/imgui/CONTROL | 4 ++-- ports/imgui/portfile.cmake | 14 +++++++++++--- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ports/imgui/CMakeLists.txt b/ports/imgui/CMakeLists.txt index 411055ef0ab2b3..598a7650b2c4f5 100644 --- a/ports/imgui/CMakeLists.txt +++ b/ports/imgui/CMakeLists.txt @@ -44,7 +44,7 @@ if (IMGUI_INCLUDE_IMPL_VULKAN) target_link_libraries(${PROJECT_NAME} PUBLIC Vulkan::Vulkan) endif() -if (IMGUI_INCLUDE_IMPL_VULKAN) +if (IMGUI_INCLUDE_IMPL_SDL2) target_link_libraries(${PROJECT_NAME} PUBLIC SDL2::SDL2main SDL2::SDL2-static) endif() diff --git a/ports/imgui/CONTROL b/ports/imgui/CONTROL index 75caffb34dcf45..5c3591768ea429 100644 --- a/ports/imgui/CONTROL +++ b/ports/imgui/CONTROL @@ -4,11 +4,11 @@ Homepage: https://github.com/ocornut/imgui Description: Bloat-free Immediate Mode Graphical User interface for C++ with minimal dependencies. Feature: vulkan -Description: vulkan implementation for imgui +Description: imgui developer renderer bindings implementation for vulkan Build-Depends: vulkan Feature: sdl2 -Description: sdl2 implementation for imgui +Description: imgui developer platform bindings implementation for sdl2 Build-Depends: sdl2 Feature: example diff --git a/ports/imgui/portfile.cmake b/ports/imgui/portfile.cmake index 69e3107b06b59a..6476d4b8c1ba27 100644 --- a/ports/imgui/portfile.cmake +++ b/ports/imgui/portfile.cmake @@ -12,15 +12,23 @@ vcpkg_from_github( file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + vulkan IMGUI_INCLUDE_IMPL_VULKAN + sdl2 IMGUI_INCLUDE_IMPL_SDL2 + example IMGUI_COMPILE_ALL_EXAMPLES +) + +if ("example" IN_LIST FEATURES AND ("sdl2" IN_LIST FEATURES OR "vulkan" IN_LIST )) + message (FATAL_ERROR "example feature uses includes whole examples folder, do not use it with other features") +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DIMGUI_INCLUDE_IMPL_VULKAN=ON - -DIMGUI_INCLUDE_IMPL_SDL2=ON + ${FEATURE_OPTIONS} OPTIONS_DEBUG -DIMGUI_SKIP_HEADERS=ON - ) vcpkg_install_cmake() From 4be36e66d6844c66f5e307d0a4473bc17fd33c87 Mon Sep 17 00:00:00 2001 From: Lassi Helynranta Date: Tue, 26 Nov 2019 20:40:31 +0200 Subject: [PATCH 5/8] fix syntax error --- ports/imgui/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/imgui/portfile.cmake b/ports/imgui/portfile.cmake index 1ec2817ae1beb0..f45ef34ab201d3 100644 --- a/ports/imgui/portfile.cmake +++ b/ports/imgui/portfile.cmake @@ -18,7 +18,7 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS example IMGUI_COMPILE_ALL_EXAMPLES ) -if ("example" IN_LIST FEATURES AND ("sdl2" IN_LIST FEATURES OR "vulkan" IN_LIST )) +if ("example" IN_LIST FEATURES AND ("sdl2" IN_LIST FEATURES OR "vulkan" IN_LIST FEATURES)) message (FATAL_ERROR "example feature uses includes whole examples folder, do not use it with other features") endif() From 2a178662d5963031c6bfcc030f7e9383e0976661 Mon Sep 17 00:00:00 2001 From: Lassi Helynranta Date: Tue, 26 Nov 2019 20:50:52 +0200 Subject: [PATCH 6/8] updated to 1.74 --- ports/imgui/portfile.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/imgui/portfile.cmake b/ports/imgui/portfile.cmake index f45ef34ab201d3..25a8f092f4c914 100644 --- a/ports/imgui/portfile.cmake +++ b/ports/imgui/portfile.cmake @@ -5,8 +5,8 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO ocornut/imgui - REF v1.73 - SHA512 1d67b7cc3f06ea77a2484e62034104386f42106fefe9b6eb62ee8a31fe949c9cda0cc095fbead9269e9da2a5d6199604d34c095eefd630655725265ac0fc4d92 + REF v1.74 + SHA512 e49e5cbe55899c0d0abc9b66c4e6e3e9941542af542d0ed3304bd3bde34c769baa2367355b77b91acb7fca56f9bcfd233dfc99881cfc8f5f6a2e2e6839990832 HEAD_REF master ) From 4a39496bd37dec24292f2457ca95edd47dd56605 Mon Sep 17 00:00:00 2001 From: Lassi Helynranta Date: Tue, 26 Nov 2019 20:56:48 +0200 Subject: [PATCH 7/8] remove unnecessary options --- ports/imgui/portfile.cmake | 2 -- 1 file changed, 2 deletions(-) diff --git a/ports/imgui/portfile.cmake b/ports/imgui/portfile.cmake index 25a8f092f4c914..674330b380117a 100644 --- a/ports/imgui/portfile.cmake +++ b/ports/imgui/portfile.cmake @@ -29,8 +29,6 @@ vcpkg_configure_cmake( ${FEATURE_OPTIONS} OPTIONS_DEBUG -DIMGUI_SKIP_HEADERS=ON - -DIMGUI_INCLUDE_IMPL_VULKAN=ON - -DIMGUI_INCLUDE_IMPL_SDL2=ON ) vcpkg_install_cmake() From 0d73b664f3ee06792851a05d1d0bfdbb94cc91ec Mon Sep 17 00:00:00 2001 From: Lassi Helynranta Date: Tue, 26 Nov 2019 20:58:35 +0200 Subject: [PATCH 8/8] added required for vulkan --- ports/imgui/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/imgui/CMakeLists.txt b/ports/imgui/CMakeLists.txt index 598a7650b2c4f5..236201f2edf4fb 100644 --- a/ports/imgui/CMakeLists.txt +++ b/ports/imgui/CMakeLists.txt @@ -20,7 +20,7 @@ set(IMGUI_SOURCES ) if (IMGUI_INCLUDE_IMPL_VULKAN) - find_package(vulkan) + find_package(vulkan REQUIRED) list (APPEND IMGUI_INCLUDES_PUBLIC examples/imgui_impl_vulkan.h) list (APPEND IMGUI_SOURCES examples/imgui_impl_vulkan.cpp)