Add search opengl support
[kdeartwork.git] / ConfigureChecks.cmake
blob1e31244ba47097f5822e1b5ca7c35b787b635397
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(OPENGL_FOUND HAVE_GL)
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(dlfcn.h HAVE_DLFCN_H)
43 check_include_files(crt_externs.h HAVE_CRT_EXTERNS_H)
44 check_include_files(inttypes.h HAVE_INTTYPES_H)
45 check_include_files(memory.h HAVE_MEMORY_H)
46 check_include_files(stdint.h HAVE_STDINT_H)
47 check_include_files(stdlib.h HAVE_STDLIB_H)
48 check_include_files(strings.h HAVE_STRINGS_H)
49 check_include_files(string.h HAVE_STRING_H)
50 check_include_files(sys/bitypes.h HAVE_SYS_BITYPES_H)
51 check_include_files(sys/stat.h HAVE_SYS_STAT_H)
52 check_include_files(sys/types.h HAVE_SYS_TYPES_H)
53 check_include_files(unistd.h HAVE_UNISTD_H)
55 check_function_exists(_NSGetEnviron   HAVE_NSGETENVIRON)
56 check_function_exists(initgroups HAVE_INITGROUPS)
57 check_function_exists(setenv     HAVE_SETENV)
58 check_function_exists(gettimeofday    HAVE_GETTIMEOFDAY)
59 check_function_exists(strlcat    HAVE_STRLCAT)
60 check_function_exists(strlcpy    HAVE_STRLCPY)
62 check_symbol_exists(res_init        "sys/types.h;netinet/in.h;arpa/nameser.h;resolv.h" HAVE_RES_INIT)
63 check_symbol_exists(snprintf        "stdio.h"                  HAVE_SNPRINTF)
64 check_symbol_exists(vsnprintf       "stdio.h"                  HAVE_VSNPRINTF)
66 check_prototype_exists(res_init "sys/types.h;netinet/in.h;arpa/nameser.h;resolv.h" HAVE_RES_INIT_PROTO)
67 check_prototype_exists(initgroups "unistd.h;sys/types.h;unistd.h;grp.h" HAVE_INITGROUPS_PROTO)
68 check_prototype_exists(setenv stdlib.h HAVE_SETENV_PROTO)
69 check_prototype_exists(strlcat string.h HAVE_STRLCAT_PROTO)
70 check_prototype_exists(strlcpy string.h HAVE_STRLCPY_PROTO)
72 check_library_exists(crypt crypt "" HAVE_CRYPT)
74 check_type_size("int" SIZEOF_INT)
75 check_type_size("char *"  SIZEOF_CHAR_P)
76 check_type_size("long" SIZEOF_LONG)
77 check_type_size("short" SIZEOF_SHORT)
78 check_type_size("size_t" SIZEOF_SIZE_T)
79 check_type_size("unsigned long" SIZEOF_UNSIGNED_LONG)