1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-22 02:32:29 +01:00
ScreenPlay/ScreenPlayShader/CMakeLists.txt

79 lines
1.9 KiB
CMake
Raw Permalink Normal View History

2023-01-19 10:33:49 +01:00
# SPDX-License-Identifier: LicenseRef-EliasSteurerTachiom OR AGPL-3.0-only
project(
ScreenPlayShader
VERSION 0.1
LANGUAGES CXX)
2020-09-10 11:40:07 +02:00
set(CMAKE_CXX_STANDARD 20)
2020-09-10 11:40:07 +02:00
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
2020-09-10 11:40:07 +02:00
find_package(
Qt6
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)
set(QML_PLUGIN_SOURCES src/shaderlibrary.cpp)
set(QML_PLUGIN_HEADER src/shaderlibrary.h)
set(SHADER
# cmake-format: sort
shaders/lightning.frag
shaders/lightning.vert
shaders/water.frag
shaders/water.vert
shaders/wobble.frag)
set(RESOURCES
# cmake-format: sort
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)
qt_add_library(${PROJECT_NAME} STATIC)
target_link_libraries(${PROJECT_NAME} PUBLIC Qt6::Core Qt6::Quick ScreenPlayCoreplugin)
2022-04-23 18:00:12 +02:00
target_include_directories(${PROJECT_NAME} PUBLIC src/)
qt_add_qml_module(
${PROJECT_NAME}
OUTPUT_DIRECTORY
${SCREENPLAY_QML_MODULES_PATH}/${PROJECT_NAME}
URI
${PROJECT_NAME}
RESOURCE_PREFIX
/qml
VERSION
1.0
SOURCES
${QML_PLUGIN_SOURCES}
${QML_PLUGIN_HEADER}
QML_FILES
${QML}
RESOURCES
${RESOURCES})
# https://doc.qt.io/qt-6/qtshadertools-build.html
2022-04-04 18:09:45 +02:00
qt6_add_shaders(
${PROJECT_NAME}
"shaders"
BATCHABLE
PRECOMPILE
PREFIX
"/"
FILES
${SHADER})
2021-06-25 16:28:30 +02:00
if(${SCREENPLAY_TESTS})
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)
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/")
endif()
2022-04-04 18:09:45 +02:00
endif()