Skip to content

Commit 34a14c9

Browse files
aminyaalandefreitas
authored andcommitted
fix: install matplot_opengl in CMake
1 parent 2a8eada commit 34a14c9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

source/matplot/CMakeLists.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ add_library(matplot
9090
freestanding/plot.h
9191
)
9292

93+
set(TARGETS matplot)
94+
9395
# Target aliases
9496
add_library(Matplot++::matplot ALIAS matplot)
9597
add_library(Matplot++::matplot++ ALIAS matplot)
@@ -220,7 +222,7 @@ if (MATPLOTPP_BUILD_EXPERIMENTAL_OPENGL_BACKEND)
220222
# Use CPM only if not found, to avoid ODR violations
221223
# find_package(GLAD REQUIRE) would suffice if it worked well
222224
FetchContent_Declare(glad GIT_REPOSITORY https://github.com/Dav1dde/glad.git GIT_TAG df8e9e16110b305479a875399cee13daa0ccadd9)
223-
FetchContent_MakeAvailable(glad)
225+
FetchContent_MakeAvailable(glad)
224226
else ()
225227
# FindGLAD does not usually create a target, so we create an interface target
226228
if (NOT TARGET glad)
@@ -245,16 +247,17 @@ if (MATPLOTPP_BUILD_EXPERIMENTAL_OPENGL_BACKEND)
245247
backend/opengl.h
246248
backend/opengl.cpp
247249
)
248-
target_include_directories(matplot_opengl PUBLIC matplot)
249250
target_link_libraries(matplot_opengl PUBLIC matplot glad glfw ${CMAKE_DL_LIBS})
251+
252+
list(APPEND TARGETS matplot_opengl)
250253
endif()
251254

252255
#######################################################
253256
### Installer ###
254257
#######################################################
255258
if (MATPLOTPP_BUILD_INSTALLER)
256259
# Install targets
257-
install(TARGETS matplot
260+
install(TARGETS ${TARGETS}
258261
EXPORT Matplot++Targets
259262
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
260263
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}

0 commit comments

Comments
 (0)