From e9f4e44e99b394e1ce4f0de5f5252276af54e1d9 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 30 May 2014 12:27:21 +0200 Subject: [PATCH] Add panda/src/configfiles --- dtool/Config.cmake | 10 +-- dtool/src/dtoolbase/CMakeLists.txt | 4 +- panda/CMakeLists.txt | 1 + panda/src/configfiles/CMakeLists.txt | 31 +++++++ panda/src/configfiles/panda.prc.in | 125 +++++++++++++++++++++++++++ 5 files changed, 163 insertions(+), 8 deletions(-) create mode 100644 panda/src/configfiles/CMakeLists.txt create mode 100644 panda/src/configfiles/panda.prc.in diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 3a22fc9da4..b6514f8380 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -596,17 +596,17 @@ find_package(FFMPEG) find_package(SWScale) find_package(SWResample) -package_option(FFMPEG DEFAULT ON +package_option(FFMPEG "Enables support for audio- and video-decoding using the FFMPEG library.") -package_option(SWSCALE DEFAULT ON +package_option(SWSCALE "Enables support for FFMPEG's libswscale for video rescaling.") -package_option(SWRESAMPLE DEFAULT ON +package_option(SWRESAMPLE "Enables support for FFMPEG's libresample for audio resampling.") # Is ODE installed, and where? find_package(ODE) -package_option(ODE DEFAULT ON +package_option(ODE "Enables support for ridid-body physics using the Open Dynamics Engine.") # Is OpenGL installed, and where? @@ -620,7 +620,7 @@ package_option(GL "Enable OpenGL support.") # libraries appropriate to the version you want to compile against. set(MIN_GL_VERSION "1 1" CACHE STRING "The variable is the major, minor version of OpenGL, separated by a -space (instead of a dot). Thus, "1 1" means OpenGL version 1.1. +space (instead of a dot). Thus, \"1 1\" means OpenGL version 1.1. This defines the minimum runtime version of OpenGL that Panda will require. Setting it to a higher version will compile in hard diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index 8a93e83399..9b4ccc020e 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -62,8 +62,6 @@ set(P3DTOOLBASE_SOURCES composite_sources(p3dtoolbase P3DTOOLBASE_SOURCES) add_library(p3dtoolbase ${P3DTOOLBASE_HEADERS} ${P3DTOOLBASE_SOURCES}) -if(HAVE_PYTHON) - target_link_libraries(p3dtoolbase ${PYTHON_LIBRARIES}) -endif() +target_use_packages(p3dtoolbase THREADS PYTHON) install(TARGETS p3dtoolbase DESTINATION lib) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index b2a11da21d..b17abfa521 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -19,6 +19,7 @@ if(HAVE_FREETYPE) endif() # Include panda source directories +add_subdirectory(src/configfiles) add_subdirectory(src/pandabase) add_subdirectory(src/express) add_subdirectory(src/downloader) diff --git a/panda/src/configfiles/CMakeLists.txt b/panda/src/configfiles/CMakeLists.txt new file mode 100644 index 0000000000..adfa257544 --- /dev/null +++ b/panda/src/configfiles/CMakeLists.txt @@ -0,0 +1,31 @@ +# Set some variables that are used in panda.prc.in. +set(AUX_DISPLAYS) + +if(HAVE_GL) + set(AUX_DISPLAYS "${AUX_DISPLAYS} +aux-display pandagl") +endif() + +if(HAVE_DX9) + set(AUX_DISPLAYS "${AUX_DISPLAYS} +aux-display pandadx9") +endif() + +if(HAVE_TINYDISPLAY) + set(AUX_DISPLAYS "${AUX_DISPLAYS} +aux-display p3tinydisplay") +endif() + +if(HAVE_RAD_MSS) + set(AUDIO_LIBRARY_NAME p3miles_audio) +elseif(HAVE_FMODEX) + set(AUDIO_LIBRARY_NAME p3fmod_audio) +elseif(HAVE_OPENAL) + set(AUDIO_LIBRARY_NAME p3openal_audio) +else() + set(AUDIO_LIBRARY_NAME none) +endif() + +configure_file(panda.prc.in "${CMAKE_BINARY_DIR}/etc/20_panda.prc") + +install(FILES "${CMAKE_BINARY_DIR}/etc/20_panda.prc" DESTINATION etc) diff --git a/panda/src/configfiles/panda.prc.in b/panda/src/configfiles/panda.prc.in new file mode 100644 index 0000000000..ffbce72552 --- /dev/null +++ b/panda/src/configfiles/panda.prc.in @@ -0,0 +1,125 @@ +// +// panda.prc.in +// +// This file defines the script to auto-generate panda.prc at +// CMake time. This is intended to fill in some of the default +// parameters, in particular the default display types. +// + +#output 20_panda.prc notouch +#### Generated automatically by CMake ${CMAKE_VERSION} from panda.prc.in. +################################# DO NOT EDIT ########################### + +plugin-path $THIS_PRC_DIR/../lib + +# Let's set up a default window size of 800x600. The user can +# override this in his or her personal prc file. +win-size 800 600 + +# Define the display types that have been compiled in. Panda will +# pick one of these by going through the list in this order until one +# is found that works, unless the user specifically requests a +# particular display type with the load-display directive. +${AUX_DISPLAYS} + +# Define an appropriate default audio library. +audio-library-name ${AUDIO_LIBRARY_NAME} + +# The egg loader is handy to have available by default. This allows +# clients to load egg files. (The bam loader is built-in so bam files +# are always loadable). + +# By qualifying with the extension "egg", we indicate the egg loader +# should be made available only if you explicitly name a file with an +# .egg extension. + +# Also see ptloader, which is built as part of pandatool; it allows +# files of more exotic types (like .flt, .mb, .lwo, and .dxf) to be +# loaded directly into Panda. + +load-file-type egg pandaegg + + +# These entries work very similar to load-file-type, except they are +# used by the MovieVideo and MovieAudio code to determine which module +# should be loaded in order to decode files of the given extension. + +# ffmpeg is added by default because it used to be compiled in. +# The * is a special catch-all extension that is consulted unless a +# loader has been defined with an explicit extension. + +load-audio-type * p3ffmpeg +load-video-type * p3ffmpeg + + +# The following lines define some handy object types to use within the +# egg syntax. This remaps { name } into whatever egg +# syntax is given by egg-object-type-name, which makes a handy +# abbreviation for modeling packages (like Maya) to insert +# sophisticated egg syntax into the generated egg file, using a single +# object type string. + +egg-object-type-portal portal { 1 } +egg-object-type-polylight polylight { 1 } +egg-object-type-seq24 { 1 } fps { 24 } +egg-object-type-seq12 { 1 } fps { 12 } +egg-object-type-seq10 { 1 } fps { 10 } +egg-object-type-seq8 { 1 } fps { 8 } +egg-object-type-seq6 { 1} fps { 6 } +egg-object-type-seq4 { 1} fps { 4 } +egg-object-type-seq2 { 1} fps { 2 } +egg-object-type-indexed indexed { 1 } + +egg-object-type-binary alpha { binary } +egg-object-type-dual alpha { dual } +egg-object-type-glass alpha { blend_no_occlude } + +# These are just shortcuts to define the Model and DCS flags, which +# indicate nodes that should not be flattened out of the hierarchy +# during the conversion process. DCS goes one step further and +# indicates that the node's transform is important and should be +# preserved (DCS stands for Dynamic Coordinate System). Notouch is +# even stronger, and means not to do any flattening below the node at +# all. +egg-object-type-model { 1 } +egg-object-type-dcs { 1 } +egg-object-type-notouch { no_touch } + +# The following define various kinds of collision geometry. These +# mark the geometry at this level and below as invisible collision +# polygons, which can be used by Panda's collision system to detect +# collisions more optimally than regular visible polygons. +egg-object-type-barrier { Polyset descend } +egg-object-type-sphere { Sphere descend } +egg-object-type-invsphere { InvSphere descend } +egg-object-type-tube { Tube descend } + +# As above, but these are flagged to be "intangible", so that they +# will trigger an event but not stop an object from passing through. +egg-object-type-trigger { Polyset descend intangible } +egg-object-type-trigger-sphere { Sphere descend intangible } + +# "floor" and "dupefloor" define the nodes in question as floor +# polygons. dupefloor means to duplicate the geometry first so that +# the same polygons serve both as visible geometry and as collision +# polygons. +egg-object-type-floor { Polyset descend level } +egg-object-type-dupefloor { Polyset keep descend level } + +# "bubble" puts an invisible bubble around an object, but does not +# otherwise remove the geometry. +egg-object-type-bubble { Sphere keep descend } + +# "ghost" turns off the normal collide bit that is set on visible +# geometry by default, so that if you are using visible geometry for +# collisions, this particular geometry will not be part of those +# collisions--it is ghostlike. +egg-object-type-ghost collide-mask { 0 } + +# "glow" is useful for halo effects and things of that ilk. It +# renders the object in add mode instead of the normal opaque mode. +egg-object-type-glow blend { add } + +# This isn't used in the egg loader, it controls a setting only within +# maya2egg itself. So if it appears in an egg file, it means nothing. +egg-object-type-keep-all-uvsets