CMakeLists.txt 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. project(updater)
  2. option(ENABLE_UPDATER "Build with Windows updater" ON)
  3. if(NOT ENABLE_UPDATER)
  4. message(STATUS "OBS: DISABLED Windows updater")
  5. return()
  6. endif()
  7. if(NOT DEFINED STATIC_ZLIB_PATH OR "${STATIC_ZLIB_PATH}" STREQUAL "")
  8. message(STATUS "STATIC_ZLIB_PATH not set, windows updater disabled")
  9. return()
  10. endif()
  11. add_executable(updater WIN32)
  12. target_sources(
  13. updater
  14. PRIVATE updater.cpp
  15. updater.hpp
  16. patch.cpp
  17. http.cpp
  18. hash.cpp
  19. resource.h
  20. updater.rc
  21. init-hook-files.c
  22. updater.manifest
  23. ${CMAKE_SOURCE_DIR}/UI/win-update/win-update-helpers.cpp
  24. ${CMAKE_SOURCE_DIR}/UI/win-update/win-update-helpers.hpp
  25. ${CMAKE_SOURCE_DIR}/deps/json11/json11.hpp
  26. ${CMAKE_SOURCE_DIR}/deps/json11/json11.cpp)
  27. target_include_directories(
  28. updater PRIVATE ${CMAKE_SOURCE_DIR}/libobs ${CMAKE_SOURCE_DIR}/UI/win-update
  29. ${CMAKE_SOURCE_DIR}/deps/json11)
  30. target_compile_definitions(updater PRIVATE NOMINMAX "PSAPI_VERSION=2")
  31. if(MSVC)
  32. target_compile_options(updater PRIVATE $<IF:$<CONFIG:DEBUG>,/MTd,/MT>)
  33. endif()
  34. target_link_libraries(updater PRIVATE OBS::blake2 OBS::lzma ${STATIC_ZLIB_PATH}
  35. comctl32 shell32 winhttp)
  36. set_target_properties(updater PROPERTIES FOLDER "frontend")