2023-01-19 10:33:49 +01:00
|
|
|
# SPDX-License-Identifier: LicenseRef-EliasSteurerTachiom OR AGPL-3.0-only
|
2021-01-28 15:19:46 +01:00
|
|
|
project(ScreenPlayUtil LANGUAGES CXX)
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
|
|
set(CMAKE_AUTORCC ON)
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
2021-09-10 11:09:38 +02:00
|
|
|
|
2023-10-29 18:10:13 +01:00
|
|
|
find_package(fmt CONFIG REQUIRED)
|
2023-12-01 16:15:53 +01:00
|
|
|
# Needed on macos
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
find_package(LibArchive REQUIRED)
|
2021-01-28 15:19:46 +01:00
|
|
|
find_package(
|
2021-09-10 11:09:38 +02:00
|
|
|
Qt6
|
2023-12-01 16:15:53 +01:00
|
|
|
COMPONENTS Core Quick Gui
|
2021-01-28 15:19:46 +01:00
|
|
|
REQUIRED)
|
|
|
|
|
2022-04-23 14:32:36 +02:00
|
|
|
set(QML
|
2022-11-02 11:33:40 +01:00
|
|
|
# cmake-format: sort
|
2022-04-23 14:32:36 +02:00
|
|
|
qml/CloseIcon.qml
|
2022-11-06 14:57:45 +01:00
|
|
|
qml/ColorImage.qml
|
2022-04-23 14:32:36 +02:00
|
|
|
qml/Dialog.qml
|
|
|
|
qml/Dialogs/CriticalError.qml
|
|
|
|
qml/Dialogs/MonitorConfiguration.qml
|
|
|
|
qml/Dialogs/SteamNotAvailable.qml
|
2022-11-02 11:33:40 +01:00
|
|
|
qml/FileDropAnimation.qml
|
2022-04-23 14:32:36 +02:00
|
|
|
qml/FileSelector.qml
|
|
|
|
qml/Grow.qml
|
|
|
|
qml/GrowIconLink.qml
|
|
|
|
qml/Headline.qml
|
|
|
|
qml/HeadlineSection.qml
|
|
|
|
qml/ImageSelector.qml
|
|
|
|
qml/LicenseSelector.qml
|
|
|
|
qml/ModalBackgroundBlur.qml
|
|
|
|
qml/MouseHoverBlocker.qml
|
|
|
|
qml/Popup.qml
|
|
|
|
qml/RippleEffect.qml
|
|
|
|
qml/Shake.qml
|
|
|
|
qml/Slider.qml
|
|
|
|
qml/Tag.qml
|
|
|
|
qml/TagSelector.qml
|
2023-02-11 11:57:09 +01:00
|
|
|
qml/TextField.qml)
|
2022-04-23 14:32:36 +02:00
|
|
|
|
2023-02-02 15:25:26 +01:00
|
|
|
set(SOURCES
|
|
|
|
# cmake-format: sort
|
2023-12-01 14:56:51 +01:00
|
|
|
src/httpfileserver.cpp
|
2023-02-02 15:25:26 +01:00
|
|
|
src/contenttypes.cpp
|
2023-10-29 18:10:13 +01:00
|
|
|
src/logginghandler.cpp
|
2023-02-02 15:25:26 +01:00
|
|
|
src/projectfile.cpp
|
2023-12-01 14:50:36 +01:00
|
|
|
src/exitcodes.cpp
|
2023-12-01 16:40:59 +01:00
|
|
|
src/steamenumsgenerated.cpp
|
2023-12-01 16:15:53 +01:00
|
|
|
src/util.cpp
|
|
|
|
src/archive.cpp)
|
2021-01-28 15:19:46 +01:00
|
|
|
|
2021-12-31 13:32:37 +01:00
|
|
|
set(HEADER
|
2022-11-02 11:33:40 +01:00
|
|
|
# cmake-format: sort
|
2022-03-12 14:36:03 +01:00
|
|
|
inc/public/ScreenPlayUtil/contenttypes.h
|
2023-12-01 16:40:59 +01:00
|
|
|
inc/public/ScreenPlayUtil/steamenumsgenerated.h
|
2023-02-02 15:25:26 +01:00
|
|
|
inc/public/ScreenPlayUtil/exitcodes.h
|
2022-03-12 14:36:03 +01:00
|
|
|
inc/public/ScreenPlayUtil/httpfileserver.h
|
2023-11-01 12:28:35 +01:00
|
|
|
inc/public/ScreenPlayUtil/logginghandler.h
|
2022-03-12 14:36:03 +01:00
|
|
|
inc/public/ScreenPlayUtil/projectfile.h
|
2022-02-20 17:55:26 +01:00
|
|
|
inc/public/ScreenPlayUtil/PropertyHelpers.h
|
2023-12-01 14:56:51 +01:00
|
|
|
inc/public/ScreenPlayUtil/ListPropertyHelper.h
|
|
|
|
inc/public/ScreenPlayUtil/HelpersCommon.h
|
2023-12-01 16:15:53 +01:00
|
|
|
inc/public/ScreenPlayUtil/archive.h
|
2022-03-12 14:36:03 +01:00
|
|
|
inc/public/ScreenPlayUtil/util.h)
|
2021-01-28 15:19:46 +01:00
|
|
|
|
2022-12-28 11:36:16 +01:00
|
|
|
if(APPLE)
|
|
|
|
list(APPEND SOURCES src/macutils.mm)
|
|
|
|
list(APPEND HEADER inc/public/ScreenPlayUtil/macutils.h)
|
|
|
|
endif()
|
|
|
|
|
2022-11-02 11:33:40 +01:00
|
|
|
set(RESOURCES # cmake-format: sort
|
|
|
|
assets/icons/attach_file.svg assets/icons/description.svg assets/icons/folder.svg)
|
2022-05-06 14:51:56 +02:00
|
|
|
|
2022-04-04 18:09:45 +02:00
|
|
|
qt_add_library(
|
|
|
|
${PROJECT_NAME}
|
|
|
|
STATIC
|
|
|
|
${SOURCES}
|
2023-12-01 16:15:53 +01:00
|
|
|
${HEADER}
|
|
|
|
)
|
2021-01-28 15:19:46 +01:00
|
|
|
|
2022-04-23 14:32:36 +02:00
|
|
|
qt_add_qml_module(
|
|
|
|
${PROJECT_NAME}
|
|
|
|
OUTPUT_DIRECTORY
|
2022-04-30 12:07:54 +02:00
|
|
|
${SCREENPLAY_QML_MODULES_PATH}/${PROJECT_NAME}
|
2022-11-02 11:33:40 +01:00
|
|
|
RESOURCE_PREFIX
|
|
|
|
/qml
|
2022-04-23 14:32:36 +02:00
|
|
|
URI
|
|
|
|
${PROJECT_NAME}
|
|
|
|
VERSION
|
|
|
|
1.0
|
|
|
|
QML_FILES
|
2022-05-06 14:51:56 +02:00
|
|
|
${QML}
|
|
|
|
RESOURCES
|
|
|
|
${RESOURCES})
|
2021-10-15 15:06:05 +02:00
|
|
|
|
2021-10-23 18:34:25 +02:00
|
|
|
find_path(CPP_HTTPLIB_INCLUDE_DIRS "httplib.h")
|
|
|
|
target_include_directories(${PROJECT_NAME} PUBLIC ${CPP_HTTPLIB_INCLUDE_DIRS})
|
|
|
|
|
2021-06-20 18:50:54 +02:00
|
|
|
target_include_directories(
|
|
|
|
${PROJECT_NAME}
|
|
|
|
PUBLIC inc/public/
|
|
|
|
PRIVATE src/)
|
2023-12-01 14:50:36 +01:00
|
|
|
|
|
|
|
# Note making this public is so thatscreenplayutil_qmltyperegistrations.cpp
|
|
|
|
# can find the #include <contenttypes.h> include
|
|
|
|
target_include_directories(${PROJECT_NAME} PUBLIC inc/public/ScreenPlayUtil)
|
|
|
|
|
|
|
|
|
2023-11-01 12:28:35 +01:00
|
|
|
target_link_libraries(
|
|
|
|
${PROJECT_NAME}
|
|
|
|
PRIVATE Qt6::Core Qt6::Quick
|
2023-12-01 16:15:53 +01:00
|
|
|
PUBLIC
|
|
|
|
Qt6::Gui
|
|
|
|
fmt::fmt-header-only
|
|
|
|
LibArchive::LibArchive
|
|
|
|
QArchive)
|
2021-11-13 14:12:19 +01:00
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
# Used for query windows monitor data
|
|
|
|
target_link_libraries(${PROJECT_NAME} PUBLIC shcore.lib)
|
|
|
|
endif()
|
2023-11-29 10:53:39 +01:00
|
|
|
|
|
|
|
# ##### USE CMAKE VARIABLES IN CODE #####
|
|
|
|
include(GenerateCMakeVariableHeader)
|
|
|
|
generate_cmake_variable_header(${PROJECT_NAME})
|