File: 0005-Compute-BOOST_PYTHON_SUFFIX-based-on-Python-version-.patch

package info (click to toggle)
pytango 10.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,196 kB
  • sloc: python: 28,206; cpp: 16,380; sql: 255; sh: 82; makefile: 43
file content (29 lines) | stat: -rw-r--r-- 1,410 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From: Roland Mas <lolando@debian.org>
Date: Tue, 2 Jul 2024 13:59:29 +0200
Subject: Compute BOOST_PYTHON_SUFFIX based on Python version in use

---
 CMakeLists.txt | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Index: pytango/CMakeLists.txt
===================================================================
--- pytango.orig/CMakeLists.txt
+++ pytango/CMakeLists.txt
@@ -52,7 +52,15 @@ message(STATUS "     - include dir:  ${P
 if (DEFINED ENV{BOOST_PYTHON_SUFFIX})
     set(BOOST_PYTHON_SUFFIX "$ENV{BOOST_PYTHON_SUFFIX}" CACHE STRING "Sets the suffix on the Boost Python component to search for (default is 3). Set this only if your Boost version is < 1.73")
 else()
-    set(BOOST_PYTHON_SUFFIX "3" CACHE STRING "Sets the suffix on the Boost Python component to search for (default is 3). Set this only if your Boost version is < 1.73")
+    string(REPLACE "." ";" PYVERSION_LIST ${Python_VERSION})
+    list(GET PYVERSION_LIST 0 PYTHON_VERSION_MAJOR)
+    list(GET PYVERSION_LIST 1 PYTHON_VERSION_MINOR)
+
+    set(BOOST_PYTHON_SUFFIX
+    "${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}" CACHE STRING
+    "Sets the suffix on the Boost Python component to search for
+    (default is based on Python version found). Set this only if your
+    Boost version is < 1.73") 
 endif()
 set(Boost_VERBOSE "ON")
 find_package(Boost 1.71 REQUIRED COMPONENTS python${BOOST_PYTHON_SUFFIX} CONFIG)