summaryrefslogtreecommitdiffstats
path: root/kweather/CMakeLists.txt
diff options
context:
space:
mode:
authorEmanoil Kotsev <deloptes@gmail.com>2021-01-07 16:29:35 +0100
committerSlávek Banko <slavek.banko@axis.cz>2021-01-24 18:44:16 +0100
commita387025180898c2a7578d81b2f06616675a9979d (patch)
treefec98bada9789a6c446230b4af45239335fae19a /kweather/CMakeLists.txt
parent7e6f57a63f70bc8650c0bd6cf6008ee0122b250b (diff)
downloadtdetoys-a387025180898c2a7578d81b2f06616675a9979d.tar.gz
tdetoys-a387025180898c2a7578d81b2f06616675a9979d.zip
kweather: Improve station list processing
+ Add a README file with information about the processing stations + Automatically generate stations.dat and weather_stations.desktop from data/nsd_cccc.txt before cmake checks + File downloaded from https://tgftp.nws.noaa.gov/data/nsd_cccc.txt + Clean up weather_stations.desktop.in and moved relevant information to data/station_names.txt + Added GG to EU and NU, PE to Canada + Mapped most of African countries to AF region + Mapped few other countries to their regions + Algeria is not in the ME region + Christmas Islands code is CX + Added Greenland to Atlantic + Added some more states to Oceania + Added some more states to Cenetral and South Americas + Antarctica as new region + Renamed Australiasia to Australia and Oceania + Region abbreviations in alphabetic order + Removed Atlantic and Mexico regions and added North America + Mapped most of the outstanding stations in Canada and elsewhere + J Leslie Turriff provided information on the stations in Canada Signed-off-by: Emanoil Kotsev <deloptes@gmail.com> Modify the generation of weather_stations.desktop so that it is possible to merge translations into a generated file. Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit f48efce5614763d16beeb150af1a4eb030148b38)
Diffstat (limited to 'kweather/CMakeLists.txt')
-rw-r--r--kweather/CMakeLists.txt20
1 files changed, 18 insertions, 2 deletions
diff --git a/kweather/CMakeLists.txt b/kweather/CMakeLists.txt
index 1be2418..075266b 100644
--- a/kweather/CMakeLists.txt
+++ b/kweather/CMakeLists.txt
@@ -45,6 +45,21 @@ tde_add_executable( kweatherservice AUTOMOC
)
+##### generate stations.dat and weather_stations.desktop
+
+if( NOT PERL_EXECUTABLE )
+ include( FindPerl )
+endif( )
+
+execute_process(
+ 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
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+)
+
+
##### sun_test (test) ###########################
# FIXME: add correct test targets support
#
@@ -118,13 +133,14 @@ tde_install_icons( kweather )
##### other data ################################
tde_create_translated_desktop(
- SOURCE weather_stations.desktop
+ SOURCE ${CMAKE_CURRENT_BINARY_DIR}/weather_stations.desktop
KEYWORDS name
DESTINATION ${DATA_INSTALL_DIR}/kweatherservice
PO_DIR kweather-stations
)
-install( FILES stations.dat
+install(
+ FILES ${CMAKE_CURRENT_BINARY_DIR}/stations.dat
DESTINATION ${DATA_INSTALL_DIR}/kweatherservice
)