瀏覽代碼

CMake: Make INTERROGATE_PYTHON_INTERFACE option dependent

This also makes it sufficient for turning on Interrogate.
Sam Edwards 7 年之前
父節點
當前提交
21a30a8429
共有 4 個文件被更改,包括 7 次插入5 次删除
  1. 1 1
      cmake/macros/Interrogate.cmake
  2. 4 2
      dtool/Config.cmake
  3. 1 1
      dtool/LocalSetup.cmake
  4. 1 1
      dtool/src/interrogatedb/CMakeLists.txt

+ 1 - 1
cmake/macros/Interrogate.cmake

@@ -237,7 +237,7 @@ endfunction(interrogate_sources)
 # Python module when it's initialized.
 #
 function(add_python_module module)
-  if(NOT HAVE_PYTHON OR NOT INTERROGATE_PYTHON_INTERFACE)
+  if(NOT INTERROGATE_PYTHON_INTERFACE)
     return()
   endif()
 

+ 4 - 2
dtool/Config.cmake

@@ -6,6 +6,8 @@
 # generate build scripts appropriate to each environment.
 #
 
+include(CMakeDependentOption)
+
 # Define the plaform we are building on.
 # The values "UNIX", "WIN32", "MINGW", "MSYS", and "CYGWIN"
 # are automatically provided by CMAKE.  "APPLE" is also provided by
@@ -255,11 +257,11 @@ mark_as_advanced(HAVE_P3D_RTDIST PANDA_PACKAGE_VERSION PANDA_PACKAGE_HOST)
 # The following options relate to interrogate, the tool that is
 # used to generate bindings for non-C++ languages.
 
-option(INTERROGATE_PYTHON_INTERFACE
+cmake_dependent_option(INTERROGATE_PYTHON_INTERFACE
   "Do you want to generate a Python-callable interrogate interface?
 This is only necessary if you plan to make calls into Panda from a
 program written in Python.  This is done only if HAVE_PYTHON is also
-true." ON)
+true." ON "HAVE_PYTHON" OFF)
 
 set(INTERROGATE_C_INTERFACE
   "Do you want to generate a C-callable interrogate interface?  This

+ 1 - 1
dtool/LocalSetup.cmake

@@ -256,7 +256,7 @@ else()
 endif()
 
 message("")
-if(HAVE_INTERROGATE AND HAVE_PYTHON)
+if(INTERROGATE_PYTHON_INTERFACE)
   message("Compilation will generate Python interfaces for Python ${PYTHON_VERSION_STRING}.")
 else()
   message("Configuring Panda WITHOUT Python interfaces.")

+ 1 - 1
dtool/src/interrogatedb/CMakeLists.txt

@@ -46,7 +46,7 @@ install(FILES ${P3INTERROGATEDB_HEADERS} DESTINATION include/panda3d)
 # Note we don't use the regular Interrogate macros; this has some custom flags
 # that would make it not worthwhile.
 
-if(NOT HAVE_PYTHON OR NOT INTERROGATE_PYTHON_INTERFACE)
+if(NOT INTERROGATE_PYTHON_INTERFACE)
   return()
 endif()