summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
blob: 13cbeff73bef27d16fa8f6a63c6f59a8e9fbca9d (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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#################################################
#
#  (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-1-tqt )


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

cmake_minimum_required( VERSION 3.1 )

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

include( TDEMacros )


##### optional stuff

option( WITH_ALL_OPTIONS "Enable all optional support" OFF )
option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} )


##### configure checks ##########################

include( ConfigureChecks.cmake )


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

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


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

install( FILES
    tqdbuserror.h tqdbusmessage.h tqdbusconnection.h
    tqdbusvariant.h tqdbusobject.h tqdbusproxy.h
    tqdbusmacros.h tqdbusdata.h tqdbusdatalist.h
    tqdbusdatamap.h tqdbusobjectpath.h tqdbusunixfd.h
    tqdbusdataconverter.h
  DESTINATION ${INCLUDE_INSTALL_DIR} )


##### install other data ########################

##### 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} )
configure_file( dbus-1-tqt.pc.cmake dbus-1-tqt.pc @ONLY )
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/dbus-1-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(
  -DDBUS_COMPILATION
  -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-1-tqt (shared) #########################

tde_add_library( dbus-1-tqt SHARED AUTOMOC
  SOURCES ${dbus_tqt_MOCS}
    tqdbusconnection.cpp tqdbuserror.cpp tqdbusintegrator.cpp
    tqdbusmarshall.cpp tqdbusmessage.cpp tqdbusserver.cpp
    tqdbusproxy.cpp tqdbusdata.cpp tqdbusdatalist.cpp
    tqdbusobjectpath.cpp tqdbusunixfd.cpp
    tqdbusdataconverter.cpp
  VERSION 0.0.0
  LINK ${TQT_LIBRARIES} ${DBUS_LIBRARIES}
  DESTINATION ${LIB_INSTALL_DIR}
)


##### dbusxml2qt3 (executable) ##################

tde_add_executable( dbusxml2qt3
  SOURCES
    tools/dbusxml2qt3/classgen.cpp
    tools/dbusxml2qt3/main.cpp
    tools/dbusxml2qt3/methodgen.cpp
  LINK ${TQT_LIBRARIES}
  DESTINATION ${BIN_INSTALL_DIR}
)