diff --git a/CMake/gen_LofarPackageList_cmake.sh b/CMake/gen_LofarPackageList_cmake.sh
index 9636ef36def3bc0949461251d2782093f7910ff6..0a50e8cbf15e3e4c8d49e910bc82f7636d85b64b 100755
--- a/CMake/gen_LofarPackageList_cmake.sh
+++ b/CMake/gen_LofarPackageList_cmake.sh
@@ -28,13 +28,13 @@
 
 # Get the LOFAR source directory root
 script_dir=$(cd $(dirname $0) && pwd)
-lofar_root=$(echo $script_dir | sed -e "s|\(.*/LOFAR\)/.*|\1|")
+lofar_root=$script_dir/..
 
 # Just a safety net; this script must be inside the LOFAR tree.
-if test "$script_dir" = "$lofar_root"; then
-  echo "ERROR: $(basename $0) MUST be inside the LOFAR source tree!"
-  exit 1
-fi
+#if test "$script_dir" = "$lofar_root"; then
+#  echo "ERROR: $(basename $0) MUST be inside the LOFAR source tree!"
+#  exit 1
+#fi
 
 # Open the output file
 exec 3> $script_dir/LofarPackageList.cmake