1
0
Fork 0

Working Cmake-terrasync-libsvn support. Probably needs additional refinement, but testable.

This commit is contained in:
James Turner 2011-01-19 12:14:59 +00:00
parent d365689d5c
commit db3717a30e
2 changed files with 10 additions and 12 deletions

View file

@ -6,11 +6,8 @@ include (CheckIncludeFile)
find_program(HAVE_APR_CONFIG apr-1-config)
if(HAVE_APR_CONFIG)
execute_process(COMMAND apr-1-config --includes
OUTPUT_VARIABLE RAW_APR_INCLUDES
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND apr-1-config --cppflags
execute_process(COMMAND apr-1-config --cppflags --includes
OUTPUT_VARIABLE APR_CFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE)
@ -20,7 +17,6 @@ if(HAVE_APR_CONFIG)
# clean up some vars, or other CMake pieces complain
string(STRIP ${RAW_APR_LIBS} APR_LIBS)
string(STRIP ${RAW_APR_INCLUDES} APR_INCLUDES)
else(HAVE_APR_CONFIG)
message(STATUS "apr-1-config not found, implement manual search for APR")
@ -38,12 +34,15 @@ find_path(LIBSVN_INCLUDE_DIR svn_client.h
check_library_exists(svn_client-1 svn_client_checkout "" HAVE_LIB_SVNCLIENT)
check_library_exists(svn_subr-1 svn_cmdline_init "" HAVE_LIB_SVNSUBR)
check_library_exists(svn_ra-1 svn_ra_initialize "" HAVE_LIB_SVNRA)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBSVN DEFAULT_MSG HAVE_LIB_SVNSUBR
HAVE_LIB_SVNCLIENT LIBSVN_INCLUDE_DIR)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBSVN DEFAULT_MSG
HAVE_LIB_SVNSUBR
HAVE_LIB_SVNCLIENT
HAVE_LIB_SVNRA
LIBSVN_INCLUDE_DIR)
if(LIBSVN_FOUND)
set(LIBSVN_LIBRARIES "svn_client-1" "svn_subr-1" ${APR_LIBS})
set(LIBSVN_INCLUDE_DIRS ${LIBSVN_INCLUDE_DIR} ${APR_INCLUDES})
set(LIBSVN_LIBRARIES "svn_client-1" "svn_subr-1" "svn_ra-1" ${APR_LIBS})
endif(LIBSVN_FOUND)

View file

@ -1,8 +1,6 @@
if(LIBSVN_FOUND)
message(STATUS "includes '${LIBSVN_INCLUDE_DIRS}'")
include_directories(${LIBSVN_INCLUDE_DIRS})
add_definitions(${APR_CFLAGS})
include_directories(${LIBSVN_INCLUDE_DIR})
endif(LIBSVN_FOUND)
add_executable(terrasync terrasync.cxx)
@ -14,6 +12,7 @@ target_link_libraries(terrasync
if(LIBSVN_FOUND)
target_link_libraries(terrasync ${LIBSVN_LIBRARIES})
set_property(TARGET terrasync APPEND PROPERTY COMPILE_FLAGS ${APR_CFLAGS})
endif()