legacy.cmake 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. find_package(zstd)
  8. find_package(nlohmann_json 3 REQUIRED)
  9. add_executable(updater WIN32)
  10. target_sources(
  11. updater
  12. PRIVATE updater.cpp
  13. updater.hpp
  14. patch.cpp
  15. http.cpp
  16. hash.cpp
  17. resource.h
  18. updater.rc
  19. init-hook-files.c
  20. updater.manifest
  21. helpers.cpp
  22. helpers.hpp)
  23. target_include_directories(updater PRIVATE ${CMAKE_SOURCE_DIR}/libobs)
  24. target_compile_definitions(updater PRIVATE NOMINMAX "PSAPI_VERSION=2")
  25. if(MSVC)
  26. target_compile_options(updater PRIVATE $<IF:$<CONFIG:DEBUG>,/MTd,/MT>)
  27. target_compile_options(updater PRIVATE "/utf-8")
  28. target_link_options(updater PRIVATE "LINKER:/IGNORE:4098")
  29. endif()
  30. target_link_libraries(updater PRIVATE OBS::blake2 nlohmann_json::nlohmann_json zstd::libzstd_static comctl32 shell32
  31. winhttp)
  32. set_target_properties(updater PROPERTIES FOLDER "frontend")