From 09e5d782a506e3bb3c9ad5a6a488ca9dfa75b307 Mon Sep 17 00:00:00 2001
From: Walter Van Herck <w.van.herck@fz-juelich.de>
Date: Wed, 21 Feb 2018 18:35:29 +0100
Subject: [PATCH] Set BORNAGAIN_USE_PYTHON3 to ON when python3 is the python
 found by cmake

---
 cmake/bornagain/modules/SearchInstalledSoftware.cmake | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/cmake/bornagain/modules/SearchInstalledSoftware.cmake b/cmake/bornagain/modules/SearchInstalledSoftware.cmake
index 77ae0193df4..80020599c42 100644
--- a/cmake/bornagain/modules/SearchInstalledSoftware.cmake
+++ b/cmake/bornagain/modules/SearchInstalledSoftware.cmake
@@ -60,6 +60,11 @@ if(BORNAGAIN_PYTHON OR BORNAGAIN_GUI)
     endif()
     message(STATUS "Found Python libraries version ${PYTHONLIBS_VERSION_STRING} at ${PYTHON_LIBRARIES}; includes at ${PYTHON_INCLUDE_DIRS}")
 
+    if(PYTHONLIBS_VERSION_STRING MATCHES "^3.*$")
+        set(BORNAGAIN_USE_PYTHON3 ON)
+        message(STATUS "Python 3 will be used. Setting BORNAGAIN_USE_PYTHON3 to ${BORNAGAIN_USE_PYTHON3}.")
+    endif()
+
     if(NOT WIN32)
         include(ValidatePythonInstallation)
         ValidatePythonInstallation()
-- 
GitLab