1 # Find Subversion client libraries, and dependencies
2 # including APR (Apache Portable Runtime)
4 include (CheckFunctionExists)
5 include (CheckIncludeFile)
6 include (CheckLibraryExists)
8 find_program(HAVE_APR_CONFIG apr-1-config)
11 execute_process(COMMAND apr-1-config --cppflags --includes
12 OUTPUT_VARIABLE APR_CFLAGS
13 OUTPUT_STRIP_TRAILING_WHITESPACE)
15 execute_process(COMMAND apr-1-config --link-ld
16 OUTPUT_VARIABLE RAW_APR_LIBS
17 OUTPUT_STRIP_TRAILING_WHITESPACE)
19 # clean up some vars, or other CMake pieces complain
20 string(STRIP "${RAW_APR_LIBS}" APR_LIBS)
23 message(STATUS "apr-1-config not found, implement manual search for APR")
24 endif(HAVE_APR_CONFIG)
26 if(HAVE_APR_CONFIG OR MSVC)
27 find_path(LIBSVN_INCLUDE_DIR svn_client.h
30 PATH_SUFFIXES include/subversion-1
38 check_library_exists(libsvn_client-1 svn_client_checkout "${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/lib" HAVE_LIB_SVNCLIENT)
39 check_library_exists(libsvn_subr-1 svn_cmdline_init "${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/lib" HAVE_LIB_SVNSUBR)
40 check_library_exists(libsvn_ra-1 svn_ra_initialize "${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/lib" HAVE_LIB_SVNRA)
42 check_library_exists(svn_client-1 svn_client_checkout "" HAVE_LIB_SVNCLIENT)
43 check_library_exists(svn_subr-1 svn_cmdline_init "" HAVE_LIB_SVNSUBR)
44 check_library_exists(svn_ra-1 svn_ra_initialize "" HAVE_LIB_SVNRA)
47 include(FindPackageHandleStandardArgs)
48 FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBSVN DEFAULT_MSG
55 set(LIBSVN_LIBRARIES "svn_client-1" "svn_subr-1" "svn_ra-1" ${APR_LIBS})
57 endif(HAVE_APR_CONFIG OR MSVC)