@@ -73,29 +73,37 @@ if (LLDB_ENABLE_PYTHON)
73
73
endforeach ()
74
74
75
75
# For Python3.dll and Python3.zip deployment
76
- find_package (Python3 3.8 COMPONENTS Development )
76
+ find_package (Python3 3.8 COMPONENTS Interpreter Development )
77
77
78
78
if (NOT ${Python3_Development_FOUND} )
79
79
message (WARNING "PythonLibs (at least version 3.8) not found. qtcreatorcdbext will be built without Python support." )
80
80
return ()
81
81
endif ()
82
82
83
- set (PythonRegex "^(.*)/(.*)/(python([0-9]+))\. [a-z]+$" )
83
+
84
+ set (PythonNameWithVersion "${CMAKE_SHARED_LIBRARY_PREFIX} python${Python3_VERSION_MAJOR} .${Python3_VERSION_MINOR} " )
85
+ set (PythonVersion "${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR} " )
86
+ if (WIN32 )
87
+ set (PythonNameWithVersion "python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR} " )
88
+ endif ()
89
+
90
+ set (PythonRegex "^(.*)/(.*)/${PythonNameWithVersion} \. [a-z]+$" )
84
91
if (CMAKE_BUILD_TYPE STREQUAL "Debug" )
85
- set (PythonRegex "^(.*)/(.*)/(python([0-9]+)_d) \. [a-z]+$" )
92
+ set (PythonRegex "^(.*)/(.*)/${PythonNameWithVersion} _d \. [a-z]+$" )
86
93
endif ()
87
94
88
95
foreach (lib IN LISTS Python3_LIBRARIES )
89
96
if (lib MATCHES ${PythonRegex} )
90
97
if (CMAKE_BUILD_TYPE STREQUAL "Debug" )
91
- set (PythonZipFileName "python${CMAKE_MATCH_4 } _d.zip" )
98
+ set (PythonZipFileName "python${PythonVersion } _d.zip" )
92
99
else ()
93
- set (PythonZipFileName "python${CMAKE_MATCH_4 } .zip" )
100
+ set (PythonZipFileName "python${PythonVersion } .zip" )
94
101
endif ()
95
- set (PythonNameWithVersion "${CMAKE_MATCH_3} " )
96
102
97
- set (PythonDll "${CMAKE_MATCH_1} /${PythonNameWithVersion}${CMAKE_SHARED_LIBRARY_SUFFIX} " )
98
- set (PythonExe "${CMAKE_MATCH_1} /python${CMAKE_EXECUTABLE_SUFFIX} " )
103
+ set (PythonDll "${lib} " )
104
+ if (WIN32 )
105
+ set (PythonDll "${CMAKE_MATCH_1} /${PythonNameWithVersion}${CMAKE_SHARED_LIBRARY_SUFFIX} " )
106
+ endif ()
99
107
set (PythonZip "${CMAKE_MATCH_1} /${PythonZipFileName} " )
100
108
101
109
break ()
@@ -105,7 +113,7 @@ if (LLDB_ENABLE_PYTHON)
105
113
if (NOT EXISTS "${PythonZip} " AND
106
114
NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR} /${PythonZipFileName} " )
107
115
include (CreatePythonXY )
108
- create_python_xy ("${PythonExe } " "${CMAKE_CURRENT_BINARY_DIR} /${PythonZipFileName} " )
116
+ create_python_xy ("${Python3_EXECUTABLE} " " ${Python3_STDLIB } " "${CMAKE_CURRENT_BINARY_DIR} /${PythonZipFileName} " )
109
117
endif ()
110
118
111
119
if (NOT EXISTS "${PythonZip} " AND
0 commit comments