From b7790ecf8c337faf3ee2f13fef42e98d7d8933d6 Mon Sep 17 00:00:00 2001
From: Marcel Loose <loose@astron.nl>
Date: Wed, 24 Jun 2009 14:42:40 +0000
Subject: [PATCH] Bug 1310: Some more CMakeLists.txt and macro files

---
 CEP/DP3/DPPP/include/DPPP/CMakeLists.txt      |  46 +++++++
 CEP/Imager/MWImager/CMakeLists.txt            |  52 ++++++++
 .../MWImager/include/MWImager/CMakeLists.txt  |  35 +++++
 CEP/Imager/MWImager/src/CMakeLists.txt        |  33 +++++
 CMake/FindPVSS.cmake                          | 124 ++++++++++++++++++
 MAC/GCF/PVSS/CMakeLists.txt                   |  53 ++++++++
 MAC/GCF/PVSS/include/GCF/PVSS/CMakeLists.txt  |  50 +++++++
 MAC/GCF/PVSS/src/CMakeLists.txt               |  44 +++++++
 8 files changed, 437 insertions(+)
 create mode 100644 CEP/DP3/DPPP/include/DPPP/CMakeLists.txt
 create mode 100644 CEP/Imager/MWImager/CMakeLists.txt
 create mode 100644 CEP/Imager/MWImager/include/MWImager/CMakeLists.txt
 create mode 100644 CEP/Imager/MWImager/src/CMakeLists.txt
 create mode 100644 CMake/FindPVSS.cmake
 create mode 100644 MAC/GCF/PVSS/CMakeLists.txt
 create mode 100644 MAC/GCF/PVSS/include/GCF/PVSS/CMakeLists.txt
 create mode 100644 MAC/GCF/PVSS/src/CMakeLists.txt

