Browse Source

Added NO_EXAMPLES cmake flag

Paul-Louis Ageneau 5 years ago
parent
commit
e481e896cb
1 changed files with 8 additions and 5 deletions
  1. 8 5
      CMakeLists.txt

+ 8 - 5
CMakeLists.txt

@@ -8,6 +8,7 @@ option(USE_GNUTLS "Use GnuTLS instead of OpenSSL" OFF)
 option(USE_JUICE "Use libjuice instead of libnice" OFF)
 option(USE_SRTP "Enable SRTP for media support" OFF)
 option(NO_WEBSOCKET "Disable WebSocket support" OFF)
+option(NO_EXAMPLES "Disable examples" OFF)
 
 if(USE_GNUTLS)
 	option(USE_NETTLE "Use Nettle instead of OpenSSL in libjuice" ON)
@@ -231,9 +232,11 @@ else()
 endif()
 
 # Examples
-set(JSON_BuildTests OFF CACHE INTERNAL "")
-add_subdirectory(deps/json)
-add_subdirectory(examples/client)
-add_subdirectory(examples/copy-paste)
-add_subdirectory(examples/copy-paste-capi)
+if(NOT NO_EXAMPLES)
+	set(JSON_BuildTests OFF CACHE INTERNAL "")
+	add_subdirectory(deps/json)
+	add_subdirectory(examples/client)
+	add_subdirectory(examples/copy-paste)
+	add_subdirectory(examples/copy-paste-capi)
+endif()