panda3d/panda/metalibs/pandagl/CMakeLists.txt
Sam Edwards e89621b88d CMake: "Flatten" metalibs more
By "flatten" I mean that component libraries aren't referenced by
genex anymore; instead, their include directories and libraries
are copied out of their interfaces and into the interface of
the metalib.

This prepares for exporting our targets, by making sure that the
component libraries don't have to be installed for CMake to be
able to export metalibs.
2018-10-10 20:16:32 -06:00

33 lines
970 B
CMake

if(HAVE_GL)
# Check that we actually have a display subsystem.
if(NOT HAVE_WGL AND NOT HAVE_COCOA AND NOT HAVE_CARBON AND NOT HAVE_GLX)
message("") # Add extra line before error
message(SEND_ERROR
"When compiling with OpenGL (HAVE_GL), at least one of:
HAVE_WGL, HAVE_COCOA, HAVE_CARBON, or HAVE_GLX must be defined.")
endif()
set(PANDAGL_LINK_TARGETS p3glgsg p3glstuff)
if(HAVE_GLX)
list(APPEND PANDAGL_LINK_TARGETS p3glxdisplay p3x11display)
endif()
if(HAVE_WGL)
list(APPEND PANDAGL_LINK_TARGETS p3wgldisplay p3windisplay)
endif()
if(HAVE_COCOA)
list(APPEND PANDAGL_LINK_TARGETS p3cocoadisplay)
endif()
if(HAVE_CARBON)
list(APPEND PANDAGL_LINK_TARGETS p3osxdisplay)
endif()
add_metalib(pandagl ${MODULE_TYPE} pandagl.cxx COMPONENTS ${PANDAGL_LINK_TARGETS})
set_target_properties(pandagl PROPERTIES DEFINE_SYMBOL BUILDING_PANDAGL)
install(TARGETS pandagl DESTINATION ${MODULE_DESTINATION})
endif()