mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-24 11:21:38 +08:00
[imgui] Add Freetype feature (#11919)
This commit is contained in:
parent
5058547304
commit
8e9ee5d36c
@ -3,56 +3,78 @@ project(imgui CXX)
|
|||||||
|
|
||||||
set(CMAKE_DEBUG_POSTFIX d)
|
set(CMAKE_DEBUG_POSTFIX d)
|
||||||
|
|
||||||
set(IMGUI_INCLUDES_PUBLIC
|
add_library(${PROJECT_NAME} "")
|
||||||
imgui.h
|
add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
|
||||||
imconfig.h
|
target_include_directories(
|
||||||
|
${PROJECT_NAME}
|
||||||
|
PUBLIC
|
||||||
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||||
|
$<INSTALL_INTERFACE:Include>
|
||||||
)
|
)
|
||||||
|
|
||||||
set(IMGUI_INCLUDES_PRIVATE
|
target_sources(
|
||||||
imgui_internal.h
|
${PROJECT_NAME}
|
||||||
imstb_textedit.h
|
PRIVATE
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/imgui.cpp
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/imgui_demo.cpp
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/imgui_draw.cpp
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/imgui_widgets.cpp
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/misc/cpp/imgui_stdlib.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set(IMGUI_SOURCES
|
if(IMGUI_FREETYPE)
|
||||||
imgui.cpp
|
find_package(Freetype REQUIRED)
|
||||||
imgui_demo.cpp
|
|
||||||
imgui_draw.cpp
|
|
||||||
imgui_widgets.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
add_library(${PROJECT_NAME}
|
target_include_directories(
|
||||||
${IMGUI_INCLUDES_PUBLIC}
|
${PROJECT_NAME}
|
||||||
${IMGUI_INCLUDES_PRIVATE}
|
PRIVATE
|
||||||
${IMGUI_SOURCES}
|
${FREETYPE_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
|
|
||||||
file(GLOB IMGUI_BINDINGS ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_* )
|
target_sources(
|
||||||
|
${PROJECT_NAME}
|
||||||
target_include_directories(${PROJECT_NAME} PUBLIC $<INSTALL_INTERFACE:include>)
|
PRIVATE
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/misc/freetype/imgui_freetype.cpp
|
||||||
install(TARGETS ${PROJECT_NAME}
|
)
|
||||||
EXPORT IMGUIExport
|
|
||||||
RUNTIME DESTINATION bin
|
|
||||||
LIBRARY DESTINATION lib
|
|
||||||
ARCHIVE DESTINATION lib
|
|
||||||
)
|
|
||||||
|
|
||||||
install(EXPORT IMGUIExport FILE ${PROJECT_NAME}Config.cmake NAMESPACE ${PROJECT_NAME}:: DESTINATION share/${PROJECT_NAME})
|
|
||||||
|
|
||||||
if(NOT IMGUI_SKIP_HEADERS)
|
|
||||||
install(
|
|
||||||
FILES ${IMGUI_INCLUDES_PUBLIC}
|
|
||||||
DESTINATION include
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(IMGUI_COPY_BINDINGS)
|
install(
|
||||||
install(
|
TARGETS ${PROJECT_NAME}
|
||||||
FILES ${IMGUI_INCLUDES_PRIVATE}
|
EXPORT ${PROJECT_NAME}_target
|
||||||
|
ARCHIVE DESTINATION lib
|
||||||
|
LIBRARY DESTINATION lib
|
||||||
|
RUNTIME DESTINATION bin
|
||||||
|
)
|
||||||
|
|
||||||
|
if(NOT IMGUI_SKIP_HEADERS)
|
||||||
|
install(FILES
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/imgui.h
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/imconfig.h
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/imgui_internal.h
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/imstb_textedit.h
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/misc/cpp/imgui_stdlib.h
|
||||||
DESTINATION include
|
DESTINATION include
|
||||||
)
|
)
|
||||||
install(
|
|
||||||
FILES ${IMGUI_BINDINGS}
|
if(IMGUI_COPY_BINDINGS)
|
||||||
DESTINATION include/bindings
|
file(GLOB IMGUI_BINDINGS ${CMAKE_CURRENT_SOURCE_DIR}/examples/imgui_impl_* )
|
||||||
)
|
install(
|
||||||
endif()
|
FILES ${IMGUI_BINDINGS}
|
||||||
|
DESTINATION include/bindings
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(IMGUI_FREETYPE)
|
||||||
|
install(FILES
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/misc/freetype/imgui_freetype.h
|
||||||
|
DESTINATION include
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
install(
|
||||||
|
EXPORT ${PROJECT_NAME}_target
|
||||||
|
NAMESPACE ${PROJECT_NAME}::
|
||||||
|
FILE ${PROJECT_NAME}-config.cmake
|
||||||
|
DESTINATION share/${PROJECT_NAME}
|
||||||
|
)
|
@ -1,8 +1,12 @@
|
|||||||
Source: imgui
|
Source: imgui
|
||||||
Version: 1.76-1
|
Version: 1.76-2
|
||||||
Homepage: https://github.com/ocornut/imgui
|
Homepage: https://github.com/ocornut/imgui
|
||||||
Description: Bloat-free Immediate Mode Graphical User interface for C++ with minimal dependencies.
|
Description: Bloat-free Immediate Mode Graphical User interface for C++ with minimal dependencies.
|
||||||
|
|
||||||
Feature: bindings
|
Feature: bindings
|
||||||
Description: make available bindings header and source files for supported implementations
|
Description: make available bindings header and source files for supported implementations
|
||||||
Build-Depends: glfw3, freeglut, opengl, sdl1, allegro5
|
Build-Depends: glfw3, freeglut, opengl, sdl2, allegro5
|
||||||
|
|
||||||
|
Feature: freetype
|
||||||
|
Description: Build font atlases using FreeType instead of stb_truetype
|
||||||
|
Build-Depends: freetype
|
||||||
|
@ -11,16 +11,16 @@ vcpkg_from_github(
|
|||||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
||||||
|
|
||||||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||||
bindings IMGUI_COPY_BINDINGS # should only be copied once, at most
|
bindings IMGUI_COPY_BINDINGS # should only be copied once, at most
|
||||||
|
freetype IMGUI_FREETYPE
|
||||||
)
|
)
|
||||||
|
|
||||||
vcpkg_configure_cmake(
|
vcpkg_configure_cmake(
|
||||||
SOURCE_PATH ${SOURCE_PATH}
|
SOURCE_PATH ${SOURCE_PATH}
|
||||||
PREFER_NINJA
|
PREFER_NINJA
|
||||||
OPTIONS_RELEASE
|
OPTIONS
|
||||||
${FEATURE_OPTIONS}
|
${FEATURE_OPTIONS}
|
||||||
OPTIONS_DEBUG
|
OPTIONS_DEBUG
|
||||||
-DIMGUI_COPY_BINDINGS=OFF
|
|
||||||
-DIMGUI_SKIP_HEADERS=ON
|
-DIMGUI_SKIP_HEADERS=ON
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -29,4 +29,4 @@ vcpkg_install_cmake()
|
|||||||
vcpkg_copy_pdbs()
|
vcpkg_copy_pdbs()
|
||||||
vcpkg_fixup_cmake_targets()
|
vcpkg_fixup_cmake_targets()
|
||||||
|
|
||||||
file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
Loading…
Reference in New Issue
Block a user