looking-glass/host/platform/Windows/capture/CMakeLists.txt
Geoffrey McRae fcf6abc7c6 [host] NvFBC/DXGI: make DXGI the default instead of the fallback
It has been detemined that a failure to init NvFBC causes a 20-30%
performance penalty on non NvFBC supported hardware (GeForce) when using
DXGI, as such reverse the order and default to using DXGI as our first
option.

If NvFBC is still desired, pr #500 added the option `app:capture` which
can be used to force NvFBC.
2021-06-06 06:14:24 +10:00

31 lines
707 B
CMake

cmake_minimum_required(VERSION 3.0)
project(capture LANGUAGES C)
include(PreCapture)
option(USE_NVFBC "Enable NVFBC Support" OFF)
option(USE_DXGI "Enable DXGI Support" ON)
if(NOT DEFINED NVFBC_SDK)
set(NVFBC_SDK "C:/Program Files (x86)/NVIDIA Corporation/NVIDIA Capture SDK")
endif()
file(TO_CMAKE_PATH "${NVFBC_SDK}" nvfbc_sdk)
if(NOT EXISTS "${nvfbc_sdk}/inc" OR NOT IS_DIRECTORY "${nvfbc_sdk}/inc")
message("Disabling NVFBC support, can't find the SDK headers")
set(USE_NVFBC OFF)
endif()
if(USE_DXGI)
add_capture("DXGI")
endif()
if(USE_NVFBC)
add_capture("NVFBC")
endif()
include("PostCapture")
add_library(capture STATIC ${CAPTURE_C})
target_link_libraries(capture ${CAPTURE_LINK})