File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 22
22
23
23
include (FindPackageHandleStandardArgs )
24
24
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
+
25
32
if (PYTHON_EXECUTABLE AND EXISTS ${PYTHON_EXECUTABLE} -config )
26
33
set (PYTHON_CONFIG ${PYTHON_EXECUTABLE} -config CACHE PATH "" FORCE )
27
34
else ()
@@ -37,6 +44,8 @@ if (PYTHON_CONFIG AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
37
44
OUTPUT_VARIABLE PYTHON_LIBRARIES
38
45
OUTPUT_STRIP_TRAILING_WHITESPACE
39
46
ERROR_QUIET )
47
+ string (STRIP "${PYTHON_LIBRARIES} " PYTHON_LIBRARIES )
48
+
40
49
execute_process (COMMAND "${PYTHON_CONFIG} " --includes
41
50
OUTPUT_VARIABLE PYTHON_INCLUDE_DIR
42
51
OUTPUT_STRIP_TRAILING_WHITESPACE
You can’t perform that action at this time.
0 commit comments