Skip to content

Commit 2e35120

Browse files
committed
Check If Target Library Plutovg Already Exists in CMake Project
This enhancement adds a check in CMakeLists.txt for target lib plutovg before find_package(plutovg) or add_subdirectory(plutovg) Now user could embed plutovg in project for better dependency management
1 parent 789067a commit 2e35120

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ set(PLUTOSVG_VERSION_MICRO 7)
66

77
project(plutosvg LANGUAGES C VERSION ${PLUTOSVG_VERSION_MAJOR}.${PLUTOSVG_VERSION_MINOR}.${PLUTOSVG_VERSION_MICRO})
88

9-
find_package(plutovg 1.0.0 QUIET)
10-
if(NOT plutovg_FOUND)
11-
add_subdirectory(plutovg)
9+
if (NOT TARGET plutovg::plutovg)
10+
find_package(plutovg 1.0.0 QUIET)
11+
if(NOT plutovg_FOUND)
12+
add_subdirectory(plutovg)
13+
endif()
1214
endif()
1315

1416
set(plutosvg_sources

0 commit comments

Comments
 (0)