@@ -9,26 +9,26 @@ function(find_first_existing_file out_var)
9
9
endfunction ()
10
10
11
11
macro (find_first_existing_vc_file out_var path )
12
- find_program (git_executable NAMES git git.exe git.cmd )
13
- # Run from a subdirectory to force git to print an absolute path.
14
- execute_process (COMMAND ${git_executable} rev-parse --git-dir
15
- WORKING_DIRECTORY ${path} /cmake
16
- RESULT_VARIABLE git_result
17
- OUTPUT_VARIABLE git_dir
18
- ERROR_QUIET )
19
- if (git_result EQUAL 0 )
20
- string (STRIP "${git_dir} " git_dir )
21
- set (${out_var} "${git_dir} /logs/HEAD" )
22
- # some branchless cases (e.g. 'repo') may not yet have .git/logs/HEAD
23
- if (NOT EXISTS "${git_dir} /logs/HEAD" )
24
- file (WRITE "${git_dir} /logs/HEAD" "" )
25
- endif ()
26
- else ()
27
- find_first_existing_file (${out_var}
28
- "${path} /.svn/wc.db" # SVN 1.7
29
- "${path} /.svn/entries" # SVN 1.6
30
- )
12
+ find_program (git_executable NAMES git git.exe git.cmd )
13
+ # Run from a subdirectory to force git to print an absolute path.
14
+ execute_process (COMMAND ${git_executable} rev-parse --git-dir
15
+ WORKING_DIRECTORY ${path} /cmake
16
+ RESULT_VARIABLE git_result
17
+ OUTPUT_VARIABLE git_dir
18
+ ERROR_QUIET )
19
+ if (git_result EQUAL 0 )
20
+ string (STRIP "${git_dir} " git_dir )
21
+ set (${out_var} "${git_dir} /logs/HEAD" )
22
+ # some branchless cases (e.g. 'repo') may not yet have .git/logs/HEAD
23
+ if (NOT EXISTS "${git_dir} /logs/HEAD" )
24
+ file (WRITE "${git_dir} /logs/HEAD" "" )
31
25
endif ()
26
+ else ()
27
+ find_first_existing_file (${out_var}
28
+ "${path} /.svn/wc.db" # SVN 1.7
29
+ "${path} /.svn/entries" # SVN 1.6
30
+ )
31
+ endif ()
32
32
endmacro ()
33
33
34
34
find_first_existing_vc_file (llvm_vc "${LLVM_MAIN_SRC_DIR} " )
0 commit comments