CMakeLists.txt 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. project(graphics-hook)
  2. set(COMPILE_D3D12_HOOK FALSE CACHE BOOL "Compile D3D12 hook support (required windows 10 SDK)")
  3. configure_file(
  4. "${CMAKE_CURRENT_SOURCE_DIR}/graphics-hook-config.h.in"
  5. "${CMAKE_BINARY_DIR}/plugins/win-capture/graphics-hook/config/graphics-hook-config.h")
  6. set(graphics-hook_HEADERS
  7. "${CMAKE_BINARY_DIR}/plugins/win-capture/graphics-hook/config/graphics-hook-config.h"
  8. graphics-hook.h
  9. ../graphics-hook-info.h
  10. ../hook-helpers.h
  11. ../funchook.h
  12. ../obfuscate.h
  13. gl-decs.h
  14. d3d9-patches.hpp)
  15. set(graphics-hook_SOURCES
  16. graphics-hook.c
  17. ../funchook.c
  18. ../obfuscate.c
  19. gl-capture.c
  20. d3d8-capture.cpp
  21. d3d9-capture.cpp
  22. dxgi-capture.cpp
  23. d3d10-capture.cpp
  24. d3d11-capture.cpp
  25. d3d12-capture.cpp)
  26. if(MSVC)
  27. add_compile_options("$<$<CONFIG:RelWithDebInfo>:/MT>")
  28. endif()
  29. add_library(graphics-hook MODULE
  30. ${graphics-hook_SOURCES}
  31. ${graphics-hook_HEADERS})
  32. target_include_directories(graphics-hook PUBLIC
  33. "${CMAKE_BINARY_DIR}/plugins/win-capture/graphics-hook/config")
  34. target_link_libraries(graphics-hook
  35. ipc-util psapi)
  36. if(CMAKE_SIZEOF_VOID_P EQUAL 8)
  37. set(_output_suffix "64")
  38. else()
  39. set(_output_suffix "32")
  40. endif()
  41. set_target_properties(graphics-hook
  42. PROPERTIES
  43. OUTPUT_NAME "graphics-hook${_output_suffix}")
  44. install_obs_datatarget(graphics-hook "obs-plugins/win-capture")