Browse Source

CMake: Don't metalib p3distributed when not built

Sam Edwards 7 years ago
parent
commit
4b70cb162e
1 changed files with 7 additions and 1 deletions
  1. 7 1
      direct/CMakeLists.txt

+ 7 - 1
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)