defaults.cmake 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # CMake macOS defaults module
  2. include_guard(GLOBAL)
  3. # Set empty codesigning team if not specified as cache variable
  4. if(NOT CODESIGN_TEAM)
  5. set(CODESIGN_TEAM
  6. ""
  7. CACHE STRING "OBS code signing team for macOS" FORCE)
  8. # Set ad-hoc codesigning identity if not specified as cache variable
  9. if(NOT CODESIGN_IDENTITY)
  10. set(CODESIGN_IDENTITY
  11. "-"
  12. CACHE STRING "OBS code signing identity for macOS" FORCE)
  13. endif()
  14. endif()
  15. if(XCODE)
  16. include(xcode)
  17. endif()
  18. include(buildspec)
  19. # Set default deployment target to 11.0 if not set and enable selection in GUI up to 13.0
  20. if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
  21. set(CMAKE_OSX_DEPLOYMENT_TARGET
  22. 11.0
  23. CACHE STRING "Minimum macOS version to target for deployment (at runtime). Newer APIs will be weak-linked." FORCE)
  24. endif()
  25. set_property(CACHE CMAKE_OSX_DEPLOYMENT_TARGET PROPERTY STRINGS 13.0 12.0 11.0)
  26. # Use Applications directory as default install destination
  27. if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
  28. set(CMAKE_INSTALL_PREFIX
  29. "$ENV{HOME}/Library/Application Support/obs-studio/plugins"
  30. CACHE STRING "Directory to install OBS after building" FORCE)
  31. endif()
  32. # Enable find_package targets to become globally available targets
  33. set(CMAKE_FIND_PACKAGE_TARGETS_GLOBAL TRUE)
  34. # Enable RPATH support for generated binaries
  35. set(CMAKE_MACOSX_RPATH TRUE)
  36. # Use RPATHs from build tree _in_ the build tree
  37. set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
  38. # Do not add default linker search paths to RPATH
  39. set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
  40. # Use common bundle-relative RPATH for installed targets
  41. set(CMAKE_INSTALL_RPATH "@executable_path/../Frameworks")