summaryrefslogtreecommitdiffstats
path: root/kioslave/svn/ConfigureChecks.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'kioslave/svn/ConfigureChecks.cmake')
-rw-r--r--kioslave/svn/ConfigureChecks.cmake50
1 files changed, 50 insertions, 0 deletions
diff --git a/kioslave/svn/ConfigureChecks.cmake b/kioslave/svn/ConfigureChecks.cmake
new file mode 100644
index 00000000..81358c60
--- /dev/null
+++ b/kioslave/svn/ConfigureChecks.cmake
@@ -0,0 +1,50 @@
+#################################################
+#
+# (C) 2010-2011 Serghei Amelian
+# serghei (DOT) amelian (AT) gmail.com
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+pkg_search_module( APR apr-1 )
+if( APR_FOUND )
+ set( HAVE_APR 1 )
+else( )
+ tde_message_fatal( "apr-1 is required, but was not found on your system" )
+endif( )
+
+
+# check for subversion library
+
+check_library_exists( "svn_client-1" "svn_pool_create_ex" "${SVN_LIBRARY_DIR}" HAVE_SVN_POOL_CREATE_EX )
+
+if( HAVE_SVN_POOL_CREATE_EX )
+ set( SVN_LIBRARIES "svn_client-1;svn_subr-1;svn_ra-1" )
+else( )
+ tde_message_fatal( "svn_client-1 library was not found on your system.\n Subversion is installed?\n Try to set SVN_LIBRARY_DIR to subversion library directory." )
+endif( )
+
+
+# check for subversion headers
+
+tde_save_and_set( CMAKE_REQUIRED_FLAGS "-I${APR_INCLUDE_DIRS}" )
+tde_save_and_set( CMAKE_REQUIRED_DEFINITIONS "${APR_CFLAGS}" )
+
+if( SVN_INCLUDE_DIR )
+ set_and_save( CMAKE_REQUIRED_INCLUDES "${SVN_INCLUDE_DIR}" )
+ check_include_file( "svn_types.h" HAVE_SVN_TYPES_H )
+ tde_restore( CMAKE_REQUIRED_INCLUDES )
+else( )
+ # FIXME must be improved
+ check_include_file( "/usr/include/subversion-1/svn_types.h" HAVE_SVN_TYPES_H )
+ set( SVN_INCLUDE_DIR "/usr/include/subversion-1" )
+endif( )
+
+tde_restore( CMAKE_REQUIRED_FLAGS CMAKE_REQUIRED_DEFINITIONS )
+
+if( NOT HAVE_SVN_TYPES_H )
+ tde_message_fatal( "svn_types.h file was not found on your system.\n Subversion devel files are installed?\n Try to set SVN_INCLUDE_DIR to subversion include directory." )
+endif( )