diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index 5d4f4ed088..34f798bd00 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -17,7 +17,13 @@ add_subdirectory(src/interval) add_subdirectory(src/showbase) # TODO: p3direct needs a source file! -add_metalib(p3direct COMPONENTS p3dcparser p3deadrec p3distributed p3interval p3showbase) +set(P3DIRECT_COMPONENTS + p3dcparser p3deadrec + p3interval p3showbase) +if(HAVE_PYTHON) + list(APPEND P3DIRECT_COMPONENTS p3distributed) +endif() +add_metalib(p3direct COMPONENTS ${P3DIRECT_COMPONENTS}) set_property(TARGET p3direct PROPERTY LINKER_LANGUAGE "CXX") if(HAVE_PYTHON)