--- CMakeLists.txt.orig	2019-05-18 21:55:29 UTC
+++ CMakeLists.txt
@@ -73,7 +73,9 @@ include(CMakePackageConfigHelpers)
 
 include("cmake/utils.cmake")
 include("cmake/options.cmake")
-include("cmake/OpenMP.cmake")
+if (USE_OPENMP)
+  include("cmake/OpenMP.cmake")
+endif()
 include("cmake/TBB.cmake")
 include("cmake/platform.cmake")
 include("cmake/SDL.cmake")
@@ -87,8 +89,12 @@ enable_testing()
 include_directories(include)
 
 add_subdirectory(src)
-add_subdirectory(examples)
-add_subdirectory(tests)
+if(BUILD_EXAMPLES)
+  add_subdirectory(examples)
+endif()
+if(BUILD_TESTS)
+  add_subdirectory(tests)
+endif()
 
 if(MKLDNN_INSTALL_MODE STREQUAL "BUNDLE")
     install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_PREFIX})
