2023-11-09 07:31:26 +00:00
|
|
|
cmake_minimum_required(VERSION 3.5)
|
2019-04-09 06:28:11 +00:00
|
|
|
project(capture LANGUAGES C)
|
|
|
|
|
2019-04-11 01:03:30 +00:00
|
|
|
include(PreCapture)
|
|
|
|
|
|
|
|
option(USE_NVFBC "Enable NVFBC Support" OFF)
|
|
|
|
option(USE_DXGI "Enable DXGI Support" ON)
|
2019-04-09 06:28:11 +00:00
|
|
|
|
2019-04-10 03:07:42 +00:00
|
|
|
if(NOT DEFINED NVFBC_SDK)
|
2019-05-22 04:59:19 +00:00
|
|
|
set(NVFBC_SDK "C:/Program Files (x86)/NVIDIA Corporation/NVIDIA Capture SDK")
|
2019-04-10 03:07:42 +00:00
|
|
|
endif()
|
2019-05-22 04:59:19 +00:00
|
|
|
|
|
|
|
file(TO_CMAKE_PATH "${NVFBC_SDK}" nvfbc_sdk)
|
|
|
|
|
|
|
|
if(NOT EXISTS "${nvfbc_sdk}/inc" OR NOT IS_DIRECTORY "${nvfbc_sdk}/inc")
|
2019-04-11 01:03:30 +00:00
|
|
|
message("Disabling NVFBC support, can't find the SDK headers")
|
|
|
|
set(USE_NVFBC OFF)
|
2019-04-10 03:07:42 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(USE_DXGI)
|
|
|
|
add_capture("DXGI")
|
|
|
|
endif()
|
2019-04-09 06:28:11 +00:00
|
|
|
|
2021-06-05 20:14:24 +00:00
|
|
|
if(USE_NVFBC)
|
|
|
|
add_capture("NVFBC")
|
|
|
|
endif()
|
|
|
|
|
2021-08-20 05:58:37 +00:00
|
|
|
add_feature_info(USE_DXGI USE_DXGI "DXGI Desktop Duplication capture backend.")
|
|
|
|
add_feature_info(USE_NVFBC USE_NVFBC "NVFBC capture backend.")
|
|
|
|
|
2019-04-09 06:28:11 +00:00
|
|
|
include("PostCapture")
|
|
|
|
|
|
|
|
add_library(capture STATIC ${CAPTURE_C})
|
|
|
|
target_link_libraries(capture ${CAPTURE_LINK})
|