Browse Source

Get pandagl building under Linux on CMake.

Sam Edwards 12 years ago
parent
commit
5b791ca358

+ 3 - 1
panda/CMakeLists.txt

@@ -31,6 +31,8 @@ add_subdirectory(src/mathutil)
 add_subdirectory(src/gsgbase)
 add_subdirectory(src/gsgbase)
 add_subdirectory(src/glstuff)
 add_subdirectory(src/glstuff)
 add_subdirectory(src/glgsg)
 add_subdirectory(src/glgsg)
+add_subdirectory(src/glxdisplay)
+add_subdirectory(src/x11display)
 add_subdirectory(src/pnmimage)
 add_subdirectory(src/pnmimage)
 add_subdirectory(src/pnmimagetypes)
 add_subdirectory(src/pnmimagetypes)
 add_subdirectory(src/gobj)
 add_subdirectory(src/gobj)
@@ -55,5 +57,5 @@ add_subdirectory(src/framework)
 
 
 # Include panda metalibs
 # Include panda metalibs
 add_subdirectory(metalibs/panda)
 add_subdirectory(metalibs/panda)
-#add_subdirectory(metalibs/pandagl)
+add_subdirectory(metalibs/pandagl)
 #add_subdirectory(metalibs/pandaegg)
 #add_subdirectory(metalibs/pandaegg)

+ 5 - 0
panda/metalibs/pandagl/CMakeLists.txt

@@ -2,6 +2,11 @@ if(HAVE_GL)
   add_definitions(-DBUILDING_PANDAGL)
   add_definitions(-DBUILDING_PANDAGL)
   set(PANDAGL_LINK_TARGETS p3glgsg)
   set(PANDAGL_LINK_TARGETS p3glgsg)
 
 
+  if(HAVE_GLX)
+    set(PANDAGL_LINK_TARGETS ${PANDAGL_LINK_TARGETS} p3glxdisplay)
+  endif()
+
+
   add_library(pandagl pandagl.cxx)
   add_library(pandagl pandagl.cxx)
   target_link_libraries(pandagl ${PANDAGL_LINK_TARGETS})
   target_link_libraries(pandagl ${PANDAGL_LINK_TARGETS})
 endif()
 endif()

+ 2 - 2
panda/src/glgsg/CMakeLists.txt

@@ -10,6 +10,6 @@ if(HAVE_GL)
 
 
   composite_sources(p3glgsg P3GLGSG_SOURCES)
   composite_sources(p3glgsg P3GLGSG_SOURCES)
   add_library(p3glgsg ${P3GLGSG_HEADERS} ${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)
   target_interrogate(p3glgsg ALL)
-endif()
+endif()

+ 27 - 0
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()

+ 15 - 0
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()