Skip to content

Commit

Permalink
vkvg-svg library as submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
jpbruyere committed Jan 6, 2022
1 parent 6ea125a commit 9f0b74c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "external/glutess"]
path = external/glutess
url = git@github.com:jpbruyere/glutess.git
[submodule "external/vkvg-svg"]
path = external/vkvg-svg
url = git@github.com:jpbruyere/vkvg-svg.git
16 changes: 15 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ IF (VKVG_FILL_NZ_GLUTESS)
ADD_DEFINITIONS (-DVKVG_FILL_NZ_GLUTESS)
ENDIF ()

OPTION(VKVG_SVG "render svg with vkvg-svg library" ON)
IF (VKVG_SVG)
ADD_DEFINITIONS (-DVKVG_SVG)
ENDIF ()


FUNCTION (updateGitSubmodule SUBMOD_NAME)
MESSAGE(STATUS "Git Submodule ${SUBMOD_NAME} update")
EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive ${SUBMOD_NAME}
Expand All @@ -99,6 +105,9 @@ IF(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
IF (VKVG_FILL_NZ_GLUTESS)
updateGitSubmodule(external/glutess)
ENDIF ()
IF (VKVG_SVG)
updateGitSubmodule(external/vkvg-svg)
ENDIF ()
endif()
ENDIF ()

Expand Down Expand Up @@ -205,6 +214,10 @@ ENDIF()
IF (VKVG_FILL_NZ_GLUTESS)
ADD_SUBDIRECTORY (external/glutess)
ENDIF ()
IF (VKVG_SVG AND NOT TARGET vkvk-svg)
ADD_SUBDIRECTORY (external/vkvg-svg)
ENDIF()


FILE(GLOB VKVG_SRC src/*.c)
SET (VKVG_PUBLIC_HEADERS "include/vkvg.h;include/vkvg-nsvg.h")
Expand All @@ -219,7 +232,6 @@ SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES
VERSION ${vkvg_VERSION_MAJOR}.${vkvg_VERSION_MINOR}
SOVERSION ${vkvg_VERSION_MAJOR}
C_STANDARD 11
#C_EXTENSIONS OFF
PUBLIC_HEADER "${VKVG_PUBLIC_HEADERS}"
)

Expand All @@ -234,6 +246,7 @@ TARGET_INCLUDE_DIRECTORIES("${PROJECT_NAME}"
${Vulkan_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/vkh/include
"$<$<BOOL:${VKVG_SVG}>:${CMAKE_CURRENT_SOURCE_DIR}/external/vkvg-svg/include>"
)
TARGET_LINK_LIBRARIES("${PROJECT_NAME}"
PUBLIC
Expand All @@ -245,6 +258,7 @@ TARGET_LINK_LIBRARIES("${PROJECT_NAME}"
"$<$<BOOL:${VKVG_USE_HARFBUZZ}>:${HarfBuzz_LIBRARIES}>"
"$<$<BOOL:${VKVG_USE_FONTCONFIG}>:${Fontconfig_LIBRARIES}>"
"$<$<BOOL:${VKVG_FILL_NZ_GLUTESS}>:glutess>"
"$<$<BOOL:${VKVG_SVG}>:vkvg-svg>"
)

INSTALL(TARGETS "${PROJECT_NAME}"
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ For API documentation and usage, please refer to the [Cairo](https://www.cairogr
<a href="https://github.com/jpbruyere/vkvg/blob/master/vkvg-tiger.png">
<kbd><img src="https://github.com/jpbruyere/vkvg/blob/master/vkvg-tiger.png" height="260"></kbd>
</a>
<a href="https://github.com/jpbruyere/vkvg/blob/master/screenshot3.png">
<kbd><img src="https://raw.githubusercontent.com/jpbruyere/vkvg/master/screenshot3.png" height="260"></kbd>
</a>
<a href="https://github.com/jpbruyere/vkvg/blob/master/screenshot1.png">
<kbd><img src="https://github.com/jpbruyere/vkvg/blob/master/screenshot1.png" height="260"></kbd>
</a>
Expand Down
1 change: 1 addition & 0 deletions external/vkvg-svg
Submodule vkvg-svg added at 40415f

0 comments on commit 9f0b74c

Please sign in to comment.