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 if(HAVE_APR_CONFIG OR MSVC)
26 find_path(LIBSVN_INCLUDE_DIR svn_client.h
29 PATH_SUFFIXES include/subversion-1
37 check_library_exists(libsvn_client-1 svn_client_checkout "${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/lib" HAVE_LIB_SVNCLIENT)
38 check_library_exists(libsvn_subr-1 svn_cmdline_init "${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/lib" HAVE_LIB_SVNSUBR)
39 check_library_exists(libsvn_ra-1 svn_ra_initialize "${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/lib" HAVE_LIB_SVNRA)
41 check_library_exists(svn_client-1 svn_client_checkout "" HAVE_LIB_SVNCLIENT)
42 check_library_exists(svn_subr-1 svn_cmdline_init "" HAVE_LIB_SVNSUBR)
43 check_library_exists(svn_ra-1 svn_ra_initialize "" HAVE_LIB_SVNRA)
46 include(FindPackageHandleStandardArgs)
47 FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBSVN DEFAULT_MSG
54 set(LIBSVN_LIBRARIES "svn_client-1" "svn_subr-1" "svn_ra-1" ${APR_LIBS})
56 endif(HAVE_APR_CONFIG OR MSVC)