summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
blob: 72c65d6382f46b74a96b9ba115fa8235436e0f63 (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
project(KGtk)
cmake_minimum_required(VERSION 2.4.0)

set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
set(CPACK_GENERATOR "TBZ2")
set(CPACK_SOURCE_GENERATOR "TBZ2")
set(CPACK_PACKAGE_VERSION_MAJOR "0")
set(CPACK_PACKAGE_VERSION_MINOR "10")
set(CPACK_PACKAGE_VERSION_PATCH "1")
set(KGTK_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")
set(KGTK_VERSION_FULL "${KGTK_VERSION}.${CPACK_PACKAGE_VERSION_PATCH}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${KGTK_VERSION_FULL}")
include(CPack)

set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
include(CheckFunctionExists)
check_function_exists(getpeereid HAVE_GETPEEREID)

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/usr/include/tqt -include tqt.h -DTQT_THREAD_SUPPORT")
SET(QT_UIC_EXECUTABLE "/usr/bin/uic-tqt")
#SET(QT_MOC_EXECUTABLE "/usr/bin/tmoc")

if (NOT "${KGTK_KDE3}" MATCHES "false")
    add_subdirectory(kdialogd3)
endif (NOT "${KGTK_KDE3}" MATCHES "false")

if (NOT "${KGTK_GTK2}" MATCHES "false")
    # Check if we have dlvsym...
    find_library(LIBDLVSYM_LIBRARY
                 NAMES dl
                 PATHS /lib /usr/lib /usr/X11R6/lib /usr/local/lib)

    if(LIBDLVSYM_LIBRARY)
        set(HAVE_DLVSYM 1)
        # Determine version of dlsym...
        find_library(LIBDL_LIBRARY
                     NAMES dl
                     PATHS /lib /usr/lib /usr/X11R6/lib /usr/local/lib)

        if(LIBDL_LIBRARY)
            execute_process(COMMAND objdump --dynamic-syms ${LIBDL_LIBRARY}
                            COMMAND grep dlsym
                            OUTPUT_VARIABLE DLSYM_DATA)
            separate_arguments(DLSYM_DATA)
            if (${CMAKE_MAJOR_VERSION} GREATER 2 OR ${CMAKE_MINOR_VERSION} GREATER 4)
                cmake_policy(SET CMP0007 OLD)
            endif (${CMAKE_MAJOR_VERSION} GREATER 2 OR ${CMAKE_MINOR_VERSION} GREATER 4)
            list(GET DLSYM_DATA 4 KGTK_DLSYM_VERSION)
        endif(LIBDL_LIBRARY)
    else(LIBDLVSYM_LIBRARY)
        message("** INFORMATION: You're libdl does not contain dlvsym - SWT apps will not be supported")
    endif(LIBDLVSYM_LIBRARY)

    add_subdirectory(gtk2)
endif (NOT "${KGTK_GTK2}" MATCHES "false")

if (NOT "${KGTK_QT3}" MATCHES "false")
    add_subdirectory(qt3)
endif (NOT "${KGTK_QT3}" MATCHES "false")

install(PROGRAMS ${CMAKE_SOURCE_DIR}/kdialogd-wrapper DESTINATION bin)
install(PROGRAMS ${CMAKE_SOURCE_DIR}/kgtk-wrapper DESTINATION bin)

message("** INFORMATION: Using installation prefix: ${CMAKE_INSTALL_PREFIX}")
configure_file (config.h.cmake ${CMAKE_BINARY_DIR}/config.h)