diff --git a/MAC/APL/APLCommon/src/CMakeLists.txt b/MAC/APL/APLCommon/src/CMakeLists.txt
index b11fc3979a4e9c4490eb5f00db0443f41c7aaaf2..ce390872ff3fe7e5c0e06679724ed11000a44403 100644
--- a/MAC/APL/APLCommon/src/CMakeLists.txt
+++ b/MAC/APL/APLCommon/src/CMakeLists.txt
@@ -28,13 +28,6 @@ include(MACAddProtocol)
 mac_add_protocol(Controller_Protocol "${MACIO_SOURCE_DIR}/autogen")
 mac_add_protocol(StartDaemon_Protocol "${MACIO_SOURCE_DIR}/autogen")
 
-# Add current source directory to -I path. This is needed because APLCOMMON uses
-# angle brackets for internal header files, instead of quotes.
-#include_directories(${CMAKE_CURRENT_SOURCE_DIR})
-
-# Add the directory where the generated C++ headers are stored to the -I path.
-#include_directories(${CMAKE_BINARY_DIR}/include/MAC)
-
 lofar_add_library(aplcommon
   Package__Version.cc
   StartDaemon_Protocol.cc
diff --git a/MAC/APL/CEPCU/test/ApplController/CMakeLists.txt b/MAC/APL/CEPCU/test/ApplController/CMakeLists.txt
index 6050e71ee115d402f3d29f21a574dc2af4b238c9..02d94f91e5f7657b46a38ae80cc7b5f35be13a0a 100644
--- a/MAC/APL/CEPCU/test/ApplController/CMakeLists.txt
+++ b/MAC/APL/CEPCU/test/ApplController/CMakeLists.txt
@@ -20,9 +20,5 @@
 
 include(LofarCTest)
 
-# Add current binary directory to -I path, so that the generated C++ header
-# files can be found.
-#include_directories(${CMAKE_CURRENT_BINARY_DIR})
-
 lofar_add_test(APExample APExample.cc APCmdImpl.cc)
 lofar_add_test(APTest APTest.cc APCmdImpl.cc)
diff --git a/MAC/APL/CURTDBDaemons/CMakeLists.txt b/MAC/APL/CURTDBDaemons/CMakeLists.txt
index 87c3760f841f45d05f3a3991cc729735430a2970..e8ae8675906c7dccb6aa33822db1e3e888207b73 100644
--- a/MAC/APL/CURTDBDaemons/CMakeLists.txt
+++ b/MAC/APL/CURTDBDaemons/CMakeLists.txt
@@ -32,13 +32,14 @@ project(CURTDBDaemons)
 include(LofarGeneral)
 
 include(LofarAddPackage)
-lofar_add_package(${PROJECT_NAME} 1.0 DEPENDS APLCommon ApplCommon Common GCFPVSS GCFRTDB GCFTM MACIO OTDB RTDBCommon)
+lofar_add_package(${PROJECT_NAME} 1.0 DEPENDS Common ApplCommon MACIO GCFTM GCFRTDB RTDBCommon APLCommon OTDB)
 
 ## ---------------------------------------------------------------------------
 ## External packages
 ## ---------------------------------------------------------------------------
 include(LofarFindPackage)
 lofar_find_package(Boost REQUIRED COMPONENTS date_time)
+lofar_find_package(PQXX REQUIRED)
 
 ## ---------------------------------------------------------------------------
 ## Generate configuration header file.
diff --git a/MAC/APL/CURTDBDaemons/src/CMakeLists.txt b/MAC/APL/CURTDBDaemons/src/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..caa60dfb4e7d02c7f5ca51aec942f150e7689540
--- /dev/null
+++ b/MAC/APL/CURTDBDaemons/src/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
+
+include(LofarPackageVersion)
+
+# Create symbolic link in binary include directory to current directory.
+execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
+  ${CMAKE_CURRENT_SOURCE_DIR}
+  ${CMAKE_BINARY_DIR}/include/CURTDBDaemons)
+
+lofar_add_library(curtdbdaemons Package__Version.cc)
+
+lofar_add_bin_program(versioncurtdbdaemons versioncurtdbdaemons.cc)
+
+add_subdirectory(LogProcessor)
+add_subdirectory(KeyValueLogger)
+add_subdirectory(SASGateway)
+add_subdirectory(SoftwareMonitor)
diff --git a/MAC/APL/CURTDBDaemons/src/KeyValueLogger/CMakeLists.txt b/MAC/APL/CURTDBDaemons/src/KeyValueLogger/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..3ee2432047ad8592a6625f6bb6d0d05012a993e0
--- /dev/null
+++ b/MAC/APL/CURTDBDaemons/src/KeyValueLogger/CMakeLists.txt
@@ -0,0 +1,23 @@
+#  $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
+
+lofar_add_bin_program(KeyValueLogger KeyValueLoggerMain.cc KeyValueLogger.cc)
+
+install(FILES KeyValueLogger.conf DESTINATION etc)
diff --git a/MAC/APL/CURTDBDaemons/src/LogProcessor/CMakeLists.txt b/MAC/APL/CURTDBDaemons/src/LogProcessor/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..5cf21415676d4415f39739b49335e52bf681cbef
--- /dev/null
+++ b/MAC/APL/CURTDBDaemons/src/LogProcessor/CMakeLists.txt
@@ -0,0 +1,26 @@
+#  $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
+
+lofar_add_bin_program(LogProcessor LogProcessorMain.cc LogProcessor.cc)
+
+install(FILES 
+  LogProcessor.conf
+  LogProcessor.log_prop
+  DESTINATION etc)
diff --git a/MAC/APL/CURTDBDaemons/src/SASGateway/CMakeLists.txt b/MAC/APL/CURTDBDaemons/src/SASGateway/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..67b13efb1a7b160adeaa304ab2375cb4378c54d9
--- /dev/null
+++ b/MAC/APL/CURTDBDaemons/src/SASGateway/CMakeLists.txt
@@ -0,0 +1,23 @@
+#  $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
+
+lofar_add_bin_program(SASGateway SASGatewayMain.cc SASGateway.cc)
+
+install(FILES SASGateway.conf DESTINATION etc)
diff --git a/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/CMakeLists.txt b/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..a45bb084d6f001ab84238d2a027f2a201c344887
--- /dev/null
+++ b/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/CMakeLists.txt
@@ -0,0 +1,23 @@
+#  $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
+
+lofar_add_bin_program(SoftwareMonitor SoftwareMonitorMain.cc SoftwareMonitor.cc)
+
+install(FILES SoftwareMonitor.conf DESTINATION etc)
diff --git a/MAC/APL/CURTDBDaemons/test/CMakeLists.txt b/MAC/APL/CURTDBDaemons/test/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..6b80201ac44a17841b295565133a3d05364bb611
--- /dev/null
+++ b/MAC/APL/CURTDBDaemons/test/CMakeLists.txt
@@ -0,0 +1,24 @@
+#  $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(LofarCTest)
+
+lofar_add_test(tLoggingProcessor tLoggingProcessor.cc)
+#lofar_add_test(tKeyValueLogger tKeyValueLogger.cc)