mirror of
https://github.com/weechat/weechat.git
synced 2026-07-04 08:43:13 +02:00
cmake: plugins: simplify dependency handling
Move the requirement checks within the respective plugin cmakefile. Use REQUIRED instead of the manual FOUND check and error handling. Note: the tcl check was only moved, since using REQUIRED explodes in CI. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
This commit is contained in:
committed by
Sébastien Helleu
parent
440907e1cd
commit
a413d16038
@@ -19,16 +19,20 @@
|
||||
# along with WeeChat. If not, see <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
if(CMAKE_VERSION VERSION_LESS "3.18.0")
|
||||
find_package(Python 3.0 REQUIRED COMPONENTS Development)
|
||||
else()
|
||||
find_package(Python 3.0 REQUIRED COMPONENTS Development.Embed)
|
||||
endif()
|
||||
|
||||
add_library(python MODULE
|
||||
weechat-python.c weechat-python.h
|
||||
weechat-python-api.c weechat-python-api.h
|
||||
)
|
||||
set_target_properties(python PROPERTIES PREFIX "")
|
||||
|
||||
if(Python_FOUND)
|
||||
include_directories(${Python_INCLUDE_DIRS})
|
||||
add_definitions(${Python_DEFINITIONS})
|
||||
target_link_libraries(python ${Python_LIBRARIES} weechat_plugins_scripts coverage_config)
|
||||
endif()
|
||||
include_directories(${Python_INCLUDE_DIRS})
|
||||
add_definitions(${Python_DEFINITIONS})
|
||||
target_link_libraries(python ${Python_LIBRARIES} weechat_plugins_scripts coverage_config)
|
||||
|
||||
install(TARGETS python LIBRARY DESTINATION "${WEECHAT_LIBDIR}/plugins")
|
||||
|
||||
Reference in New Issue
Block a user