瀏覽代碼

Merge pull request #693 from honigbeutler123/master

Auto load submodules fix #687
JoshEngebretson 9 年之前
父節點
當前提交
9a40c6ef4e
共有 1 個文件被更改,包括 14 次插入0 次删除
  1. 14 0
      Build/CMake/Modules/AtomicDesktop.cmake

+ 14 - 0
Build/CMake/Modules/AtomicDesktop.cmake

@@ -9,6 +9,20 @@ set (ATOMIC_LINK_LIBRARIES ${ATOMIC_LINK_LIBRARIES} LibCpuId SQLite)
 
 # Check whether the CEF submodule is available
 if (EXISTS ${CMAKE_SOURCE_DIR}/Submodules/CEF)
+    #Check if CEF got pulled by looking if the foldes is empty
+    file(GLOB CEF_FILES ${CMAKE_SOURCE_DIR}/Submodules/CEF/*)
+
+    list(LENGTH CEF_FILES CEF_FILES_LEN)
+    if(CEF_FILES_LEN EQUAL 0)
+     message(STATUS "Initialising CEF submodule")
+
+     find_package(Git REQUIRED)
+     if(GIT_FOUND)
+      execute_process(COMMAND git submodule update --init --remote)
+     else ()
+      message(STATUS "Could not find git in your Path. Please install git")
+     endif(GIT_FOUND)
+    endif()
     set(ATOMIC_WEBVIEW TRUE)
     add_definitions( -DATOMIC_WEBVIEW )
     include("AtomicWebView")