--- CMakeLists.txt.orig	2023-02-16 13:40:33 UTC
+++ CMakeLists.txt
@@ -197,7 +197,7 @@ printInfo("-- NEST version: ${NEST_VERSION_STRING}")
 enable_testing()
 set( TEST_OPTS "" )
 
-if ( HAVE_PYTHON )
+if ( BUILD_PYTHON AND HAVE_PYTHON )
   set( TEST_OPTS "${TEST_OPTS};--with-python=${PYTHON}" )
 endif ()
 
@@ -226,9 +226,13 @@ add_custom_target( installcheck
 ##################        Define Subdirectories here          ##################
 ################################################################################
 
+if (INSTALL_DOCS)
 add_subdirectory( doc )
+endif()
 add_subdirectory( bin )
+if (INSTALL_EXAMPLES)
 add_subdirectory( examples )
+endif()
 add_subdirectory( build_support )
 add_subdirectory( lib )
 add_subdirectory( libnestutil )
@@ -238,7 +242,7 @@ add_subdirectory( nest )
 add_subdirectory( nestkernel )
 add_subdirectory( thirdparty )
 add_subdirectory( testsuite )
-if ( HAVE_PYTHON )
+if ( BUILD_PYTHON AND HAVE_PYTHON )
   add_subdirectory( pynest )
 endif ()
 
