vcpkg/ports/imgui/portfile.cmake

80 lines
3.1 KiB
CMake
Raw Normal View History

vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_minimum_required(VERSION 2022-11-10)
if ("docking-experimental" IN_LIST FEATURES)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO ocornut/imgui
REF 192196711a7d0d7c2d60454d42654cf090498a74
SHA512 66d8c299773347e69273f21ec5b0b038551ed9e3c88398568549c406e53624c7f87dffc2fb724f4b57bd4f6a9225f0dcdec6518cdbd7bae894ab128cf80cd138
HEAD_REF docking
)
else()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO ocornut/imgui
REF v${VERSION}
SHA512 04b262921ff8987eb174f3326e6ce2b5e2cbdb89606d3d654cb9d0fa899a086ae354c0c9c4c0a65884bf4fcdfff5716cef5cb2815a5df3f6f855dc38e428eb02
HEAD_REF master
)
endif()
2017-10-09 18:48:44 +08:00
file(COPY "${CMAKE_CURRENT_LIST_DIR}/imgui-config.cmake.in" DESTINATION "${SOURCE_PATH}")
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
2017-10-09 18:48:44 +08:00
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
allegro5-binding IMGUI_BUILD_ALLEGRO5_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
wchar32 IMGUI_USE_WCHAR32
)
2020-08-25 03:49:35 +08:00
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")
2020-08-25 03:49:35 +08:00
endif()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
2020-06-24 04:56:15 +08:00
OPTIONS
${FEATURE_OPTIONS}
2017-10-09 18:48:44 +08:00
OPTIONS_DEBUG
-DIMGUI_SKIP_HEADERS=ON
)
vcpkg_cmake_install()
2019-10-15 15:43:25 +08:00
if ("freetype" IN_LIST FEATURES)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/imconfig.h" "//#define IMGUI_ENABLE_FREETYPE" "#define IMGUI_ENABLE_FREETYPE")
endif()
if ("wchar32" IN_LIST FEATURES)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/imconfig.h" "//#define IMGUI_USE_WCHAR32" "#define IMGUI_USE_WCHAR32")
endif()
2017-10-09 18:48:44 +08:00
vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup()
2017-10-09 18:48:44 +08:00
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")