Browse Source

Updated CMakeLists

Tom Haraldseid 7 years ago
parent
commit
1d65b4b316
1 changed files with 16 additions and 21 deletions
  1. 16
    21
      buildroot/share/cmake/CMakeLists.txt

+ 16
- 21
buildroot/share/cmake/CMakeLists.txt View File

@@ -9,7 +9,7 @@ cmake_minimum_required(VERSION 2.8)
9 9
 #                                                                    #
10 10
 # Usage under Windows:                                               #
11 11
 #                                                                    #
12
-#    From Marlin/buildroot/share/cmake folder: :                     #
12
+#    From Marlin/buildroot/share/cmake folder:                       #
13 13
 #        mkdir build && cd build                                     #
14 14
 #        cmake -G"Unix Makefiles" ..                                 #
15 15
 #        make                                                        #
@@ -20,31 +20,26 @@ cmake_minimum_required(VERSION 2.8)
20 20
 # and add the path to the module path                                #
21 21
 #====================================================================#
22 22
 
23
-if(NOT EXISTS ${CMAKE_BINARY_DIR}/marlin-cmake)
23
+set(SCRIPT_BRANCH 1.0.2) #Set to wanted marlin-cmake release tag or branch
24 24
 
25
-    file(DOWNLOAD https://raw.githubusercontent.com/tohara/marlin-cmake/v1.0.0/modules/Arduino_SDK.cmake
26
-                  ${CMAKE_BINARY_DIR}/marlin-cmake/modules/Arduino_SDK.cmake SHOW_PROGRESS)
27
-                  
28
-    file(DOWNLOAD https://raw.githubusercontent.com/tohara/marlin-cmake/v1.0.0/modules/marlin_cmake_functions.cmake
29
-                  ${CMAKE_BINARY_DIR}/marlin-cmake/modules/marlin_cmake_functions.cmake SHOW_PROGRESS)             
30
-    
31
-    file(DOWNLOAD https://raw.githubusercontent.com/tohara/marlin-cmake/v1.0.0/Platform/Arduino.cmake
32
-                  ${CMAKE_BINARY_DIR}/marlin-cmake/Platform/Arduino.cmake SHOW_PROGRESS)
25
+if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/marlin-cmake)
26
+
27
+	file(DOWNLOAD https://github.com/tohara/marlin-cmake/archive/${SCRIPT_BRANCH}.tar.gz
28
+				  ${CMAKE_CURRENT_LIST_DIR}/marlin-cmake-src.tar.gz SHOW_PROGRESS)
29
+				  
30
+	execute_process(COMMAND ${CMAKE_COMMAND} -E tar -xvf ${CMAKE_CURRENT_LIST_DIR}/marlin-cmake-src.tar.gz WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
31
+				  
32
+	file(RENAME ${CMAKE_CURRENT_LIST_DIR}/marlin-cmake-${SCRIPT_BRANCH} ${CMAKE_CURRENT_LIST_DIR}/marlin-cmake)
33
+	file(REMOVE ${CMAKE_CURRENT_LIST_DIR}/marlin-cmake-src.tar.gz)
33 34
     
34
-    file(DOWNLOAD https://raw.githubusercontent.com/tohara/marlin-cmake/v1.0.0/settings/marlin_boards.txt
35
-                  ${CMAKE_BINARY_DIR}/marlin-cmake/settings/marlin_boards.txt SHOW_PROGRESS)
36
-                  
37
-    file(DOWNLOAD https://raw.githubusercontent.com/tohara/marlin-cmake/v1.0.0/toolchain/ArduinoToolchain.cmake
38
-                  ${CMAKE_BINARY_DIR}/marlin-cmake/toolchain/ArduinoToolchain.cmake SHOW_PROGRESS)
39 35
               
40
-    if(WIN32)
41
-        file(DOWNLOAD https://raw.githubusercontent.com/tohara/marlin-cmake/v1.0.0/resources/make.exe
42
-                      ${CMAKE_BINARY_DIR}/make.exe SHOW_PROGRESS)
43
-    endif(WIN32)
36
+endif()
44 37
 
38
+if(WIN32 AND NOT EXISTS ${CMAKE_BINARY_DIR}/make.exe)
39
+    file(COPY ${CMAKE_CURRENT_LIST_DIR}/marlin-cmake/resources/make.exe DESTINATION ${CMAKE_BINARY_DIR}/)
45 40
 endif()
46 41
 
47
-set(CMAKE_MODULE_PATH  ${CMAKE_MODULE_PATH} ${CMAKE_BINARY_DIR}/marlin-cmake/modules)
42
+set(CMAKE_MODULE_PATH  ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_LIST_DIR}/marlin-cmake/modules)
48 43
 
49 44
 #====================================================================#
50 45
 #  Custom path to Arduino SDK can be set here.                       #
@@ -63,7 +58,7 @@ include(marlin_cmake_functions)
63 58
 #====================================================================#
64 59
 #  Set toolchain file for arduino                                    #
65 60
 #====================================================================#
66
-set(CMAKE_TOOLCHAIN_FILE ${CMAKE_BINARY_DIR}/marlin-cmake/toolchain/ArduinoToolchain.cmake) # Arduino Toolchain
61
+set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/marlin-cmake/toolchain/ArduinoToolchain.cmake) # Arduino Toolchain
67 62
 
68 63
 #====================================================================#
69 64
 #  Setup Project                                                     #

Loading…
Cancel
Save