--- CMakeLists.txt.orig	2019-12-02 22:50:20 UTC
+++ CMakeLists.txt
@@ -434,20 +434,24 @@ configure_file(
 # Regression tests
 
 # Get and configure google test
+if (BUILD_TESTING)
 include(cmake/googletest.cmake)
 fetch_googletest(
     ${PROJECT_SOURCE_DIR}/cmake
     ${PROJECT_BINARY_DIR}/googletest
     )
 
-enable_testing()
+  enable_testing()
+endif(BUILD_TESTING)
 
 #-----------------------------------------------------------------------------#
 # Source directories
 
 include_directories(src ${CMAKE_CURRENT_BINARY_DIR}/src)
 add_subdirectory(src)
-add_subdirectory(test)
+if (BUILD_TESTING)
+  add_subdirectory(test)
+endif(BUILD_TESTING)
 if(PYTHON)
   add_subdirectory(src/api/python)
 endif()
