2022-06-21 21:07:06 +02:00
|
|
|
cmake_minimum_required(VERSION 3.5)
|
|
|
|
|
2023-02-12 23:35:20 +01:00
|
|
|
project(LogDoctor VERSION 2.04 LANGUAGES CXX)
|
2022-06-21 21:07:06 +02:00
|
|
|
|
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
|
|
|
|
|
|
set(CMAKE_AUTOUIC ON)
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
|
|
set(CMAKE_AUTORCC ON)
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
|
2022-09-01 00:46:42 +02:00
|
|
|
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets Charts LinguistTools Sql Network)
|
|
|
|
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets Charts LinguistTools Sql Network)
|
2022-07-08 21:29:08 +02:00
|
|
|
|
2022-06-21 21:07:06 +02:00
|
|
|
|
|
|
|
set(TS_FILES
|
2023-01-12 23:05:39 +01:00
|
|
|
translations/LogDoctor_en_GB.ts
|
|
|
|
translations/LogDoctor_es_ES.ts
|
|
|
|
translations/LogDoctor_fr_FR.ts
|
|
|
|
translations/LogDoctor_it_IT.ts
|
|
|
|
translations/LogDoctor_ja_JP.ts
|
|
|
|
translations/LogDoctor_pt_BR.ts
|
2022-06-21 21:07:06 +02:00
|
|
|
)
|
|
|
|
|
2022-08-27 11:18:02 +02:00
|
|
|
|
2022-06-21 21:07:06 +02:00
|
|
|
set(PROJECT_SOURCES
|
2022-10-15 15:30:47 +02:00
|
|
|
main.cpp
|
|
|
|
mainwindow.ui
|
|
|
|
mainwindow.h
|
|
|
|
mainwindow.cpp
|
|
|
|
|
2023-06-03 17:21:40 +02:00
|
|
|
defines/web_servers.h
|
|
|
|
|
2023-05-14 15:44:11 +02:00
|
|
|
customs/treewidgetitems.h
|
|
|
|
|
2022-10-15 15:30:47 +02:00
|
|
|
utilities/checks.h
|
|
|
|
utilities/checks.cpp
|
|
|
|
utilities/colors.h
|
|
|
|
utilities/colors.cpp
|
|
|
|
utilities/gzip.h
|
|
|
|
utilities/gzip.cpp
|
|
|
|
utilities/io.h
|
|
|
|
utilities/io.cpp
|
2023-04-30 20:31:27 +02:00
|
|
|
utilities/memory.h
|
|
|
|
utilities/memory.cpp
|
2023-01-27 02:48:46 +01:00
|
|
|
utilities/printables.h
|
|
|
|
utilities/printables.cpp
|
2022-10-15 15:30:47 +02:00
|
|
|
utilities/rtf.h
|
|
|
|
utilities/rtf.cpp
|
|
|
|
utilities/strings.h
|
|
|
|
utilities/strings.cpp
|
2022-11-07 21:29:29 +01:00
|
|
|
utilities/stylesheets.h
|
|
|
|
utilities/stylesheets.cpp
|
2022-10-15 15:30:47 +02:00
|
|
|
utilities/vectors.h
|
|
|
|
|
|
|
|
modules/shared.h
|
|
|
|
modules/shared.cpp
|
|
|
|
|
|
|
|
modules/exceptions.h
|
|
|
|
modules/exceptions.cpp
|
|
|
|
modules/tb.h
|
|
|
|
modules/tb.cpp
|
|
|
|
|
|
|
|
modules/dialogs.h
|
|
|
|
modules/dialogs.cpp
|
|
|
|
modules/dialogs/dialogmsg.ui
|
|
|
|
modules/dialogs/dialogmsg.h
|
|
|
|
modules/dialogs/dialogmsg.cpp
|
|
|
|
modules/dialogs/dialogbool.ui
|
|
|
|
modules/dialogs/dialogbool.h
|
|
|
|
modules/dialogs/dialogbool.cpp
|
|
|
|
modules/dialogs/dialogdia.ui
|
|
|
|
modules/dialogs/dialogdia.h
|
|
|
|
modules/dialogs/dialogdia.cpp
|
|
|
|
|
|
|
|
modules/craplog/craplog.h
|
|
|
|
modules/craplog/craplog.cpp
|
2023-02-11 20:22:42 +01:00
|
|
|
modules/craplog/modules/lib.h
|
2022-10-15 15:30:47 +02:00
|
|
|
modules/craplog/modules/datetime.h
|
|
|
|
modules/craplog/modules/datetime.cpp
|
|
|
|
modules/craplog/modules/donuts.h
|
|
|
|
modules/craplog/modules/donuts.cpp
|
|
|
|
modules/craplog/modules/formats.h
|
|
|
|
modules/craplog/modules/formats.cpp
|
|
|
|
modules/craplog/modules/hash.h
|
|
|
|
modules/craplog/modules/hash.cpp
|
|
|
|
modules/craplog/modules/logs.h
|
|
|
|
modules/craplog/modules/logs.cpp
|
|
|
|
modules/craplog/modules/sha256.h
|
|
|
|
modules/craplog/modules/sha256.cpp
|
2023-05-14 14:23:18 +02:00
|
|
|
modules/craplog/modules/workers/lister.h
|
|
|
|
modules/craplog/modules/workers/lister.cpp
|
|
|
|
modules/craplog/modules/workers/parser.h
|
|
|
|
modules/craplog/modules/workers/parser.cpp
|
2023-06-03 16:43:16 +02:00
|
|
|
modules/craplog/modules/workers/parser_async.h
|
|
|
|
modules/craplog/modules/workers/parser_async.cpp
|
2022-10-15 15:30:47 +02:00
|
|
|
|
|
|
|
modules/crapview/crapview.h
|
|
|
|
modules/crapview/crapview.cpp
|
2023-07-23 11:00:46 +02:00
|
|
|
modules/crapview/modules/filters.h
|
|
|
|
modules/crapview/modules/filters.cpp
|
2022-10-15 15:30:47 +02:00
|
|
|
modules/crapview/modules/query.h
|
|
|
|
modules/crapview/modules/query.cpp
|
|
|
|
|
|
|
|
modules/craphelp/craphelp.ui
|
|
|
|
modules/craphelp/craphelp.h
|
|
|
|
modules/craphelp/craphelp.cpp
|
|
|
|
|
2022-11-13 01:36:54 +01:00
|
|
|
modules/crapup/crapup.ui
|
2022-10-15 15:30:47 +02:00
|
|
|
modules/crapup/crapup.h
|
|
|
|
modules/crapup/crapup.cpp
|
|
|
|
|
|
|
|
modules/crapinfo/crapinfo.ui
|
|
|
|
modules/crapinfo/crapinfo.h
|
|
|
|
modules/crapinfo/crapinfo.cpp
|
|
|
|
|
|
|
|
tools/crapnote/crapnote.ui
|
|
|
|
tools/crapnote/crapnote.h
|
|
|
|
tools/crapnote/crapnote.cpp
|
|
|
|
|
2022-11-10 18:22:06 +01:00
|
|
|
games/games.h
|
|
|
|
games/games.cpp
|
|
|
|
|
2022-11-24 22:30:34 +01:00
|
|
|
games/crisscross/crisscross.ui
|
|
|
|
games/crisscross/game.h
|
|
|
|
games/crisscross/game.cpp
|
|
|
|
|
|
|
|
games/snake/snake.ui
|
|
|
|
games/snake/game.h
|
|
|
|
games/snake/game.cpp
|
|
|
|
games/snake/snake.h
|
|
|
|
games/snake/snake.cpp
|
|
|
|
games/snake/food.h
|
|
|
|
games/snake/food.cpp
|
2022-10-17 20:20:29 +02:00
|
|
|
|
2022-10-15 15:30:47 +02:00
|
|
|
resources/resources.qrc
|
|
|
|
${TS_FILES}
|
2022-06-21 21:07:06 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
|
2022-07-26 20:47:37 +02:00
|
|
|
qt_add_executable(LogDoctor
|
2022-06-21 21:07:06 +02:00
|
|
|
MANUAL_FINALIZATION
|
|
|
|
${PROJECT_SOURCES}
|
|
|
|
)
|
|
|
|
# Define target properties for Android with Qt 6 as:
|
2022-07-26 20:47:37 +02:00
|
|
|
# set_property(TARGET LogDoctor APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR
|
2022-06-21 21:07:06 +02:00
|
|
|
# ${CMAKE_CURRENT_SOURCE_DIR}/android)
|
|
|
|
# For more information, see https://doc.qt.io/qt-6/qt-add-executable.html#target-creation
|
|
|
|
|
|
|
|
qt_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
|
|
|
|
else()
|
|
|
|
if(ANDROID)
|
2022-07-26 20:47:37 +02:00
|
|
|
add_library(LogDoctor SHARED
|
2022-06-21 21:07:06 +02:00
|
|
|
${PROJECT_SOURCES}
|
|
|
|
)
|
|
|
|
# Define properties for Android with Qt 5 after find_package() calls as:
|
|
|
|
# set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android")
|
|
|
|
else()
|
2022-07-26 20:47:37 +02:00
|
|
|
add_executable(LogDoctor
|
2022-06-21 21:07:06 +02:00
|
|
|
${PROJECT_SOURCES}
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
|
|
|
|
endif()
|
|
|
|
|
2022-09-01 00:46:42 +02:00
|
|
|
if(WIN32)
|
2022-10-15 15:30:47 +02:00
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-Bstatic -lgcc -lstdc++ -lwinpthread")
|
2022-09-01 00:46:42 +02:00
|
|
|
target_link_libraries(LogDoctor PRIVATE
|
|
|
|
-static Qt${QT_VERSION_MAJOR}::Widgets
|
|
|
|
-static Qt${QT_VERSION_MAJOR}::Charts
|
|
|
|
-static Qt${QT_VERSION_MAJOR}::Sql
|
|
|
|
-static Qt${QT_VERSION_MAJOR}::Network)
|
|
|
|
else()
|
2023-06-11 23:32:26 +02:00
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")
|
2022-10-15 15:30:47 +02:00
|
|
|
target_link_libraries(LogDoctor PRIVATE
|
|
|
|
Qt${QT_VERSION_MAJOR}::Widgets
|
|
|
|
Qt${QT_VERSION_MAJOR}::Charts
|
|
|
|
Qt${QT_VERSION_MAJOR}::Sql
|
|
|
|
Qt${QT_VERSION_MAJOR}::Network)
|
2022-09-01 00:46:42 +02:00
|
|
|
# Include zlib
|
2022-10-15 15:30:47 +02:00
|
|
|
find_package(ZLIB REQUIRED)
|
2022-09-01 00:46:42 +02:00
|
|
|
include_directories(${ZLIB_INCLUDE_DIRS})
|
|
|
|
target_link_libraries(LogDoctor PRIVATE ${ZLIB_LIBRARIES})
|
|
|
|
endif()
|
2022-08-12 22:13:14 +02:00
|
|
|
|
2023-04-29 15:10:08 +02:00
|
|
|
set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os")
|
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
|
|
|
|
|
2022-08-17 23:36:39 +02:00
|
|
|
|
2022-11-16 17:30:07 +01:00
|
|
|
if(APPLE)
|
|
|
|
set_target_properties(LogDoctor PROPERTIES
|
|
|
|
MACOSX_BUNDLE TRUE
|
|
|
|
#MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
|
|
|
|
MACOSX_BUNDLE_BUNDLE_NAME ${PROJECT_NAME}
|
|
|
|
MACOSX_BUNDLE_ICON_FILE ${PROJECT_NAME}
|
|
|
|
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
|
|
|
|
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
|
|
|
|
)
|
|
|
|
elseif(WIN32)
|
|
|
|
set_target_properties(LogDoctor PROPERTIES
|
|
|
|
WIN32_EXECUTABLE TRUE
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2022-06-21 21:07:06 +02:00
|
|
|
|
|
|
|
if(QT_VERSION_MAJOR EQUAL 6)
|
2022-07-26 20:47:37 +02:00
|
|
|
qt_finalize_executable(LogDoctor)
|
2022-06-21 21:07:06 +02:00
|
|
|
endif()
|
2022-12-03 18:10:51 +01:00
|
|
|
|
2022-12-03 19:36:04 +01:00
|
|
|
|
2023-01-12 23:05:39 +01:00
|
|
|
# CTest
|
2023-04-11 23:28:55 +02:00
|
|
|
include(CTest)
|
2023-01-12 23:05:39 +01:00
|
|
|
enable_testing()
|
2023-04-11 23:28:55 +02:00
|
|
|
add_executable(LogDocTester
|
|
|
|
tests/main.cpp
|
|
|
|
tests/white_box.h
|
|
|
|
tests/white_box.cpp
|
|
|
|
# 2 test
|
|
|
|
modules/exceptions.h
|
|
|
|
modules/exceptions.cpp
|
|
|
|
modules/craplog/modules/lib.h
|
|
|
|
utilities/gzip.h
|
|
|
|
utilities/gzip.cpp
|
|
|
|
utilities/io.h
|
|
|
|
utilities/io.cpp
|
|
|
|
utilities/strings.h
|
|
|
|
utilities/strings.cpp
|
|
|
|
utilities/vectors.h
|
|
|
|
modules/craplog/modules/datetime.h
|
|
|
|
modules/craplog/modules/datetime.cpp
|
|
|
|
modules/craplog/modules/formats.h
|
|
|
|
modules/craplog/modules/formats.cpp
|
|
|
|
modules/craplog/modules/logs.h
|
|
|
|
modules/craplog/modules/logs.cpp
|
2023-07-23 11:00:46 +02:00
|
|
|
modules/crapview/modules/filters.h
|
|
|
|
modules/crapview/modules/filters.cpp
|
2023-04-11 23:28:55 +02:00
|
|
|
)
|
|
|
|
if(WIN32)
|
|
|
|
target_link_libraries(LogDocTester PRIVATE
|
|
|
|
-static Qt${QT_VERSION_MAJOR}::Widgets
|
|
|
|
#-static Qt${QT_VERSION_MAJOR}::Sql
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
target_link_libraries(LogDocTester PRIVATE
|
|
|
|
Qt${QT_VERSION_MAJOR}::Widgets
|
|
|
|
#Qt${QT_VERSION_MAJOR}::Sql
|
|
|
|
${ZLIB_LIBRARIES}
|
|
|
|
)
|
|
|
|
endif()
|
2023-01-12 23:05:39 +01:00
|
|
|
add_test(
|
2023-04-11 23:28:55 +02:00
|
|
|
NAME LogDocTester
|
|
|
|
COMMAND $<TARGET_FILE:LogDocTester>
|
2023-01-12 23:05:39 +01:00
|
|
|
)
|
|
|
|
|
2023-02-11 20:22:42 +01:00
|
|
|
|
2022-12-06 21:24:04 +01:00
|
|
|
# Deb/Flatpak
|
2022-12-03 18:10:51 +01:00
|
|
|
if(UNIX AND NOT APPLE)
|
2022-12-03 19:36:04 +01:00
|
|
|
install(TARGETS
|
|
|
|
LogDoctor
|
|
|
|
RUNTIME DESTINATION /usr/bin
|
|
|
|
CONFIGURATIONS Release
|
|
|
|
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ
|
|
|
|
RENAME logdoctor
|
2022-12-03 18:10:51 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
install(FILES
|
|
|
|
${CMAKE_SOURCE_DIR}/installation_stuff/LogDoctor.desktop
|
|
|
|
DESTINATION /usr/share/applications
|
|
|
|
)
|
|
|
|
|
2022-12-03 19:36:04 +01:00
|
|
|
install(DIRECTORY
|
|
|
|
DESTINATION /usr/share/LogDoctor
|
2022-12-03 18:10:51 +01:00
|
|
|
)
|
|
|
|
install(FILES
|
|
|
|
${CMAKE_SOURCE_DIR}/installation_stuff/LogDoctor.svg
|
|
|
|
DESTINATION /usr/share/LogDoctor
|
|
|
|
)
|
|
|
|
install(DIRECTORY
|
2022-12-06 21:24:04 +01:00
|
|
|
${CMAKE_SOURCE_DIR}/installation_stuff/logdocdata/help
|
2022-12-03 18:10:51 +01:00
|
|
|
DESTINATION /usr/share/LogDoctor
|
|
|
|
)
|
|
|
|
install(DIRECTORY
|
2022-12-06 21:24:04 +01:00
|
|
|
${CMAKE_SOURCE_DIR}/installation_stuff/logdocdata/licenses
|
2022-12-03 18:10:51 +01:00
|
|
|
DESTINATION /usr/share/LogDoctor
|
|
|
|
)
|
|
|
|
endif()
|