summarylogtreecommitdiffstats
path: root/mxdatagenerator-optional-download.patch
blob: e5d1edb9aefc55dd3480006ff25dad4ff98c2ff7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Skip the in-tree network download of mxDataGenerator when MXDATAGENERATOR_INC_DIR
is supplied externally.

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -468,28 +468,28 @@ endif()

 ################################################################################
 # mxDataGenerator Download
-configure_file(CMakeMXDataGeneratorDownload.cmake mxDataGenerator-download/CMakeLists.txt)
-  execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
-      RESULT_VARIABLE result
-      WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/mxDataGenerator-download )
-if(result)
-  message(FATAL_ERROR "CMake step for mxDataGenerator failed: ${result}")
-endif()
-  execute_process(COMMAND ${CMAKE_COMMAND} --build .
-      RESULT_VARIABLE result
-      WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/mxDataGenerator-download )
-if(result)
-  message(FATAL_ERROR "Build step for mxDataGenerator failed: ${result}")
-endif()
-  execute_process(COMMAND ${CMAKE_COMMAND} ${CMAKE_BINARY_DIR}/mxDataGenerator-src -B${CMAKE_BINARY_DIR}/mxDataGenerator-build
-      RESULT_VARIABLE result
-      WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/mxDataGenerator-src )
-if(result)
-  message(FATAL_ERROR "Config step for mxDataGenerator-src failed: ${result}")
-endif()
-
 if (NOT DEFINED MXDATAGENERATOR_INC_DIR)
+  configure_file(CMakeMXDataGeneratorDownload.cmake mxDataGenerator-download/CMakeLists.txt)
+    execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
+        RESULT_VARIABLE result
+        WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/mxDataGenerator-download )
+  if(result)
+    message(FATAL_ERROR "CMake step for mxDataGenerator failed: ${result}")
+  endif()
+    execute_process(COMMAND ${CMAKE_COMMAND} --build .
+        RESULT_VARIABLE result
+        WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/mxDataGenerator-download )
+  if(result)
+    message(FATAL_ERROR "Build step for mxDataGenerator failed: ${result}")
+  endif()
+    execute_process(COMMAND ${CMAKE_COMMAND} ${CMAKE_BINARY_DIR}/mxDataGenerator-src -B${CMAKE_BINARY_DIR}/mxDataGenerator-build
+        RESULT_VARIABLE result
+        WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/mxDataGenerator-src )
+  if(result)
+    message(FATAL_ERROR "Config step for mxDataGenerator-src failed: ${result}")
+  endif()
+
   set (MXDATAGENERATOR_INC_DIR "${CMAKE_BINARY_DIR}/mxDataGenerator-src/lib/include")
-  message ("MXDATAGENERATOR_INC_DIR ${MXDATAGENERATOR_INC_DIR}")
 endif ()
+message ("MXDATAGENERATOR_INC_DIR ${MXDATAGENERATOR_INC_DIR}")
 ################################################################################

 ## rocBLAS