@@ -49,6 +49,8 @@ set(FPLOT_SOURCES ${FPLOT_SOURCES} PARENT_SCOPE)
4949include (FetchContent)
5050find_package (ferror QUIET )
5151find_package (collections QUIET )
52+ find_package (geompack QUIET )
53+ find_package (fstring QUIET )
5254if (NOT ferror_FOUND)
5355 message (STATUS "FERROR could not be found. A reference version will be employed." )
5456 FetchContent_Declare(
@@ -78,12 +80,35 @@ else()
7880 set (BUILD_COLLECTIONS FALSE )
7981endif ()
8082
81- FetchContent_Declare(
82- geompack
83- GIT_REPOSITORY "https://github.com/jchristopherson/geompack"
84- GIT_TAG main
85- )
86- FetchContent_MakeAvailable(geompack)
83+ if (NOT geompack_FOUND)
84+ message (STATUS "GEOMPACK could not be found. A reference version will be employed." )
85+ FetchContent_Declare(
86+ geompack
87+ GIT_REPOSITORY "https://github.com/jchristopherson/geompack"
88+ GIT_TAG main
89+ )
90+ FetchContent_MakeAvailable(geompack)
91+ set (GEOMPACK_LIBRARIES geompack)
92+ set (BUILD_GEOMPACK TRUE )
93+ else ()
94+ set (GEOMPACK_LIBRARIES geompack::geompack)
95+ set (BUILD_GEOMPACK FALSE )
96+ endif ()
97+
98+ if (NOT fstring_FOUND)
99+ message (STATUS "FSTRING could not be found. A reference version will be employed." )
100+ FetchContent_Declare(
101+ fstring
102+ GIT_REPOSITORY "https://github.com/jchristopherson/fstring"
103+ GIT_TAG main
104+ )
105+ FetchContent_MakeAvailable(fstring)
106+ set (FSTRING_LIBRARIES fstring)
107+ set (BUILD_FSTRING TRUE )
108+ else ()
109+ set (FSTRING_LIBRARIES fstring::fstring)
110+ set (BUILD_FSTRING FALSE )
111+ endif ()
87112
88113FetchContent_Declare(
89114 forcolormap
@@ -92,27 +117,20 @@ FetchContent_Declare(
92117)
93118FetchContent_MakeAvailable(forcolormap)
94119
95- FetchContent_Declare(
96- fstring
97- GIT_REPOSITORY "https://github.com/jchristopherson/fstring"
98- GIT_TAG main
99- )
100- FetchContent_MakeAvailable(fstring)
101-
102120# Build
103121add_library (${PROJECT_NAME} ${FPLOT_SOURCES} )
104122target_link_libraries (
105123 ${PROJECT_NAME}
106124 PUBLIC
107125 ${FERROR_LIBRARIES}
108- ${COLLECTIONS_LIBRARIES}
109126)
110127target_link_libraries (
111128 ${PROJECT_NAME}
112129 PRIVATE
113- $<BUILD_INTERFACE:geompack>
130+ ${COLLECTIONS_LIBRARIES}
131+ ${GEOMPACK_LIBRARIES}
132+ ${FSTRING_LIBRARIES}
114133 $<BUILD_INTERFACE:forcolormap>
115- $<BUILD_INTERFACE:fstring>
116134)
117135
118136set_target_properties (
@@ -155,3 +173,10 @@ if (${BUILD_COLLECTIONS} AND ${BUILD_SHARED_LIBS})
155173 install (IMPORTED_RUNTIME_ARTIFACTS ${COLLECTIONS_LIBRARIES} )
156174endif ()
157175
176+ if (${BUILD_GEOMPACK} AND ${BUILD_SHARED_LIBS} )
177+ install (IMPORTED_RUNTIME_ARTIFACTS ${GEOMPACK_LIBRARIES} )
178+ endif ()
179+
180+ if (${BUILD_FSTRING} AND ${BUILD_SHARED_LIBS} )
181+ install (IMPORTED_RUNTIME_ARTIFACTS ${FSTRING_LIBRARIES} )
182+ endif ()
0 commit comments