summaryrefslogtreecommitdiffstats
path: root/ConfigureChecks.cmake
blob: 205f5f58eaf667ac92168e3ebebaeb365aadead9 (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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
###########################################
#                                         #
#  Improvements and feedback 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( )

set( ENV{PKG_CONFIG_PATH} "${PKG_CONFIG_PATH}:$ENV{PKG_CONFIG_PATH}:${LIB_INSTALL_DIR}/pkgconfig" )


##### check for gcc visibility support

if( WITH_GCC_VISIBILITY )
  tde_setup_gcc_visibility( )
endif( WITH_GCC_VISIBILITY )


##### check for libexiv2

pkg_search_module( EXIV2 exiv2 )
if( NOT EXIV2_FOUND )
   tde_message_fatal( "exiv2 is required, but was not found on your system" )
endif( NOT EXIV2_FOUND )

check_include_file_cxx( "exiv2/exiv2.hpp" HAVE_EXIV2_EXIV2_HPP )


##### check for libjpeg

find_package( JPEG )
if( NOT JPEG_FOUND )
  tde_message_fatal( "jpeg library is required, but was not found on your system" )
endif()


##### checks for libkipi

if( WITH_KIPI )
  pkg_search_module( LIBKIPI libkipi )
  if( NOT LIBKIPI_FOUND )
    tde_message_fatal( "libkipi was requested but not found on your system." )
  endif( )
  set( GV_HAVE_KIPI 1 )
endif( )


##### checks for libmng

if( WITH_MNG )
  find_file( HAVE_LIBMNG_H "libmng.h" )
  if( NOT HAVE_LIBMNG_H )
    tde_message_fatal( "libmng was requested but not found on your system." )
  endif( )
  set( MNG_LIBRARY mng )
  set( HAVE_LIBMNG 1 )
endif( )


##### check for libpng

find_package( PNG )
if( NOT PNG_FOUND )
  tde_message_fatal( "png library is required, but was not found on your system" )
endif()


##### check for libxcursor
if( WITH_XCURSOR )
  pkg_search_module( XCURSOR xcursor )
  if( XCURSOR_FOUND )
    set( GV_HAVE_XCURSOR 1 )
  else( )
    tde_message_fatal( "xcursor library is required, but was not found on your system" )
  endif( )
endif()


##### check for lround function

tde_save_and_set( CMAKE_REQUIRED_LIBRARIES "m" )
check_symbol_exists ( lround  "math.h" HAVE_LROUND  )
tde_restore( CMAKE_REQUIRED_LIBRARIES )
if( NOT HAVE_LROUND )
  set( HAVE_LROUND 0 )
endif( NOT HAVE_LROUND )


##### check for thread support

find_package( Threads )


##### check architecture

if( NOT CMAKE_ARCHITECTURE )
  execute_process(
    COMMAND ${CMAKE_C_COMPILER} -dumpmachine
    OUTPUT_VARIABLE CMAKE_ARCHITECTURE
    ERROR_VARIABLE CMAKE_ARCHITECTURE
    OUTPUT_STRIP_TRAILING_WHITESPACE
    ERROR_STRIP_TRAILING_WHITESPACE )
  set( CMAKE_ARCHITECTURE "${CMAKE_ARCHITECTURE}" CACHE INTERNAL "" FORCE )
  message( STATUS "Detected ${CMAKE_ARCHITECTURE} target architecture" )
endif( )


##### check specific architecture dependant support

if( ${CMAKE_ARCHITECTURE} MATCHES "i.86" )

  # MMX support
  message( STATUS "Performing MMX support test" )
  check_c_source_compiles( "
    int main() {
      #if defined(__GNUC__)
      __asm__(\"pxor %mm0, %mm0\");
      #else
      #error Not gcc on x86/x86_64
      #endif
      return 0;
    }"
    HAVE_X86_MMX
  )

endif( )