Project

General

Profile

Download (1.32 KB) Statistics
| Branch: | Tag: | Revision:
1

    
2

    
3
#helpfull functions and macros
4
MACRO(SUBDIRLIST result curdir REGEX_PREFIX)
5
  FILE(GLOB children RELATIVE ${curdir} ${curdir}/${REGEX_PREFIX}*)
6
  SET(dirlist "")
7
  FOREACH(child ${children})
8
    IF(IS_DIRECTORY ${curdir}/${child})
9
      LIST(APPEND dirlist ${child})
10
    ENDIF()
11
  ENDFOREACH()
12
  SET(${result} ${dirlist})
13
ENDMACRO()
14

    
15
MACRO(LUSTREFILES result dir)
16
  FILE(GLOB children ${dir} ${dir}/*.lus)
17
  SET(lustreFileslist "")
18
  FOREACH(child ${children})
19
    IF(EXISTS ${child} AND NOT IS_DIRECTORY ${child})
20
      LIST(APPEND lustreFileslist ${child})
21
    ENDIF()
22
  ENDFOREACH()
23
  SET(${result} ${lustreFileslist})
24
ENDMACRO()
25

    
26

    
27
function(JOIN VALUES GLUE OUTPUT)
28
  string (REGEX REPLACE "([^\\]|^);" "\\1${GLUE}" _TMP_STR "${VALUES}")
29
  string (REGEX REPLACE "[\\](.)" "\\1" _TMP_STR "${_TMP_STR}") #fixes escaping
30
  set (${OUTPUT} "${_TMP_STR}" PARENT_SCOPE)
31
endfunction()
32

    
33

    
34
function(download_zustre)
35
  message("Download latest version of zustre")
36

    
37
  find_package(Git QUIET)
38

    
39
  set(repo_url "https://github.com/coco-team/zustre.git")
40
  set(repo_dir "${CMAKE_CURRENT_SOURCE_DIR}/zustre")
41
  
42
  if(NOT EXISTS "${repo_dir}")
43
    set(ZUSTRE_CHECKOUT_COMMAND "${GIT_EXECUTABLE} clone ${repo_url} ${repo_dir}" PARENT_SCOPE)
44
  endif()
45
  #set(CTEST_UPDATE_COMMAND "${GIT_EXECUTABLE}")
46

    
47
  
48
  set(ZUSTRE_REPO "${repo_dir}" PARENT_SCOPE)
49
endfunction()
(5-5/7)