1 include(CheckIncludeFile)
2 include(CheckIncludeFiles)
3 include(CheckSymbolExists)
4 include(CheckFunctionExists)
5 include(CheckLibraryExists)
6 include(CheckPrototypeExists)
9 # The FindKDE4.cmake module sets _KDE4_PLATFORM_DEFINITIONS with
10 # definitions like _GNU_SOURCE that are needed on each platform.
11 set(CMAKE_REQUIRED_DEFINITIONS ${_KDE4_PLATFORM_DEFINITIONS})
13 #check for libz using the cmake supplied FindZLIB.cmake
34 set(HAVE_BZIP2_SUPPORT 1)
36 set(NEED_BZ2_PREFIX 1)
37 endif(BZIP2_NEED_PREFIX)
39 set(HAVE_BZIP2_SUPPORT 0)
54 #now check for dlfcn.h using the cmake supplied CHECK_include_FILE() macro
55 # If definitions like -D_GNU_SOURCE are needed for these checks they
56 # should be added to _KDE4_PLATFORM_DEFINITIONS when it is originally
57 # defined outside this file. Here we include these definitions in
58 # CMAKE_REQUIRED_DEFINITIONS so they will be included in the build of
60 set(CMAKE_REQUIRED_DEFINITIONS ${_KDE4_PLATFORM_DEFINITIONS})
62 set(CMAKE_REQUIRED_LIBRARIES ${KDEWIN32_LIBRARIES} )
63 set(CMAKE_REQUIRED_INCLUDES ${KDEWIN32_INCLUDES} )
66 check_include_files(dlfcn.h HAVE_DLFCN_H)
67 check_include_files(crt_externs.h HAVE_CRT_EXTERNS_H)
68 check_include_files(inttypes.h HAVE_INTTYPES_H)
69 check_include_files(memory.h HAVE_MEMORY_H)
70 check_include_files(stdint.h HAVE_STDINT_H)
71 check_include_files(stdlib.h HAVE_STDLIB_H)
72 check_include_files(strings.h HAVE_STRINGS_H)
73 check_include_files(string.h HAVE_STRING_H)
74 check_include_files(sys/bitypes.h HAVE_SYS_BITYPES_H)
75 check_include_files(sys/stat.h HAVE_SYS_STAT_H)
76 check_include_files(sys/types.h HAVE_SYS_TYPES_H)
77 check_include_files(unistd.h HAVE_UNISTD_H)
79 check_function_exists(_NSGetEnviron HAVE_NSGETENVIRON)
80 check_function_exists(initgroups HAVE_INITGROUPS)
81 check_function_exists(setenv HAVE_SETENV)
82 check_function_exists(gettimeofday HAVE_GETTIMEOFDAY)
83 check_function_exists(strlcat HAVE_STRLCAT)
84 check_function_exists(strlcpy HAVE_STRLCPY)
86 check_symbol_exists(res_init "sys/types.h;netinet/in.h;arpa/nameser.h;resolv.h" HAVE_RES_INIT)
87 check_symbol_exists(snprintf "stdio.h" HAVE_SNPRINTF)
88 check_symbol_exists(vsnprintf "stdio.h" HAVE_VSNPRINTF)
90 check_prototype_exists(res_init "sys/types.h;netinet/in.h;arpa/nameser.h;resolv.h" HAVE_RES_INIT_PROTO)
91 check_prototype_exists(initgroups "unistd.h;sys/types.h;unistd.h;grp.h" HAVE_INITGROUPS_PROTO)
92 check_prototype_exists(setenv stdlib.h HAVE_SETENV_PROTO)
93 check_prototype_exists(strlcat string.h HAVE_STRLCAT_PROTO)
94 check_prototype_exists(strlcpy string.h HAVE_STRLCPY_PROTO)
97 check_type_size("int" SIZEOF_INT)
98 check_type_size("char *" SIZEOF_CHAR_P)
99 check_type_size("long" SIZEOF_LONG)
100 check_type_size("short" SIZEOF_SHORT)
101 check_type_size("size_t" SIZEOF_SIZE_T)
102 check_type_size("unsigned long" SIZEOF_UNSIGNED_LONG)