diff --git a/CMakeLists.txt b/CMakeLists.txt index ad623b7673..6189b6ac7b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,191 +1,194 @@ cmake_minimum_required(VERSION 3.0) project(KDevelop VERSION 5.2.80) # KDevelop SOVERSION # E.g. for KDevelop 5.2.0 => SOVERSION 52 (we only promise ABI compatibility between patch version updates) set(KDEVELOP_SOVERSION 53) # plugin version as used e.g. in plugin installation path set(KDEV_PLUGIN_VERSION 31) # we need some parts of the ECM CMake helpers find_package (ECM 5.14.0 REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${KDevelop_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH}) include(KDECompilerSettings NO_POLICY_SCOPE) # needs to be first, as set policies influence following macros include(ECMOptionalAddSubdirectory) include(ECMInstallIcons) include(ECMAddAppIcon) include(ECMSetupVersion) include(ECMAddTests) include(ECMMarkNonGuiExecutable) include(ECMGenerateHeaders) include(ECMQtDeclareLoggingCategory) include(GenerateExportHeader) include(CMakePackageConfigHelpers) include(FeatureSummary) include(WriteBasicConfigVersionFile) include(CheckFunctionExists) include(KDEInstallDirs) include(KDECMakeSettings) include(KDevelopMacrosInternal) if(POLICY CMP0071) # CMake 3.10 generates warnings when projects combine AUTOMOC with qt5_wrap_ui() or qt5_add_resources() # Avoid that by setting this policy (cf. https://bugreports.qt.io/browse/QTBUG-63442) # Note: Once we depend on a Qt which has this fix (likely Qt 5.9.4+), remove this cmake_policy(SET CMP0071 OLD) endif() set(QT_MIN_VERSION "5.5.0") find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED Widgets Concurrent Quick QuickWidgets) if(BUILD_TESTING) find_package(Qt5Test ${QT_MIN_VERSION} CONFIG REQUIRED) endif() set(KF5_DEP_VERSION "5.15.0") # we need KCrash::initialize find_package(KF5 ${KF5_DEP_VERSION} REQUIRED COMPONENTS Config Declarative DocTools IconThemes I18n ItemModels ItemViews JobWidgets KCMUtils KIO NewStuff NotifyConfig Parts Service TextEditor ThreadWeaver XmlGui WindowSystem Crash GuiAddons Archive Notifications ) find_package(KF5SysGuard CONFIG) set_package_properties(KF5SysGuard PROPERTIES PURPOSE "Framework for process listing. Required for the 'Attach to Process' feature" TYPE RECOMMENDED ) find_package(KDevelop-PG-Qt 1.90.90 CONFIG) set_package_properties(KDevelop-PG-Qt PROPERTIES PURPOSE "KDevelop parser generator library. Required for the QMake Builder/Manager plugin." TYPE RECOMMENDED ) find_package(SharedMimeInfo REQUIRED) if(NOT CMAKE_VERSION VERSION_LESS "3.10.0" AND KF5_VERSION VERSION_LESS "5.42.0") # CMake 3.9+ warns about automoc on files without Q_OBJECT, and doesn't know about other macros. # 3.10+ lets us provide more macro names that require automoc. # KF5 >= 5.42 takes care itself of adding its macros in its cmake config files list(APPEND CMAKE_AUTOMOC_MACRO_NAMES "K_PLUGIN_FACTORY_WITH_JSON" "K_EXPORT_PLASMA_DATAENGINE_WITH_JSON" "K_EXPORT_PLASMA_RUNNER") endif() if(NOT CMAKE_VERSION VERSION_LESS "3.9.0" AND KF5_VERSION VERSION_LESS "5.44.0") # CMake's automoc needs help to find names of plugin metadata files in case Q_PLUGIN_METADATA # is indirectly used via other C++ preprocessor macros # 3.9+ lets us provide some filter rule pairs (keyword, regexp) to match the names of such files # in the plain text of the sources. See AUTOMOC_DEPEND_FILTERS docs for details. list(APPEND CMAKE_AUTOMOC_DEPEND_FILTERS "K_PLUGIN_FACTORY_WITH_JSON" "[\n^][ \t]*K_PLUGIN_FACTORY_WITH_JSON[ \t\n]*\\([^,]*,[ \t\n]*\"([^\"]+)\"" "K_EXPORT_PLASMA_DATAENGINE_WITH_JSON" "[\n^][ \t]*K_EXPORT_PLASMA_DATAENGINE_WITH_JSON[ \t\n]*\\([^,]*,[^,]*,[ \t\n]*\"([^\"]+)\"" ) endif() add_definitions( -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050500 -DQT_NO_SIGNALS_SLOTS_KEYWORDS -DQT_NO_URL_CAST_FROM_STRING + -DQT_NO_CAST_FROM_ASCII + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY -DQT_STRICT_ITERATORS -DQT_USE_QSTRINGBUILDER -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT ) # Turn off missing-field-initializers warning for GCC to avoid noise from false positives with empty {} # See discussion: http://mail.kde.org/pipermail/kdevelop-devel/2014-February/046910.html add_compile_flag_if_supported(-Wno-missing-field-initializers) add_compile_flag_if_supported(-Werror=switch) add_compile_flag_if_supported(-Werror=undefined-bool-conversion) add_compile_flag_if_supported(-Werror=tautological-undefined-compare) if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_flag_if_supported(-Wdocumentation) add_compile_flag_if_supported(-Wcovered-switch-default) # This warning is triggered by every call to qCDebug() add_compile_flag_if_supported(-Wno-gnu-zero-variadic-macro-arguments) endif() if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_flag_if_supported(-pedantic) add_compile_flag_if_supported(-Wzero-as-null-pointer-constant CXX_ONLY) endif() if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") add_compile_flag_if_supported(-Wsuggest-override CXX_ONLY) endif() include_directories(${KDevelop_SOURCE_DIR} ${KDevelop_BINARY_DIR}) string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_TOLOWER) if(CMAKE_BUILD_TYPE_TOLOWER MATCHES "debug" OR CMAKE_BUILD_TYPE_TOLOWER STREQUAL "") set(COMPILER_OPTIMIZATIONS_DISABLED TRUE) else() set(COMPILER_OPTIMIZATIONS_DISABLED FALSE) endif() # create config-kdevelop.h configure_file(config-kdevelop.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kdevelop.h) add_subdirectory(kdevplatform) add_subdirectory(plugins) add_subdirectory(pics) add_subdirectory(app) add_subdirectory(app_templates) add_subdirectory(file_templates) add_subdirectory(shortcuts) add_subdirectory(doc) set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KDevelop") configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/KDevelopConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/KDevelopConfig.cmake" INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} ) ecm_setup_version(${KDevelop_VERSION_MAJOR}.${KDevelop_VERSION_MINOR}.${KDevelop_VERSION_PATCH} VARIABLE_PREFIX KDEVELOP VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kdevelop_version.h" PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KDevelopConfigVersion.cmake" ) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/kdevelop_version.h" DESTINATION "${KDE_INSTALL_INCLUDEDIR}/kdevelop") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/KDevelopConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/KDevelopConfigVersion.cmake" DESTINATION "${CMAKECONFIG_INSTALL_DIR}" ) install(EXPORT KDevelopTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" NAMESPACE KDev:: FILE KDevelopTargets.cmake) # kdebugsettings file install(FILES kdevelop.categories DESTINATION ${KDE_INSTALL_CONFDIR}) # CTestCustom.cmake has to be in the CTEST_BINARY_DIR. # in the KDE build system, this is the same as CMAKE_BINARY_DIR. configure_file(${CMAKE_SOURCE_DIR}/CTestCustom.cmake ${CMAKE_BINARY_DIR}/CTestCustom.cmake) install(FILES org.kde.kdevelop.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) # Make it possible to use the po files fetched by the fetch-translations step ki18n_install(po) feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/kdevplatform/CMakeLists.txt b/kdevplatform/CMakeLists.txt index 095cd32dc9..0f09bcfd22 100644 --- a/kdevplatform/CMakeLists.txt +++ b/kdevplatform/CMakeLists.txt @@ -1,98 +1,92 @@ # kdevplatform soversion # E.g. for KDevelop 5.2.0 => SOVERSION 52 (we only promise ABI compatibility between patch version updates) set(KDEVPLATFORM_SOVERSION ${KDEVELOP_SOVERSION}) # Increase this to reset incompatible item-repositories. # Changing KDEVELOP_VERSION automatically resets the itemrepository as well. set(KDEV_ITEMREPOSITORY_INCREMENT 1) set(KDevPlatform_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(KDevPlatform_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) set(CMAKE_MODULE_PATH ${KDevPlatform_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH}) set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KDevPlatform") include(KDevPlatformMacros) include(KDevPlatformMacrosInternal) find_package(Grantlee5 CONFIG) set_package_properties(Grantlee5 PROPERTIES PURPOSE "Grantlee templating library, needed for file templates" URL "http://www.grantlee.org/" TYPE REQUIRED) set(Boost_ADDITIONAL_VERSIONS 1.39.0 1.39) find_package(Boost 1.35.0) set_package_properties(Boost PROPERTIES PURPOSE "Boost libraries for enabling the classbrowser" URL "http://www.boost.org" TYPE REQUIRED) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/config-kdevplatform.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kdevplatform.h ) include_directories(${KDevPlatform_SOURCE_DIR} ${KDevPlatform_BINARY_DIR}) if(BUILD_TESTING) set(KDEV_FIND_DEP_QT5TEST "find_dependency(Qt5Test \"${QT_MIN_VERSION}\")") endif() configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/KDevPlatformConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/KDevPlatformConfig.cmake" INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} ) ecm_setup_version(PROJECT VARIABLE_PREFIX KDEVPLATFORM VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kdevplatform_version.h" PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KDevPlatformConfigVersion.cmake" SOVERSION ${KDEVPLATFORM_SOVERSION} ) string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_TOLOWER) if(CMAKE_BUILD_TYPE_TOLOWER MATCHES "debug" OR CMAKE_BUILD_TYPE_TOLOWER STREQUAL "") set(COMPILER_OPTIMIZATIONS_DISABLED TRUE) else() set(COMPILER_OPTIMIZATIONS_DISABLED FALSE) endif() -add_definitions( - -DQT_NO_CAST_FROM_ASCII - -DQT_NO_CAST_TO_ASCII - -DQT_NO_CAST_FROM_BYTEARRAY -) - add_subdirectory(sublime) add_subdirectory(interfaces) add_subdirectory(project) add_subdirectory(language) add_subdirectory(shell) add_subdirectory(util) add_subdirectory(outputview) add_subdirectory(vcs) add_subdirectory(pics) add_subdirectory(debugger) add_subdirectory(documentation) add_subdirectory(serialization) add_subdirectory(template) if(BUILD_TESTING) add_subdirectory(tests) endif() install( FILES "${KDevPlatform_BINARY_DIR}/kdevplatform_version.h" "${KDevPlatform_BINARY_DIR}/config-kdevplatform.h" DESTINATION "${KDE_INSTALL_INCLUDEDIR}/kdevplatform" ) install( FILES "${KDevPlatform_BINARY_DIR}/KDevPlatformConfig.cmake" "${KDevPlatform_BINARY_DIR}/KDevPlatformConfigVersion.cmake" cmake/modules/KDevPlatformMacros.cmake DESTINATION "${CMAKECONFIG_INSTALL_DIR}" ) install( EXPORT KDevPlatformTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" NAMESPACE KDev:: FILE KDevPlatformTargets.cmake ) # kdebugsettings file install( FILES kdevplatform.categories DESTINATION ${KDE_INSTALL_CONFDIR} ) diff --git a/plugins/astyle/3rdparty/libastyle/CMakeLists.txt b/plugins/astyle/3rdparty/libastyle/CMakeLists.txt index ea9e848799..2b4eb0d99f 100644 --- a/plugins/astyle/3rdparty/libastyle/CMakeLists.txt +++ b/plugins/astyle/3rdparty/libastyle/CMakeLists.txt @@ -1,22 +1,28 @@ +remove_definitions( + -DQT_NO_CAST_FROM_ASCII + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY +) + set(astylelib_SRCS ASBeautifier.cpp ASEnhancer.cpp ASFormatter.cpp ASResource.cpp ASLocalizer.cpp ) add_library(astylelib STATIC ${astylelib_SRCS}) set_property(TARGET astylelib PROPERTY POSITION_INDEPENDENT_CODE ON) if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") # astyle lib throws lots of warnings with -Wdocumentation add_target_compile_flag_if_supported(astylelib PRIVATE "-Wno-documentation") endif() if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_target_compile_flag_if_supported(astylelib PRIVATE "-Wno-zero-as-null-pointer-constant") endif() if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") add_target_compile_flag_if_supported(astylelib PRIVATE "-Wno-suggest-override") endif() # add as SYSTEM include dir so compiler does not emit warnings for the lib headers target_include_directories(astylelib SYSTEM PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/plugins/astyle/tests/CMakeLists.txt b/plugins/astyle/tests/CMakeLists.txt index 6b3e5a8e7c..6e1410101f 100644 --- a/plugins/astyle/tests/CMakeLists.txt +++ b/plugins/astyle/tests/CMakeLists.txt @@ -1,12 +1,18 @@ +remove_definitions( + -DQT_NO_CAST_FROM_ASCII + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY +) + include_directories(${CMAKE_CURRENT_BINARY_DIR}/..) set(test_astyle_SRCS test_astyle.cpp ../astyle_formatter.cpp ../astyle_stringiterator.cpp ${kdevastyle_LOG_SRCS} ) ecm_add_test(${test_astyle_SRCS} TEST_NAME test_astyle LINK_LIBRARIES astylelib Qt5::Test KDev::Interfaces KDev::Util) diff --git a/plugins/bazaar/tests/CMakeLists.txt b/plugins/bazaar/tests/CMakeLists.txt index effab2bce8..feab827e24 100644 --- a/plugins/bazaar/tests/CMakeLists.txt +++ b/plugins/bazaar/tests/CMakeLists.txt @@ -1,19 +1,25 @@ +remove_definitions( + -DQT_NO_CAST_FROM_ASCII + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY +) + # Running the test only makes sense if the bzr command line client # is present. So check for it before adding the test... FIND_PROGRAM(BZR_FOUND NAMES bzr) if (BZR_FOUND) set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}) set(bazaartest_SRCS test_bazaar.cpp ../diffjob.cpp ../bzrannotatejob.cpp ../bazaarplugin.cpp ../bazaarutils.cpp ../copyjob.cpp ) ecm_add_test(${bazaartest_SRCS} TEST_NAME test_kdevbazaar LINK_LIBRARIES Qt5::Test KDev::Vcs KDev::Util KDev::Tests) endif() diff --git a/plugins/clang/CMakeLists.txt b/plugins/clang/CMakeLists.txt index 2bb2126a5c..0ed104f210 100644 --- a/plugins/clang/CMakeLists.txt +++ b/plugins/clang/CMakeLists.txt @@ -1,137 +1,133 @@ add_definitions(-DTRANSLATION_DOMAIN=\"kdevclang\") add_definitions(${LLVM_CFLAGS}) include_directories(${CLANG_INCLUDE_DIRS}) configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/libclang_include_path.h.cmake" "${CMAKE_CURRENT_BINARY_DIR}/libclang_include_path.h" @ONLY ) if(BUILD_TESTING) add_subdirectory(tests) endif() -add_definitions( - -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_BYTEARRAY -) - # TODO: Move to kdevplatform function(add_private_library target) set(options) set(oneValueArgs) set(multiValueArgs SOURCES) cmake_parse_arguments(KDEV_ADD_PRIVATE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) string(REPLACE "KDev" "" shortTargetName ${target}) if (${shortTargetName} STREQUAL ${target}) message(FATAL_ERROR "Target passed to add_private_library needs to start with \"KDev\", was \"${target}\"") endif() string(TOLOWER ${shortTargetName} shortTargetNameToLower) add_library(${target} SHARED ${KDEV_ADD_PRIVATE_SOURCES}) generate_export_header(${target} EXPORT_FILE_NAME ${shortTargetNameToLower}export.h) set_target_properties(${target} PROPERTIES VERSION ${KDEV_PLUGIN_VERSION} SOVERSION ${KDEV_PLUGIN_VERSION} ) install(TARGETS ${target} ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP) endfunction() set(kdevclangprivate_SRCS clangsettings/clangsettingsmanager.cpp clangsettings/sessionsettings/sessionsettings.cpp codecompletion/completionhelper.cpp codecompletion/context.cpp codecompletion/includepathcompletioncontext.cpp codecompletion/model.cpp codegen/adaptsignatureaction.cpp codegen/adaptsignatureassistant.cpp codegen/codegenhelper.cpp codegen/clangrefactoring.cpp codegen/clangclasshelper.cpp codegen/sourcemanipulation.cpp duchain/builder.cpp duchain/clangdiagnosticevaluator.cpp duchain/clangducontext.cpp duchain/clanghelpers.cpp duchain/clangindex.cpp duchain/clangparsingenvironment.cpp duchain/clangparsingenvironmentfile.cpp duchain/clangpch.cpp duchain/clangproblem.cpp duchain/debugvisitor.cpp duchain/documentfinderhelpers.cpp duchain/duchainutils.cpp duchain/macrodefinition.cpp duchain/macronavigationcontext.cpp duchain/missingincludepathproblem.cpp duchain/navigationwidget.cpp duchain/parsesession.cpp duchain/todoextractor.cpp duchain/types/classspecializationtype.cpp duchain/unknowndeclarationproblem.cpp duchain/unsavedfile.cpp util/clangdebug.cpp util/clangtypes.cpp util/clangutils.cpp ) include_directories( ${CMAKE_CURRENT_BINARY_DIR} ) ki18n_wrap_ui(kdevclangprivate_SRCS clangsettings/sessionsettings/sessionsettings.ui ) kconfig_add_kcfg_files(kdevclangprivate_SRCS clangsettings/sessionsettings/sessionconfig.kcfgc) add_private_library(KDevClangPrivate SOURCES ${kdevclangprivate_SRCS}) target_link_libraries(KDevClangPrivate LINK_PRIVATE Qt5::Core KF5::TextEditor KF5::ThreadWeaver KDev::DefinesAndIncludesManager KDev::Util LINK_PUBLIC KDev::Language KDev::Project KDev::Util Clang::clang ) install(DIRECTORY duchain/wrappedQtHeaders DESTINATION ${KDE_INSTALL_DATADIR}/kdevclangsupport DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE FILE_PERMISSIONS OWNER_READ GROUP_READ WORLD_READ) set(kdevclangsupport_SRCS clangparsejob.cpp clangsupport.cpp clanghighlighting.cpp ) qt5_add_resources(kdevclangsupport_SRCS kdevclangsupport.qrc) kdevplatform_add_plugin(kdevclangsupport JSON kdevclangsupport.json SOURCES ${kdevclangsupport_SRCS}) target_link_libraries(kdevclangsupport KDevClangPrivate KF5::ThreadWeaver KF5::TextEditor KDev::Util KDev::Project KDev::DefinesAndIncludesManager ) install(FILES kdevclang.xml DESTINATION ${KDE_INSTALL_MIMEDIR}) update_xdg_mimetypes(${KDE_INSTALL_MIMEDIR}) diff --git a/plugins/clang/tests/CMakeLists.txt b/plugins/clang/tests/CMakeLists.txt index 7b1f5e1daa..c0d00f5d42 100644 --- a/plugins/clang/tests/CMakeLists.txt +++ b/plugins/clang/tests/CMakeLists.txt @@ -1,113 +1,119 @@ +remove_definitions( + -DQT_NO_CAST_FROM_ASCII + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY +) + add_executable(clang-parser clang-parser.cpp ) target_link_libraries(clang-parser KDev::Tests KDevClangPrivate ) add_library(codecompletiontestbase STATIC codecompletiontestbase.cpp) target_link_libraries(codecompletiontestbase PUBLIC KDev::Tests Qt5::Test KDevClangPrivate ) add_executable(clang-minimal-visitor WIN32 minimal_visitor.cpp ) ecm_mark_nongui_executable(clang-minimal-visitor) target_link_libraries(clang-minimal-visitor Clang::clang ) ecm_add_test(test_buddies.cpp TEST_NAME test_buddies-clang LINK_LIBRARIES KDev::Tests Qt5::Test ) ecm_add_test(test_codecompletion.cpp TEST_NAME test_codecompletion LINK_LIBRARIES codecompletiontestbase ) ecm_add_test(test_assistants.cpp TEST_NAME test_assistants LINK_LIBRARIES KDev::Tests Qt5::Test KDevClangPrivate ) ecm_add_test(test_clangutils.cpp TEST_NAME test_clangutils LINK_LIBRARIES KDev::Tests Qt5::Test Clang::clang KDevClangPrivate ) ecm_add_test(test_duchain.cpp TEST_NAME test_duchain-clang LINK_LIBRARIES KDev::Tests Qt5::Test KDevClangPrivate KDev::DefinesAndIncludesManager ) ecm_add_test(test_refactoring.cpp TEST_NAME test_refactoring-clang LINK_LIBRARIES KDev::Tests Qt5::Test KDevClangPrivate ) ecm_add_test(test_duchainutils.cpp TEST_NAME test_duchainutils LINK_LIBRARIES KDev::Tests Qt5::Test KDevClangPrivate ) ecm_add_test(test_problems.cpp TEST_NAME test_problems LINK_LIBRARIES KDev::Tests Qt5::Test KDevClangPrivate ) configure_file("testfilepaths.h.cmake" "testfilepaths.h" ESCAPE_QUOTES) ecm_add_test(test_files.cpp TEST_NAME test_files-clang LINK_LIBRARIES Qt5::Test Qt5::Core KDev::Language KDev::Tests ) if(NOT COMPILER_OPTIMIZATIONS_DISABLED) ecm_add_test(bench_codecompletion.cpp TEST_NAME bench_codecompletion LINK_LIBRARIES codecompletiontestbase ) set_tests_properties(bench_codecompletion PROPERTIES TIMEOUT 30) ecm_add_test(bench_duchain.cpp TEST_NAME bench_duchain LINK_LIBRARIES KDev::Tests Qt5::Test KDevClangPrivate ) set_tests_properties(bench_duchain PROPERTIES TIMEOUT 30) endif() diff --git a/plugins/clazy/tests/CMakeLists.txt b/plugins/clazy/tests/CMakeLists.txt index d596fc3fbe..144b5cc9c9 100644 --- a/plugins/clazy/tests/CMakeLists.txt +++ b/plugins/clazy/tests/CMakeLists.txt @@ -1,6 +1,12 @@ +remove_definitions( + -DQT_NO_CAST_FROM_ASCII + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY +) + ecm_add_test( test_clazyjob.cpp TEST_NAME test_clazyjob LINK_LIBRARIES kdevclazy_core Qt5::Test KDev::Tests ) diff --git a/plugins/cmake/tests/CMakeLists.txt b/plugins/cmake/tests/CMakeLists.txt index bc1ceb4e59..aa6ae9d601 100644 --- a/plugins/cmake/tests/CMakeLists.txt +++ b/plugins/cmake/tests/CMakeLists.txt @@ -1,12 +1,18 @@ +remove_definitions( + -DQT_NO_CAST_FROM_ASCII + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY +) + configure_file("paths.h.cmake" "cmake-test-paths.h" ESCAPE_QUOTES) set(commonlibs Qt5::Test Qt5::Core KDev::Interfaces kdevcmakecommon) ecm_add_test(cmakeparsertest.cpp ../parser/cmListFileLexer.c TEST_NAME test_cmakeparser LINK_LIBRARIES ${commonlibs}) ecm_add_test(test_cmakemanager.cpp LINK_LIBRARIES ${commonlibs} KDev::Language KDev::Tests KDev::Project kdevcmakemanagernosettings) ecm_add_test(test_ctestfindsuites.cpp LINK_LIBRARIES ${commonlibs} KDev::Language KDev::Tests) ecm_add_test(test_cmakeserver.cpp LINK_LIBRARIES ${commonlibs} KDev::Language KDev::Tests KDev::Project kdevcmakemanagernosettings) # this is not a unit test but a testing tool, kept here for convenience add_executable(kdevprojectopen kdevprojectopen.cpp) target_link_libraries(kdevprojectopen Qt5::Test KDev::Project KDev::Tests kdevcmakecommon) diff --git a/plugins/cppcheck/CMakeLists.txt b/plugins/cppcheck/CMakeLists.txt index 632ab68f93..8e77f72b2d 100644 --- a/plugins/cppcheck/CMakeLists.txt +++ b/plugins/cppcheck/CMakeLists.txt @@ -1,69 +1,63 @@ add_definitions(-DTRANSLATION_DOMAIN=\"kdevcppcheck\") -add_definitions( - -DQT_NO_CAST_FROM_ASCII - -DQT_NO_CAST_TO_ASCII - -DQT_NO_CAST_FROM_BYTEARRAY -) - find_package(Cppcheck QUIET) set_package_properties(Cppcheck PROPERTIES DESCRIPTION "A tool for static C/C++ code analysis" URL "http://cppcheck.sourceforge.net/" PURPOSE "Recommended: required by the non-essential Cppcheck plugin" TYPE RUNTIME ) set(kdevcppcheck_core_SRCS parser.cpp job.cpp parameters.cpp utils.cpp ) ecm_qt_declare_logging_category(kdevcppcheck_core_SRCS HEADER debug.h IDENTIFIER KDEV_CPPCHECK CATEGORY_NAME "kdevelop.plugins.cppcheck" ) kconfig_add_kcfg_files(kdevcppcheck_core_SRCS config/globalsettings.kcfgc config/projectsettings.kcfgc ) add_library(kdevcppcheck_core STATIC ${kdevcppcheck_core_SRCS} ) target_link_libraries(kdevcppcheck_core KDev::Language KDev::Project KDev::Shell ) set(kdevcppcheck_SRCS plugin.cpp problemmodel.cpp config/globalconfigpage.cpp config/projectconfigpage.cpp ) ki18n_wrap_ui(kdevcppcheck_SRCS config/globalconfigpage.ui config/projectconfigpage.ui ) qt5_add_resources(kdevcppcheck_SRCS kdevcppcheck.qrc ) kdevplatform_add_plugin(kdevcppcheck JSON kdevcppcheck.json SOURCES ${kdevcppcheck_SRCS} ) target_link_libraries(kdevcppcheck kdevcppcheck_core KF5::ItemViews ) ecm_install_icons(ICONS icons/128-apps-cppcheck.png DESTINATION ${KDE_INSTALL_ICONDIR} THEME hicolor) if(BUILD_TESTING) add_subdirectory(tests) endif() diff --git a/plugins/custom-buildsystem/tests/CMakeLists.txt b/plugins/custom-buildsystem/tests/CMakeLists.txt index 6c909c95af..5ba650ae40 100644 --- a/plugins/custom-buildsystem/tests/CMakeLists.txt +++ b/plugins/custom-buildsystem/tests/CMakeLists.txt @@ -1,24 +1,30 @@ +remove_definitions( + -DQT_NO_CAST_FROM_ASCII + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY +) + configure_file(testconfig.h.in testconfig.h) ecm_add_test(test_custombuildsystemplugin.cpp ${custom_LOG_SRCS} TEST_NAME test_custombuildsystemplugin LINK_LIBRARIES Qt5::Test KDev::Tests KDev::Project) # Small sample app loading a dialog with the config-ui and a dummy project # Useful for testing UI ideas quickly set( kcm_uitest_SRCS kcmuitestmain.cpp ../custombuildsystemconfigwidget.cpp ../configconstants.cpp ../configwidget.cpp ${custom_LOG_SRCS} ) include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_BINARY_DIR}/.. ) ki18n_wrap_ui( kcm_uitest_SRCS ../configwidget.ui ../custombuildsystemconfigwidget.ui ) add_executable( kcm_uitest ${kcm_uitest_SRCS} ) target_link_libraries( kcm_uitest KDev::Project KDev::Tests ) diff --git a/plugins/custom-definesandincludes/compilerprovider/tests/CMakeLists.txt b/plugins/custom-definesandincludes/compilerprovider/tests/CMakeLists.txt index 22ea21caec..a4839f7e11 100644 --- a/plugins/custom-definesandincludes/compilerprovider/tests/CMakeLists.txt +++ b/plugins/custom-definesandincludes/compilerprovider/tests/CMakeLists.txt @@ -1,10 +1,16 @@ +remove_definitions( + -DQT_NO_CAST_FROM_ASCII + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY +) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../..) set(test_compilerprovider_SRCS test_compilerprovider.cpp ../../tests/projectsgenerator.cpp ) ecm_add_test(${test_compilerprovider_SRCS} TEST_NAME test_compilerprovider LINK_LIBRARIES kdevcompilerprovider KDev::Tests Qt5::Test) diff --git a/plugins/custom-definesandincludes/tests/CMakeLists.txt b/plugins/custom-definesandincludes/tests/CMakeLists.txt index cc0ce4b2c5..43ef61250d 100644 --- a/plugins/custom-definesandincludes/tests/CMakeLists.txt +++ b/plugins/custom-definesandincludes/tests/CMakeLists.txt @@ -1,9 +1,15 @@ +remove_definitions( + -DQT_NO_CAST_FROM_ASCII + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY +) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..) set(test_definesandincludes_SRCS test_definesandincludes.cpp projectsgenerator.cpp) ecm_add_test(${test_definesandincludes_SRCS} TEST_NAME test_definesandincludes LINK_LIBRARIES Qt5::Test KDev::Tests KDev::Project) diff --git a/plugins/custommake/makefileresolver/tests/CMakeLists.txt b/plugins/custommake/makefileresolver/tests/CMakeLists.txt index 3e039ca2f7..77ab79613e 100644 --- a/plugins/custommake/makefileresolver/tests/CMakeLists.txt +++ b/plugins/custommake/makefileresolver/tests/CMakeLists.txt @@ -1,11 +1,17 @@ +remove_definitions( + -DQT_NO_CAST_FROM_ASCII + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY +) + set(test_custommake_SRCS test_custommake.cpp ) ecm_add_test(${test_custommake_SRCS} TEST_NAME test_custommake LINK_LIBRARIES Qt5::Test KDev::Tests KDev::Project kdevmakefileresolver ) diff --git a/plugins/cvs/tests/CMakeLists.txt b/plugins/cvs/tests/CMakeLists.txt index 244fe7c4d9..5395f9c96b 100644 --- a/plugins/cvs/tests/CMakeLists.txt +++ b/plugins/cvs/tests/CMakeLists.txt @@ -1,45 +1,51 @@ +remove_definitions( + -DQT_NO_CAST_FROM_ASCII + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY +) + # Due to the use of system() and some unix-style paths this test will only run # under Linux. (Maybe this can be fixed later) # # Moreover, I'm not sure if there is a cvs commandline client for windows # (need to check this out ...) if (UNIX) # Running the test only makes sense if the cvs command line client # is present. So check for it before adding the test ... find_program(CVS NAMES cvs PATHS /bin /usr/bin /usr/local/bin ) if (CVS) include_directories( .. ${CMAKE_CURRENT_BINARY_DIR}/.. ) set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} ) set(test_cvs_SRCS test_cvs.cpp ../cvsjob.cpp ../cvsproxy.cpp ../cvsannotatejob.cpp ../cvslogjob.cpp ../cvsstatusjob.cpp ../cvsdiffjob.cpp ${kdevcvs_LOG_PART_SRCS} ) ecm_add_test(${test_cvs_SRCS} TEST_NAME test_cvs LINK_LIBRARIES Qt5::Test KDev::Util KDev::Vcs KDev::Tests ) endif () endif () diff --git a/plugins/debuggercommon/tests/CMakeLists.txt b/plugins/debuggercommon/tests/CMakeLists.txt index 2b50fe3e9c..3a3bd6d6b0 100644 --- a/plugins/debuggercommon/tests/CMakeLists.txt +++ b/plugins/debuggercommon/tests/CMakeLists.txt @@ -1,27 +1,33 @@ +remove_definitions( + -DQT_NO_CAST_FROM_ASCII + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY +) + get_filename_component(GDB_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../gdb ABSOLUTE) get_filename_component(LLDB_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../lldb ABSOLUTE) configure_file(debuggers-tests-config.h.in debuggers-tests-config.h) add_subdirectory(debuggees) add_library(kdevdbg_testhelper STATIC testhelper.cpp) target_link_libraries(kdevdbg_testhelper PUBLIC kdevdebuggercommon KDev::Debugger Qt5::Core PRIVATE Qt5::Test ) ecm_add_test(test_miparser LINK_LIBRARIES Qt5::Test kdevdbg_testhelper ) ecm_add_test(test_micommand LINK_LIBRARIES Qt5::Test kdevdbg_testhelper ) ecm_add_test(test_micommandqueue LINK_LIBRARIES Qt5::Test kdevdbg_testhelper ) diff --git a/plugins/docker/tests/CMakeLists.txt b/plugins/docker/tests/CMakeLists.txt index 6ea6087d85..236c5c8f70 100644 --- a/plugins/docker/tests/CMakeLists.txt +++ b/plugins/docker/tests/CMakeLists.txt @@ -1,2 +1,8 @@ +remove_definitions( + -DQT_NO_CAST_FROM_ASCII + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY +) + ecm_add_test(test_docker.cpp LINK_LIBRARIES Qt5::Test Qt5::Core KDev::Interfaces KDevPlatformTests) diff --git a/plugins/filetemplates/tests/CMakeLists.txt b/plugins/filetemplates/tests/CMakeLists.txt index 5ea4633fdc..376483b7a7 100644 --- a/plugins/filetemplates/tests/CMakeLists.txt +++ b/plugins/filetemplates/tests/CMakeLists.txt @@ -1,9 +1,15 @@ +remove_definitions( + -DQT_NO_CAST_FROM_ASCII + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY +) + configure_file(tests_config.h.cmake tests_config.h) add_subdirectory(data/testgenerationtest/templates) ecm_add_test(test_generationtest.cpp LINK_LIBRARIES Qt5::Test KDev::Tests KDev::Language ) diff --git a/plugins/gdb/unittests/CMakeLists.txt b/plugins/gdb/unittests/CMakeLists.txt index 6a70198c97..aae6c65cdc 100644 --- a/plugins/gdb/unittests/CMakeLists.txt +++ b/plugins/gdb/unittests/CMakeLists.txt @@ -1,14 +1,20 @@ +remove_definitions( + -DQT_NO_CAST_FROM_ASCII + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY +) + ecm_add_test(test_gdb.cpp LINK_LIBRARIES kdevgdb_static kdevdbg_testhelper KDev::Tests Qt5::Test ) ecm_add_test(test_gdbprinters.cpp LINK_LIBRARIES Qt5::Core Qt5::Test kdevdebuggercommon ) diff --git a/plugins/genericprojectmanager/tests/CMakeLists.txt b/plugins/genericprojectmanager/tests/CMakeLists.txt index 2d9120cacc..b95880bfeb 100644 --- a/plugins/genericprojectmanager/tests/CMakeLists.txt +++ b/plugins/genericprojectmanager/tests/CMakeLists.txt @@ -1,2 +1,8 @@ +remove_definitions( + -DQT_NO_CAST_FROM_ASCII + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY +) + ecm_add_test(test_projectload.cpp LINK_LIBRARIES Qt5::Test KDev::Project KDev::Interfaces KDev::Tests) diff --git a/plugins/git/tests/CMakeLists.txt b/plugins/git/tests/CMakeLists.txt index 07ab6121eb..332b02da20 100644 --- a/plugins/git/tests/CMakeLists.txt +++ b/plugins/git/tests/CMakeLists.txt @@ -1,28 +1,35 @@ # Running the test only makes sense if the git command line client # is present. So check for it before adding the test... find_program(GIT_FOUND NAMES git) if (GIT_FOUND) include_directories( .. ${CMAKE_CURRENT_BINARY_DIR}/.. ) + + remove_definitions( + -DQT_NO_CAST_FROM_ASCII + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY + ) + set(gittest_SRCS test_git.cpp ../gitplugin.cpp ../gitclonejob.cpp ../stashmanagerdialog.cpp ../stashpatchsource.cpp ../gitjob.cpp ../gitmessagehighlighter.cpp ../gitplugincheckinrepositoryjob.cpp ../gitnameemaildialog.cpp ${kdevgit_LOG_PART_SRCS} ) ki18n_wrap_ui(gittest_SRCS ../stashmanagerdialog.ui) ki18n_wrap_ui(gittest_SRCS ../gitnameemaildialog.ui) ecm_add_test(${gittest_SRCS} TEST_NAME test_kdevgit LINK_LIBRARIES Qt5::Test KDev::Vcs KDev::Util KDev::Tests GUI) endif () diff --git a/plugins/grepview/tests/CMakeLists.txt b/plugins/grepview/tests/CMakeLists.txt index eca7411a32..ddef1d514e 100644 --- a/plugins/grepview/tests/CMakeLists.txt +++ b/plugins/grepview/tests/CMakeLists.txt @@ -1,26 +1,32 @@ +remove_definitions( + -DQT_NO_CAST_FROM_ASCII + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY +) + include_directories( .. ${CMAKE_CURRENT_BINARY_DIR}/.. ) set(findReplaceTest_SRCS test_findreplace.cpp ../grepviewplugin.cpp ../grepdialog.cpp ../grepoutputmodel.cpp ../grepoutputdelegate.cpp ../grepjob.cpp ../grepfindthread.cpp ../grepoutputview.cpp ../greputil.cpp ${kdevgrepview_LOG_PART_SRCS} ) set(kdevgrepview_PART_UI ../grepwidget.ui ../grepoutputview.ui ) ki18n_wrap_ui(findReplaceTest_SRCS ${kdevgrepview_PART_UI}) ecm_add_test(${findReplaceTest_SRCS} TEST_NAME test_findreplace LINK_LIBRARIES Qt5::Test KDev::Language KDev::Project KDev::Util KDev::Tests GUI) diff --git a/plugins/kdeprovider/tests/CMakeLists.txt b/plugins/kdeprovider/tests/CMakeLists.txt index 3e7c9292fe..c6de4ff82d 100644 --- a/plugins/kdeprovider/tests/CMakeLists.txt +++ b/plugins/kdeprovider/tests/CMakeLists.txt @@ -1,7 +1,13 @@ +remove_definitions( + -DQT_NO_CAST_FROM_ASCII + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY +) + set(test_kdeprojectsreader_SRCS ../kdeprojectsreader.cpp ../kdeprojectsmodel.cpp test_kdeprojectsreader.cpp) ecm_add_test(${test_kdeprojectsreader_SRCS} TEST_NAME test_kdeprojectsreader LINK_LIBRARIES Qt5::Test Qt5::Core Qt5::Gui Qt5::Network KDev::Vcs) diff --git a/plugins/lldb/unittests/CMakeLists.txt b/plugins/lldb/unittests/CMakeLists.txt index 6c4bb84053..1d596a9360 100644 --- a/plugins/lldb/unittests/CMakeLists.txt +++ b/plugins/lldb/unittests/CMakeLists.txt @@ -1,16 +1,22 @@ +remove_definitions( + -DQT_NO_CAST_FROM_ASCII + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY +) + ecm_add_test(test_lldb.cpp LINK_LIBRARIES kdevlldb_static kdevdbg_testhelper KDev::Tests Qt5::Test ) # Unit tests for printers ecm_add_test(test_lldbformatters.cpp LINK_LIBRARIES kdevlldb_static kdevdbg_testhelper KDev::Tests Qt5::Test ) diff --git a/plugins/manpage/tests/CMakeLists.txt b/plugins/manpage/tests/CMakeLists.txt index d820c883a6..ce86d6ceba 100644 --- a/plugins/manpage/tests/CMakeLists.txt +++ b/plugins/manpage/tests/CMakeLists.txt @@ -1,11 +1,17 @@ +remove_definitions( + -DQT_NO_CAST_FROM_ASCII + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY +) + set(test_manpagemodel_SRCS test_manpagemodel.cpp ../manpagedocumentation.cpp ../manpagedocumentationwidget.cpp ../manpagemodel.cpp ../manpageplugin.cpp ) ecm_add_test(${test_manpagemodel_SRCS} TEST_NAME test_manpagemodel LINK_LIBRARIES Qt5::Test KDev::Documentation KDev::Interfaces KDev::Tests) diff --git a/plugins/outlineview/CMakeLists.txt b/plugins/outlineview/CMakeLists.txt index 1149ebb735..22c25425d1 100644 --- a/plugins/outlineview/CMakeLists.txt +++ b/plugins/outlineview/CMakeLists.txt @@ -1,29 +1,23 @@ add_definitions(-DTRANSLATION_DOMAIN=\"kdevoutlineview\") -add_definitions( - -DQT_NO_CAST_FROM_ASCII - -DQT_NO_CAST_TO_ASCII - -DQT_NO_CAST_FROM_BYTEARRAY -) - set(kdevoutlineview_SRCS outlineviewplugin.cpp outlinenode.cpp outlinemodel.cpp outlinewidget.cpp ) ecm_qt_declare_logging_category(kdevoutlineview_SRCS HEADER debug.h IDENTIFIER PLUGIN_OUTLINE CATEGORY_NAME "kdevelop.plugins.outline" ) kdevplatform_add_plugin(kdevoutlineview JSON kdevoutlineview.json SOURCES ${kdevoutlineview_SRCS}) target_link_libraries(kdevoutlineview KDev::Interfaces KDev::Language KF5::CoreAddons KF5::I18n KF5::ItemModels KF5::TextEditor ) diff --git a/plugins/perforce/CMakeLists.txt b/plugins/perforce/CMakeLists.txt index 10bd980756..b2c5ec7f35 100644 --- a/plugins/perforce/CMakeLists.txt +++ b/plugins/perforce/CMakeLists.txt @@ -1,26 +1,33 @@ +# temporary while patch series in work 08/2018 +remove_definitions( + -DQT_NO_CAST_FROM_ASCII + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY +) + add_subdirectory(p4clientstub) ecm_qt_declare_logging_category(kdevperforce_LOG_PART_SRCS HEADER debug.h IDENTIFIER PLUGIN_PERFORCE CATEGORY_NAME "kdevelop.plugins.perforce" ) set(kdevperforce_UIS ui/perforceimportmetadatawidget.ui ) set(kdevperforce_PART_SRCS ui/perforceimportmetadatawidget.cpp perforceplugin.cpp perforcepluginmetadata.cpp ${kdevperforce_LOG_PART_SRCS} ) ki18n_wrap_ui(kdevperforce_PART_SRCS ${kdevperforce_UIS}) kdevplatform_add_plugin(kdevperforce JSON kdevperforce.json SOURCES ${kdevperforce_PART_SRCS}) target_link_libraries(kdevperforce KDev::Interfaces KDev::Vcs ) if(BUILD_TESTING) add_subdirectory(tests) endif() diff --git a/plugins/projectfilter/tests/CMakeLists.txt b/plugins/projectfilter/tests/CMakeLists.txt index 0656e5569a..970fcbabc0 100644 --- a/plugins/projectfilter/tests/CMakeLists.txt +++ b/plugins/projectfilter/tests/CMakeLists.txt @@ -1,7 +1,13 @@ +remove_definitions( + -DQT_NO_CAST_FROM_ASCII + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY +) + set(test_projectfilter_SRCS test_projectfilter.cpp ../projectfilter.cpp ../filter.cpp) ecm_add_test(${test_projectfilter_SRCS} TEST_NAME test_projectfilter LINK_LIBRARIES KDev::Project KDev::Tests Qt5::Test) diff --git a/plugins/qmakemanager/parser/tests/CMakeLists.txt b/plugins/qmakemanager/parser/tests/CMakeLists.txt index b5cfdc5dd4..d40da55f75 100644 --- a/plugins/qmakemanager/parser/tests/CMakeLists.txt +++ b/plugins/qmakemanager/parser/tests/CMakeLists.txt @@ -1,34 +1,40 @@ +remove_definitions( + -DQT_NO_CAST_FROM_ASCII + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY +) + ecm_add_test(parsetest.cpp ${qmakecommon_LOG_SRCS} TEST_NAME test_qmakeparse LINK_LIBRARIES Qt5::Test kdevqmakeparser ) ecm_add_test(assignmenttest.cpp ${qmakecommon_LOG_SRCS} TEST_NAME test_qmakeassignment LINK_LIBRARIES Qt5::Test kdevqmakeparser ) ecm_add_test(functionscopetest.cpp testhelpers.cpp ${qmakecommon_LOG_SRCS} TEST_NAME test_qmakefunctionscope LINK_LIBRARIES Qt5::Test kdevqmakeparser ) ecm_add_test(scopetest.cpp testhelpers.cpp ${qmakecommon_LOG_SRCS} TEST_NAME test_qmakescope LINK_LIBRARIES Qt5::Test kdevqmakeparser ) ecm_add_test(lexertest.cpp TEST_NAME test_qmakelexer LINK_LIBRARIES Qt5::Test kdevqmakeparser ) diff --git a/plugins/qmakemanager/tests/CMakeLists.txt b/plugins/qmakemanager/tests/CMakeLists.txt index 6985b0941e..ae68120cdd 100644 --- a/plugins/qmakemanager/tests/CMakeLists.txt +++ b/plugins/qmakemanager/tests/CMakeLists.txt @@ -1,23 +1,29 @@ +remove_definitions( + -DQT_NO_CAST_FROM_ASCII + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY +) + set(QMAKE_TESTS_PROJECTS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/manual") set(QMAKE_TESTS_PROJECTS_DIR "${CMAKE_CURRENT_BINARY_DIR}/manual") file(COPY ${QMAKE_TESTS_PROJECTS_SOURCE_DIR} DESTINATION "${QMAKE_TESTS_PROJECTS_DIR}/..") get_property(QMAKE_EXECUTABLE_LOCATION TARGET Qt5::qmake PROPERTY LOCATION) configure_file(qmaketestconfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/qmaketestconfig.h) set(test_qmakefile_SRCS test_qmakefile.cpp) ecm_add_test(${test_qmakefile_SRCS} TEST_NAME test_qmakefile LINK_LIBRARIES Qt5::Test KDev::Tests kdevqmakeparser kdevqmakecommon ) set(test_qmakeproject_SRCS test_qmakeproject.cpp) ecm_add_test(${test_qmakeproject_SRCS} TEST_NAME test_qmakeproject LINK_LIBRARIES Qt5::Test KDev::Tests KDev::Util kdevqmakeparser kdevqmakecommon ) diff --git a/plugins/qmljs/3rdparty/qtcreator-libs/CMakeLists.txt b/plugins/qmljs/3rdparty/qtcreator-libs/CMakeLists.txt index 232be05a49..849a23d1ce 100644 --- a/plugins/qmljs/3rdparty/qtcreator-libs/CMakeLists.txt +++ b/plugins/qmljs/3rdparty/qtcreator-libs/CMakeLists.txt @@ -1,77 +1,83 @@ +remove_definitions( + -DQT_NO_CAST_FROM_ASCII + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY +) + qt5_wrap_ui(uifiles_SRCS utils/projectintropage.ui utils/filewizardpage.ui utils/newclasswidget.ui ) add_library(kdevqtc-qmlsupport STATIC ${uifiles_SRCS} languageutils/componentversion.cpp languageutils/fakemetaobject.cpp qmljs/parser/qmldirparser.cpp qmljs/parser/qmlerror.cpp qmljs/parser/qmljsast.cpp qmljs/parser/qmljsastvisitor.cpp qmljs/parser/qmljsengine_p.cpp qmljs/parser/qmljsgrammar.cpp qmljs/parser/qmljslexer.cpp qmljs/parser/qmljsparser.cpp qmljs/qmljsdocument.cpp qmljs/qmljsutils.cpp utils/changeset.cpp utils/fileutils.cpp utils/qtcassert.cpp utils/savefile.cpp utils/json.cpp utils/filesystemwatcher.cpp utils/environment.cpp utils/hostosinfo.cpp qmljs/persistenttrie.cpp qmljs/qmljsbind.cpp qmljs/qmljsbundle.cpp qmljs/qmljscontext.cpp qmljs/qmljsdialect.cpp qmljs/qmljsevaluate.cpp qmljs/qmljsimportdependencies.cpp qmljs/qmljsinterpreter.cpp qmljs/qmljsmodelmanagerinterface.cpp qmljs/qmljsplugindumper.cpp qmljs/qmljsqrcparser.cpp qmljs/qmljsscopeastpath.cpp qmljs/qmljsscopebuilder.cpp qmljs/qmljsscopechain.cpp qmljs/qmljstypedescriptionreader.cpp qmljs/qmljsvalueowner.cpp qmljs/qmljsviewercontext.cpp ) if (APPLE) target_sources(kdevqtc-qmlsupport PRIVATE utils/fileutils_mac.mm) target_link_libraries(kdevqtc-qmlsupport LINK_PRIVATE "-framework Foundation" ) endif() # silence warnings which won't be fixed in this 3rd-party code copy, to keep diff small if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_target_compile_flag_if_supported(kdevqtc-qmlsupport PRIVATE "-Wno-documentation") endif() if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_target_compile_flag_if_supported(kdevqtc-qmlsupport PRIVATE "-Wno-pedantic") add_target_compile_flag_if_supported(kdevqtc-qmlsupport PRIVATE "-Wno-implicit-fallthrough") add_target_compile_flag_if_supported(kdevqtc-qmlsupport PRIVATE "-Wno-zero-as-null-pointer-constant") endif() if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") add_target_compile_flag_if_supported(kdevqtc-qmlsupport PRIVATE "-Wno-suggest-override") add_target_compile_flag_if_supported(kdevqtc-qmlsupport PRIVATE "-Wno-class-memaccess") endif() target_compile_definitions(kdevqtc-qmlsupport PUBLIC -DLANGUAGEUTILS_BUILD_DIR -DQTCREATOR_UTILS_LIB -DQT_CREATOR -DQML_BUILD_STATIC_LIB) # add as SYSTEM include dir so compiler does not emit warnings for the lib headers target_include_directories(kdevqtc-qmlsupport SYSTEM PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(kdevqtc-qmlsupport LINK_PRIVATE Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Network Qt5::Xml ) diff --git a/plugins/qmljs/codecompletion/tests/CMakeLists.txt b/plugins/qmljs/codecompletion/tests/CMakeLists.txt index 5f62dc241d..9adbcb8319 100644 --- a/plugins/qmljs/codecompletion/tests/CMakeLists.txt +++ b/plugins/qmljs/codecompletion/tests/CMakeLists.txt @@ -1,6 +1,12 @@ +remove_definitions( + -DQT_NO_CAST_FROM_ASCII + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY +) + ecm_add_test(test_qmljscompletion.cpp LINK_LIBRARIES Qt5::Test KDev::Tests kdevqmljscompletion ) diff --git a/plugins/qmljs/duchain/tests/CMakeLists.txt b/plugins/qmljs/duchain/tests/CMakeLists.txt index a23ffabe8d..afdc8ed268 100644 --- a/plugins/qmljs/duchain/tests/CMakeLists.txt +++ b/plugins/qmljs/duchain/tests/CMakeLists.txt @@ -1,15 +1,21 @@ +remove_definitions( + -DQT_NO_CAST_FROM_ASCII + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY +) + ecm_add_test(test_qmljscontexts.cpp LINK_LIBRARIES Qt5::Test KDev::Language KDev::Tests kdevqmljsduchain ) ecm_add_test(test_qmljsdeclarations.cpp LINK_LIBRARIES Qt5::Test KDev::Language KDev::Tests kdevqmljsduchain ) diff --git a/plugins/qmljs/tests/CMakeLists.txt b/plugins/qmljs/tests/CMakeLists.txt index 60e42bf563..4716c56181 100644 --- a/plugins/qmljs/tests/CMakeLists.txt +++ b/plugins/qmljs/tests/CMakeLists.txt @@ -1,17 +1,23 @@ +remove_definitions( + -DQT_NO_CAST_FROM_ASCII + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY +) + add_executable(qml-parser qml-parser.cpp ) target_link_libraries(qml-parser KDev::Tests kdevqmljsduchain ) configure_file("testfilepaths.h.cmake" "testfilepaths.h" ESCAPE_QUOTES) ecm_add_test(test_files.cpp LINK_LIBRARIES Qt5::Test Qt5::Core KDev::Language KDev::Tests kdevqmljsduchain ) diff --git a/plugins/qthelp/tests/CMakeLists.txt b/plugins/qthelp/tests/CMakeLists.txt index 06c751e8a2..53ee49c27a 100644 --- a/plugins/qthelp/tests/CMakeLists.txt +++ b/plugins/qthelp/tests/CMakeLists.txt @@ -1,26 +1,32 @@ +remove_definitions( + -DQT_NO_CAST_FROM_ASCII + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY +) + include_directories(${CMAKE_CURRENT_BINARY_DIR}/..) configure_file(testqthelpconfig.h.in testqthelpconfig.h) set(test_qthelpplugin_SRCS test_qthelpplugin.cpp ../qthelpplugin.cpp ../qthelpproviderabstract.cpp ../qthelpprovider.cpp ../qthelpdocumentation.cpp ../qthelpqtdoc.cpp ../qthelp_config_shared.cpp ../qthelpconfig.cpp ../qthelpnetwork.cpp ${kdevqthelp_LOG_SRCS} ) ki18n_wrap_ui(test_qthelpplugin_SRCS ../qthelpconfig.ui ../qthelpconfigeditdialog.ui ) ecm_add_test(${test_qthelpplugin_SRCS} TEST_NAME test_qthelpplugin LINK_LIBRARIES Qt5::Test KF5::NewStuff KF5::KIOWidgets KF5::TextEditor KF5::IconThemes Qt5::Help KDev::Tests KDev::Documentation ) diff --git a/plugins/quickopen/tests/CMakeLists.txt b/plugins/quickopen/tests/CMakeLists.txt index 986ee75acc..86c0458c53 100644 --- a/plugins/quickopen/tests/CMakeLists.txt +++ b/plugins/quickopen/tests/CMakeLists.txt @@ -1,13 +1,19 @@ +remove_definitions( + -DQT_NO_CAST_FROM_ASCII + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY +) + add_library(quickopentestbase STATIC quickopentestbase.cpp ../projectfilequickopen.cpp) target_link_libraries(quickopentestbase PUBLIC Qt5::Test KF5::IconThemes KDev::Tests KDev::Project KDev::Language) ecm_add_test(test_quickopen.cpp LINK_LIBRARIES quickopentestbase) if(NOT COMPILER_OPTIMIZATIONS_DISABLED) ecm_add_test(bench_quickopen.cpp LINK_LIBRARIES quickopentestbase) set_tests_properties(bench_quickopen PROPERTIES TIMEOUT 30) endif() diff --git a/plugins/subversion/tests/CMakeLists.txt b/plugins/subversion/tests/CMakeLists.txt index a18a0c177c..9c4d311210 100644 --- a/plugins/subversion/tests/CMakeLists.txt +++ b/plugins/subversion/tests/CMakeLists.txt @@ -1,9 +1,15 @@ +remove_definitions( + -DQT_NO_CAST_FROM_ASCII + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY +) + ecm_add_test(test_svnrecursiveadd.cpp LINK_LIBRARIES Qt5::Test Qt5::Gui KDev::Tests KDev::Util KDev::Vcs ) ecm_add_test(test_svnimport.cpp LINK_LIBRARIES Qt5::Test Qt5::Gui KDev::Tests KDev::Util KDev::Vcs )