RazorAutostartEntry => LxQt::AutostartEntry
[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     razorsettings.h
13     xfitman.h
14     razorplugininfo.h
15     powermanager.h
16     addplugindialog/addplugindialog.h
17     screensaver.h
18     lxqtapplication.h
19     libtranslate.h
20     programfinder.h
21
22     configdialog/configdialog.h
23     configdialog/pageselectwidget.h
24
25     lxqtpower/lxqtpower.h
26     razornotification.h
27     lxqtautostartentry.h
28     translatorsinfo/translatorsinfo.h
29     razorgridlayout.h
30     rotatedwidget.h
31 )
32
33 set(PUB_LINKS
34
35     aboutdialog/LxQtAboutDialog
36 )
37
38 set(PRIV_HDRS
39     aboutdialog/lxqtaboutdialog_p.h
40     aboutdialog/technicalinfo.h
41 )
42
43 set(SRCS
44     aboutdialog/lxqtaboutdialog.cpp
45     aboutdialog/technicalinfo.cpp
46     xfitman.cpp
47     razorplugininfo.cpp
48     powermanager.cpp
49     addplugindialog/addplugindialog.cpp
50     razorsettings.cpp
51     screensaver.cpp
52     lxqtapplication.cpp
53     programfinder.cpp
54
55     configdialog/configdialog.cpp
56     configdialog/pageselectwidget.cpp
57
58     lxqtpower/lxqtpower.cpp
59     lxqtpower/lxqtpowerproviders.cpp
60     razornotification.cpp
61     lxqtautostartentry.cpp
62     translatorsinfo/translatorsinfo.cpp
63     razorgridlayout.cpp
64     rotatedwidget.cpp
65 )
66
67 set(MOCS
68     aboutdialog/lxqtaboutdialog.h
69     aboutdialog/lxqtaboutdialog_p.h
70     powermanager.h
71     addplugindialog/addplugindialog.h
72     razorsettings.h
73     screensaver.h
74     lxqtapplication.h
75
76     configdialog/configdialog.h
77     configdialog/pageselectwidget.h
78
79     razornotification.h
80     razornotification_p.h
81     lxqtpower/lxqtpower.h
82     lxqtpower/lxqtpowerproviders.h
83     razorgridlayout.h
84     rotatedwidget.h
85 )
86
87 set(FORMS
88     aboutdialog/lxqtaboutdialog.ui
89
90     configdialog/configdialog.ui
91
92     addplugindialog/addplugindialog.ui
93 )
94
95
96 find_package(Qt4 REQUIRED QUIET)
97 include(${QT_USE_FILE})
98
99 QT4_ADD_DBUS_INTERFACE(SRCS
100     dbus/org.freedesktop.Notifications.xml
101     notifications_interface
102 )
103
104 find_package(X11 REQUIRED QUIET)
105
106 find_package(QTXDG REQUIRED QUIET)
107 include(${QTXDG_USE_FILE})
108
109
110 include_directories (
111     ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
112     ${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR} ${QT_QTDBUS_INCLUDE_DIR}
113     ${X11_INCLUDE_DIR}
114     ${CMAKE_SOURCE_DIR}/libraries
115 )
116
117 set(LXQT_VERSION ${LXQT_MAJOR_VERSION}.${LXQT_MINOR_VERSION}.${LXQT_PATCH_VERSION})
118
119 message(STATUS "")
120 message(STATUS "liblxqt version: ${LXQT_VERSION}")
121 message(STATUS "")
122
123
124 #************************************************
125 # Build config.cmake files
126 #************************************************
127 set(LXQT_SHARE_DIR ${CMAKE_INSTALL_PREFIX}/share/lxqt/)
128 include(cmake/FindInstallConfigPath.cmake)
129
130 set(LXQT_INCLUDE_DIR ${CMAKE_INSTALL_PREFIX}/include/lxqt)
131
132 configure_file(
133     ${CMAKE_CURRENT_SOURCE_DIR}/cmake/lxqt-config.cmake.in
134     ${CMAKE_CURRENT_BINARY_DIR}/lxqt-config.cmake
135     @ONLY
136 )
137 #************************************************
138 # End of build config.cmake
139 #************************************************
140 include_directories(${LXQT_INCLUDE_DIR})
141
142 set(APP_SHARE_DIR ${CMAKE_INSTALL_PREFIX}/share/liblxqrt)
143 add_definitions(-DTRANSLATIONS_DIR=\"${APP_SHARE_DIR}\")
144
145 # Translations **********************************
146 include(cmake/lxqt_use.cmake)
147 razor_translate_ts(QM_FILES
148     SOURCES
149         ${PUB_HDRS}
150         ${PRIV_HDRS}
151         ${SRCS}
152         ${MOCS}
153         ${FORMS}
154     INSTALLATION_DIR
155         ${APP_SHARE_DIR}
156 )
157
158 #************************************************
159
160
161 QT4_WRAP_CPP(MOCS ${MOCS})
162 QT4_WRAP_UI(UIS ${FORMS})
163
164 include(translatorsinfo/CMakeLists.txt)
165 get_translatorsinfo_qrc(translatorsinfo_qrc)
166 qt4_add_resources(QRC_CXX_SOURCES ${translatorsinfo_qrc})
167
168 add_library(lxqt
169     SHARED ${PUB_HDRS}
170            ${PRIV_HDRS}
171            ${SRCS}
172            ${dbus_generated}
173            ${UIS} ${MOCS}
174            ${QM_FILES}
175            ${QRC_CXX_SOURCES})
176
177 target_link_libraries(lxqt
178     ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY}
179     ${QT_QTDBUS_LIBRARY}
180     ${X11_X11_LIB}
181     qtxdg
182 )
183
184 set_target_properties(lxqt PROPERTIES
185     VERSION   ${LXQT_VERSION}
186     SOVERSION ${LXQT_MAJOR_VERSION}
187 )
188
189 install(TARGETS lxqt DESTINATION lib${LIB_SUFFIX})
190 install(FILES ${PUB_HDRS}  DESTINATION ${LXQT_INCLUDE_DIR})
191 install(FILES ${PUB_LINKS} DESTINATION ${LXQT_INCLUDE_DIR})
192
193 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lxqt-config.cmake DESTINATION share/cmake/lxqt)
194 install(FILES cmake/lxqt_use.cmake DESTINATION share/cmake/lxqt)
195
196 include(cmake/create_pkgconfig_file.cmake)
197 create_pkgconfig_file(lxqt "Shared library for LXQt applications")