Skip to content

Commit 71932e9

Browse files
committed
Merge remote-tracking branch 'origin/topic/dnthayer/ticket1734'
* origin/topic/dnthayer/ticket1734: Fix FindPythonDev.cmake for systems with Python 3 BIT-1734 #merged
2 parents 39510b5 + d58a72d commit 71932e9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

FindPythonDev.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@
2222

2323
include(FindPackageHandleStandardArgs)
2424

25+
if (PYTHON_EXECUTABLE)
26+
# Get the real path so that we can reliably find the correct python-config
27+
# (e.g. some systems may have a "python" symlink, but not a "python-config"
28+
# symlink).
29+
get_filename_component(PYTHON_EXECUTABLE "${PYTHON_EXECUTABLE}" REALPATH)
30+
endif ()
31+
2532
if (PYTHON_EXECUTABLE AND EXISTS ${PYTHON_EXECUTABLE}-config)
2633
set(PYTHON_CONFIG ${PYTHON_EXECUTABLE}-config CACHE PATH "" FORCE)
2734
else ()
@@ -37,6 +44,8 @@ if (PYTHON_CONFIG AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
3744
OUTPUT_VARIABLE PYTHON_LIBRARIES
3845
OUTPUT_STRIP_TRAILING_WHITESPACE
3946
ERROR_QUIET)
47+
string(STRIP "${PYTHON_LIBRARIES}" PYTHON_LIBRARIES)
48+
4049
execute_process(COMMAND "${PYTHON_CONFIG}" --includes
4150
OUTPUT_VARIABLE PYTHON_INCLUDE_DIR
4251
OUTPUT_STRIP_TRAILING_WHITESPACE

0 commit comments

Comments
 (0)