From 21a30a8429008cbd4ee5038fe72c6c0dd82b26f4 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 13 Jun 2018 18:49:28 -0600 Subject: [PATCH] CMake: Make INTERROGATE_PYTHON_INTERFACE option dependent This also makes it sufficient for turning on Interrogate. --- cmake/macros/Interrogate.cmake | 2 +- dtool/Config.cmake | 6 ++++-- dtool/LocalSetup.cmake | 2 +- dtool/src/interrogatedb/CMakeLists.txt | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 55fcee0ed0..c45f99a950 100644 --- a/cmake/macros/Interrogate.cmake +++ b/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() diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 168faf2fca..06e8a0448b 100644 --- a/dtool/Config.cmake +++ b/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 diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index 0dadc4c5c3..3b7b603336 100644 --- a/dtool/LocalSetup.cmake +++ b/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.") diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index 6b6858a98c..736178008c 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/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()