From 5b791ca358c254caa2bc4e75974d9b3f7907db4c Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 26 Jan 2014 18:46:38 -0700 Subject: [PATCH] Get pandagl building under Linux on CMake. --- panda/CMakeLists.txt | 4 +++- panda/metalibs/pandagl/CMakeLists.txt | 5 +++++ panda/src/glgsg/CMakeLists.txt | 4 ++-- panda/src/glxdisplay/CMakeLists.txt | 27 +++++++++++++++++++++++++++ panda/src/x11display/CMakeLists.txt | 15 +++++++++++++++ 5 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 panda/src/glxdisplay/CMakeLists.txt create mode 100644 panda/src/x11display/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 9cd71ea20e..6614096da1 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -31,6 +31,8 @@ add_subdirectory(src/mathutil) add_subdirectory(src/gsgbase) add_subdirectory(src/glstuff) add_subdirectory(src/glgsg) +add_subdirectory(src/glxdisplay) +add_subdirectory(src/x11display) add_subdirectory(src/pnmimage) add_subdirectory(src/pnmimagetypes) add_subdirectory(src/gobj) @@ -55,5 +57,5 @@ add_subdirectory(src/framework) # Include panda metalibs add_subdirectory(metalibs/panda) -#add_subdirectory(metalibs/pandagl) +add_subdirectory(metalibs/pandagl) #add_subdirectory(metalibs/pandaegg) diff --git a/panda/metalibs/pandagl/CMakeLists.txt b/panda/metalibs/pandagl/CMakeLists.txt index ecc86d95cd..9d321ef16f 100644 --- a/panda/metalibs/pandagl/CMakeLists.txt +++ b/panda/metalibs/pandagl/CMakeLists.txt @@ -2,6 +2,11 @@ if(HAVE_GL) add_definitions(-DBUILDING_PANDAGL) set(PANDAGL_LINK_TARGETS p3glgsg) + if(HAVE_GLX) + set(PANDAGL_LINK_TARGETS ${PANDAGL_LINK_TARGETS} p3glxdisplay) + endif() + + add_library(pandagl pandagl.cxx) target_link_libraries(pandagl ${PANDAGL_LINK_TARGETS}) endif() diff --git a/panda/src/glgsg/CMakeLists.txt b/panda/src/glgsg/CMakeLists.txt index 1863697573..c7519749aa 100644 --- a/panda/src/glgsg/CMakeLists.txt +++ b/panda/src/glgsg/CMakeLists.txt @@ -10,6 +10,6 @@ if(HAVE_GL) composite_sources(p3glgsg P3GLGSG_SOURCES) add_library(p3glgsg ${P3GLGSG_HEADERS} ${P3GLGSG_SOURCES}) - target_link_libraries(p3glgsg p3glstuff p3display) + target_link_libraries(p3glgsg p3glstuff p3display ${OPENGL_LIBRARIES}) target_interrogate(p3glgsg ALL) -endif() \ No newline at end of file +endif() diff --git a/panda/src/glxdisplay/CMakeLists.txt b/panda/src/glxdisplay/CMakeLists.txt new file mode 100644 index 0000000000..079c6baa1d --- /dev/null +++ b/panda/src/glxdisplay/CMakeLists.txt @@ -0,0 +1,27 @@ +if(HAVE_GLX) + set(P3GLXDISPLAY_HEADERS + config_glxdisplay.h + glxGraphicsBuffer.h glxGraphicsBuffer.I + glxGraphicsPipe.h glxGraphicsPipe.I + glxGraphicsPixmap.h glxGraphicsPixmap.I + glxGraphicsWindow.h + glxGraphicsStateGuardian.h glxGraphicsStateGuardian.I + posixGraphicsStateGuardian.h posixGraphicsStateGuardian.I + panda_glxext.h + ) + + set(P3GLXDISPLAY_SOURCES + config_glxdisplay.cxx + glxGraphicsBuffer.cxx + glxGraphicsPipe.cxx + glxGraphicsPixmap.cxx + glxGraphicsWindow.cxx + glxGraphicsStateGuardian.cxx + posixGraphicsStateGuardian.cxx + ) + + composite_sources(p3glxdisplay P3GLXDISPLAY_SOURCES) + add_library(p3glxdisplay ${P3GLXDISPLAY_HEADERS} ${P3GLXDISPLAY_SOURCES}) + target_link_libraries(p3glxdisplay p3glgsg p3x11display) + target_interrogate(p3glxdisplay ALL) +endif() diff --git a/panda/src/x11display/CMakeLists.txt b/panda/src/x11display/CMakeLists.txt new file mode 100644 index 0000000000..849bef5e42 --- /dev/null +++ b/panda/src/x11display/CMakeLists.txt @@ -0,0 +1,15 @@ +if(HAVE_X11) + set(P3X11DISPLAY_HEADERS + config_x11display.h x11GraphicsPipe.I x11GraphicsPipe.h + x11GraphicsWindow.h x11GraphicsWindow.I + ) + + set(P3X11DISPLAY_SOURCES + config_x11display.cxx x11GraphicsPipe.cxx x11GraphicsWindow.cxx + ) + + composite_sources(p3x11display P3X11DISPLAY_SOURCES) + add_library(p3x11display ${P3X11DISPLAY_HEADERS} ${P3X11DISPLAY_SOURCES}) + target_link_libraries(p3x11display p3display ${X11_LIBRARIES}) + target_interrogate(p3x11display ALL) +endif()