Browse Source

Add CMakeLists.txt for panda/framework.

kestred 12 years ago
parent
commit
73d89146e6

+ 2 - 1
panda/CMakeLists.txt

@@ -46,6 +46,7 @@ add_subdirectory(src/grutil)
 add_subdirectory(src/tform)
 add_subdirectory(src/tform)
 add_subdirectory(src/pgui)
 add_subdirectory(src/pgui)
 add_subdirectory(src/recorder)
 add_subdirectory(src/recorder)
+add_subdirectory(src/collide)
+add_subdirectory(src/framework)
 
 
-#add_subdirectory(src/framework)
 #add_subdirectory(src/testbed)
 #add_subdirectory(src/testbed)

+ 61 - 0
panda/src/framework/CMakeLists.txt

@@ -0,0 +1,61 @@
+set(P3FRAMEWORK_HEADERS
+  config_framework.h
+  pandaFramework.I pandaFramework.h
+  windowFramework.I windowFramework.h
+)
+
+set(P3FRAMEWORK_SOURCES
+  config_framework.cxx
+  pandaFramework.cxx
+  windowFramework.cxx
+  rock_floor.rgb_src.c shuttle_controls.bam_src.c
+)
+
+
+set(P3FRAMEWORK_LINK_TARGETS p3char p3pgui p3recorder p3collide) #p3recorder p3collide p3pnmimagetypes
+if(LINK_ALL_STATIC)
+  # If we're statically linking, we need to explicitly link with
+  # at least one of the available renderers.
+  if(HAVE_GL)
+    set(P3FRAMEWORK_LINK_TARGETS
+      ${P3FRAMEWORK_LINK_TARGETS}
+      pandagl
+    )
+  elseif(HAVE_DX10)
+    set(P3FRAMEWORK_LINK_TARGETS
+      ${P3FRAMEWORK_LINK_TARGETS}
+      pandadx10
+    )
+  elseif(HAVE_DX9)
+    set(P3FRAMEWORK_LINK_TARGETS
+      ${P3FRAMEWORK_LINK_TARGETS}
+      pandadx9
+    )
+  elseif(HAVE_DX8)
+    set(P3FRAMEWORK_LINK_TARGETS
+      ${P3FRAMEWORK_LINK_TARGETS}
+      pandadx8
+    )
+  elseif(HAVE_TINYDISPLAY)
+    set(P3FRAMEWORK_LINK_TARGETS
+      ${P3FRAMEWORK_LINK_TARGETS}
+      p3tinydisplay
+    )
+  else()
+    message(WARNING
+      "No renderer library available to link to p3framework."
+    )
+  endif()
+
+  # And we might like to have the p3egg loader available.
+  if(HAVE_EGG)
+    set(P3FRAMEWORK_LINK_TARGETS
+      ${P3FRAMEWORK_LINK_TARGETS}
+      pandaegg
+    )
+  endif()
+endif()
+
+composite_sources(p3framework P3FRAMEWORK_SOURCES)
+add_library(p3framework ${P3FRAMEWORK_HEADERS} ${P3FRAMEWORK_SOURCES})
+target_link_libraries(p3framework ${P3FRAMEWORK_LINK_TARGETS})

+ 1 - 0
panda/src/framework/config_framework.h

@@ -28,6 +28,7 @@ NotifyCategoryDecl(framework, EXPCL_FRAMEWORK, EXPTP_FRAMEWORK);
 extern ConfigVariableDouble aspect_ratio;
 extern ConfigVariableDouble aspect_ratio;
 extern ConfigVariableBool show_frame_rate_meter;
 extern ConfigVariableBool show_frame_rate_meter;
 extern ConfigVariableBool show_scene_graph_analyzer_meter;
 extern ConfigVariableBool show_scene_graph_analyzer_meter;
+extern ConfigVariableString window_type;
 
 
 extern ConfigVariableString record_session;
 extern ConfigVariableString record_session;
 extern ConfigVariableString playback_session;
 extern ConfigVariableString playback_session;

+ 1 - 0
panda/src/framework/pandaFramework.h

@@ -16,6 +16,7 @@
 #define PANDAFRAMEWORK_H
 #define PANDAFRAMEWORK_H
 
 
 #include "pandabase.h"
 #include "pandabase.h"
+#include "config_framework.h"
 
 
 #include "windowFramework.h"
 #include "windowFramework.h"
 
 

+ 1 - 0
panda/src/framework/rock_floor.rgb_src.c

@@ -1,3 +1,4 @@
+#include "stddef.h" // size_t
 
 
 /*
 /*
  * This table was generated by the command:
  * This table was generated by the command:

+ 1 - 1
panda/src/framework/shuttle_controls.bam_src.c

@@ -1,4 +1,4 @@
-
+#include "stddef.h" // size_t
 /*
 /*
  * This table was generated by the command:
  * This table was generated by the command:
  *
  *