LogDoctor/logdoctor/CMakeLists.txt

148 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
)
2022-08-27 11:18:02 +02:00
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-08-27 11:18:02 +02:00
utilities/checks.h
utilities/checks.cpp
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-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-27 11:18:02 +02:00
modules/shared.h
modules/shared.cpp
modules/craplog/craplog.h
modules/craplog/craplog.cpp
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
modules/craplog/modules/store.h
modules/craplog/modules/store.cpp
modules/crapview/crapview.h
modules/crapview/crapview.cpp
modules/crapview/modules/query.h
modules/crapview/modules/query.cpp
modules/craphelp/craphelp.ui
modules/craphelp/craphelp.h
modules/craphelp/craphelp.cpp
modules/crapup/crapup.h
modules/crapup/crapup.cpp
modules/crapinfo/crapinfo.ui
modules/crapinfo/crapinfo.h
modules/crapinfo/crapinfo.cpp
2022-08-17 23:36:39 +02:00
2022-08-18 21:12:27 +02:00
tools/crapnote/crapnote.ui
tools/crapnote/crapnote.h
tools/crapnote/crapnote.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()