CMakeLists.txt 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. cmake_minimum_required(VERSION 3.28...3.30)
  2. if(NOT TARGET OBS::obfuscate)
  3. add_subdirectory("${CMAKE_SOURCE_DIR}/libobs" "${CMAKE_BINARY_DIR}/libobs")
  4. endif()
  5. if(NOT TARGET OBS::inject-library)
  6. add_subdirectory("${CMAKE_SOURCE_DIR}/shared/obs-inject-library" obs-inject-library)
  7. endif()
  8. add_executable(inject-helper)
  9. target_sources(inject-helper PRIVATE inject-helper.c)
  10. target_link_libraries(inject-helper PRIVATE OBS::inject-library OBS::obfuscate)
  11. if(OBS_PARENT_ARCHITECTURE STREQUAL CMAKE_VS_PLATFORM_NAME)
  12. if(CMAKE_VS_PLATFORM_NAME STREQUAL x64)
  13. add_custom_command(
  14. TARGET inject-helper
  15. POST_BUILD
  16. COMMAND "${CMAKE_COMMAND}" --build ${CMAKE_SOURCE_DIR}/build_x86 --config $<CONFIG> -t inject-helper
  17. COMMENT "Build x86 inject-helper"
  18. )
  19. endif()
  20. add_dependencies(win-capture inject-helper)
  21. endif()
  22. if(CMAKE_VS_PLATFORM_NAME STREQUAL x64)
  23. set(_OUTPUT_NAME inject-helper64)
  24. else()
  25. set(_OUTPUT_NAME inject-helper32)
  26. endif()
  27. set_target_properties_obs(
  28. inject-helper PROPERTIES
  29. FOLDER plugins/win-capture
  30. OUTPUT_NAME ${_OUTPUT_NAME}
  31. MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>"
  32. )