2 find_package(Subversion)
5 function(try_cvs_checkout repository module dir result_var)
6 # Assume cvs checkouts will not work:
7 set(${result_var} 0 PARENT_SCOPE)
10 message(STATUS "try_cvs_checkout")
12 # Ensure directory exists so we can call cvs in it:
13 file(MAKE_DIRECTORY "${dir}")
15 # Try to do the cvs checkout command:
16 execute_process(COMMAND ${CVS_EXECUTABLE} -d ${repository} co ${module}
17 WORKING_DIRECTORY ${dir}
21 # If it worked, cvs checkouts will work:
23 set(${result_var} 1 PARENT_SCOPE)
26 message(STATUS "try_cvs_checkout -- done")
28 endfunction(try_cvs_checkout)
31 function(try_svn_checkout repository dir result_var)
32 # Assume svn checkouts will not work:
33 set(${result_var} 0 PARENT_SCOPE)
35 if(Subversion_SVN_EXECUTABLE)
36 message(STATUS "try_svn_checkout")
38 # Ensure directory exists so we can call svn in it:
39 file(MAKE_DIRECTORY "${dir}")
41 # Try to do the svn checkout command:
42 execute_process(COMMAND ${Subversion_SVN_EXECUTABLE} co ${repository} ${dir}
43 WORKING_DIRECTORY ${dir}
47 # If it worked, svn checkouts will work:
49 set(${result_var} 1 PARENT_SCOPE)
52 message(STATUS "try_svn_checkout -- done")
54 endfunction(try_svn_checkout)