1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-06 19:12:30 +01:00
ScreenPlay/ScreenPlayShader/CMakeLists.txt

59 lines
1.3 KiB
CMake
Raw Normal View History

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)
qt_add_library(${PROJECT_NAME} STATIC)
target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Core Qt6::Quick)
target_include_directories(${PROJECT_NAME} PUBLIC src/ )
qt_add_qml_module(
${PROJECT_NAME}
OUTPUT_DIRECTORY
${CMAKE_BINARY_DIR}/bin/${PROJECT_NAME}
URI
${PROJECT_NAME}
VERSION
1.0
SOURCES
${QML_PLUGIN_SOURCES}
${QML_PLUGIN_HEADER}
QML_FILES
${QML})
# 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
2022-04-04 18:09:45 +02:00
# shader/lightning.frag shader/lightning.vert
shaders/wobble.frag
shaders/water.frag
shaders/water.vert)
if(${SCREENPLAY_TESTS})
qt_add_executable(tst_ScreenPlayShader src/TestMain.cpp Resources.qrc)
target_link_libraries(tst_ScreenPlayShader PRIVATE Qt::Quick ${PROJECT_NAME}plugin )
target_compile_definitions(tst_ScreenPlayShader PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
2022-04-04 18:09:45 +02:00
endif()