All public files has lxqt prefix
[lxde/liblxqt.git] / CMakeLists.txt
1 cmake_minimum_required( VERSION 2.6 )
2
3 project(liblxqt)
4
5 set(LXQT_MAJOR_VERSION 0)
6 set(LXQT_MINOR_VERSION 5)
7 set(LXQT_PATCH_VERSION 0)
8
9
10 set(PUB_HDRS
11     aboutdialog/lxqtaboutdialog.h
12     lxqtsettings.h
13     lxqtxfitman.h
14     lxqtplugininfo.h
15     lxqtpowermanager.h
16     addplugindialog/lxqtaddplugindialog.h
17     lxqtscreensaver.h
18     lxqtapplication.h
19     lxqtlibtranslate.h
20     lxqtprogramfinder.h
21
22     configdialog/lxqtconfigdialog.h
23     configdialog/lxqtpageselectwidget.h
24
25     lxqtpower/lxqtpower.h
26     lxqtnotification.h
27     lxqtautostartentry.h
28     lxqtgridlayout.h
29     lxqtrotatedwidget.h
30 )
31
32 set(PUBLIC_CLASSES
33     LxQtAboutDialog
34     LxQtSettings
35     LxQtXfitMan
36     LxQtPluginInfo
37     LxQtPowerManager
38     LxQtAddPluginDialog
39     LxQtScreenSaver
40     LxQtApplication
41     LxQtLibTranslate
42     LxQtProgramFinder
43
44     LxQtConfigDialog
45     LxQtPageSelectWidget
46
47     LxQtPower
48     LxQtNotification
49     LxQtAutostartEntry
50     LxQtGridLayout
51     LxQtRotatedWidget
52 )
53
54 set(PRIV_HDRS
55     aboutdialog/lxqtaboutdialog_p.h
56     aboutdialog/technicalinfo.h
57     translatorsinfo/translatorsinfo.h
58 )
59
60 set(SRCS
61     aboutdialog/lxqtaboutdialog.cpp
62     aboutdialog/technicalinfo.cpp
63     lxqtxfitman.cpp
64     lxqtplugininfo.cpp
65     lxqtpowermanager.cpp
66     addplugindialog/lxqtaddplugindialog.cpp
67     lxqtsettings.cpp
68     lxqtscreensaver.cpp
69     lxqtapplication.cpp
70     lxqtprogramfinder.cpp
71
72     configdialog/lxqtconfigdialog.cpp
73     configdialog/lxqtpageselectwidget.cpp
74
75     lxqtpower/lxqtpower.cpp
76     lxqtpower/lxqtpowerproviders.cpp
77     lxqtnotification.cpp
78     lxqtautostartentry.cpp
79     translatorsinfo/translatorsinfo.cpp
80     lxqtgridlayout.cpp
81     lxqtrotatedwidget.cpp
82 )
83
84 set(MOCS
85     aboutdialog/lxqtaboutdialog.h
86     aboutdialog/lxqtaboutdialog_p.h
87     lxqtpowermanager.h
88     addplugindialog/lxqtaddplugindialog.h
89     lxqtsettings.h
90     lxqtscreensaver.h
91     lxqtapplication.h
92
93     configdialog/lxqtconfigdialog.h
94     configdialog/lxqtpageselectwidget.h
95
96     lxqtnotification.h
97     lxqtnotification_p.h
98     lxqtpower/lxqtpower.h
99     lxqtpower/lxqtpowerproviders.h
100     lxqtgridlayout.h
101     lxqtrotatedwidget.h
102 )
103
104 set(FORMS
105     aboutdialog/lxqtaboutdialog.ui
106
107     configdialog/lxqtconfigdialog.ui
108
109     addplugindialog/lxqtaddplugindialog.ui
110 )
111
112 # additional cmake files
113 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
114
115 find_package(Qt4 REQUIRED QUIET)
116 include(${QT_USE_FILE})
117
118 QT4_ADD_DBUS_INTERFACE(SRCS
119     dbus/org.freedesktop.Notifications.xml
120     notifications_interface
121 )
122
123 find_package(X11 REQUIRED QUIET)
124
125 find_package(QTXDG REQUIRED QUIET)
126 include(${QTXDG_USE_FILE})
127
128
129 include_directories (
130     ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
131     ${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR} ${QT_QTDBUS_INCLUDE_DIR}
132     ${X11_INCLUDE_DIR}
133     ${CMAKE_SOURCE_DIR}/libraries
134 )
135
136 set(LXQT_VERSION ${LXQT_MAJOR_VERSION}.${LXQT_MINOR_VERSION}.${LXQT_PATCH_VERSION})
137
138 message(STATUS "")
139 message(STATUS "liblxqt version: ${LXQT_VERSION}")
140 message(STATUS "")
141
142
143 #************************************************
144 # Build config.cmake files
145 #************************************************
146 set(LXQT_SHARE_DIR ${CMAKE_INSTALL_PREFIX}/share/lxqt/)
147 include(cmake/FindInstallConfigPath.cmake)
148
149 set(LXQT_INCLUDE_DIR ${CMAKE_INSTALL_PREFIX}/include/lxqt)
150
151 configure_file(
152     ${CMAKE_CURRENT_SOURCE_DIR}/cmake/lxqt-config.cmake.in
153     ${CMAKE_CURRENT_BINARY_DIR}/lxqt-config.cmake
154     @ONLY
155 )
156 #************************************************
157 # End of build config.cmake
158 #************************************************
159 include_directories(${LXQT_INCLUDE_DIR})
160
161 set(APP_SHARE_DIR ${CMAKE_INSTALL_PREFIX}/share/liblxqrt)
162 add_definitions(-DTRANSLATIONS_DIR=\"${APP_SHARE_DIR}\")
163
164 # Translations **********************************
165 include(cmake/lxqt_use.cmake)
166 razor_translate_ts(QM_FILES
167     SOURCES
168         ${PUB_HDRS}
169         ${PRIV_HDRS}
170         ${SRCS}
171         ${MOCS}
172         ${FORMS}
173     INSTALLATION_DIR
174         ${APP_SHARE_DIR}
175 )
176
177 #************************************************
178
179 # create the portable headers *******************
180 include(create_portable_headers)
181 create_portable_headers(PORTABLE_HEADERS ${PUBLIC_CLASSES})
182 #************************************************
183
184 QT4_WRAP_CPP(MOCS ${MOCS})
185 QT4_WRAP_UI(UIS ${FORMS})
186
187 include(translatorsinfo/CMakeLists.txt)
188 get_translatorsinfo_qrc(translatorsinfo_qrc)
189 qt4_add_resources(QRC_CXX_SOURCES ${translatorsinfo_qrc})
190
191 add_library(lxqt
192     SHARED ${PUB_HDRS}
193            ${PRIV_HDRS}
194            ${SRCS}
195            ${dbus_generated}
196            ${UIS} ${MOCS}
197            ${QM_FILES}
198            ${QRC_CXX_SOURCES})
199
200 target_link_libraries(lxqt
201     ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY}
202     ${QT_QTDBUS_LIBRARY}
203     ${X11_X11_LIB}
204     qtxdg
205 )
206
207 set_target_properties(lxqt PROPERTIES
208     VERSION   ${LXQT_VERSION}
209     SOVERSION ${LXQT_MAJOR_VERSION}
210 )
211
212 install(TARGETS lxqt DESTINATION lib${LIB_SUFFIX})
213 install(FILES ${PUB_HDRS}  DESTINATION ${LXQT_INCLUDE_DIR})
214 install(FILES ${PORTABLE_HEADERS} DESTINATION ${LXQT_INCLUDE_DIR})
215
216 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lxqt-config.cmake DESTINATION share/cmake/lxqt)
217 install(FILES cmake/lxqt_use.cmake DESTINATION share/cmake/lxqt)
218
219 include(cmake/create_pkgconfig_file.cmake)
220 create_pkgconfig_file(lxqt "Shared library for LXQt applications")