From e81b46476ba18c6b4c098dec37e527f00a6af193 Mon Sep 17 00:00:00 2001 From: Andreas Sturmlechner Date: Mon, 13 Jul 2020 00:41:25 +0200 Subject: [PATCH] Use CMake's own FindBoost module to detect Boost Python Introduces BOOSTPYTHON_VERSION_MAJOR_MINOR for packaging. Signed-off-by: Andreas Sturmlechner --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,7 +55,8 @@ endif() include(KigConfigureChecks.cmake) -find_package(BoostPython) +set(BOOSTPYTHON_VERSION_MAJOR_MINOR python37 CACHE STRING "Version of BoostPython to feed CMake's FindBoost") +find_package(Boost 1.70 COMPONENTS ${BOOSTPYTHON_VERSION_MAJOR_MINOR}) if(KF6DocTools_FOUND) add_subdirectory( doc ) @@ -67,7 +68,9 @@ add_subdirectory( mimetypes ) add_subdirectory( macros ) add_subdirectory( pykig ) -if(BoostPython_FOUND) +if(Boost_FOUND) + find_package(PythonLibs 3 REQUIRED) + include_directories(${PYTHON_INCLUDE_DIRS}) add_subdirectory( scripting ) add_definitions(-DKIG_ENABLE_PYTHON_SCRIPTING) get_filename_component(PYTHON_LIBRARY_REALPATH "${PYTHON_LIBRARY}" REALPATH) @@ -76,9 +79,7 @@ if(BoostPython_FOUND) endif() set_package_properties( - BoostPython PROPERTIES - DESCRIPTION "Python scripting support in Boost" - URL "https://www.boost.org/" + Boost PROPERTIES TYPE OPTIONAL PURPOSE "Kig can optionally use Boost.Python for Python scripting" ) @@ -96,9 +97,6 @@ endif() feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) include_directories( ${CMAKE_SOURCE_DIR}/modes ) -if(BoostPython_FOUND) - include_directories(${BoostPython_INCLUDE_DIRS}) -endif() # kigpart @@ -348,7 +346,7 @@ ki18n_wrap_ui(kigpart_PART_SRCS misc/kigcoordinateprecisiondialog.ui ) -if(BoostPython_FOUND) +if(Boost_FOUND) set(kigpart_PART_SRCS ${kigpart_PART_SRCS} modes/popup/scriptactionsprovider.cc scripting/newscriptwizard.cc @@ -379,8 +377,8 @@ target_link_libraries(kigpart KF6::Archive ) -if(BoostPython_FOUND) - target_link_libraries(kigpart ${BoostPython_LIBRARIES} KF6::TextEditor) +if(Boost_FOUND) + target_link_libraries(kigpart Boost::${BOOSTPYTHON_VERSION_MAJOR_MINOR} ${PYTHON_LIBRARIES} KF6::TextEditor) endif() if (Qt${QT_MAJOR_VERSION}XmlPatterns_FOUND) -- 2.50.1