1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-26 21:06:38 +02:00

python: use built-in CMake FindPython module from CMake 3.12 or higher

This commit is contained in:
Albert Lee
2025-05-19 04:47:57 +00:00
committed by Sébastien Helleu
parent 3f670d31fe
commit f07d439cec
3 changed files with 10 additions and 38 deletions
+6 -2
View File
@@ -122,8 +122,12 @@ else()
endif()
if(ENABLE_SCRIPTS AND ENABLE_PYTHON)
find_package(Python)
if(PYTHON_FOUND)
if(CMAKE_VERSION VERSION_LESS "3.18.0")
find_package(Python 3.0 COMPONENTS Development)
else()
find_package(Python 3.0 COMPONENTS Development.Embed)
endif()
if(Python_FOUND)
add_subdirectory(python)
else()
message(SEND_ERROR "Python not found")
+4 -2
View File
@@ -23,8 +23,10 @@ add_library(python MODULE
)
set_target_properties(python PROPERTIES PREFIX "")
if(PYTHON_FOUND)
target_link_libraries(python PkgConfig::PYTHON weechat_plugins_scripts coverage_config)
if(Python_FOUND)
include_directories(${Python_INCLUDE_DIRS})
add_definitions(${Python_DEFINITIONS})
target_link_libraries(python ${Python_LIBRARIES} weechat_plugins_scripts coverage_config)
endif()
install(TARGETS python LIBRARY DESTINATION "${WEECHAT_LIBDIR}/plugins")