add cmake option to enable or disable using of msdf library

This commit is contained in:
ohyzha
2024-08-07 20:04:19 +03:00
parent 64712f0c94
commit 634b4431b3
2 changed files with 85 additions and 81 deletions

View File

@@ -1,3 +1,4 @@
if (ENABLE_MSDF)
include(FetchContent)
if(NOT DEFINED MSDFGEN_REPO)
@@ -81,12 +82,15 @@ FetchContent_Declare(
GIT_SHALLOW TRUE
)
FetchContent_MakeAvailable(msdfgen_atlas)
endif()
function(LinkMsdf TARGET)
if (ENABLE_MSDF)
target_link_libraries(${TARGET} PRIVATE msdfgen::msdfgen msdfgen::msdfgen-ext msdf-atlas-gen)
if (FREETYPE_BUILT_FROM_SOURCES)
target_include_directories(${TARGET} PUBLIC ${FREETYPE_INCLUDE_DIR})
else()
target_include_directories(${TARGET} PUBLIC ${FREETYPE_INCLUDE_DIRS})
endif()
endif()
endfunction()

View File

@@ -22,7 +22,7 @@ endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
option(TRACY_ENABLE "Enable Tracy Profiler" OFF)
option(ENABLE_MSDF "Enable msdf library" ON)
add_subdirectory(3rdParty)
project (openVulkanoCpp VERSION 1.0 LANGUAGES C CXX)