2022-04-04 18:06:43 +02:00
|
|
|
cmake_minimum_required(VERSION 3.16)
|
2020-10-29 18:53:52 +01:00
|
|
|
project(ScreenPlayShader 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_AUTORCC ON)
|
|
|
|
set(CMAKE_AUTOMOC 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:06:43 +02:00
|
|
|
set(QML
|
2022-03-12 14:36:03 +01:00
|
|
|
src/ShadertoyShader.qml src/TestMain.qml)
|
2022-02-20 17:55:26 +01:00
|
|
|
|
2022-04-04 18:06:43 +02:00
|
|
|
qt_add_library(${PROJECT_NAME} STATIC)
|
2022-02-20 17:55:26 +01:00
|
|
|
target_include_directories(${PROJECT_NAME} PUBLIC src/)
|
2022-04-04 18:06:43 +02:00
|
|
|
qt6_add_shaders(${PROJECT_NAME} "shaders"
|
|
|
|
BATCHABLE
|
|
|
|
PRECOMPILE
|
|
|
|
PREFIX
|
|
|
|
"/ScreenPlayShader"
|
|
|
|
FILES
|
|
|
|
#shader/lightning.frag
|
|
|
|
#shader/lightning.vert
|
|
|
|
shaders/wobble.frag
|
|
|
|
shaders/water.frag
|
|
|
|
shaders/water.vert)
|
2021-10-15 15:06:05 +02:00
|
|
|
|
2022-04-04 18:06:43 +02:00
|
|
|
# https://doc.qt.io/qt-6/qtshadertools-build.html
|
2021-06-25 16:28:30 +02:00
|
|
|
|
2022-04-04 18:06:43 +02:00
|
|
|
target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Core Qt6::Quick)
|
2022-02-20 17:55:26 +01:00
|
|
|
|
2022-04-04 18:06:43 +02:00
|
|
|
if(${SCREENPLAY_TESTS})
|
2022-02-20 17:55:26 +01:00
|
|
|
qt_add_executable(tst_ScreenPlayShader src/TestMain.cpp)
|
2022-04-04 18:06:43 +02:00
|
|
|
|
|
|
|
qt_add_qml_module(
|
|
|
|
tst_ScreenPlayShader
|
|
|
|
URI
|
|
|
|
ScreenPlayShader
|
|
|
|
VERSION
|
|
|
|
1.0
|
|
|
|
QML_FILES
|
|
|
|
${QML})
|
|
|
|
|
|
|
|
|
|
|
|
target_link_libraries(tst_ScreenPlayShader PRIVATE
|
|
|
|
Qt6::Quick
|
|
|
|
Qt::Core
|
|
|
|
Qt::Gui
|
|
|
|
Qt::Qml
|
|
|
|
Qt::Quick
|
|
|
|
${PROJECT_NAME})
|
|
|
|
|
|
|
|
endif()
|