From c1f44b366c430986d240dbd389ced6e744890d6c Mon Sep 17 00:00:00 2001 From: James Turner Date: Wed, 19 Jan 2011 12:14:59 +0000 Subject: [PATCH] Working Cmake-terrasync-libsvn support. Probably needs additional refinement, but testable. --- CMakeModules/FindSvnClient.cmake | 17 ++++++++--------- utils/TerraSync/CMakeLists.txt | 5 ++--- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/CMakeModules/FindSvnClient.cmake b/CMakeModules/FindSvnClient.cmake index 51f4452bf..717b8b04d 100644 --- a/CMakeModules/FindSvnClient.cmake +++ b/CMakeModules/FindSvnClient.cmake @@ -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) diff --git a/utils/TerraSync/CMakeLists.txt b/utils/TerraSync/CMakeLists.txt index c44af48bf..86526eb0b 100644 --- a/utils/TerraSync/CMakeLists.txt +++ b/utils/TerraSync/CMakeLists.txt @@ -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()