Commit 51d34999 authored by Vincent Pinon's avatar Vincent Pinon

Windows crash reports

parent 294cc23d
......@@ -92,6 +92,9 @@ endif()
find_package(KF5 REQUIRED COMPONENTS Archive Bookmarks CoreAddons Config ConfigWidgets
DBusAddons KIO WidgetsAddons NotifyConfig NewStuff XmlGui Notifications GuiAddons TextWidgets IconThemes
OPTIONAL_COMPONENTS DocTools FileMetaData Crash Purpose)
if(WIN32)
find_package(DrMinGW)
endif(WIN32)
if (KF5FileMetaData_FOUND)
message(STATUS "Found KF5 FileMetadata to extract file metadata")
......
# cmake macro to find DrMinGW Windows crash handler
#
# copyright (c) 2018, Vincent Pinon <vpinon@kde.org>
#
# once done this will define:
#
# DRMINGW_FOUND - system has DrMinGW
# DRMINGW_INCLUDE_DIR - the DrMinGW include directory
# DRMINGW_LIBRARY - the libraries needed to use DrMinGW
#
# redistribution and use is allowed according to the terms of the bsd license.
if (DRMINGW_INCLUDE_DIR AND DRMINGW_LIBRARY)
# already in cache, be silent
set (DRMINGW_FIND_QUIETLY true)
endif (DRMINGW_INCLUDE_DIR AND DRMINGW_LIBRARY)
find_path (DRMINGW_INCLUDE_DIR exchndl.h)
find_library (DRMINGW_LIBRARY exchndl)
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args (DrMinGW DEFAULT_MSG DRMINGW_INCLUDE_DIR DRMINGW_LIBRARY)
mark_as_advanced(DRMINGW_INCLUDE_DIR DRMINGW_LIBRARY)
......@@ -294,10 +294,13 @@ if (KF5_FILEMETADATA)
target_link_libraries(kdenlive KF5::FileMetaData)
endif()
if (KF5Crash_FOUND)
if (DRMINGW_FOUND)
add_definitions(-DUSE_DRMINGW)
target_link_libraries(kdenlive ${DRMINGW_LIBRARY})
elseif (KF5Crash_FOUND)
add_definitions(-DKF5_USE_CRASH)
target_link_libraries(kdenlive KF5::Crash)
endif()
endif(DRMINGW_FOUND)
target_link_libraries(kdenlive Qt5::Script Qt5::Widgets Qt5::Concurrent Qt5::Qml Qt5::Quick)
......
......@@ -26,9 +26,12 @@
#include "kxmlgui_version.h"
#include <KAboutData>
#ifdef KF5_USE_CRASH
#include <KCrash>
#ifdef USE_DRMINGW
# include <exchndl.h>
#elif defined(KF5_USE_CRASH)
# include <KCrash>
#endif
#include <KIconLoader>
#include <KSharedConfig>
#include <KConfigGroup>
......@@ -147,7 +150,9 @@ int main(int argc, char *argv[])
parser.process(app);
aboutData.processCommandLine(&parser);
#ifdef KF5_USE_CRASH
#ifdef USE_DRMINGW
ExcHndlInit();
#elif defined(KF5_USE_CRASH)
KCrash::initialize();
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment