Browse Source

Added Status messages & checking if git is in path

Cedric Seehausen 9 years ago
parent
commit
fd0b8e2c0e
1 changed files with 27 additions and 5 deletions
  1. 27 5
      Build/CMake/Modules/AtomicDesktop.cmake

+ 27 - 5
Build/CMake/Modules/AtomicDesktop.cmake

@@ -13,13 +13,35 @@ if (EXISTS ${CMAKE_SOURCE_DIR}/Submodules/CEF)
     file(GLOB RESULT ${CMAKE_SOURCE_DIR}/Submodules/CEF)
     list(LENGTH ${RESULT} RES_LEN)
     if(RES_LEN EQUAL 0)
+     message(STATUS "Trying to initalise CEF submodule")
+
+     set(PATH_STRING $ENV{PATH})
+     string(REPLACE ":" ";" PATHLIST ${PATH_STRING})
+
+     set(GIT_FOUND false)
+     foreach(cpath ${PATHLIST})
+      if (EXISTS ${cpath}/git)
+       set(GIT_FOUND true)
+       break()
+      endif()
+     endforeach(cpath)
+
      # DIR is empty, so init the submodule and checkout master
-     execute_process(COMMAND git submodule update --init --remote)
-    endif()
+     if(GIT_FOUND)
+      execute_process(COMMAND git submodule update --init --remote)
+
+      set(ATOMIC_WEBVIEW TRUE)
+      add_definitions( -DATOMIC_WEBVIEW )
+      include("AtomicWebView")
+     else ()
+      message(STATUS "Could not find git in your Path please install git to enable WebView")
+     endif(GIT_FOUND)
 
-    set(ATOMIC_WEBVIEW TRUE)
-    add_definitions( -DATOMIC_WEBVIEW )
-    include("AtomicWebView")
+    else ()
+     set(ATOMIC_WEBVIEW TRUE)
+     add_definitions( -DATOMIC_WEBVIEW )
+     include("AtomicWebView")
+    endif()
 endif()
 
 include(AtomicNET)