--- CMakeLists.txt.orig	2022-01-21 18:01:36 UTC
+++ CMakeLists.txt
@@ -100,7 +100,7 @@ set( CMAKE_INSTALL_DATADIR "share/${PROJECT_NAME}" CAC
 ################################################################################
 
 # needed for pynest test suite
-if ( ${with-python} STREQUAL "ON" )
+if ( BUILD_PYTHON AND ${with-python} STREQUAL "ON" )
   find_program( NOSETESTS NAMES nosetests )
 endif ()
 
@@ -202,7 +202,7 @@ message("-- 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 ()
 
@@ -231,9 +231,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 )
@@ -243,7 +247,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 ()
 
