From 166ac72b968b1cf04012fd2f254768a3dfaa09a1 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 11 Nov 2015 13:53:34 -0800 Subject: [PATCH] CMake: Only define Python modules when HAVE_PYTHON is on. --- direct/CMakeLists.txt | 6 ++++-- panda/CMakeLists.txt | 26 ++++++++++++++------------ 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index 7d89af1a93..e5481d9415 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -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) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 51f821c2c5..e386e55853 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -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()