cmake_minimum_required(VERSION 3.21)
project(URH VERSION 0.1.1 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

enable_testing()
add_executable(urh-geometry-tests native/tests/geometry_test.cpp)
target_include_directories(urh-geometry-tests PRIVATE native/include)
add_test(NAME urh-p1-geometry COMMAND urh-geometry-tests)

if(WIN32)
  # Modern Windows 10 SDK + C++/WinRT; this is a separate executable from the
  # Python R0 GUI and never silently starts capture or injects into a process.
  add_executable(urh-wgc WIN32 native/src/wgc_preview.cpp)
  target_include_directories(urh-wgc PRIVATE native/include)
  target_compile_definitions(urh-wgc PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX UNICODE _UNICODE _WIN32_WINNT=0x0A00 WINVER=0x0A00)
  target_link_libraries(urh-wgc PRIVATE windowsapp d3d11 dxgi d3dcompiler user32 gdi32 ole32)
  if(MSVC)
    target_compile_options(urh-wgc PRIVATE /W4 /EHsc /permissive- /Zc:__cplusplus)
  endif()
endif()
