summaryrefslogtreecommitdiffstats
path: root/qt4/CMakeLists.txt
blob: 3f8dadbd44927395d6a79a864991e78444caa2e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
find_package(Qt4)

if (QT4_FOUND)
    message("** INFORMATION: Qt4 LD_PRELOAD library will be built.")
    # set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" )
    set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}"  CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is /lib${LIB_SUFFIX})" FORCE)

    ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/mangled.h
                    COMMAND ${CMAKE_SOURCE_DIR}/mangled.sh ${CMAKE_CXX_COMPILER} ${CMAKE_CURRENT_BINARY_DIR}/mangled.h)

    include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}/common ${CMAKE_BINARY_DIR} ${QT_INCLUDE_DIR})
    set(kqt4_SRCS kqt4.cpp mangled.h)
    add_definitions(${QT_DEFINITIONS} -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT)
    add_library(kqt4 SHARED ${kqt4_SRCS})
    target_link_libraries(kqt4 ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY} -lc -ldl)
    install(TARGETS kqt4 LIBRARY DESTINATION ${LIB_INSTALL_DIR}/kgtk)

    configure_file (kqt4-wrapper.cmake ${CMAKE_CURRENT_BINARY_DIR}/kqt4-wrapper @ONLY)
    install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/kqt4-wrapper DESTINATION bin)
else (QT4_FOUND)
    message("** ERROR      : Could not locate Qt4 headers, Qt4 LD_PRELOAD library will not be built.")
endif (QT4_FOUND)