Remove Makefile.am, all is into CMakeLists.txt
[kdeaccessibility.git] / ConfigureChecks.cmake
blob69a81a2009068848eaf94cf3e7cf71e6e0266d7b
1 include(CheckIncludeFile)
2 include(CheckIncludeFiles)
3 include(CheckSymbolExists)
4 include(CheckFunctionExists)
5 include(CheckLibraryExists)
6 include(CheckPrototypeExists)
7 include(CheckTypeSize)
8 include(MacroBoolTo01)
10 # The FindKDE4.cmake module sets _KDE4_PLATFORM_DEFINITIONS with
11 # definitions like _GNU_SOURCE that are needed on each platform.
12 set(CMAKE_REQUIRED_DEFINITIONS ${_KDE4_PLATFORM_DEFINITIONS})
14 #check for libz using the cmake supplied FindZLIB.cmake
15 macro_bool_to_01(ZLIB_FOUND HAVE_LIBZ)
16 macro_bool_to_01(JPEG_FOUND HAVE_LIBJPEG)
17 macro_bool_to_01(PNG_FOUND HAVE_LIBPNG)
18 macro_bool_to_01(LIBART_FOUND HAVE_LIBART)
19 macro_bool_to_01(CARBON_FOUND HAVE_CARBON)
20 macro_bool_to_01(AKODE_FOUND HAVE_AKODE)
21 if(BZIP2_FOUND)
22    set(HAVE_BZIP2_SUPPORT 1)
23    if(BZIP2_NEED_PREFIX)
24       set(NEED_BZ2_PREFIX 1)
25    endif(BZIP2_NEED_PREFIX)
26 else(BZIP2_FOUND)
27    set(HAVE_BZIP2_SUPPORT 0)
28 endif(BZIP2_FOUND)
30 #now check for dlfcn.h using the cmake supplied CHECK_include_FILE() macro
31 # If definitions like -D_GNU_SOURCE are needed for these checks they
32 # should be added to _KDE4_PLATFORM_DEFINITIONS when it is originally
33 # defined outside this file.  Here we include these definitions in
34 # CMAKE_REQUIRED_DEFINITIONS so they will be included in the build of
35 # checks below.
36 set(CMAKE_REQUIRED_DEFINITIONS ${_KDE4_PLATFORM_DEFINITIONS})
37 if (WIN32)
38    set(CMAKE_REQUIRED_LIBRARIES ${KDEWIN32_LIBRARIES} )
39    set(CMAKE_REQUIRED_INCLUDES  ${KDEWIN32_INCLUDES} )
40 endif (WIN32)
42 check_include_files(alsa/asoundlib.h HAVE_ALSA_ASOUNDLIB_H)
43 check_include_files(crt_externs.h HAVE_CRT_EXTERNS_H)
44 check_include_files(dlfcn.h HAVE_DLFCN_H)
45 check_include_files(inttypes.h HAVE_INTTYPES_H)
46 check_include_files(memory.h HAVE_MEMORY_H)
47 check_include_files(stdint.h HAVE_STDINT_H)
48 check_include_files(stdlib.h HAVE_STDLIB_H)
49 check_include_files(strings.h HAVE_STRINGS_H)
50 check_include_files(string.h HAVE_STRING_H)
51 check_include_files(sys/asoundlib.h HAVE_SYS_ASOUNDLIB_H)
52 check_include_files(sys/bitypes.h HAVE_SYS_BITYPES_H)
53 check_include_files(sys/stat.h HAVE_SYS_STAT_H)
54 check_include_files(sys/time.h HAVE_SYS_TIME_H)
55 check_include_files(sys/types.h HAVE_SYS_TYPES_H)
56 check_include_files(unistd.h HAVE_UNISTD_H)
57 check_include_files("sys/time.h;time.h" TIME_WITH_SYS_TIME)
59 check_function_exists(strlcpy    HAVE_STRLCPY)
60 check_function_exists(strlcat    HAVE_STRLCAT)
61 check_function_exists(_NSGetEnviron   HAVE_NSGETENVIRON)
62 check_function_exists(setenv     HAVE_SETENV)
63 check_function_exists(unsetenv   HAVE_UNSETENV)
65 check_symbol_exists(res_init        "sys/types.h;netinet/in.h;arpa/nameser.h;resolv.h" HAVE_RES_INIT)
66 check_symbol_exists(snprintf        "stdio.h"                  HAVE_SNPRINTF)
67 check_symbol_exists(vsnprintf       "stdio.h"                  HAVE_VSNPRINTF)
69 check_prototype_exists(res_init "sys/types.h;netinet/in.h;arpa/nameser.h;resolv.h" HAVE_RES_INIT_PROTO)
72 check_prototype_exists(setenv stdlib.h HAVE_SETENV_PROTO)
73 check_prototype_exists(strlcat string.h HAVE_STRLCAT_PROTO)
74 check_prototype_exists(strlcpy string.h HAVE_STRLCPY_PROTO)
75 check_prototype_exists(unsetenv stdlib.h HAVE_UNSETENV_PROTO)
77 check_library_exists(crypt crypt "" HAVE_CRYPT)
79 check_type_size("int" SIZEOF_INT)
80 check_type_size("char *"  SIZEOF_CHAR_P)
81 check_type_size("long" SIZEOF_LONG)
82 check_type_size("short" SIZEOF_SHORT)
83 check_type_size("size_t" SIZEOF_SIZE_T)
84 check_type_size("unsigned long" SIZEOF_UNSIGNED_LONG)