From e54804a430384e39b761f048bee87f9abc18286f Mon Sep 17 00:00:00 2001
From: Dilawar Singh <dilawars@ncbs.res.in>
Date: Wed, 7 Mar 2018 10:20:35 +0530
Subject: [PATCH] PyMOOSE installation directory can work.

---
 CMakeLists.txt            | 12 ++++++------
 moose-core/CMakeLists.txt |  6 +++++-
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 05ad3854..804af8b5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,12 +26,12 @@ message( STATUS "Building version ${VERSION}" )
 message( STATUS "CMAKE_INSTALL_PREFIX= ${CMAKE_INSTALL_PREFIX}" )
 
 # Options to pass down to moose-core
-option(WITH_DOC "Build documentation" OFF)
-option(DEBUG "Build with DEBUG support" OFF)
-option(WITH_BOOST "Use Boost libraries instead of GSL" OFF)
-option(WITH_CUDA "Use CUDA/GPU" OFF)
-option(WITH_MPI "Use MPI (experimental)" OFF)
-option(WITH_GUI "Install moose-gui. Works only with python2." ON )
+option(WITH_DOC   "Build documentation"                         OFF)
+option(DEBUG      "Build with DEBUG support"                    OFF)
+option(WITH_BOOST "Use Boost libraries instead of GSL"          OFF)
+option(WITH_CUDA  "Use CUDA/GPU"                                OFF)
+option(WITH_MPI   "Use MPI (experimental)"                      OFF)
+option(WITH_GUI   "Install moose-gui. Works only with python2." ON )
 
 # Required packages.
 find_package(PythonInterp REQUIRED)
diff --git a/moose-core/CMakeLists.txt b/moose-core/CMakeLists.txt
index 349d580c..20588f7a 100644
--- a/moose-core/CMakeLists.txt
+++ b/moose-core/CMakeLists.txt
@@ -415,7 +415,11 @@ find_package(PythonInterp REQUIRED)
 if(NOT PYMOOSE_BDIST_DIR)
     set(PYMOOSE_BDIST_DIR ${CMAKE_BINARY_DIR}/bdist)
 endif( )
-set(PYMOOSE_BDIST_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/pymoose_bdist_install)
+
+# If no one hsa set the PYMOOSE bdist installation directory, use default.
+if(NOT PYMOOSE_BDIST_INSTALL_DIR)
+    set(PYMOOSE_BDIST_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/pymoose_bdist_install)
+endif()
 file(MAKE_DIRECTORY ${PYMOOSE_BDIST_INSTALL_DIR})
 
 # We need a custom name for bdist; same on all platform.
-- 
GitLab