Browse Source

Merge branch 'cmake' into cmake-cfs-install

Conflicts:
	direct/src/autorestart/CMakeLists.txt
	dtool/src/interrogate/CMakeLists.txt
	dtool/src/interrogatedb/CMakeLists.txt
	panda/CMakeLists.txt
	panda/src/express/CMakeLists.txt
Sam Edwards 12 years ago
parent
commit
493dde680a

+ 6 - 3
CMakeLists.txt

@@ -28,8 +28,9 @@ include(Interrogate)        # Defines target_interrogate AND add_python_module
 include_directories("${CMAKE_BINARY_DIR}/include")
 include_directories("${CMAKE_BINARY_DIR}/include")
 
 
 # Determine which trees to build.
 # Determine which trees to build.
-option(BUILD_DTOOL "Build the dtool source tree." ON)
-option(BUILD_PANDA "Build the panda source tree." ON)
+option(BUILD_DTOOL  "Build the dtool source tree." ON)
+option(BUILD_PANDA  "Build the panda source tree." ON)
+option(BUILD_DIRECT "Build the direct source tree." ON)
 
 
 # Include Panda3D packages
 # Include Panda3D packages
 if(BUILD_DTOOL)
 if(BUILD_DTOOL)
@@ -40,4 +41,6 @@ if(BUILD_PANDA)
   add_subdirectory(panda)
   add_subdirectory(panda)
 endif()
 endif()
 
 
-add_subdirectory(direct)
+if(BUILD_DIRECT)
+  add_subdirectory(direct)
+endif()

+ 4 - 0
direct/CMakeLists.txt

@@ -1,3 +1,7 @@
+if(NOT BUILD_PANDA)
+  message(FATAL_ERROR "Cannot build direct without panda!  Please enable the BUILD_PANDA option.")
+endif()
+
 # Include source directories which have C++ components:
 # Include source directories which have C++ components:
 add_subdirectory(src/directbase)
 add_subdirectory(src/directbase)
 add_subdirectory(src/autorestart)
 add_subdirectory(src/autorestart)

+ 7 - 4
direct/src/autorestart/CMakeLists.txt

@@ -1,4 +1,7 @@
-add_executable(autorestart autorestart.c)
-set_target_properties(autorestart PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA)
-target_link_libraries(autorestart p3dtool)
-install(TARGETS autorestart DESTINATION bin)
+if(UNIX)
+  add_executable(autorestart autorestart.c)
+  set_target_properties(autorestart PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA)
+  target_link_libraries(autorestart p3dtool)
+
+  install(TARGETS autorestart DESTINATION bin)
+endif()

+ 2 - 1
panda/CMakeLists.txt

@@ -40,6 +40,8 @@ add_subdirectory(src/glstuff)
 add_subdirectory(src/glgsg)
 add_subdirectory(src/glgsg)
 add_subdirectory(src/x11display)
 add_subdirectory(src/x11display)
 add_subdirectory(src/glxdisplay)
 add_subdirectory(src/glxdisplay)
+add_subdirectory(src/windisplay)
+add_subdirectory(src/wgldisplay)
 add_subdirectory(src/movies)
 add_subdirectory(src/movies)
 add_subdirectory(src/audio)
 add_subdirectory(src/audio)
 add_subdirectory(src/chan)
 add_subdirectory(src/chan)
@@ -66,7 +68,6 @@ add_subdirectory(metalibs/panda)
 add_subdirectory(metalibs/pandagl)
 add_subdirectory(metalibs/pandagl)
 add_subdirectory(metalibs/pandaegg)
 add_subdirectory(metalibs/pandaegg)
 
 
-
 # Now add the Python modules:
 # Now add the Python modules:
 set(CORE_MODULE_COMPONENTS
 set(CORE_MODULE_COMPONENTS
     p3chan p3char p3collide p3cull p3device p3dgraph p3display p3downloader
     p3chan p3char p3collide p3cull p3device p3dgraph p3display p3downloader

+ 4 - 1
panda/metalibs/pandagl/CMakeLists.txt

@@ -11,7 +11,10 @@ if(HAVE_GL)
   set(PANDAGL_LINK_TARGETS p3glgsg)
   set(PANDAGL_LINK_TARGETS p3glgsg)
 
 
   if(HAVE_GLX)
   if(HAVE_GLX)
-    set(PANDAGL_LINK_TARGETS ${PANDAGL_LINK_TARGETS} p3glxdisplay)
+    list(APPEND PANDAGL_LINK_TARGETS p3glxdisplay)
+  endif()
+  if(HAVE_WGL)
+    list(APPEND PANDAGL_LINK_TARGETS p3wgldisplay)
   endif()
   endif()
 
 
 
 

+ 4 - 0
panda/src/express/CMakeLists.txt

@@ -130,6 +130,10 @@ target_link_libraries(p3express p3pandabase p3dtool p3dtoolconfig
   ${_TAR_LIBRARY})
   ${_TAR_LIBRARY})
 target_interrogate(p3express ALL)
 target_interrogate(p3express ALL)
 
 
+if(WIN32)
+  target_link_libraries(p3express advapi32.lib ws2_32.lib)
+endif()
+
 install(TARGETS p3express DESTINATION lib)
 install(TARGETS p3express DESTINATION lib)
 
 
 #add_executable(p3expressTestTypes test_types.cxx)
 #add_executable(p3expressTestTypes test_types.cxx)

+ 21 - 0
panda/src/wgldisplay/CMakeLists.txt

@@ -0,0 +1,21 @@
+if(HAVE_WGL)
+  set(P3WGLDISPLAY_HEADERS
+      config_wgldisplay.h
+      wglGraphicsBuffer.I wglGraphicsBuffer.h
+      wglGraphicsPipe.I wglGraphicsPipe.h
+      wglGraphicsStateGuardian.I wglGraphicsStateGuardian.h
+      wglGraphicsWindow.I wglGraphicsWindow.h
+      wglext.h)
+
+  set(P3WGLDISPLAY_SOURCES
+      config_wgldisplay.cxx
+      wglGraphicsBuffer.cxx
+      wglGraphicsPipe.cxx
+      wglGraphicsStateGuardian.cxx
+      wglGraphicsWindow.cxx)
+
+
+  composite_sources(p3wgldisplay P3WGLDISPLAY_SOURCES)
+  add_library(p3wgldisplay ${P3WGLDISPLAY_HEADERS} ${P3WGLDISPLAY_SOURCES})
+  target_link_libraries(p3wgldisplay p3display p3putil p3windisplay p3glgsg)
+endif()

+ 17 - 0
panda/src/windisplay/CMakeLists.txt

@@ -0,0 +1,17 @@
+if(WIN32)
+  set(P3WINDISPLAY_HEADERS
+      config_windisplay.h
+      winGraphicsPipe.I winGraphicsPipe.h
+      winGraphicsWindow.I winGraphicsWindow.h
+      winDetectDx.h)
+
+  set(P3WINDISPLAY_SOURCES
+      config_windisplay.cxx winGraphicsPipe.cxx
+      winGraphicsWindow.cxx
+      winDetectDx9.cxx winDetectDx8.cxx)
+
+  composite_sources(p3windisplay P3WINDISPLAY_SOURCES)
+  add_library(p3windisplay ${P3WINDISPLAY_HEADERS} ${P3WINDISPLAY_SOURCES})
+  target_link_libraries(p3windisplay p3display p3putil
+    Coreimm.lib)
+endif()