From ae9baa3aa93e2e8f22cc5d4fe15d485fc6dfc736 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rn=20K=C3=BCnsem=C3=B6ller?=
 <jkuensem@physik.uni-bielefeld.de>
Date: Fri, 8 Jun 2018 13:37:17 +0000
Subject: [PATCH] Task LSMR-8: Initial CMake integration

---
 .gitattributes                           |  7 ++++++
 CMake/LofarPackageList.cmake             |  5 +++--
 SAS/CMakeLists.txt                       |  1 +
 SAS/LSMR/CMakeLists.txt                  | 11 ++++++++++
 SAS/LSMR/bin/CMakeLists.txt              |  2 ++
 SAS/LSMR/bin/lsmr                        | 28 ++++++++++++++++++++++++
 SAS/LSMR/src/CMakeLists.txt              | 16 ++++++++++++++
 SAS/LSMR/src/lsmr/CMakeLists.txt         | 14 ++++++++++++
 SAS/LSMR/src/lsmr/lsmrapp/CMakeLists.txt | 14 ++++++++++++
 SAS/LSMR/test/CMakeLists.txt             |  0
 10 files changed, 96 insertions(+), 2 deletions(-)
 create mode 100644 SAS/LSMR/CMakeLists.txt
 create mode 100644 SAS/LSMR/bin/CMakeLists.txt
 create mode 100644 SAS/LSMR/bin/lsmr
 create mode 100644 SAS/LSMR/src/CMakeLists.txt
 create mode 100644 SAS/LSMR/src/lsmr/CMakeLists.txt
 create mode 100644 SAS/LSMR/src/lsmr/lsmrapp/CMakeLists.txt
 create mode 100644 SAS/LSMR/test/CMakeLists.txt

diff --git a/.gitattributes b/.gitattributes
index 438769bfc21..9225f153e54 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -4231,8 +4231,14 @@ SAS/Feedback_Service/src/Feedback.h -text
 SAS/Feedback_Service/src/FeedbackMain.cc -text
 SAS/Feedback_Service/src/FeedbackService.conf -text
 SAS/Feedback_Service/src/fb_data_44883.txt -text
+SAS/LSMR/CMakeLists.txt -text
+SAS/LSMR/bin/CMakeLists.txt -text
+SAS/LSMR/bin/lsmr -text
 SAS/LSMR/requirements.txt -text
+SAS/LSMR/src/CMakeLists.txt -text
+SAS/LSMR/src/lsmr/CMakeLists.txt -text
 SAS/LSMR/src/lsmr/__init__.py -text
+SAS/LSMR/src/lsmr/lsmrapp/CMakeLists.txt -text
 SAS/LSMR/src/lsmr/lsmrapp/__init__.py -text
 SAS/LSMR/src/lsmr/lsmrapp/admin.py -text
 SAS/LSMR/src/lsmr/lsmrapp/apps.py -text
@@ -4244,6 +4250,7 @@ SAS/LSMR/src/lsmr/settings.py -text
 SAS/LSMR/src/lsmr/urls.py -text
 SAS/LSMR/src/lsmr/wsgi.py -text
 SAS/LSMR/src/manage.py -text
+SAS/LSMR/test/CMakeLists.txt -text
 SAS/MoM/CMakeLists.txt -text
 SAS/MoM/MoMQueryService/CMakeLists.txt -text
 SAS/MoM/MoMQueryService/MoMQueryServiceClient/CMakeLists.txt -text
diff --git a/CMake/LofarPackageList.cmake b/CMake/LofarPackageList.cmake
index 3c531b6a1ad..ce394cfeda3 100644
--- a/CMake/LofarPackageList.cmake
+++ b/CMake/LofarPackageList.cmake
@@ -1,7 +1,7 @@
 # - Create for each LOFAR package a variable containing the absolute path to
 # its source directory. 
 #
-# Generated by gen_LofarPackageList_cmake.sh at ma 16 apr 2018 13:39:17 CEST
+# Generated by gen_LofarPackageList_cmake.sh at Fr 8. Jun 15:16:51 CEST 2018
 #
 #                      ---- DO NOT EDIT ----
 #
@@ -36,9 +36,9 @@ if(NOT DEFINED LOFAR_PACKAGE_LIST_INCLUDED)
   set(TestDynDPPP_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/DP3/TestDynDPPP)
   set(PythonDPPP_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/DP3/PythonDPPP)
   set(DPPP_AOFlag_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/DP3/DPPP_AOFlag)
-  set(DPPP_Interpolate_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/DP3/DPPP_Interpolate)
   set(SPW_Combine_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/DP3/SPWCombine)
   set(DPPP_DDECal_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/DP3/DPPP_DDECal)
+  set(DPPP_Interpolate_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/DP3/DPPP_Interpolate)
   set(LofarFT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/Imager/LofarFT)
   set(AWImager2_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/Imager/AWImager2)
   set(Laps-GRIDInterface_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/LAPS/GRIDInterface)
