summaryrefslogtreecommitdiffstats
path: root/ConfigureChecks.cmake
blob: d5afdd494cc3354f879446c522c155a16bdd165f (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
############################################
#                                          #
#  Improvements and feedbacks are welcome  #
#                                          #
#  This file is released under GPL >= 3    #
#                                          #
############################################


# required stuff
find_package( TQt )
find_package( TDE )

tde_setup_architecture_flags( )

include(TestBigEndian)
test_big_endian(WORDS_BIGENDIAN)

tde_setup_largefiles( )


##### check for gcc visibility support

if( WITH_GCC_VISIBILITY )
  tde_setup_gcc_visibility( )
endif( WITH_GCC_VISIBILITY )


##### check for the file program

find_program( FILE_EXECUTABLE file )

if( NOT FILE_EXECUTABLE )
    tde_message_fatal( "the program 'file' is required to build basket, but was not found on your system" )
endif()


##### check for X11

find_package( X11 )


##### check for gpgme

if( WITH_GPGME )
pkg_search_module( GPGME gpgme )

if( NOT GPGME_FOUND )
    find_program( GPGME_CONFIG_EXECUTABLE gpgme-config )
    if( NOT GPGME_CONFIG_EXECUTABLE )
        tde_message_fatal( "Gpgme library is required but not found on your system" )
    endif()

    execute_process(
        COMMAND ${GPGME_CONFIG_EXECUTABLE} --libs
        OUTPUT_VARIABLE GPGME_LIBRARIES
        ERROR_VARIABLE  GPGME_LIBRARIES
        OUTPUT_STRIP_TRAILING_WHITESPACE
        ERROR_STRIP_TRAILING_WHITESPACE
    )
    execute_process(
        COMMAND ${GPGME_CONFIG_EXECUTABLE} --cflags
        OUTPUT_VARIABLE GPGME_CFLAGS
        ERROR_VARIABLE  GPGME_CFLAGS
        OUTPUT_STRIP_TRAILING_WHITESPACE
        ERROR_STRIP_TRAILING_WHITESPACE
    )
    string( REGEX MATCHALL "-I([^ ]*)" GPGME_INCLUDE_FLAGS "${GPGME_CFLAGS}" )
    string( REGEX REPLACE "-I" "" GPGME_INCLUDE_DIRS "${GPGME_INCLUDE_FLAGS}" )
    set( GPGME_INCLUDE_DIRS "${GPGME_INCLUDE_DIRS}" CACHE INTERNAL "" )
    set( GPGME_LIBRARIES "${GPGME_LIBRARIES}" CACHE INTERNAL "" )
    set( HAVE_LIBGPGME 1 )
 else()
    set( HAVE_LIBGPGME 1 )
endif( NOT GPGME_FOUND )
endif( WITH_GPGME )


##### check for aRts

if( WITH_ARTS )
    pkg_search_module( ARTS  arts  )
    pkg_search_module( ARTSC artsc )
    find_library( ARTSKDE artskde )

    if( ARTSKDE )
        set( ARTSKDE_LIBRARIES artskde-shared )
    endif()

   if( (NOT ARTS_FOUND) OR (NOT ARTSKDE) )
       tde_message_fatal( "aRts support has been requested but was not found on your system." )
    else()
       set( WITH_ARTS 1 )
   endif()
endif( WITH_ARTS )


##### check for libart-lgpl

if ( WITH_LIBART )
pkg_search_module( LIBART libart libart_lgpl libart-2.0 )

if( NOT LIBART_FOUND )
    tde_message_fatal( "Libart support has been requested but was not found on your system." )
 else()
    set( HAVE_LIBART 1 )
endif()
endif( WITH_LIBART )


##### check for kontact

if( BUILD_KONTACT_PLUGIN )
find_file( HAVE_KONTACT_HEADER "kontact/core.h" )

if( NOT HAVE_KONTACT_HEADER )
    tde_message_fatal( "kontact plugin support has been requested but kontact headers were not found on your system." )
endif()
endif( BUILD_KONTACT_PLUGIN )