summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
blob: 8d4b8bda46d4f5194a1218eab8f4a6309c89fded (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#################################################
#
#  (C) 2010-2011 Serghei Amelian
#  serghei (DOT) amelian (AT) gmail.com
#
#  Improvements and feedback are welcome
#
#  This file is released under GPL >= 2
#
#################################################

project( dbus-tqt-1 )
set( VERSION R14.0.8 )


##### cmake setup ###############################

cmake_minimum_required( VERSION 2.8 )

include( FindPkgConfig )
include( CheckCXXSourceCompiles )
include( CheckSymbolExists )

set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
include( TDEMacros )
include( ConfigureChecks.cmake )


##### install paths setup #######################

tde_setup_install_path( EXEC_INSTALL_PREFIX   "${CMAKE_INSTALL_PREFIX}" )
tde_setup_install_path( LIB_INSTALL_DIR       "${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX}" )
tde_setup_install_path( INCLUDE_INSTALL_DIR   "${CMAKE_INSTALL_PREFIX}/include" )
tde_setup_install_path( PKGCONFIG_INSTALL_DIR "${LIB_INSTALL_DIR}/pkgconfig" )


##### install headers ###########################

install( FILES
    dbus-qt.h message.h connection.h server.h
  DESTINATION ${INCLUDE_INSTALL_DIR}/dbus-1.0/dbus )


##### write pkgconfig file ######################

string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_EXEC_PREFIX ${EXEC_INSTALL_PREFIX} )
string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_INCLUDE_DIR ${INCLUDE_INSTALL_DIR} )
string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_LIB_DIR ${LIB_INSTALL_DIR} )

foreach( _lib ${PROJECT_NAME} ${DBUS_LIBRARIES} )
  set( PC_LIBRARIES "${PC_LIBRARIES} -l${_lib}" )
endforeach( )

configure_file( dbus-tqt.pc.cmake dbus-tqt.pc @ONLY )
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/dbus-tqt.pc DESTINATION ${PKGCONFIG_INSTALL_DIR} )


##### build setup ###############################

set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include tqt.h" )
set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )

add_definitions(
  -DQT_THREAD_SUPPORT
  ${TQT_CFLAGS_OTHER}
)

include_directories(
  ${CMAKE_CURRENT_BINARY_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR}
  ${TQT_INCLUDE_DIRS}
  ${DBUS_INCLUDE_DIRS}
)

link_directories(
  ${TQT_LIBRARY_DIRS}
)


##### dbus-tqt-1 (shared) #########################

tde_add_library( dbus-tqt-1 SHARED AUTOMOC
  SOURCES
    dbus-qthread.cpp message.cpp connection.cpp
    integrator.cpp server.cpp
  VERSION 0.0.0
  LINK ${TQT_LIBRARIES} ${DBUS_LIBRARIES}
  DESTINATION ${LIB_INSTALL_DIR}
)