Line 0
Link Here
|
|
|
1 |
From 934ec9add33d413e4d5c9cec1cb3ebb5cbfd81f4 Mon Sep 17 00:00:00 2001 |
2 |
From: Michael Palimaka <kensington@gentoo.org> |
3 |
Date: Thu, 19 Jun 2014 00:17:48 +1000 |
4 |
Subject: [PATCH] Fix detection of PYTHON_ABI-versioned Boost Python libraries |
5 |
wrt bug #400969. |
6 |
|
7 |
--- |
8 |
Modules/FindBoost.cmake | 41 +++++++++++++++++++++++++++++++++++++++++ |
9 |
1 file changed, 41 insertions(+) |
10 |
|
11 |
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake |
12 |
index dfd4460..70bfb4f 100644 |
13 |
--- a/Modules/FindBoost.cmake |
14 |
+++ b/Modules/FindBoost.cmake |
15 |
@@ -952,6 +952,15 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS}) |
16 |
set( _boost_docstring_release "Boost ${COMPONENT} library (release)") |
17 |
set( _boost_docstring_debug "Boost ${COMPONENT} library (debug)") |
18 |
|
19 |
+ if(${COMPONENT} STREQUAL "python" OR ${COMPONENT} STREQUAL "mpi_python") |
20 |
+ # Get version of Python. |
21 |
+ if (NOT PYTHON_EXECUTABLE) |
22 |
+ #if a certain version of python was detected by cmake before use that one |
23 |
+ set(PYTHON_EXECUTABLE "python") |
24 |
+ endif (NOT PYTHON_EXECUTABLE) |
25 |
+ execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c "import sys; sys.stdout.write('.'.join(str(x) for x in sys.version_info[:2]))" OUTPUT_VARIABLE _python_version) |
26 |
+ endif() |
27 |
+ |
28 |
# Compute component-specific hints. |
29 |
set(_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT "") |
30 |
if(${COMPONENT} STREQUAL "mpi" OR ${COMPONENT} STREQUAL "mpi_python" OR |
31 |
@@ -984,6 +993,15 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS}) |
32 |
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}-${Boost_LIB_VERSION} |
33 |
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG} |
34 |
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT} ) |
35 |
+ if(${COMPONENT} STREQUAL "python" OR ${COMPONENT} STREQUAL "mpi_python") |
36 |
+ list(APPEND _boost_RELEASE_NAMES |
37 |
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}-${Boost_LIB_VERSION} |
38 |
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG} |
39 |
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}-${Boost_LIB_VERSION} |
40 |
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG} |
41 |
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version} ) |
42 |
+ endif() |
43 |
+ |
44 |
if(_boost_STATIC_RUNTIME_WORKAROUND) |
45 |
set(_boost_RELEASE_STATIC_ABI_TAG "-s${_boost_RELEASE_ABI_TAG}") |
46 |
list(APPEND _boost_RELEASE_NAMES |
47 |
@@ -991,6 +1009,13 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS}) |
48 |
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} |
49 |
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}-${Boost_LIB_VERSION} |
50 |
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} ) |
51 |
+ if(${COMPONENT} STREQUAL "python" OR ${COMPONENT} STREQUAL "mpi_python") |
52 |
+ list(APPEND _boost_RELEASE_NAMES |
53 |
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}-${Boost_LIB_VERSION} |
54 |
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} |
55 |
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}-${Boost_LIB_VERSION} |
56 |
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} ) |
57 |
+ endif() |
58 |
endif() |
59 |
if(Boost_THREADAPI AND ${COMPONENT} STREQUAL "thread") |
60 |
_Boost_PREPEND_LIST_WITH_THREADAPI(_boost_RELEASE_NAMES ${_boost_RELEASE_NAMES}) |
61 |
@@ -1020,6 +1045,15 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS}) |
62 |
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG} |
63 |
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED} |
64 |
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT} ) |
65 |
+ if(${COMPONENT} STREQUAL "python" OR ${COMPONENT} STREQUAL "mpi_python") |
66 |
+ list(APPEND _boost_DEBUG_NAMES |
67 |
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}-${Boost_LIB_VERSION} |
68 |
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG} |
69 |
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}-${Boost_LIB_VERSION} |
70 |
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG} |
71 |
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_MULTITHREADED} |
72 |
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version} ) |
73 |
+ endif() |
74 |
if(_boost_STATIC_RUNTIME_WORKAROUND) |
75 |
set(_boost_DEBUG_STATIC_ABI_TAG "-s${_boost_DEBUG_ABI_TAG}") |
76 |
list(APPEND _boost_DEBUG_NAMES |
77 |
@@ -1027,6 +1061,13 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS}) |
78 |
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} |
79 |
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}-${Boost_LIB_VERSION} |
80 |
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} ) |
81 |
+ if(${COMPONENT} STREQUAL "python" OR ${COMPONENT} STREQUAL "mpi_python") |
82 |
+ list(APPEND _boost_DEBUG_NAMES |
83 |
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}-${Boost_LIB_VERSION} |
84 |
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} |
85 |
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}-${Boost_LIB_VERSION} |
86 |
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} ) |
87 |
+ endif() |
88 |
endif() |
89 |
if(Boost_THREADAPI AND ${COMPONENT} STREQUAL "thread") |
90 |
_Boost_PREPEND_LIST_WITH_THREADAPI(_boost_DEBUG_NAMES ${_boost_DEBUG_NAMES}) |
91 |
-- |
92 |
1.8.5.5 |
93 |
|