diff --git a/code/nel/tools/misc/CMakeLists.txt b/code/nel/tools/misc/CMakeLists.txt index c9bbcd058..f7f1b9a39 100644 --- a/code/nel/tools/misc/CMakeLists.txt +++ b/code/nel/tools/misc/CMakeLists.txt @@ -3,8 +3,10 @@ SUBDIRS(bnp_make disp_sheet_id extract_filename lock make_sheet_id xml_packer) IF(WITH_QT) ADD_SUBDIRECTORY(words_dic_qt) ADD_SUBDIRECTORY(message_box_qt) - ADD_SUBDIRECTORY(crash_report) ENDIF(WITH_QT) +IF(WITH_QT OR WITH_QT5) + ADD_SUBDIRECTORY(crash_report) +ENDIF(WITH_QT OR WITH_QT5) IF(WIN32) ADD_SUBDIRECTORY(exec_timeout) diff --git a/code/nel/tools/misc/crash_report/CMakeLists.txt b/code/nel/tools/misc/crash_report/CMakeLists.txt index 0e2d2a9bc..fe063f6d0 100644 --- a/code/nel/tools/misc/crash_report/CMakeLists.txt +++ b/code/nel/tools/misc/crash_report/CMakeLists.txt @@ -1,39 +1,65 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SRC_DIR} ${QT_INCLUDES}) FILE(GLOB CRASHREPORT_SRC *.cpp) -FILE(GLOB CRASHREPORT_HDR *h) +FILE(GLOB CRASHREPORT_HDR *.h) +FILE(GLOB CRASHREPORT_UI *.ui) -SET(CRASHREPORT_MOC_HDR -crash_report_socket.h -crash_report_widget.h +FILE(GLOB CRASHREPORT_MOC_HDR + crash_report_socket.h + crash_report_widget.h ) -SET(CRASHREPORT_UI -crash_report_widget.ui -) +find_package(Qt5Network) -SET(QT_USE_QTGUI TRUE) -SET(QT_USE_QTNETWORK TRUE) -SET(QT_USE_QTMAIN TRUE) -SET(QT_USE_QTOPENGL FALSE) -SET(QT_USE_QTXML FALSE) +IF(!WITH_QT5) + SET(QT_USE_QTGUI TRUE) + SET(QT_USE_QTNETWORK TRUE) + SET(QT_USE_QTMAIN TRUE) + SET(QT_USE_QTOPENGL FALSE) + SET(QT_USE_QTXML FALSE) + INCLUDE(${QT_USE_FILE}) +ENDIF(!WITH_QT5) -INCLUDE(${QT_USE_FILE}) ADD_DEFINITIONS(${QT_DEFINITIONS}) -QT4_WRAP_CPP(CRASHREPORT_MOC_SRC ${CRASHREPORT_MOC_HDR}) -QT4_WRAP_UI(CRASHREPORT_UI_HDR ${CRASHREPORT_UI}) +IF(WITH_QT5) + SET(CMAKE_AUTOMOC ON) + QT5_WRAP_CPP(CRASHREPORT_MOC_SRC ${CRASHREPORT_MOC_HDR}) + QT5_WRAP_UI(CRASHREPORT_UI_HDR ${CRASHREPORT_UI}) +ELSE(WITH_QT5) + QT4_WRAP_CPP(CRASHREPORT_MOC_SRC ${CRASHREPORT_MOC_HDR}) + QT4_WRAP_UI(CRASHREPORT_UI_HDR ${CRASHREPORT_UI}) +ENDIF(WITH_QT5) + +SOURCE_GROUP(resources FILES ${CRASHREPORT_UI}) +IF(!WITH_QT5) + SOURCE_GROUP(generated FILES ${CRASHREPORT_UI_HDR} ${CRASHREPORT_MOC_SRC}) +ENDIF(!WITH_QT5) +SOURCE_GROUP("" FILES ${CRASHREPORT_SRC} ${CRASHREPORT_HDR}) -SOURCE_GROUP(QtResources FILES ${CRASHREPORT_UI}) -SOURCE_GROUP(QtGeneratedUiHdr FILES ${CRASHREPORT_UI_HDR}) -SOURCE_GROUP(QtGeneratedMocQrcSrc FILES ${CRASHREPORT_MOC_SRC}) -SOURCE_GROUP("source files" FILES ${CRASHREPORT_SRC}) -SOURCE_GROUP("header files" FILES ${CRASHREPORT_HDR}) +IF(WITH_QT5) + ADD_EXECUTABLE(crash_report WIN32 MACOSX_BUNDLE + ${CRASHREPORT_SRC} + ${CRASHREPORT_HDR} + ${CRASHREPORT_UI} + ) +ELSE(WITH_QT5) + ADD_EXECUTABLE(crash_report WIN32 MACOSX_BUNDLE + ${CRASHREPORT_SRC} + ${CRASHREPORT_MOC_HDR} + ${CRASHREPORT_MOC_SRC} + ${CRASHREPORT_UI_HDR} + ) +ENDIF(WITH_QT5) -ADD_EXECUTABLE(crash_report WIN32 MACOSX_BUNDLE ${CRASHREPORT_SRC} ${CRASHREPORT_MOC_HDR} ${CRASHREPORT_MOC_SRC} ${CRASHREPORT_UI_HDR}) -TARGET_LINK_LIBRARIES(crash_report ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY}) +IF(WITH_QT5) + TARGET_LINK_LIBRARIES(crash_report + Qt5::Widgets + Qt5::Network) +ELSE(WITH_QT5) + TARGET_LINK_LIBRARIES(crash_report ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY}) +ENDIF(WITH_QT5) NL_DEFAULT_PROPS(crash_report "NeL, Tools, Misc: Crash Report") NL_ADD_RUNTIME_FLAGS(crash_report) INSTALL(TARGETS crash_report RUNTIME DESTINATION ${NL_BIN_PREFIX}) -