From 3547cd96d942c89f7786e9c4e374f5fd0c433dbd Mon Sep 17 00:00:00 2001 From: Jonathan Higgs Date: Thu, 22 Jul 2021 22:05:05 +0100 Subject: [PATCH] [imguizmo] new port (#18991) * [imguizmo] new port * [imguizmo] Apply suggestions from code review Co-authored-by: JonLiu1993 <63675417+JonLiu1993@users.noreply.github.com> * [imguizmo] fix formatting * [imguizmo] fix version-date * [imguizmo] apply suggestions from code review Co-authored-by: Phoebe <20694052+PhoebeHui@users.noreply.github.com> * [imguizmo] apply suggestions from code review Co-authored-by: Phoebe <20694052+PhoebeHui@users.noreply.github.com> * [imguizmo] add std version requirement * [imguizmo] remove debug lib rename * [imguizmo] update to use v1.83 tag * [imguizmo] fixed hash Co-authored-by: JonLiu1993 <63675417+JonLiu1993@users.noreply.github.com> Co-authored-by: Phoebe <20694052+PhoebeHui@users.noreply.github.com> --- ports/imguizmo/CMakeLists.txt | 59 +++++++++++++++++++++++++++++++++++ ports/imguizmo/portfile.cmake | 24 ++++++++++++++ ports/imguizmo/vcpkg.json | 17 ++++++++++ versions/baseline.json | 4 +++ versions/i-/imguizmo.json | 9 ++++++ 5 files changed, 113 insertions(+) create mode 100644 ports/imguizmo/CMakeLists.txt create mode 100644 ports/imguizmo/portfile.cmake create mode 100644 ports/imguizmo/vcpkg.json create mode 100644 versions/i-/imguizmo.json diff --git a/ports/imguizmo/CMakeLists.txt b/ports/imguizmo/CMakeLists.txt new file mode 100644 index 0000000000..1b552bae2d --- /dev/null +++ b/ports/imguizmo/CMakeLists.txt @@ -0,0 +1,59 @@ +cmake_minimum_required(VERSION 3.8) +project(imguizmo) + +find_package(imgui CONFIG REQUIRED) +get_target_property(IMGUI_INCLUDE_DIRS imgui::imgui + INTERFACE_INCLUDE_DIRECTORIES +) + +add_library(${PROJECT_NAME} "") +add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) + +target_compile_options(${PROJECT_NAME} PRIVATE "-std=c++11") + +target_include_directories( + ${PROJECT_NAME} + PUBLIC + $ + $ + PRIVATE + ${IMGUI_INCLUDE_DIRS} +) + +target_sources( + ${PROJECT_NAME} + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/GraphEditor.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/ImCurveEdit.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/ImGradient.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/ImGuizmo.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/ImSequencer.cpp +) + +install( + TARGETS ${PROJECT_NAME} + EXPORT ${PROJECT_NAME}_target + ARCHIVE DESTINATION lib + ARCHIVE DESTINATION lib + RUNTIME DESTINATION bin +) + +if (NOT IMGUIZMO_SKIP_HEADERS) + install( + FILES + ${CMAKE_CURRENT_SOURCE_DIR}/GraphEditor.h + ${CMAKE_CURRENT_SOURCE_DIR}/ImCurveEdit.h + ${CMAKE_CURRENT_SOURCE_DIR}/ImGradient.h + ${CMAKE_CURRENT_SOURCE_DIR}/ImGuizmo.h + ${CMAKE_CURRENT_SOURCE_DIR}/ImSequencer.h + ${CMAKE_CURRENT_SOURCE_DIR}/ImZoomSlider.h + DESTINATION include + ) +endif() + +install( + EXPORT ${PROJECT_NAME}_target + NAMESPACE ${PROJECT_NAME}:: + FILE ${PROJECT_NAME}-config.cmake + DESTINATION share/${PROJECT_NAME} +) \ No newline at end of file diff --git a/ports/imguizmo/portfile.cmake b/ports/imguizmo/portfile.cmake new file mode 100644 index 0000000000..342001ea8d --- /dev/null +++ b/ports/imguizmo/portfile.cmake @@ -0,0 +1,24 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO CedricGuillemet/ImGuizmo + REF 1.83 + SHA512 23285398688b4cdf3128ecb918b70c9a52f06c8e911da57430442b838cecf653e233d8cdfefc6acd3e4da381869ffc6fb74bcaaafc8e33657d6060a645517363 + HEAD_REF master +) + +file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS_DEBUG + -DIMGUIZMO_SKIP_HEADERS=ON +) + +vcpkg_cmake_install() + +vcpkg_copy_pdbs() +vcpkg_cmake_config_fixup() + +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/imguizmo/vcpkg.json b/ports/imguizmo/vcpkg.json new file mode 100644 index 0000000000..09184a7230 --- /dev/null +++ b/ports/imguizmo/vcpkg.json @@ -0,0 +1,17 @@ +{ + "name": "imguizmo", + "version": "1.83", + "description": "Immediate mode 3D gizmo for scene editing and other controls based on Dear ImGui", + "homepage": "https://github.com/CedricGuillemet/ImGuizmo", + "dependencies": [ + "imgui", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index f628494062..115d17d3c9 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2664,6 +2664,10 @@ "baseline": "2.1-2", "port-version": 0 }, + "imguizmo": { + "baseline": "1.83", + "port-version": 0 + }, "immer": { "baseline": "2019-06-07", "port-version": 0 diff --git a/versions/i-/imguizmo.json b/versions/i-/imguizmo.json new file mode 100644 index 0000000000..096f396410 --- /dev/null +++ b/versions/i-/imguizmo.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "9611b5ef89fd20182ee8d6c84c505e986f3ea880", + "version": "1.83", + "port-version": 0 + } + ] +}