]> git.mxchange.org Git - simgear.git/commitdiff
Improved CMake support for libsvn
authorThorstenB <brehmt@gmail.com>
Thu, 4 Aug 2011 17:23:55 +0000 (19:23 +0200)
committerThorstenB <brehmt@gmail.com>
Thu, 4 Aug 2011 17:28:13 +0000 (19:28 +0200)
Added missing CMake defines for SVN_CLIENT.
Don't detect libsvn without APR.
When installed, enable libsvn support by default (same as for automake).
When enabled, provide libsvn include dir to libtsync.
gitignore temporary CMake files

.gitignore
CMakeLists.txt
CMakeModules/FindSvnClient.cmake
simgear/scene/tsync/CMakeLists.txt
simgear/simgear_config_cmake.h.in

index 290f76f98876dfe62c355345a30e90efa7e670be..c74854a773bf65047fe83ca0decbde9960aced0c 100644 (file)
@@ -21,5 +21,6 @@ CMakeCache.txt
 CPackConfig.cmake
 CPackSourceConfig.cmake
 cmake_uninstall.cmake
+CTestTestfile.cmake
 install_manifest.txt
 
index 517d87df1453c0e7f92a59d4bd096f4634f28cd8..e97a0e8a973655667ff015074b5d63a5a3aee56a 100644 (file)
@@ -20,7 +20,7 @@ set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}")
 option(SIMGEAR_SHARED "Set to ON to build SimGear as a shared library/framework" OFF)
 option(SIMGEAR_HEADLESS "Set to ON to build SimGear with GUI/graphics support" OFF)
 option(JPEG_FACTORY "Enable JPEG-factory support" OFF)
-option(ENABLE_LIBSVN "Set to ON to build SimGear with libsvnclient support" OFF)
+option(ENABLE_LIBSVN "Set to ON to build SimGear with libsvnclient support" ON)
 
 set(MSVC_3RDPARTY_ROOT NOT_FOUND CACHE PATH "Location where the third-party dependencies are extracted")
 
@@ -71,11 +71,13 @@ endif()
 
 if(ENABLE_LIBSVN)
        find_package(SvnClient)
-       
+
        if(LIBSVN_FOUND)
                message(STATUS "libsvn found, enabling in SimGear")
                set(HAVE_SVN_CLIENT_H 1)
                set(HAVE_LIBSVN_CLIENT_1 1)
+       else()
+               message(STATUS "Missing libsvn, unable to enable SVN in SimGear")
        endif(LIBSVN_FOUND)
 endif(ENABLE_LIBSVN)
 
index 717b8b04d0d749b3b0e1fdd849de65eed1fbab7e..baf03027e3dce103f9f0d43c2e4a8d4bae5f028d 100644 (file)
@@ -22,27 +22,30 @@ 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
-)
-
-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)
-
-if(LIBSVN_FOUND)
-    set(LIBSVN_LIBRARIES "svn_client-1" "svn_subr-1" "svn_ra-1" ${APR_LIBS})
-endif(LIBSVN_FOUND)
+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)
+
+       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)
+endif(HAVE_APR_CONFIG)
+
index 238e0b90e7bc187e5e147b04dbd89aedef2b7eb1..5c0be4297e7a5ab53de9c642d71bf361cdbb7601 100644 (file)
@@ -8,4 +8,15 @@ set(SOURCES
     terrasync.cxx
     )
 
+if(LIBSVN_FOUND)
+       add_definitions(${APR_CFLAGS})
+
+       IF(APPLE)
+               set_property(SOURCE terrasync.cxx PROPERTY COMPILE_FLAGS "-iwithsysroot ${LIBSVN_INCLUDE_DIR}")
+       ELSE()
+               include_directories(${LIBSVN_INCLUDE_DIR})
+       ENDIF(APPLE)
+
+endif()
+
 simgear_component(tsync scene/tsync "${SOURCES}" "${HEADERS}")
index 2bc95fb39575dde959aa2cc94692225e9d859bbb..bfb4b1b916619db7efaf7288a3311cedf20e0ed9 100644 (file)
@@ -12,5 +12,8 @@
 #cmakedefine HAVE_ISNAN
 #cmakedefine HAVE_WINDOWS_H
 
+#cmakedefine HAVE_SVN_CLIENT_H
+#cmakedefine HAVE_LIBSVN_CLIENT_1
+
 // set if building headless (no OSG or OpenGL libs)
 #cmakedefine NO_OPENSCENEGRAPH_INTERFACE