Skip to content

Commit

Permalink
cmake / _him_fetch_and_compile_plutosvg: build plutovg manually (to a…
Browse files Browse the repository at this point in the history
…void install, since we link statically)
  • Loading branch information
pthom committed Dec 20, 2024
1 parent cb7facc commit 53f85c6
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions hello_imgui_cmake/hello_imgui_build_lib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -461,14 +461,25 @@ function(_him_fetch_and_compile_plutosvg)
set(backup_build_shared_libs ${BUILD_SHARED_LIBS})
set(BUILD_SHARED_LIBS OFF)

# Fetch & build plutovg at configure time
# Fetch & build plutovg at configure time, then compile manually at build time
# (the stock CMakeLists does install lib/ and include/ although we link to it statically)
include(FetchContent)
FetchContent_Declare(plutovg
FetchContent_Populate(plutovg
GIT_REPOSITORY https://github.com/sammycage/plutovg
GIT_TAG v0.0.8
GIT_PROGRESS TRUE
SOURCE_DIR ${CMAKE_BINARY_DIR}/plutovg_source
BINARY_DIR ${CMAKE_BINARY_DIR}/plutovg_build
)
FetchContent_MakeAvailable(plutovg)
file(GLOB plutovg_sources ${plutovg_SOURCE_DIR}/source/*.c)
add_library(plutovg STATIC ${plutovg_sources})
target_include_directories(plutovg PUBLIC $<BUILD_INTERFACE:${plutovg_SOURCE_DIR}/include>)
find_library(MATH_LIBRARY m)
if(MATH_LIBRARY)
target_link_libraries(plutovg PRIVATE ${MATH_LIBRARY})
endif()
him_add_installable_dependency(plutovg)


# Fetch plutosvg at configure time, then compile manually at build time
# (the stock CMakeLists of plutosvg is not compatible with a custom install of freetype)
Expand Down

0 comments on commit 53f85c6

Please sign in to comment.