diff --git a/CEP/DP3/DPPP/include/DPPP/CMakeLists.txt b/CEP/DP3/DPPP/include/DPPP/CMakeLists.txt
new file mode 100644
index 00000000000..2b29af08787
--- /dev/null
+++ b/CEP/DP3/DPPP/include/DPPP/CMakeLists.txt
@@ -0,0 +1,46 @@
+#  $Id$
+#
+#  Copyright (C) 2008-2009
+#  ASTRON (Netherlands Foundation for Research in Astronomy)
+#  P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl
+#
+#  This program 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 2 of the License, or
+#  (at your option) any later version.
+#
+#  This program 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 this program; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+# List of header files that will be installed.
+set(inst_HEADERS
+  Package__Version.h
+  FlaggerStatistics.h
+  MsInfo.h
+  MsFile.h
+  ComplexMedianFlagger.h
+  FrequencyFlagger.h
+  ComplexMedianFlagger2.h
+  MADFlagger.h
+  BandpassCorrector.h
+  DataSquasher.h
+  DataBuffer.h
+  RunDetails.h
+  Pipeline.h)
+
+# Create symbolic link to include directory.
+execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink 
+  ${CMAKE_CURRENT_SOURCE_DIR}
+  ${CMAKE_BINARY_DIR}/include/${PROJECT_NAME})
+
+# Install header files.
+install(FILES ${inst_HEADERS} DESTINATION include/${PROJECT_NAME})
+
+set(${PROJECT_NAME}_INCLUDE_PATH_SUFFIX ${PROJECT_NAME} 
+  CACHE INTERNAL "Include path suffix for package \"${PROJECT_NAME}\"")
diff --git a/CEP/Imager/MWImager/CMakeLists.txt b/CEP/Imager/MWImager/CMakeLists.txt
new file mode 100644
index 00000000000..38c72fdaf96
--- /dev/null
+++ b/CEP/Imager/MWImager/CMakeLists.txt
@@ -0,0 +1,52 @@
+#  $Id$
+#
+#  Copyright (C) 2008-2009
+#  ASTRON (Netherlands Foundation for Research in Astronomy)
+#  P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl
+#
+#  This program 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 2 of the License, or
+#  (at your option) any later version.
+#
+#  This program 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 this program; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+cmake_minimum_required(VERSION 2.6)
+
+## ---------------------------------------------------------------------------
+## Preamble: set compilers
+## ---------------------------------------------------------------------------
+include(LofarInit)
+
+## ---------------------------------------------------------------------------
+## Project characteristics
+## ---------------------------------------------------------------------------
+project(MWImager)
+include(LofarGeneral)
+
+include(LofarAddPackage)
+lofar_add_package(${PROJECT_NAME} 0.1 DEPENDS Common MWCommon)
+
+## ---------------------------------------------------------------------------
+## External packages
+## ---------------------------------------------------------------------------
+include(LofarFindPackage)
+
+## ---------------------------------------------------------------------------
+## Generate configuration header file.
+## ---------------------------------------------------------------------------
+include(LofarConfig)
+
+## ---------------------------------------------------------------------------
+## Subdirectories
+## ---------------------------------------------------------------------------
+add_subdirectory(include/MWImager)
+add_subdirectory(src)
+add_subdirectory(test)
diff --git a/CEP/Imager/MWImager/include/MWImager/CMakeLists.txt b/CEP/Imager/MWImager/include/MWImager/CMakeLists.txt
new file mode 100644
index 00000000000..028ca6fd56d
--- /dev/null
+++ b/CEP/Imager/MWImager/include/MWImager/CMakeLists.txt
@@ -0,0 +1,35 @@
+#  $Id$
+#
+#  Copyright (C) 2008-2009
+#  ASTRON (Netherlands Foundation for Research in Astronomy)
+#  P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl
+#
+#  This program 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 2 of the License, or
+#  (at your option) any later version.
+#
+#  This program 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 this program; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+# List of header files that will be installed.
+set(inst_HEADERS
+  Package__Version.h
+  ConvertParset.h)
+
+# Create symbolic link to include directory.
+execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink 
+  ${CMAKE_CURRENT_SOURCE_DIR}
+  ${CMAKE_BINARY_DIR}/include/${PROJECT_NAME})
+
+# Install header files.
+install(FILES ${inst_HEADERS} DESTINATION include/${PROJECT_NAME})
+
+set(${PROJECT_NAME}_INCLUDE_PATH_SUFFIX ${PROJECT_NAME} 
+  CACHE INTERNAL "Include path suffix for package \"${PROJECT_NAME}\"")
diff --git a/CEP/Imager/MWImager/src/CMakeLists.txt b/CEP/Imager/MWImager/src/CMakeLists.txt
new file mode 100644
index 00000000000..0a74ca8acb1
--- /dev/null
+++ b/CEP/Imager/MWImager/src/CMakeLists.txt
@@ -0,0 +1,33 @@
+#  $Id$
+#
+#  Copyright (C) 2008-2009
+#  ASTRON (Netherlands Foundation for Research in Astronomy)
+#  P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl
+#
+#  This program 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 2 of the License, or
+#  (at your option) any later version.
+#
+#  This program 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 this program; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+include(LofarPackageVersion)
+
+lofar_add_library(mwimager
+  Package__Version.cc
+  ConvertParset.cc)
+
+lofar_add_bin_program(versionmwimager versionmwimager.cc)
+lofar_add_bin_program(convertimagerparset convertimagerparset.cc)
+
+install(PROGRAMS
+  mwimager
+  mwimager-part
+  DESTINATION bin)
diff --git a/CMake/FindPVSS.cmake b/CMake/FindPVSS.cmake
new file mode 100644
index 00000000000..25dacd61c6a
--- /dev/null
+++ b/CMake/FindPVSS.cmake
@@ -0,0 +1,124 @@
+# $Id$
+#
+# Copyright (C) 2008-2009
+# ASTRON (Netherlands Foundation for Research in Astronomy)
+# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl
+#
+# This program 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 2 of the License, or
+# (at your option) any later version.
+#
+# This program 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 this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+# Try to find PVSS (Prozessvisualisierungs- und Steuerungssystem)
+#
+# Variables defined by this module:
+#  
+#  PVSS_FOUND        - System has PVSS
+#  PVSS_DEFINITIONS  - Compiler definitions required for PVSS 
+#  PVSS_INCLUDE_DIR  - "Top-level" PVSS include directory (cached)
+#  PVSS_INCLUDE_DIRS - List of PVSS include directories
+#  PVSS_LIBRARY_DIR  - PVSS library directory (cached)
+#  PVSS_LIBRARIES    - List of all PVSS libraries
+
+# Compiler definitions required for PVSS
+set(pvss_definitions
+  -D__UNIX
+  -D__PC
+  -DHAS_TEMPLATES=1 
+  -DBC_DESTRUCTOR 
+  -Dbcm_boolean_h 
+  -DOS_LINUX 
+  -DLINUX 
+  -DLINUX2 
+  -DDLLEXP_BASICS= 
+  -DDLLEXP_CONFIGS= 
+  -DDLLEXP_DATAPOINT= 
+  -DDLLEXP_MESSAGES= 
+  -DDLLEXP_MANAGER= 
+  -DDLLEXP_CTRL=)
+  
+# Define PVSS include directories, relative to top-level include directory.
+set(pvss_include_dirs 
+  Basics/DpBasics 
+  Basics/Variables 
+  Basics/Utilities 
+  Basics/NoPosix 
+  BCMNew 
+  Configs 
+  Datapoint 
+  Messages 
+  Manager)
+
+# Define PVSS libraries.
+set(pvss_libraries 
+  Manager
+  Messages 
+  Datapoint 
+  Basics 
+  bcm)
+  
+if(NOT PVSS_FOUND)
+
+  # Get the PVSS version information. 
+  # Use hard-coded value if version information file cannot be found.
+  find_file(PVSS_VERSINFO_MK
+    NAMES VersInfo.mk
+    PATHS ENV PVSSHOME
+    PATH_SUFFIXES api)
+  if(NOT PVSS_VERSINFO_MK)
+    set(pvss_version "V37_304")
+  else()
+    file(STRINGS ${PVSS_VERSINFO_MK} match REGEX "^PVSS_VERSION_MAIN")
+    string(REGEX REPLACE "^.*= *([^ ]+)$" "\\1" pvss_version_main ${match})
+    file(STRINGS ${PVSS_VERSINFO_MK} match REGEX "^PVSS_VERSION_BUILD")
+    string(REGEX REPLACE "^.*= *([^ ]+)$" "\\1" pvss_version_build ${match})
+    set(pvss_version "V${pvss_version_main}_${pvss_version_build}")
+  endif(NOT PVSS_VERSINFO_MK)
+
+  # Search for the PVSS include directory
+  find_path(PVSS_INCLUDE_DIR
+    NAMES Basics/Utilities/Util.hxx
+    PATHS ENV PVSSHOME
+    PATH_SUFFIXES api/include)
+  set(PVSS_INCLUDE_DIRS ${PVSS_INCLUDE_DIR})
+  set(pvss_check_list PVSS_INCLUDE_DIR)
+  
+  # Search for the PVSS libraries
+  string(TOLOWER "${CMAKE_SYSTEM_NAME}" osname)
+  foreach(lib ${pvss_libraries})
+    find_library(PVSS_${lib}_LIBRARY
+      NAMES ${lib}${pvss_version}
+      PATHS ENV PVSSHOME
+      PATH_SUFFIXES api/lib.${osname})
+    list(APPEND pvss_check_list PVSS_${lib}_LIBRARY)
+  endforeach(lib Manager Messages Datapoint Basics bcm)
+
+  # Handle the QUIETLY and REQUIRED arguments and set PVSS_FOUND to TRUE if
+  # all elements of pvss_check_list are TRUE.
+  include(FindPackageHandleStandardArgs)
+  find_package_handle_standard_args(PVSS DEFAULT_MSG ${pvss_check_list})
+  
+  # Now it's time to fill the non-cached variables
+  set(PVSS_DEFINITIONS)
+  foreach(def ${pvss_definitions})
+    set(PVSS_DEFINITIONS "${PVSS_DEFINITIONS} ${def}")
+  endforeach(def ${pvss_definitions})
+  set(PVSS_INCLUDE_DIRS)
+  foreach(dir ${pvss_include_dirs})
+    list(APPEND PVSS_INCLUDE_DIRS ${PVSS_INCLUDE_DIR}/${dir})
+  endforeach(dir ${pvss_include_dirs})
+  set(PVSS_LIBRARIES)
+  foreach(lib ${pvss_libraries})
+    list(APPEND PVSS_LIBRARIES ${PVSS_${lib}_LIBRARY})
+  endforeach(lib ${pvss_libraries})
+   
+endif(NOT PVSS_FOUND)
diff --git a/MAC/GCF/PVSS/CMakeLists.txt b/MAC/GCF/PVSS/CMakeLists.txt
new file mode 100644
index 00000000000..cb79ba73afb
--- /dev/null
+++ b/MAC/GCF/PVSS/CMakeLists.txt
@@ -0,0 +1,53 @@
+#  $Id$
+#
+#  Copyright (C) 2008-2009
+#  ASTRON (Netherlands Foundation for Research in Astronomy)
+#  P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl
+#
+#  This program 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 2 of the License, or
+#  (at your option) any later version.
+#
+#  This program 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 this program; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+cmake_minimum_required(VERSION 2.6)
+
+## ---------------------------------------------------------------------------
+## Preamble: set compilers
+## ---------------------------------------------------------------------------
+include(LofarInit)
+
+## ---------------------------------------------------------------------------
+## Project characteristics
+## ---------------------------------------------------------------------------
+project(GCFPVSS)
+include(LofarGeneral)
+
+include(LofarAddPackage)
+lofar_add_package(${PROJECT_NAME} 1.0 DEPENDS Common GCFTM)
+
+## ---------------------------------------------------------------------------
+## External packages
+## ---------------------------------------------------------------------------
+include(LofarFindPackage)
+lofar_find_package(PVSS)# REQUIRED)
+
+## ---------------------------------------------------------------------------
+## Generate configuration header file.
+## ---------------------------------------------------------------------------
+include(LofarConfig)
+
+## ---------------------------------------------------------------------------
+## Subdirectories
+## ---------------------------------------------------------------------------
+add_subdirectory(include/GCF/PVSS)
+add_subdirectory(src)
+add_subdirectory(test)
diff --git a/MAC/GCF/PVSS/include/GCF/PVSS/CMakeLists.txt b/MAC/GCF/PVSS/include/GCF/PVSS/CMakeLists.txt
new file mode 100644
index 00000000000..6c78689fa51
--- /dev/null
+++ b/MAC/GCF/PVSS/include/GCF/PVSS/CMakeLists.txt
@@ -0,0 +1,50 @@
+#  $Id$
+#
+#  Copyright (C) 2008-2009
+#  ASTRON (Netherlands Foundation for Research in Astronomy)
+#  P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl
+#
+#  This program 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 2 of the License, or
+#  (at your option) any later version.
+#
+#  This program 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 this program; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+# List of header files that will be installed.
+set(inst_HEADERS
+  Package__Version.h
+  GCF_PValue.h
+  GCF_Defines.h
+  GCF_PVChar.h
+  GCF_PVBlob.h
+  GCF_PVBool.h
+  GCF_PVDateTime.h
+  GCF_PVDouble.h
+  GCF_PVDynArr.h
+  GCF_PVInteger.h
+  GCF_PVString.h
+  GCF_PVTypes.h
+  GCF_PVUnsigned.h
+  PVSSinfo.h
+  PVSSresponse.h
+  PVSSresult.h
+  PVSSservice.h)
+
+# Create symbolic link to include directory.
+execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink 
+  ${CMAKE_CURRENT_SOURCE_DIR}
+  ${CMAKE_BINARY_DIR}/include/GCF/PVSS)
+
+# Install header files.
+install(FILES ${inst_HEADERS} DESTINATION include/GCF/PVSS)
+
+set(${PROJECT_NAME}_INCLUDE_PATH_SUFFIX GCF/PVSS
+  CACHE INTERNAL "Include path suffix for package \"${PROJECT_NAME}\"")
diff --git a/MAC/GCF/PVSS/src/CMakeLists.txt b/MAC/GCF/PVSS/src/CMakeLists.txt
new file mode 100644
index 00000000000..652c6ff5163
--- /dev/null
+++ b/MAC/GCF/PVSS/src/CMakeLists.txt
@@ -0,0 +1,44 @@
+#  $Id$
+#
+#  Copyright (C) 2008-2009
+#  ASTRON (Netherlands Foundation for Research in Astronomy)
+#  P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl
+#
+#  This program 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 2 of the License, or
+#  (at your option) any later version.
+#
+#  This program 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 this program; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+include(LofarPackageVersion)
+
+# Extra preprocessor definitions
+add_definitions("-DUSES_NEW_IOSTREAMS -DLOFARLOGGER_SUBPACKAGE=\"PVSS\"")
+
+lofar_add_library(gcfpvss
+  Package__Version.cc
+  GCF_PValue.cc
+  GCF_PVChar.cc
+  GCF_PVBool.cc
+  GCF_PVDateTime.cc
+  GCF_PVDouble.cc
+  GCF_PVString.cc
+  GCF_PVInteger.cc
+  GCF_PVUnsigned.cc
+  GCF_PVDynArr.cc
+  GCF_PVBlob.cc
+  GSA_SCADAHandler.cc
+  GSA_PvssApi.cc
+  GSA_Resources.cc
+  PVSSinfo.cc
+  PVSSservice.cc)
+
+lofar_add_bin_program(versiongcfpvss versiongcfpvss.cc)
-- 
GitLab