From c4dc12ec94686f4506c8716095710da5c70b9c9a Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Thu, 4 Aug 2011 18:59:46 +0200 Subject: [PATCH] Improved CMake support for libsvn Don't detect libsvn without APR. When installed, enable libsvn support by default (same as for automake). When enabled, provide libsvn to fgfs. gitignore temporary CMake files --- .gitignore | 4 +++ CMakeLists.txt | 2 +- CMakeModules/FindSvnClient.cmake | 44 +++++++++++++++++--------------- src/Main/CMakeLists.txt | 1 + utils/fgadmin/src/.gitignore | 1 + 5 files changed, 30 insertions(+), 22 deletions(-) create mode 100644 utils/fgadmin/src/.gitignore diff --git a/.gitignore b/.gitignore index 1ff6ff74d..80583e2e4 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,7 @@ INSTALL Debug/ *.o lib*.a +CMakeFiles +CMakeCache.txt +*.cmake + diff --git a/CMakeLists.txt b/CMakeLists.txt index 364075f98..f8553454e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,7 +55,7 @@ option(ENABLE_YASIM "Set to ON to build FlightGear with YASIM FDM" ON) option(ENABLE_JSBSIM "Set to ON to build FlightGear with JSBSim FDM" ON) option(ENABLE_FGADMIN "Set to ON to build FlightGear with FGADMIN" ON) option(EVENT_INPUT "Set to ON to build FlightGear with event-based Input support" OFF) -option(ENABLE_LIBSVN "Set to ON to build FlightGear/terrasync with libsvnclient support" OFF) +option(ENABLE_LIBSVN "Set to ON to build FlightGear/terrasync with libsvnclient support" ON) option(WITH_FGPANEL "Set to ON to build the fgpanel application" ON) set(MSVC_3RDPARTY_ROOT NOT_FOUND CACHE PATH "Location where the third-party dependencies are extracted") diff --git a/CMakeModules/FindSvnClient.cmake b/CMakeModules/FindSvnClient.cmake index 717b8b04d..0823a5322 100644 --- a/CMakeModules/FindSvnClient.cmake +++ b/CMakeModules/FindSvnClient.cmake @@ -22,27 +22,29 @@ else(HAVE_APR_CONFIG) message(STATUS "apr-1-config not found, implement manual search for APR") endif(HAVE_APR_CONFIG) -find_path(LIBSVN_INCLUDE_DIR svn_client.h - HINTS - $ENV{LIBSVN_DIR} - PATH_SUFFIXES include/subversion-1 - PATHS - /usr/local - /usr - /opt -) +if(HAVE_APR_CONFIG) + find_path(LIBSVN_INCLUDE_DIR svn_client.h + HINTS + $ENV{LIBSVN_DIR} + PATH_SUFFIXES include/subversion-1 + PATHS + /usr/local + /usr + /opt + ) -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) + 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 - HAVE_LIB_SVNRA - LIBSVN_INCLUDE_DIR) + include(FindPackageHandleStandardArgs) + 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" "svn_ra-1" ${APR_LIBS}) -endif(LIBSVN_FOUND) + if(LIBSVN_FOUND) + set(LIBSVN_LIBRARIES "svn_client-1" "svn_subr-1" "svn_ra-1" ${APR_LIBS}) + endif(LIBSVN_FOUND) +endif(HAVE_APR_CONFIG) diff --git a/src/Main/CMakeLists.txt b/src/Main/CMakeLists.txt index c03bdaeed..2f80a23f6 100644 --- a/src/Main/CMakeLists.txt +++ b/src/Main/CMakeLists.txt @@ -78,6 +78,7 @@ target_link_libraries(fgfs ${ALUT_LIBRARY} ${ZLIB_LIBRARIES} ${PLIB_LIBRARIES} + ${LIBSVN_LIBRARIES} ${RT_LIBRARY}) install(TARGETS fgfs RUNTIME DESTINATION bin) diff --git a/utils/fgadmin/src/.gitignore b/utils/fgadmin/src/.gitignore new file mode 100644 index 000000000..6e2d97b1f --- /dev/null +++ b/utils/fgadmin/src/.gitignore @@ -0,0 +1 @@ +fgadmin -- 2.39.5