diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e9beb9f..14436b8b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,154 +1,154 @@ cmake_minimum_required(VERSION 3.0) project(kdevpython) # write the plugin version to a file set(KDEVPYTHON_VERSION_MAJOR 5) set(KDEVPYTHON_VERSION_MINOR 2) set(KDEVPYTHON_VERSION_PATCH 80) # KDevplatform dependency version set( KDEVPLATFORM_VERSION "${KDEVPYTHON_VERSION_MAJOR}.${KDEVPYTHON_VERSION_MINOR}" ) find_package (ECM "5.14.0" REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${kdevpython_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH}) include(KDECompilerSettings NO_POLICY_SCOPE) include(KDEInstallDirs) include(KDECMakeSettings) include(GenerateExportHeader) include(ECMAddTests) include(ECMSetupVersion) include(ECMQtDeclareLoggingCategory) if(NOT CMAKE_VERSION VERSION_LESS "3.10.0") # Avoids bogus warnings with CMake 3.10+ list(APPEND CMAKE_AUTOMOC_MACRO_NAMES "K_PLUGIN_FACTORY_WITH_JSON") endif() if(POLICY CMP0071) # Avoids compat messages from CMake 3.10+, with Qt < 5.9.4 # See https://bugreports.qt.io/browse/QTBUG-63442 cmake_policy(SET CMP0071 OLD) endif() if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wdocumentation") endif() add_definitions( -DTRANSLATION_DOMAIN=\"kdevpython\" ) # CMake looks for exactly the specified version first and ignores newer versions. # To avoid that, start looking for the newest supported version and work down. set(Python_ADDITIONAL_VERSIONS 3.7 3.6 3.5 3.4) foreach(_PYTHON_V ${Python_ADDITIONAL_VERSIONS}) find_package(PythonInterp ${_PYTHON_V}) if ( PYTHONINTERP_FOUND ) break() endif() endforeach() # Must unset before searching for libs, otherwise these are checked before the required version... unset(Python_ADDITIONAL_VERSIONS) if ( PYTHONINTERP_FOUND AND PYTHON_VERSION_STRING VERSION_GREATER "3.4" ) # Find libraries that match the found interpreter (mismatched versions not supported). # This assumes libs are available for the newest Python version on the system. # KDevelop should _always_ be built against the newest possible version, so notabug. find_package(PythonLibs "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}" REQUIRED EXACT) endif() if ( NOT PYTHONLIBS_FOUND OR PYTHONLIBS_VERSION_STRING VERSION_LESS "3.4.3" ) message(FATAL_ERROR "Python >= 3.4.3 but < 3.8 with --enable-shared is required to build kdev-python") endif() configure_file(kdevpythonversion.h.cmake "${CMAKE_CURRENT_BINARY_DIR}/kdevpythonversion.h" @ONLY) set(QT_MIN_VERSION "5.5.0") find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED Core Widgets Test) set(KF5_DEP_VERSION "5.15.0") find_package(KF5 ${KF5_DEP_VERSION} REQUIRED I18n ThreadWeaver TextEditor ) find_package(KDevPlatform ${KDEVPLATFORM_VERSION} CONFIG REQUIRED) find_package(KDevelop ${KDEVPLATFORM_VERSION} REQUIRED) if ( NOT WIN32 ) set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wfatal-errors -Wall") endif ( NOT WIN32 ) # then, build the plugin include_directories( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/duchain ${CMAKE_CURRENT_SOURCE_DIR}/parser ${CMAKE_CURRENT_BINARY_DIR}/parser ) add_subdirectory(app_templates) add_subdirectory(parser) add_subdirectory(duchain) add_subdirectory(codecompletion) add_subdirectory(debugger) add_subdirectory(docfilekcm) set(kdevpythonlanguagesupport_PART_SRCS codegen/correctionfilegenerator.cpp codegen/refactoring.cpp pythonlanguagesupport.cpp pythonparsejob.cpp pythonhighlighting.cpp pythonstylechecking.cpp # config pages: docfilekcm/docfilewizard.cpp docfilekcm/docfilemanagerwidget.cpp docfilekcm/kcm_docfiles.cpp pep8kcm/kcm_pep8.cpp projectconfig/projectconfigpage.cpp ) ecm_qt_declare_logging_category(kdevpythonlanguagesupport_PART_SRCS HEADER codegendebug.h IDENTIFIER KDEV_PYTHON_CODEGEN - CATEGORY_NAME "kdevelop.languages.python.codegen" + CATEGORY_NAME "kdevelop.plugins.python.codegen" ) ecm_qt_declare_logging_category(kdevpythonlanguagesupport_PART_SRCS HEADER pythondebug.h IDENTIFIER KDEV_PYTHON - CATEGORY_NAME "kdevelop.languages.python" + CATEGORY_NAME "kdevelop.plugins.python" ) ki18n_wrap_ui(kdevpythonlanguagesupport_PART_SRCS codegen/correctionwidget.ui projectconfig/projectconfig.ui pep8kcm/pep8.ui ) kdevplatform_add_plugin(kdevpythonlanguagesupport JSON kdevpythonsupport.json SOURCES ${kdevpythonlanguagesupport_PART_SRCS}) target_link_libraries(kdevpythonlanguagesupport KDev::Interfaces KDev::Language KDev::Util KF5::ThreadWeaver KF5::TextEditor kdevpythoncompletion kdevpythonparser kdevpythonduchain ) get_target_property(DEFINESANDINCLUDES_INCLUDE_DIRS KDev::DefinesAndIncludesManager INTERFACE_INCLUDE_DIRECTORIES) include_directories(${DEFINESANDINCLUDES_INCLUDE_DIRS}) install(DIRECTORY documentation_files DESTINATION ${KDE_INSTALL_DATADIR}/kdevpythonsupport) install(DIRECTORY correction_files DESTINATION ${KDE_INSTALL_DATADIR}/kdevpythonsupport) install(FILES codestyle.py DESTINATION ${KDE_INSTALL_DATADIR}/kdevpythonsupport) install(FILES org.kde.kdev-python.metainfo.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) # kdebugsettings file install(FILES kdevpythonsupport.categories DESTINATION ${KDE_INSTALL_CONFDIR}) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/codecompletion/CMakeLists.txt b/codecompletion/CMakeLists.txt index 828c0daa..3f9fd955 100644 --- a/codecompletion/CMakeLists.txt +++ b/codecompletion/CMakeLists.txt @@ -1,44 +1,44 @@ set(completion_SRCS context.cpp model.cpp worker.cpp helpers.cpp items/missingincludeitem.cpp items/declaration.cpp items/functiondeclaration.cpp items/implementfunction.cpp items/importfile.cpp items/keyword.cpp items/replacementvariable.cpp ) ecm_qt_declare_logging_category(completion_SRCS HEADER codecompletiondebug.h IDENTIFIER KDEV_PYTHON_CODECOMPLETION - CATEGORY_NAME "kdevelop.languages.python.codecompletion" + CATEGORY_NAME "kdevelop.plugins.python.codecompletion" ) add_library(kdevpythoncompletion SHARED ${completion_SRCS}) generate_export_header(kdevpythoncompletion EXPORT_MACRO_NAME KDEVPYTHONCOMPLETION_EXPORT EXPORT_FILE_NAME pythoncompletionexport.h ) add_dependencies(kdevpythoncompletion kdevpythonparser kdevpythonduchain ) target_link_libraries(kdevpythoncompletion LINK_PRIVATE KDev::Language KDev::Interfaces KDev::Project kdevpythonduchain kdevpythonparser ) install(TARGETS kdevpythoncompletion DESTINATION ${INSTALL_TARGETS_DEFAULT_ARGS}) if (BUILD_TESTING) add_subdirectory(tests) endif() diff --git a/debugger/CMakeLists.txt b/debugger/CMakeLists.txt index 8df59fbe..60ea9f30 100644 --- a/debugger/CMakeLists.txt +++ b/debugger/CMakeLists.txt @@ -1,33 +1,33 @@ set(kdevpdb_PART_SRCS breakpointcontroller.cpp variable.cpp variablecontroller.cpp pdbframestackmodel.cpp pdblauncher.cpp debugjob.cpp debugsession.cpp pdbdebuggerplugin.cpp ) ecm_qt_declare_logging_category(kdevpdb_PART_SRCS HEADER debuggerdebug.h IDENTIFIER KDEV_PYTHON_DEBUGGER - CATEGORY_NAME "kdevelop.languages.python.debugger" + CATEGORY_NAME "kdevelop.plugins.python.debugger" ) kdevplatform_add_plugin(kdevpdb JSON kdevpdb.json SOURCES ${kdevpdb_PART_SRCS}) generate_export_header(kdevpdb EXPORT_MACRO_NAME KDEVPYTHONDEBUG_EXPORT) target_link_libraries(kdevpdb kdevpythonparser KDev::Interfaces KDev::Language KDev::Debugger KDev::OutputView KDev::Project KDev::Util KF5::TextEditor ) install(FILES __kdevpython_debugger_utils.py DESTINATION ${KDE_INSTALL_DATADIR}/kdevpythonsupport/debugger) install(FILES kdevpdb.py DESTINATION ${KDE_INSTALL_DATADIR}/kdevpythonsupport/debugger) diff --git a/duchain/CMakeLists.txt b/duchain/CMakeLists.txt index 33e0ca53..16462b66 100644 --- a/duchain/CMakeLists.txt +++ b/duchain/CMakeLists.txt @@ -1,60 +1,60 @@ set(duchain_SRCS declarations/functiondeclaration.cpp types/nonetype.cpp types/hintedtype.cpp types/unsuretype.cpp types/indexedcontainer.cpp expressionvisitor.cpp helpers.cpp pythonducontext.cpp contextbuilder.cpp pythoneditorintegrator.cpp declarationbuilder.cpp usebuilder.cpp dumpchain.cpp navigation/navigationwidget.cpp navigation/declarationnavigationcontext.cpp correctionhelper.cpp assistants/missingincludeassistant.cpp ../docfilekcm/docfilewizard.cpp # for the docfile generation assistant widget, to be used in the problem resolver ) ecm_qt_declare_logging_category(duchain_SRCS HEADER duchaindebug.h IDENTIFIER KDEV_PYTHON_DUCHAIN - CATEGORY_NAME "kdevelop.languages.python.duchain" + CATEGORY_NAME "kdevelop.plugins.python.duchain" ) add_library( kdevpythonduchain SHARED ${duchain_SRCS} ) generate_export_header( kdevpythonduchain EXPORT_MACRO_NAME KDEVPYTHONDUCHAIN_EXPORT EXPORT_FILE_NAME pythonduchainexport.h ) target_link_libraries( kdevpythonduchain LINK_PRIVATE KF5::TextEditor KDev::Interfaces KDev::Language KDev::Project KDev::Util kdevpythonparser ) install(TARGETS kdevpythonduchain DESTINATION ${INSTALL_TARGETS_DEFAULT_ARGS}) add_subdirectory(navigation) if (BUILD_TESTING) add_subdirectory(tests) endif() add_subdirectory(types) add_subdirectory(declarations) add_subdirectory(assistants) diff --git a/kdevpythonsupport.categories b/kdevpythonsupport.categories index b3f3cf1e..cdd89abf 100644 --- a/kdevpythonsupport.categories +++ b/kdevpythonsupport.categories @@ -1,10 +1,10 @@ # KDebugSettings data file # Format: # lognamedescription -kdevelop.languages.python KDevelop plugin: Python language support -kdevelop.languages.python.codecompletion KDevelop plugin: Python language support - codecompletion -kdevelop.languages.python.codegen KDevelop plugin: Python language support - codegen -kdevelop.languages.python.debugger KDevelop plugin: Python language support - debugger -kdevelop.languages.python.duchain KDevelop plugin: Python language support - duchain -kdevelop.languages.python.parser KDevelop plugin: Python language support - parser +kdevelop.plugins.python KDevelop plugin: Python language support +kdevelop.plugins.python.codecompletion KDevelop plugin: Python language support - codecompletion +kdevelop.plugins.python.codegen KDevelop plugin: Python language support - codegen +kdevelop.plugins.python.debugger KDevelop plugin: Python language support - debugger +kdevelop.plugins.python.duchain KDevelop plugin: Python language support - duchain +kdevelop.plugins.python.parser KDevelop plugin: Python language support - parser diff --git a/parser/CMakeLists.txt b/parser/CMakeLists.txt index df12ddde..899e2d17 100644 --- a/parser/CMakeLists.txt +++ b/parser/CMakeLists.txt @@ -1,34 +1,34 @@ set(parser_STAT_SRCS codehelpers.cpp parsesession.cpp ast.cpp astdefaultvisitor.cpp astvisitor.cpp astbuilder.cpp cythonsyntaxremover.cpp rangefixvisitor.cpp ) ecm_qt_declare_logging_category(parser_STAT_SRCS HEADER parserdebug.h IDENTIFIER KDEV_PYTHON_PARSER - CATEGORY_NAME "kdevelop.languages.python.parser" + CATEGORY_NAME "kdevelop.plugins.python.parser" ) include_directories(${PYTHON_INCLUDE_DIRS}) add_library( kdevpythonparser SHARED ${parser_STAT_SRCS} ) generate_export_header(kdevpythonparser EXPORT_MACRO_NAME KDEVPYTHONPARSER_EXPORT EXPORT_FILE_NAME parserexport.h) target_link_libraries(kdevpythonparser LINK_PRIVATE KDev::Language Qt5::Core ${PYTHON_LIBRARIES} ) install(TARGETS kdevpythonparser DESTINATION ${INSTALL_TARGETS_DEFAULT_ARGS}) if (BUILD_TESTING) add_subdirectory(tests) endif()