CatchConfigOptions.cmake 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # Copyright Catch2 Authors
  2. # Distributed under the Boost Software License, Version 1.0.
  3. # (See accompanying file LICENSE_1_0.txt or copy at
  4. # https://www.boost.org/LICENSE_1_0.txt)
  5. # SPDX-License-Identifier: BSL-1.0
  6. ##
  7. # This file contains options that are materialized into the Catch2
  8. # compiled library. All of them default to OFF, as even the positive
  9. # forms correspond to the user _forcing_ them to ON, while being OFF
  10. # means that Catch2 can use its own autodetection.
  11. #
  12. # For detailed docs look into docs/configuration.md
  13. macro(AddOverridableConfigOption OptionBaseName)
  14. option(CATCH_CONFIG_${OptionBaseName} "Read docs/configuration.md for details" OFF)
  15. option(CATCH_CONFIG_NO_${OptionBaseName} "Read docs/configuration.md for details" OFF)
  16. endmacro()
  17. macro(AddConfigOption OptionBaseName)
  18. option(CATCH_CONFIG_${OptionBaseName} "Read docs/configuration.md for details" OFF)
  19. endmacro()
  20. set(_OverridableOptions
  21. "ANDROID_LOGWRITE"
  22. "BAZEL_SUPPORT"
  23. "COLOUR_WIN32"
  24. "COUNTER"
  25. "CPP11_TO_STRING"
  26. "CPP17_BYTE"
  27. "CPP17_OPTIONAL"
  28. "CPP17_STRING_VIEW"
  29. "CPP17_UNCAUGHT_EXCEPTIONS"
  30. "CPP17_VARIANT"
  31. "GLOBAL_NEXTAFTER"
  32. "POSIX_SIGNALS"
  33. "USE_ASYNC"
  34. "WCHAR"
  35. "WINDOWS_SEH"
  36. )
  37. foreach(OptionName ${_OverridableOptions})
  38. AddOverridableConfigOption(${OptionName})
  39. endforeach()
  40. set(_OtherConfigOptions
  41. "DISABLE_EXCEPTIONS"
  42. "DISABLE_EXCEPTIONS_CUSTOM_HANDLER"
  43. "DISABLE"
  44. "DISABLE_STRINGIFICATION"
  45. "ENABLE_ALL_STRINGMAKERS"
  46. "ENABLE_OPTIONAL_STRINGMAKER"
  47. "ENABLE_PAIR_STRINGMAKER"
  48. "ENABLE_TUPLE_STRINGMAKER"
  49. "ENABLE_VARIANT_STRINGMAKER"
  50. "EXPERIMENTAL_REDIRECT"
  51. "FAST_COMPILE"
  52. "NOSTDOUT"
  53. "PREFIX_ALL"
  54. "WINDOWS_CRTDBG"
  55. )
  56. foreach(OptionName ${_OtherConfigOptions})
  57. AddConfigOption(${OptionName})
  58. endforeach()
  59. set(CATCH_CONFIG_SHARED_LIBRARY ${BUILD_SHARED_LIBS})
  60. set(CATCH_CONFIG_DEFAULT_REPORTER "console" CACHE STRING "Read docs/configuration.md for details. The name of the reporter should be without quotes.")
  61. set(CATCH_CONFIG_CONSOLE_WIDTH "80" CACHE STRING "Read docs/configuration.md for details. Must form a valid integer literal.")
  62. # There is no good way to both turn this into a CMake cache variable,
  63. # and keep reasonable default semantics inside the project. Thus we do
  64. # not define it and users have to provide it as an outside variable.
  65. #set(CATCH_CONFIG_FALLBACK_STRINGIFIER "" CACHE STRING "Read docs/configuration.md for details.")