Browse Source

CMake: Only define Python modules when HAVE_PYTHON is on.

Sam Edwards 10 years ago
parent
commit
166ac72b96
2 changed files with 16 additions and 12 deletions
  1. 4 2
      direct/CMakeLists.txt
  2. 12 10
      panda/CMakeLists.txt

+ 4 - 2
direct/CMakeLists.txt

@@ -16,8 +16,10 @@ add_subdirectory(src/interval)
 #add_subdirectory(src/motiontrail)
 #add_subdirectory(src/motiontrail)
 add_subdirectory(src/showbase)
 add_subdirectory(src/showbase)
 
 
-add_python_module(direct p3dcparser p3deadrec p3distributed p3interval p3showbase)
-target_link_libraries(direct core)
+if(HAVE_PYTHON)
+  add_python_module(direct p3dcparser p3deadrec p3distributed p3interval p3showbase)
+  target_link_libraries(direct core)
+endif()
 
 
 # Installation:
 # Installation:
 if(HAVE_PYTHON)
 if(HAVE_PYTHON)

+ 12 - 10
panda/CMakeLists.txt

@@ -96,17 +96,19 @@ if(HAVE_FREETYPE)
   list(APPEND CORE_MODULE_COMPONENTS p3pnmtext)
   list(APPEND CORE_MODULE_COMPONENTS p3pnmtext)
 endif()
 endif()
 
 
-add_python_module(core ${CORE_MODULE_COMPONENTS} LINK panda)
+if(HAVE_PYTHON)
+  add_python_module(core ${CORE_MODULE_COMPONENTS} LINK panda)
 
 
-if(HAVE_EGG)
-  add_python_module(egg p3egg p3egg2pg)
-  target_link_libraries(egg core)
-endif()
+  if(HAVE_EGG)
+    add_python_module(egg p3egg p3egg2pg)
+    target_link_libraries(egg core)
+  endif()
 
 
-add_python_module(physics p3physics p3particlesystem)
-target_link_libraries(physics core)
+  add_python_module(physics p3physics p3particlesystem)
+  target_link_libraries(physics core)
 
 
-if(HAVE_ODE)
-  add_python_module(ode p3ode)
-  target_link_libraries(ode core)
+  if(HAVE_ODE)
+    add_python_module(ode p3ode)
+    target_link_libraries(ode core)
+  endif()
 endif()
 endif()