@@ -169,6 +169,7 @@ if(NOT DEFINED LOFAR_PACKAGE_LIST_INCLUDED)
   set(TriggerEmailService_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SAS/TriggerEmailService)
   set(SpecificationServices_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SAS/SpecificationServices)
   set(XSD_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SAS/XSD)
+  set(LSMR_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SAS/LSMR)
   set(DataManagementCommon_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SAS/DataManagement/DataManagementCommon)
   set(StorageQueryService_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SAS/DataManagement/StorageQueryService)
   set(Cleanup_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SAS/DataManagement/Cleanup)
diff --git a/SAS/CMakeLists.txt b/SAS/CMakeLists.txt
index bd958ea2d6b..45e7947ac5c 100644
--- a/SAS/CMakeLists.txt
+++ b/SAS/CMakeLists.txt
@@ -12,6 +12,7 @@ lofar_add_package(TriggerServices)
 lofar_add_package(TriggerEmailService)
 lofar_add_package(SpecificationServices)
 lofar_add_package(XSD)
+lofar_add_package(LSMR)
 
 add_subdirectory(MoM)
 add_subdirectory(ResourceAssignment)
diff --git a/SAS/LSMR/CMakeLists.txt b/SAS/LSMR/CMakeLists.txt
new file mode 100644
index 00000000000..2b0f10a1ae3
--- /dev/null
+++ b/SAS/LSMR/CMakeLists.txt
@@ -0,0 +1,11 @@
+
+
+lofar_package(LSMR 0.1)
+
+include(PythonInstall)
+
+add_subdirectory(src)
+add_subdirectory(bin)
+add_subdirectory(test)
+
+
diff --git a/SAS/LSMR/bin/CMakeLists.txt b/SAS/LSMR/bin/CMakeLists.txt
new file mode 100644
index 00000000000..41aa725cbbb
--- /dev/null
+++ b/SAS/LSMR/bin/CMakeLists.txt
@@ -0,0 +1,2 @@
+lofar_add_bin_scripts(lsmr)
+
diff --git a/SAS/LSMR/bin/lsmr b/SAS/LSMR/bin/lsmr
new file mode 100644
index 00000000000..570bb46a466
--- /dev/null
+++ b/SAS/LSMR/bin/lsmr
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+# Copyright (C) 2012-2015  ASTRON (Netherlands Institute for Radio Astronomy)
+# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
+#
+# This file is part of the LOFAR software suite.
+# The LOFAR software suite is free software: you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as published
+# by the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# The LOFAR software suite is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+
+
+# Startup script for the external trigger rest webservice
+
+echo "---"
+echo "! This is for testing only, properly deploy in Nginx or Apache for production use!"
+echo "---"
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+/usr/bin/python $DIR/../lib*/python3.4/site-packages/lofar/sas/lsmr/manage.py runserver 0.0.0.0:8000
+
diff --git a/SAS/LSMR/src/CMakeLists.txt b/SAS/LSMR/src/CMakeLists.txt
new file mode 100644
index 00000000000..59947a0ce3f
--- /dev/null
+++ b/SAS/LSMR/src/CMakeLists.txt
@@ -0,0 +1,16 @@
+lofar_find_package(PythonInterp 3.4 REQUIRED)
+include(PythonInstall)
+include(FindPythonModule)
+find_python_module(django REQUIRED)
+find_python_module(rest_framework REQUIRED)     # pip install djangorestframework
+find_python_module(ldap REQUIRED)
+
+set(_py_files
+    manage.py
+    urls.py
+    )
+
+python_install(${_py_files}
+    DESTINATION lofar/sas/lsmr)
+
+add_subdirectory(lsmr)
diff --git a/SAS/LSMR/src/lsmr/CMakeLists.txt b/SAS/LSMR/src/lsmr/CMakeLists.txt
new file mode 100644
index 00000000000..55ad4bf485a
--- /dev/null
+++ b/SAS/LSMR/src/lsmr/CMakeLists.txt
@@ -0,0 +1,14 @@
+
+include(PythonInstall)
+
+set(_py_files
+    __init__.py
+    settings.py
+    urls.py
+    wsgi.py
+    )
+
+python_install(${_py_files}
+    DESTINATION lofar/sas/lsmr/lsmr)
+
+add_subdirectory(lsmrapp)
diff --git a/SAS/LSMR/src/lsmr/lsmrapp/CMakeLists.txt b/SAS/LSMR/src/lsmr/lsmrapp/CMakeLists.txt
new file mode 100644
index 00000000000..e1c1088ec3d
--- /dev/null
+++ b/SAS/LSMR/src/lsmr/lsmrapp/CMakeLists.txt
@@ -0,0 +1,14 @@
+
+include(PythonInstall)
+
+set(_py_files
+    __init__.py
+    admin.py
+    apps.py
+    models.py
+    tests.py
+    views.py
+    )
+
+python_install(${_py_files}
+    DESTINATION lofar/sas/lsmr/lsmr/lsmrapp)
\ No newline at end of file
diff --git a/SAS/LSMR/test/CMakeLists.txt b/SAS/LSMR/test/CMakeLists.txt
new file mode 100644
index 00000000000..e69de29bb2d
-- 
GitLab