2023-01-19 10:33:49 +01:00
|
|
|
# SPDX-License-Identifier: LicenseRef-EliasSteurerTachiom OR AGPL-3.0-only
|
2022-04-07 11:03:00 +02:00
|
|
|
project(
|
|
|
|
ScreenPlayShader
|
|
|
|
VERSION 0.1
|
|
|
|
LANGUAGES CXX)
|
2020-09-10 11:40:07 +02:00
|
|
|
|
2021-01-28 15:19:46 +01:00
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
2020-09-10 11:40:07 +02:00
|
|
|
set(CMAKE_AUTOMOC ON)
|
2022-04-07 11:03:00 +02:00
|
|
|
set(CMAKE_AUTORCC ON)
|
2021-09-10 11:09:38 +02:00
|
|
|
|
2020-09-10 11:40:07 +02:00
|
|
|
find_package(
|
2021-09-10 11:09:38 +02:00
|
|
|
Qt6
|
2022-02-20 17:55:26 +01:00
|
|
|
COMPONENTS Quick Core ShaderTools
|
2020-10-29 18:53:52 +01:00
|
|
|
REQUIRED)
|
2020-09-10 11:40:07 +02:00
|
|
|
|
2022-04-04 18:09:45 +02:00
|
|
|
set(QML src/ShadertoyShader.qml src/TestMain.qml)
|
2022-02-20 17:55:26 +01:00
|
|
|
|
2022-04-07 11:03:00 +02:00
|
|
|
set(QML_PLUGIN_SOURCES src/shaderlibrary.cpp)
|
2021-10-15 15:06:05 +02:00
|
|
|
|
2022-04-07 11:03:00 +02:00
|
|
|
set(QML_PLUGIN_HEADER src/shaderlibrary.h)
|
2021-10-15 15:06:05 +02:00
|
|
|
|
2022-04-23 14:32:36 +02:00
|
|
|
set(SHADER
|
2022-11-02 11:33:40 +01:00
|
|
|
# cmake-format: sort
|
2022-04-23 14:32:36 +02:00
|
|
|
shaders/lightning.frag
|
2022-11-02 11:33:40 +01:00
|
|
|
shaders/lightning.vert
|
2022-04-23 14:32:36 +02:00
|
|
|
shaders/water.frag
|
2022-11-02 11:33:40 +01:00
|
|
|
shaders/water.vert
|
|
|
|
shaders/wobble.frag)
|
2021-10-15 15:06:05 +02:00
|
|
|
|
2022-04-23 14:32:36 +02:00
|
|
|
set(RESOURCES
|
2022-11-02 11:33:40 +01:00
|
|
|
# cmake-format: sort
|
2022-04-23 14:32:36 +02:00
|
|
|
assets/mask_01.png
|
|
|
|
assets/Shadertoy_Bayer.png
|
|
|
|
assets/Shadertoy_Gray_Noise_Medium.png
|
|
|
|
assets/Shadertoy_Lichen.jpg
|
2022-04-23 18:00:12 +02:00
|
|
|
assets/test_image_andras-vas-Bd7gNnWJBkU-unsplash.jpg)
|
2022-04-07 11:03:00 +02:00
|
|
|
|
2022-04-04 18:06:43 +02:00
|
|
|
qt_add_library(${PROJECT_NAME} STATIC)
|
2023-12-03 11:43:17 +01:00
|
|
|
target_link_libraries(${PROJECT_NAME} PUBLIC Qt6::Core Qt6::Quick ScreenPlayUtilplugin)
|
2022-04-23 18:00:12 +02:00
|
|
|
target_include_directories(${PROJECT_NAME} PUBLIC src/)
|
2021-10-15 15:06:05 +02:00
|
|
|
|
|
|
|
qt_add_qml_module(
|
|
|
|
${PROJECT_NAME}
|
2022-04-07 11:03:00 +02:00
|
|
|
OUTPUT_DIRECTORY
|
2022-04-30 12:07:54 +02:00
|
|
|
${SCREENPLAY_QML_MODULES_PATH}/${PROJECT_NAME}
|
2021-10-15 15:06:05 +02:00
|
|
|
URI
|
|
|
|
${PROJECT_NAME}
|
2022-11-02 11:33:40 +01:00
|
|
|
RESOURCE_PREFIX
|
|
|
|
/qml
|
2021-10-15 15:06:05 +02:00
|
|
|
VERSION
|
|
|
|
1.0
|
2022-04-07 11:03:00 +02:00
|
|
|
SOURCES
|
|
|
|
${QML_PLUGIN_SOURCES}
|
|
|
|
${QML_PLUGIN_HEADER}
|
2021-10-15 15:06:05 +02:00
|
|
|
QML_FILES
|
2022-04-23 14:32:36 +02:00
|
|
|
${QML}
|
|
|
|
RESOURCES
|
|
|
|
${RESOURCES})
|
2021-10-15 15:06:05 +02:00
|
|
|
|
2022-04-07 11:03:00 +02:00
|
|
|
# https://doc.qt.io/qt-6/qtshadertools-build.html
|
2022-04-04 18:09:45 +02:00
|
|
|
qt6_add_shaders(
|
|
|
|
${PROJECT_NAME}
|
|
|
|
"shaders"
|
2022-04-04 18:06:43 +02:00
|
|
|
BATCHABLE
|
|
|
|
PRECOMPILE
|
|
|
|
PREFIX
|
2022-04-07 11:03:00 +02:00
|
|
|
"/"
|
2022-04-04 18:06:43 +02:00
|
|
|
FILES
|
2022-04-23 14:32:36 +02:00
|
|
|
${SHADER})
|
2021-06-25 16:28:30 +02:00
|
|
|
|
2022-04-04 18:06:43 +02:00
|
|
|
if(${SCREENPLAY_TESTS})
|
2022-04-23 14:32:36 +02:00
|
|
|
qt_add_executable(tst_ScreenPlayShader src/TestMain.cpp)
|
2022-04-23 18:00:12 +02:00
|
|
|
target_link_libraries(tst_ScreenPlayShader PRIVATE Qt::Quick ${PROJECT_NAME}plugin)
|
2023-11-30 09:51:12 +01:00
|
|
|
if(APPLE)
|
2023-12-03 11:45:20 +01:00
|
|
|
set_target_properties(tst_ScreenPlayShader PROPERTIES RUNTIME_OUTPUT_DIRECTORY
|
|
|
|
"${CMAKE_BINARY_DIR}/bin/ScreenPlay.app/Contents/MacOS/")
|
2023-11-30 09:51:12 +01:00
|
|
|
endif()
|
2022-04-04 18:09:45 +02:00
|
|
|
endif()
|