From e3e7cde272eacd182853f147a9969d6a3dd5f7ff Mon Sep 17 00:00:00 2001
From: Marcel Loose <loose@astron.nl>
Date: Thu, 13 Jan 2011 08:47:21 +0000
Subject: [PATCH] Bug 1619: PythonInstall now defines PYTHON_BUILD_DIR, so it
 should be included early. Furthermore, PYTHON_BUILD_DIR and
 PYTHON_INSTALL_DIR must be FORCEd into the cache.

---
 CEP/pyparmdb/src/CMakeLists.txt       | 2 +-
 CMake/PythonInstall.cmake             | 4 ++--
 LCS/pyparameterset/src/CMakeLists.txt | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/CEP/pyparmdb/src/CMakeLists.txt b/CEP/pyparmdb/src/CMakeLists.txt
index 2bf2129dbd3..156c0273473 100644
--- a/CEP/pyparmdb/src/CMakeLists.txt
+++ b/CEP/pyparmdb/src/CMakeLists.txt
@@ -1,6 +1,7 @@
 # $Id$
 
 include(LofarPackageVersion)
+include(PythonInstall)
 
 # Add current build directory to the include path. This is needed, because
 # pyparmdb.cc #include's Package__Version.cc (yucky!).
@@ -24,5 +25,4 @@ lofar_add_library(lofar_pyparmdb Package__Version.cc)
 lofar_add_bin_program(versionpyparmdb versionpyparmdb.cc)
 
 # Install Python modules
-include(PythonInstall)
 python_install(__init__.py DESTINATION lofar/parmdb)
diff --git a/CMake/PythonInstall.cmake b/CMake/PythonInstall.cmake
index c3b71ff3875..f941a09ed1f 100644
--- a/CMake/PythonInstall.cmake
+++ b/CMake/PythonInstall.cmake
@@ -42,9 +42,9 @@ if(PYTHON_EXECUTABLE)
     message(FATAL_ERROR "Python command failed:\n${_pyerr}")
   endif(_pyerr)
   set(PYTHON_BUILD_DIR "${CMAKE_BINARY_DIR}/${_pydir}" CACHE PATH 
-    "Build directory for Python extensions")
+    "Build directory for Python extensions" FORCE)
   set(PYTHON_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${_pydir}" CACHE PATH 
-    "Installation directory for Python extensions")
+    "Installation directory for Python extensions" FORCE)
 endif(PYTHON_EXECUTABLE)
 
 
diff --git a/LCS/pyparameterset/src/CMakeLists.txt b/LCS/pyparameterset/src/CMakeLists.txt
index cd3fb2d26fb..a5085bcdd31 100644
--- a/LCS/pyparameterset/src/CMakeLists.txt
+++ b/LCS/pyparameterset/src/CMakeLists.txt
@@ -1,6 +1,7 @@
 # $Id$
 
 include(LofarPackageVersion)
+include(PythonInstall)
 
 # Add current build directory to the include path. This is needed, because
 # pyparameterset.cc #include's Package__Version.cc (yucky!).
@@ -24,5 +25,4 @@ lofar_add_library(lofar_pyparameterset Package__Version.cc)
 lofar_add_bin_program(versionpyparameterset versionpyparameterset.cc)
 
 # Install Python modules
-include(PythonInstall)
 python_install(__init__.py DESTINATION lofar/parameterset)
-- 
GitLab