forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cmake-3.0.0-FindBoost-python.patch
93 lines (89 loc) · 6.33 KB
/
cmake-3.0.0-FindBoost-python.patch
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
From 934ec9add33d413e4d5c9cec1cb3ebb5cbfd81f4 Mon Sep 17 00:00:00 2001
From: Michael Palimaka <[email protected]>
Date: Thu, 19 Jun 2014 00:17:48 +1000
Subject: [PATCH] Fix detection of PYTHON_ABI-versioned Boost Python libraries
wrt bug #400969.
---
Modules/FindBoost.cmake | 41 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index dfd4460..70bfb4f 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -952,6 +952,15 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
set( _boost_docstring_release "Boost ${COMPONENT} library (release)")
set( _boost_docstring_debug "Boost ${COMPONENT} library (debug)")
+ if(${COMPONENT} STREQUAL "python" OR ${COMPONENT} STREQUAL "mpi_python")
+ # Get version of Python.
+ if (NOT PYTHON_EXECUTABLE)
+ #if a certain version of python was detected by cmake before use that one
+ set(PYTHON_EXECUTABLE "python")
+ endif (NOT PYTHON_EXECUTABLE)
+ 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)
+ endif()
+
# Compute component-specific hints.
set(_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT "")
if(${COMPONENT} STREQUAL "mpi" OR ${COMPONENT} STREQUAL "mpi_python" OR
@@ -984,6 +993,15 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}-${Boost_LIB_VERSION}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT} )
+ if(${COMPONENT} STREQUAL "python" OR ${COMPONENT} STREQUAL "mpi_python")
+ list(APPEND _boost_RELEASE_NAMES
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version} )
+ endif()
+
if(_boost_STATIC_RUNTIME_WORKAROUND)
set(_boost_RELEASE_STATIC_ABI_TAG "-s${_boost_RELEASE_ABI_TAG}")
list(APPEND _boost_RELEASE_NAMES
@@ -991,6 +1009,13 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}-${Boost_LIB_VERSION}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} )
+ if(${COMPONENT} STREQUAL "python" OR ${COMPONENT} STREQUAL "mpi_python")
+ list(APPEND _boost_RELEASE_NAMES
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} )
+ endif()
endif()
if(Boost_THREADAPI AND ${COMPONENT} STREQUAL "thread")
_Boost_PREPEND_LIST_WITH_THREADAPI(_boost_RELEASE_NAMES ${_boost_RELEASE_NAMES})
@@ -1020,6 +1045,15 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT} )
+ if(${COMPONENT} STREQUAL "python" OR ${COMPONENT} STREQUAL "mpi_python")
+ list(APPEND _boost_DEBUG_NAMES
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_MULTITHREADED}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version} )
+ endif()
if(_boost_STATIC_RUNTIME_WORKAROUND)
set(_boost_DEBUG_STATIC_ABI_TAG "-s${_boost_DEBUG_ABI_TAG}")
list(APPEND _boost_DEBUG_NAMES
@@ -1027,6 +1061,13 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}-${Boost_LIB_VERSION}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} )
+ if(${COMPONENT} STREQUAL "python" OR ${COMPONENT} STREQUAL "mpi_python")
+ list(APPEND _boost_DEBUG_NAMES
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_python_version}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} )
+ endif()
endif()
if(Boost_THREADAPI AND ${COMPONENT} STREQUAL "thread")
_Boost_PREPEND_LIST_WITH_THREADAPI(_boost_DEBUG_NAMES ${_boost_DEBUG_NAMES})
--
1.8.5.5