summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt20
1 files changed, 20 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4668d4bea..9151ff786 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,12 +11,29 @@ option(CITRA_USE_BUNDLED_SDL2 "Download bundled SDL2 binaries" OFF)
option(ENABLE_QT "Enable the Qt frontend" ON)
option(CITRA_USE_BUNDLED_QT "Download bundled Qt binaries" OFF)
+option(ENABLE_WEB_SERVICE "Enable web services (telemetry, etc.)" ON)
+
if(NOT EXISTS ${CMAKE_SOURCE_DIR}/.git/hooks/pre-commit)
message(STATUS "Copying pre-commit hook")
file(COPY hooks/pre-commit
DESTINATION ${CMAKE_SOURCE_DIR}/.git/hooks)
endif()
+# Sanity check : Check that all submodules are present
+# =======================================================================
+
+function(check_submodules_present)
+ file(READ "${CMAKE_SOURCE_DIR}/.gitmodules" gitmodules)
+ string(REGEX MATCHALL "path *= *[^ \t\r\n]*" gitmodules ${gitmodules})
+ foreach(module ${gitmodules})
+ string(REGEX REPLACE "path *= *" "" module ${module})
+ if (NOT EXISTS "${CMAKE_SOURCE_DIR}/${module}/.git")
+ message(SEND_ERROR "Git submodule ${module} not found."
+ "Please run: git submodule update --init --recursive")
+ endif()
+ endforeach()
+endfunction()
+check_submodules_present()
# Detect current compilation architecture and create standard definitions
# =======================================================================
@@ -223,6 +240,9 @@ if (ENABLE_QT)
find_package(Qt5 REQUIRED COMPONENTS Widgets OpenGL ${QT_PREFIX_HINT})
endif()
+if (ENABLE_WEB_SERVICE)
+ add_definitions(-DENABLE_WEB_SERVICE)
+endif()
# Platform-specific library requirements
# ======================================