1 # Find Subversion client libraries, and dependencies
2 # including APR (Apache Portable Runtime)
4 include (CheckFunctionExists)
5 include (CheckIncludeFile)
7 find_program(HAVE_APR_CONFIG apr-1-config)
10 execute_process(COMMAND apr-1-config --cppflags --includes
11 OUTPUT_VARIABLE APR_CFLAGS
12 OUTPUT_STRIP_TRAILING_WHITESPACE)
14 execute_process(COMMAND apr-1-config --link-ld
15 OUTPUT_VARIABLE RAW_APR_LIBS
16 OUTPUT_STRIP_TRAILING_WHITESPACE)
18 # clean up some vars, or other CMake pieces complain
19 string(STRIP ${RAW_APR_LIBS} APR_LIBS)
22 message(STATUS "apr-1-config not found, implement manual search for APR")
23 endif(HAVE_APR_CONFIG)
25 find_path(LIBSVN_INCLUDE_DIR svn_client.h
28 PATH_SUFFIXES include/subversion-1
35 check_library_exists(svn_client-1 svn_client_checkout "" HAVE_LIB_SVNCLIENT)
36 check_library_exists(svn_subr-1 svn_cmdline_init "" HAVE_LIB_SVNSUBR)
37 check_library_exists(svn_ra-1 svn_ra_initialize "" HAVE_LIB_SVNRA)
39 include(FindPackageHandleStandardArgs)
40 FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBSVN DEFAULT_MSG
47 set(LIBSVN_LIBRARIES "svn_client-1" "svn_subr-1" "svn_ra-1" ${APR_LIBS})