Browse Source

CMake: Migrate detection for the physics packages

Sam Edwards 7 years ago
parent
commit
9e841800ee
3 changed files with 30 additions and 24 deletions
  1. 0 6
      dtool/Config.cmake
  2. 0 18
      dtool/LocalSetup.cmake
  3. 30 0
      dtool/Package.cmake

+ 0 - 6
dtool/Config.cmake

@@ -466,12 +466,6 @@ option(HAVE_VIDEO4LINUX
   "Set this to enable webcam support on Linux." ${IS_LINUX})
 
 
-# Is ODE installed, and where?
-find_package(ODE QUIET)
-
-package_option(ODE
-  "Enables support for ridid-body physics using the Open Dynamics Engine.")
-
 # Is OpenGL installed, and where?
 find_package(OpenGL QUIET)
 set(GL_FOUND ${OPENGL_FOUND})

+ 0 - 18
dtool/LocalSetup.cmake

@@ -189,12 +189,6 @@ endif()
 # Now go through all the packages and report whether we have them.
 show_packages()
 
-if(HAVE_PHYSX)
-  message("+ Ageia PhysX")
-else()
-  message("- Did not find Ageia PhysX")
-endif()
-
 if(HAVE_SPEEDTREE)
   message("+ SpeedTree")
 else()
@@ -261,12 +255,6 @@ else()
   message("- Did not find OpenCV")
 endif()
 
-if(HAVE_ODE)
-  message("+ ODE")
-else()
-  message("- Did not find ODE")
-endif()
-
 if(HAVE_AWESOMIUM)
   message("+ AWESOMIUM")
 else()
@@ -307,12 +295,6 @@ else()
   message("- Did not find libRocket")
 endif()
 
-if(HAVE_BULLET)
-  message("+ Bullet Physics")
-else()
-  message("- Did not find Bullet Physics")
-endif()
-
 if(HAVE_VORBIS)
   message("+ libvorbis (Ogg Vorbis Decoder)")
 else()

+ 30 - 0
dtool/Package.cmake

@@ -225,6 +225,36 @@ find_package(GTK2 QUIET COMPONENTS gtk)
 #config_package(GTK2 "gtk+-2")
 package_option(GTK2)
 
+#
+# ------------ Physics engines ------------
+#
+
+# Bullet
+find_package(Bullet QUIET)
+
+package_option(Bullet
+  "Enable this option to support game dynamics with the Bullet physics library.")
+
+config_package(Bullet "Bullet physics")
+
+# ODE
+find_package(ODE QUIET)
+
+package_option(ODE
+  "Enable this option to support game dynamics with the Open Dynamics Engine (ODE)."
+  LICENSE "BSD-3")
+
+config_package(ODE "Open Dynamics Engine")
+
+# PhysX
+find_package(PhysX QUIET)
+
+package_option(PhysX
+  "Enable this option to support game dynamics with Nvidia PhysX."
+  LICENSE "Nvidia")
+
+config_package(PhysX "Nvidia PhysX")
+
 # Find and configure WxWidgets
 find_package(wxWidgets QUIET)
 if(WXWIDGETS_FOUND)