CMake: Only define Python modules when HAVE_PYTHON is on.

This commit is contained in:
Sam Edwards 2015-11-11 13:53:34 -08:00
parent 28a60ff52e
commit 166ac72b96
2 changed files with 18 additions and 14 deletions

View File

@ -16,8 +16,10 @@ add_subdirectory(src/interval)
#add_subdirectory(src/motiontrail)
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:
if(HAVE_PYTHON)

View File

@ -96,17 +96,19 @@ if(HAVE_FREETYPE)
list(APPEND CORE_MODULE_COMPONENTS p3pnmtext)
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()
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_EGG)
add_python_module(egg p3egg p3egg2pg)
target_link_libraries(egg core)
endif()
add_python_module(physics p3physics p3particlesystem)
target_link_libraries(physics core)
if(HAVE_ODE)
add_python_module(ode p3ode)
target_link_libraries(ode core)
endif()
endif()