vcpkg/ports/imgui/portfile.cmake
MonicaLiu 66bef96adb
[imgui/vsgimgui] Update imgui to 1.90.6 and vsgimgui to 0.3.0 (#38669)
Fixes #38662, update `imgui` to 1.90.6, update `vsgimgui` to 0.3.0.

imgui
-
Except `osx-binding, metal-binding, android-binding`, other features are
tested successfully in the following triplet:
```
x64-windows
x64-windows-static
```

Except `osx-binding,metal-binding,android-binding,dx12-binding`, other
features are tested successfully in the following triplet:
```
x86-windows
```

- [x] Changes comply with the [maintainer
guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md).
- [x] SHA512s are updated for each updated download.
- [ ] ~The "supports" clause reflects platforms that may be fixed by
this new version.~
- [ ] ~Any fixed [CI
baseline](https://github.com/microsoft/vcpkg/blob/master/scripts/ci.baseline.txt)
entries are removed from that file.~
- [ ] ~Any patches that are no longer applied are deleted from the
port's directory.~
- [x] The version database is fixed by rerunning `./vcpkg x-add-version
--all` and committing the result.
- [x] Only one version is added to each modified port's versions file.

---------

Co-authored-by: Monica <v-liumonica@microsoft.com>
2024-05-13 12:53:17 -07:00

84 lines
3.3 KiB
CMake

vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
if ("docking-experimental" IN_LIST FEATURES)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO ocornut/imgui
REF "v${VERSION}-docking"
SHA512 f4e97f8a191276b1deb1510cb9136ab7a9a4abc029727f752dff8c01bb6af4a692b2239de84839aa39aa359220f08ffe9bdff01b57942dd6e01183ec6778cfa7
HEAD_REF docking
)
else()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO ocornut/imgui
REF "v${VERSION}"
SHA512 c9ff56ec6f8eb05b5034bb0b886568e843743a4313e36613db214f6080506703d5ed2ee606c88cd8957e73575e2b0e39deb52e1ac0c1a6e0a9fe38bca5e6dc0e
HEAD_REF master
)
endif()
file(COPY "${CMAKE_CURRENT_LIST_DIR}/imgui-config.cmake.in" DESTINATION "${SOURCE_PATH}")
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
allegro5-binding IMGUI_BUILD_ALLEGRO5_BINDING
android-binding IMGUI_BUILD_ANDROID_BINDING
dx9-binding IMGUI_BUILD_DX9_BINDING
dx10-binding IMGUI_BUILD_DX10_BINDING
dx11-binding IMGUI_BUILD_DX11_BINDING
dx12-binding IMGUI_BUILD_DX12_BINDING
glfw-binding IMGUI_BUILD_GLFW_BINDING
glut-binding IMGUI_BUILD_GLUT_BINDING
metal-binding IMGUI_BUILD_METAL_BINDING
opengl2-binding IMGUI_BUILD_OPENGL2_BINDING
opengl3-binding IMGUI_BUILD_OPENGL3_BINDING
osx-binding IMGUI_BUILD_OSX_BINDING
sdl2-binding IMGUI_BUILD_SDL2_BINDING
sdl2-renderer-binding IMGUI_BUILD_SDL2_RENDERER_BINDING
vulkan-binding IMGUI_BUILD_VULKAN_BINDING
win32-binding IMGUI_BUILD_WIN32_BINDING
freetype IMGUI_FREETYPE
freetype-lunasvg IMGUI_FREETYPE_LUNASVG
wchar32 IMGUI_USE_WCHAR32
)
if ("libigl-imgui" IN_LIST FEATURES)
vcpkg_download_distfile(
IMGUI_FONTS_DROID_SANS_H
URLS
https://raw.githubusercontent.com/libigl/libigl-imgui/c3efb9b62780f55f9bba34561f79a3087e057fc0/imgui_fonts_droid_sans.h
FILENAME "imgui_fonts_droid_sans.h"
SHA512
abe9250c9a5989e0a3f2285bbcc83696ff8e38c1f5657c358e6fe616ff792d3c6e5ff2fa23c2eeae7d7b307392e0dc798a95d14f6d10f8e9bfbd7768d36d8b31
)
file(INSTALL "${IMGUI_FONTS_DROID_SANS_H}" DESTINATION "${CURRENT_PACKAGES_DIR}/include")
endif()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${FEATURE_OPTIONS}
OPTIONS_DEBUG
-DIMGUI_SKIP_HEADERS=ON
)
vcpkg_cmake_install()
if ("freetype" IN_LIST FEATURES)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/imconfig.h" "//#define IMGUI_ENABLE_FREETYPE" "#define IMGUI_ENABLE_FREETYPE")
endif()
if ("freetype-lunasvg" IN_LIST FEATURES)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/imconfig.h" "//#define IMGUI_ENABLE_FREETYPE_LUNASVG" "#define IMGUI_ENABLE_FREETYPE_LUNASVG")
endif()
if ("wchar32" IN_LIST FEATURES)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/imconfig.h" "//#define IMGUI_USE_WCHAR32" "#define IMGUI_USE_WCHAR32")
endif()
vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup()
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")