LogDoctor/logdoctor/CMakeLists.txt

147 lines
4.1 KiB
CMake
Raw Normal View History

2022-06-21 21:07:06 +02:00
cmake_minimum_required(VERSION 3.5)
project(LogDoctor VERSION 6.0 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-07-10 18:07:51 +02:00
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets Charts LinguistTools Sql)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets Charts LinguistTools Sql)
2022-07-08 21:29:08 +02:00
2022-06-21 21:07:06 +02:00
set(TS_FILES
2022-08-18 21:12:27 +02:00
translations/LogDoctor_en.ts
translations/LogDoctor_es.ts
translations/LogDoctor_fr.ts
translations/LogDoctor_it.ts
2022-06-21 21:07:06 +02:00
)
set(PROJECT_SOURCES
main.cpp
2022-08-11 21:02:28 +02:00
mainwindow.ui
2022-06-21 21:07:06 +02:00
mainwindow.h
2022-06-23 04:00:37 +02:00
mainwindow.cpp
2022-06-26 17:40:27 +02:00
2022-06-27 21:55:14 +02:00
utilities/colors.h
utilities/colors.cpp
2022-08-12 22:13:14 +02:00
utilities/gzip.h
utilities/gzip.cpp
2022-06-27 21:55:14 +02:00
utilities/io.h
utilities/io.cpp
utilities/rtf.h
utilities/rtf.cpp
utilities/strings.h
utilities/strings.cpp
utilities/vectors.h
utilities/vectors.cpp
2022-07-10 18:07:51 +02:00
modules/charts/donuts.h
modules/charts/donuts.cpp
modules/checks.h
modules/checks.cpp
2022-06-28 20:53:42 +02:00
modules/dialogs.h
modules/dialogs.cpp
2022-08-06 21:53:13 +02:00
modules/exceptions.h
modules/exceptions.cpp
2022-06-27 21:55:14 +02:00
modules/tb.h
modules/tb.cpp
2022-08-22 21:11:46 +02:00
tools/shared.h
tools/shared.cpp
2022-06-26 17:40:27 +02:00
tools/craplog/craplog.h
tools/craplog/craplog.cpp
tools/craplog/modules/datetime.h
tools/craplog/modules/datetime.cpp
2022-06-26 20:58:11 +02:00
tools/craplog/modules/formats.h
tools/craplog/modules/formats.cpp
2022-06-26 17:40:27 +02:00
tools/craplog/modules/hash.h
tools/craplog/modules/hash.cpp
tools/craplog/modules/logs.h
tools/craplog/modules/logs.cpp
2022-06-26 22:31:13 +02:00
tools/craplog/modules/sha256.h
tools/craplog/modules/sha256.cpp
2022-07-03 19:12:42 +02:00
tools/craplog/modules/store.h
tools/craplog/modules/store.cpp
2022-06-26 17:40:27 +02:00
2022-07-20 21:43:19 +02:00
tools/crapview/crapview.h
tools/crapview/crapview.cpp
2022-07-21 21:42:36 +02:00
tools/crapview/modules/query.h
tools/crapview/modules/query.cpp
2022-07-20 21:43:19 +02:00
2022-08-11 21:02:28 +02:00
tools/craphelp/craphelp.ui
tools/craphelp/craphelp.h
tools/craphelp/craphelp.cpp
2022-08-17 23:36:39 +02:00
tools/crapup/crapup.h
tools/crapup/crapup.cpp
2022-08-18 21:12:27 +02:00
tools/crapnote/crapnote.ui
tools/crapnote/crapnote.h
tools/crapnote/crapnote.cpp
2022-08-23 21:43:57 +02:00
tools/crapinfo/crapinfo.ui
tools/crapinfo/crapinfo.h
tools/crapinfo/crapinfo.cpp
resources/resources.qrc
2022-06-21 21:07:06 +02:00
${TS_FILES}
)
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
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:
# 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)
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()
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()
target_link_libraries(LogDoctor PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Charts Qt${QT_VERSION_MAJOR}::Sql)
2022-06-21 21:07:06 +02:00
2022-08-12 22:13:14 +02:00
# Include zlib
find_package( ZLIB REQUIRED )
include_directories(${ZLIB_INCLUDE_DIRS})
target_link_libraries(LogDoctor PRIVATE ${ZLIB_LIBRARIES})
2022-08-18 21:12:27 +02:00
# Include libcurl
2022-08-17 23:36:39 +02:00
find_package( CURL REQUIRED )
include_directories(${CURL_INCLUDE_DIRS})
target_link_libraries(LogDoctor PRIVATE ${CURL_LIBRARIES})
set_target_properties(LogDoctor PROPERTIES
2022-06-21 21:07:06 +02:00
MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
MACOSX_BUNDLE TRUE
WIN32_EXECUTABLE TRUE
)
if(QT_VERSION_MAJOR EQUAL 6)
qt_finalize_executable(LogDoctor)
2022-06-21 21:07:06 +02:00
endif()