summaryrefslogtreecommitdiffstats
path: root/kweather/CMakeLists.txt
blob: b6185853e576fb30b102b88d0e71dbdd57310265 (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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
#################################################
#
#  (C) 2012 Golubev Alexander
#  fatzer2 (AT) gmail.com
#
#  Improvements and feedback are welcome
#
#  This file is released under GPL >= 2
#
#################################################

add_subdirectory( graphics )

include_directories(
  ${CMAKE_BINARY_DIR}
  ${CMAKE_CURRENT_BINARY_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR}
  ${TDE_INCLUDE_DIR}
  ${TQT_INCLUDE_DIRS}
)

link_directories(
  ${TQT_LIBRARY_DIRS}
)


##### kweatherreport (tdeinit) ##################

tde_add_tdeinit_executable( kweatherreport AUTOMOC
  SOURCES reportmain.cpp weatherservice.stub
    reportview.cpp
  LINK tdeui-shared tdehtml-shared
)


##### kweatherservice (executable) ##############

tde_add_executable( kweatherservice AUTOMOC
  SOURCES main.cpp weather_icon.cpp metar_parser.cpp
    weatherlib.cpp weatherservice.cpp
    weatherservice.skel stationdatabase.cpp
    sun.cpp weatherservice.stub
  LINK tdeio-shared
  DESTINATION ${BIN_INSTALL_DIR}
)


##### generate stations.dat and weather_stations.desktop

if( NOT PERL_EXECUTABLE )
  include( FindPerl )
endif( )

add_custom_command(
    OUTPUT stations.dat weather_stations.desktop
    COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/genstations.pl
        ${CMAKE_CURRENT_SOURCE_DIR}/data/nsd_cccc.txt
        ${CMAKE_CURRENT_SOURCE_DIR}/data/station_names.txt
        ${CMAKE_CURRENT_SOURCE_DIR}/weather_stations.desktop.in
    DEPENDS
        ${CMAKE_CURRENT_SOURCE_DIR}/genstations.pl
        ${CMAKE_CURRENT_SOURCE_DIR}/data/nsd_cccc.txt
        ${CMAKE_CURRENT_SOURCE_DIR}/data/station_names.txt
        ${CMAKE_CURRENT_SOURCE_DIR}/weather_stations.desktop.in
    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)


##### sun_test (test) ###########################
# FIXME: add correct test targets support
# 
# tde_add_executable( sun_test AUTOMOC
#   SOURCES sun_test.cpp sun.cpp
# )
# 
# add_test( NAME sun_test-test
#   COMMAND sun_test)
# 
# 
##### stationdatabase_test (test) ###############
# 
# tde_add_executable( stationdatabase_test AUTOMOC
#   SOURCES stationdatabase_test.cpp
#     stationdatabase.cpp
# )
# 
# add_test( NAME stationdatabase_test-test
#   COMMAND stationdatabase_test)
# 
# 
##### metar_parser_test (test) ##################
# 
# tde_add_executable( metar_parser_test AUTOMOC
#   SOURCES metar_parser_test.cpp metar_parser.cpp
#     weather_icon.cpp stationdatabase.cpp sun.cpp
# )
# 
# add_test( NAME metar_parser_test-test
#   COMMAND metar_parser_test)
# 

##### weather_panelapplet (kpart) ###############

tde_add_kpart( weather_panelapplet AUTOMOC
  SOURCES reportview.cpp kweather.cpp
    dockwidget.cpp weatherIface.skel
    weatherservice.stub weatherbutton.cpp
  LINK tdehtml-shared
  DESTINATION ${PLUGIN_INSTALL_DIR}
)


##### kcm_weather (kpart) #######################

tde_add_kpart( kcm_weather AUTOMOC
  SOURCES kcmweather.cpp prefdialogdata.ui
    weatherservice.stub
  LINK tdeio-shared
  DESTINATION ${PLUGIN_INSTALL_DIR}
)


##### kcm_weatherservice (kpart) ################

tde_add_kpart( kcm_weatherservice AUTOMOC
  SOURCES kcmweatherservice.cpp
    serviceconfigwidget.cpp serviceconfigdata.ui
    weatherservice.stub
  LINK tdeui-shared tdehtml-shared
  DESTINATION ${PLUGIN_INSTALL_DIR}
)

##### weather_sidebar (kpart) ####################
if( BUILD_KONQ_KWEATHER )
  tde_import( konqueror )
  tde_add_kpart( weather_sidebar AUTOMOC
    SOURCES sidebarwidget.cpp dockwidget.cpp
      weatherbar.cpp weatherbar.skel
      weatherbutton.cpp weatherservice.stub
    LINK tdeio-shared konqsidebarplugin-shared tdeutils-shared
    DESTINATION ${PLUGIN_INSTALL_DIR}
  )
endif( )


##### icons #####################################

tde_install_icons( kweather )


##### other data ################################

tde_create_translated_desktop(
  SOURCE ${CMAKE_CURRENT_BINARY_DIR}/weather_stations.desktop
  KEYWORDS name
  DESTINATION ${DATA_INSTALL_DIR}/kweatherservice
  PO_DIR kweather-stations
)

install(
  FILES ${CMAKE_CURRENT_BINARY_DIR}/stations.dat
  DESTINATION ${DATA_INSTALL_DIR}/kweatherservice
)

tde_create_translated_desktop(
  SOURCE kweather.desktop
  DESTINATION ${DATA_INSTALL_DIR}/kicker/applets
  PO_DIR kweather-desktops
)

tde_create_translated_desktop(
  SOURCE
    kweatherservice.desktop
    kcmweather.desktop
    kcmweatherservice.desktop
  DESTINATION ${SERVICES_INSTALL_DIR}
  PO_DIR kweather-desktops
)

if( BUILD_KONQ_KWEATHER )
  tde_create_translated_desktop(
    SOURCE weatherbar.desktop
    DESTINATION ${DATA_INSTALL_DIR}/konqsidebartng/entries
    PO_DIR kweather-desktops
  )

  tde_create_translated_desktop(
    SOURCE weatherbar_add.desktop
    DESTINATION ${DATA_INSTALL_DIR}/konqsidebartng/add
    PO_DIR kweather-desktops
  )
endif( )