]> git.mxchange.org Git - simgear.git/blob - CMakeModules/FindSvnClient.cmake
Cmake Windows tweaks.
[simgear.git] / CMakeModules / FindSvnClient.cmake
1 # Find Subversion client libraries, and dependencies
2 # including APR (Apache Portable Runtime)
3
4 include (CheckFunctionExists)
5 include (CheckIncludeFile)
6
7 find_program(HAVE_APR_CONFIG apr-1-config)
8 if(HAVE_APR_CONFIG) 
9         
10     execute_process(COMMAND apr-1-config --cppflags --includes
11         OUTPUT_VARIABLE APR_CFLAGS
12         OUTPUT_STRIP_TRAILING_WHITESPACE)
13         
14     execute_process(COMMAND apr-1-config --link-ld
15         OUTPUT_VARIABLE RAW_APR_LIBS
16         OUTPUT_STRIP_TRAILING_WHITESPACE)
17     
18 # clean up some vars, or other CMake pieces complain
19         string(STRIP ${RAW_APR_LIBS} APR_LIBS)
20
21 else(HAVE_APR_CONFIG)
22     message(STATUS "apr-1-config not found, implement manual search for APR")
23 endif(HAVE_APR_CONFIG)
24
25 if(HAVE_APR_CONFIG) 
26         find_path(LIBSVN_INCLUDE_DIR svn_client.h
27           HINTS
28           $ENV{LIBSVN_DIR}
29           PATH_SUFFIXES include/subversion-1
30           PATHS
31           /usr/local
32           /usr
33           /opt
34         )
35
36         check_library_exists(svn_client-1 svn_client_checkout "" HAVE_LIB_SVNCLIENT)
37         check_library_exists(svn_subr-1 svn_cmdline_init "" HAVE_LIB_SVNSUBR)
38         check_library_exists(svn_ra-1 svn_ra_initialize "" HAVE_LIB_SVNRA)
39
40         include(FindPackageHandleStandardArgs)
41         FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBSVN DEFAULT_MSG 
42                 HAVE_LIB_SVNSUBR 
43                 HAVE_LIB_SVNCLIENT
44                 HAVE_LIB_SVNRA 
45                 LIBSVN_INCLUDE_DIR)
46
47         if(LIBSVN_FOUND)
48                 set(LIBSVN_LIBRARIES "svn_client-1" "svn_subr-1" "svn_ra-1" ${APR_LIBS})
49         endif(LIBSVN_FOUND)
50 endif(HAVE_APR_CONFIG)
51