Files
video-shader-toys/CMakeLists.txt
2026-05-02 15:49:45 +10:00

91 lines
2.6 KiB
CMake

cmake_minimum_required(VERSION 3.24)
project(video_shader LANGUAGES C CXX RC)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/apps/LoopThroughWithOpenGLCompositing")
set(GPUDIRECT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/Blackmagic DeckLink SDK 16.0/Win/Samples/NVIDIA_GPUDirect")
set(SHADER_SLANG_SOURCE "${APP_DIR}/video_effect.slang")
if(NOT EXISTS "${APP_DIR}/LoopThroughWithOpenGLCompositing.cpp")
message(FATAL_ERROR "Imported app sources were not found under ${APP_DIR}")
endif()
if(NOT EXISTS "${GPUDIRECT_DIR}/lib/x64/dvp.lib")
message(FATAL_ERROR "NVIDIA GPUDirect library not found under ${GPUDIRECT_DIR}")
endif()
add_executable(LoopThroughWithOpenGLCompositing WIN32
"${APP_DIR}/DeckLinkAPI_i.c"
"${APP_DIR}/GLExtensions.cpp"
"${APP_DIR}/GLExtensions.h"
"${APP_DIR}/LoopThroughWithOpenGLCompositing.cpp"
"${APP_DIR}/LoopThroughWithOpenGLCompositing.h"
"${APP_DIR}/LoopThroughWithOpenGLCompositing.rc"
"${APP_DIR}/OpenGLComposite.cpp"
"${APP_DIR}/OpenGLComposite.h"
"${APP_DIR}/resource.h"
"${APP_DIR}/stdafx.cpp"
"${APP_DIR}/stdafx.h"
"${APP_DIR}/targetver.h"
"${APP_DIR}/VideoFrameTransfer.cpp"
"${APP_DIR}/VideoFrameTransfer.h"
"${SHADER_SLANG_SOURCE}"
)
target_include_directories(LoopThroughWithOpenGLCompositing PRIVATE
"${APP_DIR}"
"${GPUDIRECT_DIR}/include"
)
target_link_directories(LoopThroughWithOpenGLCompositing PRIVATE
"${GPUDIRECT_DIR}/lib/x64"
)
target_link_libraries(LoopThroughWithOpenGLCompositing PRIVATE
dvp.lib
opengl32
glu32
)
target_compile_definitions(LoopThroughWithOpenGLCompositing PRIVATE
_UNICODE
UNICODE
)
set_source_files_properties(
"${SHADER_SLANG_SOURCE}"
PROPERTIES HEADER_FILE_ONLY TRUE
)
if(MSVC)
target_compile_options(LoopThroughWithOpenGLCompositing PRIVATE /W3)
endif()
add_custom_command(TARGET LoopThroughWithOpenGLCompositing POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${GPUDIRECT_DIR}/bin/x64/dvp.dll"
"$<TARGET_FILE_DIR:LoopThroughWithOpenGLCompositing>/dvp.dll"
)
source_group(TREE "${APP_DIR}" FILES
"${APP_DIR}/DeckLinkAPI_i.c"
"${APP_DIR}/GLExtensions.cpp"
"${APP_DIR}/GLExtensions.h"
"${APP_DIR}/LoopThroughWithOpenGLCompositing.cpp"
"${APP_DIR}/LoopThroughWithOpenGLCompositing.h"
"${APP_DIR}/LoopThroughWithOpenGLCompositing.rc"
"${APP_DIR}/OpenGLComposite.cpp"
"${APP_DIR}/OpenGLComposite.h"
"${APP_DIR}/resource.h"
"${APP_DIR}/stdafx.cpp"
"${APP_DIR}/stdafx.h"
"${APP_DIR}/targetver.h"
"${APP_DIR}/VideoFrameTransfer.cpp"
"${APP_DIR}/VideoFrameTransfer.h"
"${SHADER_SLANG_SOURCE}"
)