summaryrefslogtreecommitdiffstats
path: root/kioslave/svn/ConfigureChecks.cmake
blob: 81358c60404ce578abacd0392364d64d5d698ffc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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( )