From e940c43b3e8670147e293c4d92f16acce48e3937 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 5 Feb 2014 18:10:16 -0700 Subject: [PATCH 1/8] CMake: Remove PYTHON_LIBRARIES link from interrogatedb; it's unused there. --- dtool/src/interrogatedb/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index 58477d2ad75..927fea94a08 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -30,4 +30,4 @@ set(P3INTERROGATEDB_SOURCES composite_sources(p3interrogatedb P3INTERROGATEDB_SOURCES) add_library(p3interrogatedb ${P3INTERROGATEDB_HEADERS} ${P3INTERROGATEDB_SOURCES}) -target_link_libraries(p3interrogatedb p3dconfig ${PYTHON_LIBRARIES}) +target_link_libraries(p3interrogatedb p3dconfig) From 1ffd204b006afaca9d76ff924e7033bde8b4324b Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 5 Feb 2014 22:27:46 -0700 Subject: [PATCH 2/8] CMake: Rearrange panda/CMakeLists.txt for dependency order; older CMakes insist on it. --- panda/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index cd4c40221b7..a0d1673699e 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -29,10 +29,6 @@ add_subdirectory(src/linmath) add_subdirectory(src/event) 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) @@ -40,6 +36,10 @@ add_subdirectory(src/pgraph) add_subdirectory(src/pgraphnodes) add_subdirectory(src/cull) add_subdirectory(src/display) +add_subdirectory(src/glstuff) +add_subdirectory(src/glgsg) +add_subdirectory(src/x11display) +add_subdirectory(src/glxdisplay) add_subdirectory(src/movies) add_subdirectory(src/audio) add_subdirectory(src/chan) From 74bc1248672a1b4bfba3d32361c805e9956789f7 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 5 Feb 2014 23:28:28 -0700 Subject: [PATCH 3/8] CMake: Add support for building WGL display output. --- panda/CMakeLists.txt | 2 ++ panda/metalibs/pandagl/CMakeLists.txt | 5 ++++- panda/src/wgldisplay/CMakeLists.txt | 21 +++++++++++++++++++++ panda/src/windisplay/CMakeLists.txt | 17 +++++++++++++++++ 4 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 panda/src/wgldisplay/CMakeLists.txt create mode 100644 panda/src/windisplay/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index a0d1673699e..3923e863c3a 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -40,6 +40,8 @@ add_subdirectory(src/glstuff) add_subdirectory(src/glgsg) add_subdirectory(src/x11display) add_subdirectory(src/glxdisplay) +add_subdirectory(src/windisplay) +add_subdirectory(src/wgldisplay) add_subdirectory(src/movies) add_subdirectory(src/audio) add_subdirectory(src/chan) diff --git a/panda/metalibs/pandagl/CMakeLists.txt b/panda/metalibs/pandagl/CMakeLists.txt index 96eb7465cc8..9ee26ce33f3 100644 --- a/panda/metalibs/pandagl/CMakeLists.txt +++ b/panda/metalibs/pandagl/CMakeLists.txt @@ -11,7 +11,10 @@ if(HAVE_GL) set(PANDAGL_LINK_TARGETS p3glgsg) 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() diff --git a/panda/src/wgldisplay/CMakeLists.txt b/panda/src/wgldisplay/CMakeLists.txt new file mode 100644 index 00000000000..f6e83b06af6 --- /dev/null +++ b/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() diff --git a/panda/src/windisplay/CMakeLists.txt b/panda/src/windisplay/CMakeLists.txt new file mode 100644 index 00000000000..3d07b6f9a93 --- /dev/null +++ b/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() From b64feda7296b4f2074617ef92266ba4ac37c72e2 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 5 Feb 2014 23:29:49 -0700 Subject: [PATCH 4/8] CMake: Add Windows platform libraries when building on Win32. --- panda/src/express/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index 34645871ae7..67f374fe0fb 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -130,6 +130,10 @@ target_link_libraries(p3express p3pandabase p3dtool p3dtoolconfig ${_TAR_LIBRARY}) target_interrogate(p3express ALL) +if(WIN32) + target_link_libraries(p3express advapi32.lib ws2_32.lib) +endif() + #add_executable(p3expressTestTypes test_types.cxx) #target_link_libraries(p3expressTestTypes p3express p3dtoolutil p3dtool p3prc p3dtoolconfig p3pystub) #add_test(p3express_test_types p3expressTestTypes) From f9b590045a7ff80948b2f9251a1c03f8bceff0a0 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 6 Feb 2014 13:36:33 -0700 Subject: [PATCH 5/8] CMake: Fix typo. --- dtool/src/interrogate/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dtool/src/interrogate/CMakeLists.txt b/dtool/src/interrogate/CMakeLists.txt index f5404dc028d..6d3752afaef 100644 --- a/dtool/src/interrogate/CMakeLists.txt +++ b/dtool/src/interrogate/CMakeLists.txt @@ -55,4 +55,4 @@ target_link_libraries(interrogate add_executable(interrogate_module interrogate_module.cxx) target_link_libraries(interrogate_module p3cppParser p3interrogatedb p3dconfig p3prc p3dtoolutil p3dtoolbase - p3pystub ${OPENSSL_LIBRARIES}) + p3pystub ${_OPENSSL_LIBRARIES}) From 87cae490cd3b906b28fc068e317daebee5411b0d Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 8 Feb 2014 17:51:05 -0700 Subject: [PATCH 6/8] CMake: Only build 'direct' if BUILD_DIRECT is on. --- CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c242ea0160..d7ca1c4600d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,8 +26,9 @@ include(dtool/Package.cmake) include(dtool/Config.cmake) # 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 if(BUILD_DTOOL) @@ -38,4 +39,6 @@ if(BUILD_PANDA) add_subdirectory(panda) endif() -add_subdirectory(direct) +if(BUILD_DIRECT) + add_subdirectory(direct) +endif() From e2a03d6435f94afc390bdc1b73e8be4542199c33 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 8 Feb 2014 17:51:14 -0700 Subject: [PATCH 7/8] CMake: 'direct' depends on 'panda' --- direct/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index 904bf6f9aef..28f09f3c8c5 100644 --- a/direct/CMakeLists.txt +++ b/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: add_subdirectory(src/directbase) add_subdirectory(src/autorestart) From 9035f7aa85f02b0f3f90c50dd82a157978b3a65e Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 8 Feb 2014 17:59:12 -0700 Subject: [PATCH 8/8] CMake: Only build 'autorestart' on UNIX. --- direct/src/autorestart/CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/direct/src/autorestart/CMakeLists.txt b/direct/src/autorestart/CMakeLists.txt index 31524487c55..3293a08e082 100644 --- a/direct/src/autorestart/CMakeLists.txt +++ b/direct/src/autorestart/CMakeLists.txt @@ -1,3 +1,5 @@ -add_executable(autorestart autorestart.c) -set_target_properties(autorestart PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA) -target_link_libraries(autorestart p3dtool) +if(UNIX) + add_executable(autorestart autorestart.c) + set_target_properties(autorestart PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA) + target_link_libraries(autorestart p3dtool) +endif()