ShowProjectConfig.cmake 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. #
  2. # SRT - Secure, Reliable, Transport Copyright (c) 2021 Haivision Systems Inc.
  3. #
  4. # This Source Code Form is subject to the terms of the Mozilla Public License,
  5. # v. 2.0. If a copy of the MPL was not distributed with this file, You can
  6. # obtain one at http://mozilla.org/MPL/2.0/.
  7. #
  8. function(ShowProjectConfig)
  9. set(__ssl_configuration)
  10. if (SSL_FOUND OR SSL_LIBRARIES)
  11. set(__ssl_configuration
  12. " SSL Configuration:
  13. SSL_FOUND=${SSL_FOUND}
  14. SSL_INCLUDE_DIRS=${SSL_INCLUDE_DIRS}
  15. SSL_LIBRARIES=${SSL_LIBRARIES}
  16. SSL_VERSION=${SSL_VERSION}\n")
  17. endif()
  18. set(static_property_link_libraries)
  19. if (srt_libspec_static)
  20. get_target_property(
  21. static_property_link_libraries
  22. ${TARGET_srt}_static
  23. LINK_LIBRARIES)
  24. endif()
  25. set(shared_property_link_libraries)
  26. if (srt_libspec_shared)
  27. get_target_property(
  28. shared_property_link_libraries
  29. ${TARGET_srt}_shared
  30. LINK_LIBRARIES)
  31. endif()
  32. # See https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#id13
  33. set(__more_tc1_config)
  34. if (CMAKE_CROSSCOMPILING)
  35. set(__more_tc1_config
  36. " CMAKE_SYSROOT: ${CMAKE_SYSROOT}\n")
  37. endif()
  38. # See https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#id13
  39. set(__more_tc2_config)
  40. if (APPLE)
  41. set(__more_tc2_config
  42. " CMAKE_INSTALL_NAME_TOOL: ${CMAKE_INSTALL_NAME_TOOL}
  43. CMAKE_OSX_SYSROOT: ${CMAKE_OSX_SYSROOT}
  44. CMAKE_OSX_ARCHITECTURES: ${CMAKE_OSX_ARCHITECTURES}
  45. CMAKE_OSX_DEPLOYMENT_TARGET: ${CMAKE_OSX_DEPLOYMENT_TARGET}
  46. CMAKE_OSX_SYSROOT: ${CMAKE_OSX_SYSROOT}\n")
  47. elseif (ANDROID)
  48. set(__more_tc2_config
  49. " CMAKE_ANDROID_NDK: ${CMAKE_ANDROID_NDK}
  50. CMAKE_ANDROID_STANDALONE_TOOLCHAIN: ${CMAKE_ANDROID_STANDALONE_TOOLCHAIN}
  51. CMAKE_ANDROID_API: ${CMAKE_ANDROID_API}
  52. CMAKE_ANDROID_ARCH_ABI: ${CMAKE_ANDROID_ARCH_ABI}
  53. CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION: ${CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION}
  54. CMAKE_ANDROID_STL_TYPE: ${CMAKE_ANDROID_STL_TYPE}\n")
  55. endif()
  56. message(STATUS
  57. "\n"
  58. "========================================================================\n"
  59. "= Project Configuration:\n"
  60. "========================================================================\n"
  61. " SRT Version:\n"
  62. " SRT_VERSION: ${SRT_VERSION}\n"
  63. " SRT_VERSION_BUILD: ${SRT_VERSION_BUILD}\n"
  64. " CMake Configuration:\n"
  65. " CMAKE_VERSION: ${CMAKE_VERSION}\n"
  66. " CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}\n"
  67. " CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}\n"
  68. " Target Configuration:\n"
  69. " CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}\n"
  70. " CMAKE_SYSTEM_VERSION: ${CMAKE_SYSTEM_VERSION}\n"
  71. " CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}\n"
  72. " CMAKE_SIZEOF_VOID_P: ${CMAKE_SIZEOF_VOID_P}\n"
  73. " DARWIN: ${DARWIN}\n"
  74. " LINUX: ${LINUX}\n"
  75. " BSD: ${BSD}\n"
  76. " MICROSOFT: ${MICROSOFT}\n"
  77. " GNU: ${GNU}\n"
  78. " ANDROID: ${ANDROID}\n"
  79. " SUNOS: ${SUNOS}\n"
  80. " POSIX: ${POSIX}\n"
  81. " SYMLINKABLE: ${SYMLINKABLE}\n"
  82. " APPLE: ${APPLE}\n"
  83. " UNIX: ${UNIX}\n"
  84. " WIN32: ${WIN32}\n"
  85. " MINGW: ${MINGW}\n"
  86. " CYGWIN: ${CYGWIN}\n"
  87. " CYGWIN_USE_POSIX: ${CYGWIN_USE_POSIX}\n"
  88. " Toolchain Configuration:\n"
  89. " CMAKE_TOOLCHAIN_FILE: ${CMAKE_TOOLCHAIN_FILE}\n"
  90. " CMAKE_CROSSCOMPILING: ${CMAKE_CROSSCOMPILING}\n"
  91. "${__more_tc1_config}"
  92. " CMAKE_C_COMPILER_ID: ${CMAKE_C_COMPILER_ID}\n"
  93. " CMAKE_C_COMPILER_VERSION: ${CMAKE_C_COMPILER_VERSION}\n"
  94. " CMAKE_C_COMPILER: ${CMAKE_C_COMPILER}\n"
  95. " CMAKE_C_FLAGS: '${CMAKE_C_FLAGS}'\n"
  96. " CMAKE_C_COMPILE_FEATURES: ${CMAKE_C_COMPILE_FEATURES}\n"
  97. " CMAKE_C_STANDARD: ${CMAKE_CXX_STANDARD}\n"
  98. " CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}\n"
  99. " CMAKE_CXX_COMPILER_VERSION: ${CMAKE_CXX_COMPILER_VERSION}\n"
  100. " CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER}\n"
  101. " CMAKE_CXX_FLAGS: '${CMAKE_CXX_FLAGS}'\n"
  102. " CMAKE_CXX_COMPILE_FEATURES: ${CMAKE_CXX_COMPILE_FEATURES}\n"
  103. " CMAKE_CXX_STANDARD: ${CMAKE_CXX_STANDARD}\n"
  104. " CMAKE_LINKER: ${CMAKE_LINKER}\n"
  105. #" CMAKE_EXE_LINKER_FLAGS: ${CMAKE_EXE_LINKER_FLAGS}\n"
  106. #" CMAKE_EXE_LINKER_FLAGS_INIT: ${CMAKE_EXE_LINKER_FLAGS_INIT}\n"
  107. #" CMAKE_MODULE_LINKER_FLAGS: ${CMAKE_MODULE_LINKER_FLAGS}\n"
  108. #" CMAKE_MODULE_LINKER_FLAGS_INIT: ${CMAKE_MODULE_LINKER_FLAGS_INIT}\n"
  109. #" CMAKE_SHARED_LINKER_FLAGS: ${CMAKE_SHARED_LINKER_FLAGS}\n"
  110. #" CMAKE_SHARED_LINKER_FLAGS_INIT: ${CMAKE_SHARED_LINKER_FLAGS_INIT}\n"
  111. #" CMAKE_STATIC_LINKER_FLAGS: ${CMAKE_STATIC_LINKER_FLAGS}\n"
  112. #" CMAKE_STATIC_LINKER_FLAGS_INIT: ${CMAKE_STATIC_LINKER_FLAGS_INIT}\n"
  113. " CMAKE_NM: ${CMAKE_NM}\n"
  114. " CMAKE_AR: ${CMAKE_AR}\n"
  115. " CMAKE_RANLIB: ${CMAKE_RANLIB}\n"
  116. "${__more_tc2_config}"
  117. " HAVE_COMPILER_GNU_COMPAT: ${HAVE_COMPILER_GNU_COMPAT}\n"
  118. " CMAKE_THREAD_LIBS: ${CMAKE_THREAD_LIBS}\n"
  119. " CMAKE_THREAD_LIBS_INIT: ${CMAKE_THREAD_LIBS_INIT}\n"
  120. " ENABLE_THREAD_CHECK: ${ENABLE_THREAD_CHECK}\n"
  121. " USE_CXX_STD_APP: ${USE_CXX_STD_APP}\n"
  122. " USE_CXX_STD_LIB: ${USE_CXX_STD_LIB}\n"
  123. " STDCXX: ${STDCXX}\n"
  124. " USE_CXX_STD: ${USE_CXX_STD}\n"
  125. " HAVE_CLOCK_GETTIME_IN: ${HAVE_CLOCK_GETTIME_IN}\n"
  126. " HAVE_CLOCK_GETTIME_LIBRT: ${HAVE_CLOCK_GETTIME_LIBRT}\n"
  127. " HAVE_PTHREAD_GETNAME_NP_IN_PTHREAD_NP_H: ${HAVE_PTHREAD_GETNAME_NP_IN_PTHREAD_NP_H}\n"
  128. " HAVE_PTHREAD_SETNAME_NP_IN_PTHREAD_NP_H: ${HAVE_PTHREAD_SETNAME_NP_IN_PTHREAD_NP_H}\n"
  129. " HAVE_PTHREAD_GETNAME_NP: ${HAVE_PTHREAD_GETNAME_NP}\n"
  130. " HAVE_PTHREAD_SETNAME_NP: ${HAVE_PTHREAD_SETNAME_NP}\n"
  131. " HAVE_LIBATOMIC: ${HAVE_LIBATOMIC}\n"
  132. " HAVE_LIBATOMIC_COMPILES: ${HAVE_LIBATOMIC_COMPILES}\n"
  133. " HAVE_LIBATOMIC_COMPILES_STATIC: ${HAVE_LIBATOMIC_COMPILES_STATIC}\n"
  134. " HAVE_GCCATOMIC_INTRINSICS: ${HAVE_GCCATOMIC_INTRINSICS}\n"
  135. " HAVE_GCCATOMIC_INTRINSICS_REQUIRES_LIBATOMIC: ${HAVE_GCCATOMIC_INTRINSICS_REQUIRES_LIBATOMIC}\n"
  136. " HAVE_CXX_ATOMIC: ${HAVE_CXX_ATOMIC}\n"
  137. " HAVE_CXX_ATOMIC_STATIC: ${HAVE_CXX_ATOMIC_STATIC}\n"
  138. " HAVE_CXX_STD_PUT_TIME: ${HAVE_CXX_STD_PUT_TIME}\n"
  139. " Project Configuration:\n"
  140. " ENABLE_DEBUG: ${ENABLE_DEBUG}\n"
  141. " ENABLE_CXX11: ${ENABLE_CXX11}\n"
  142. " ENABLE_APPS: ${ENABLE_APPS}\n"
  143. " ENABLE_EXAMPLES: ${ENABLE_EXAMPLES}\n"
  144. " ENABLE_BONDING: ${ENABLE_BONDING}\n"
  145. " ENABLE_TESTING: ${ENABLE_TESTING}\n"
  146. " ENABLE_PROFILE: ${ENABLE_PROFILE}\n"
  147. " ENABLE_LOGGING: ${ENABLE_LOGGING}\n"
  148. " ENABLE_HEAVY_LOGGING: ${ENABLE_HEAVY_LOGGING}\n"
  149. " ENABLE_HAICRYPT_LOGGING: ${ENABLE_HAICRYPT_LOGGING}\n"
  150. " ENABLE_SHARED: ${ENABLE_SHARED}\n"
  151. " ENABLE_STATIC: ${ENABLE_STATIC}\n"
  152. " ENABLE_RELATIVE_LIBPATH: ${ENABLE_RELATIVE_LIBPATH}\n"
  153. " ENABLE_GETNAMEINFO: ${ENABLE_GETNAMEINFO}\n"
  154. " ENABLE_UNITTESTS: ${ENABLE_UNITTESTS}\n"
  155. " ENABLE_ENCRYPTION: ${ENABLE_ENCRYPTION}\n"
  156. " ENABLE_CXX_DEPS: ${ENABLE_CXX_DEPS}\n"
  157. " USE_STATIC_LIBSTDCXX: ${USE_STATIC_LIBSTDCXX}\n"
  158. " ENABLE_INET_PTON: ${ENABLE_INET_PTON}\n"
  159. " ENABLE_CODE_COVERAGE: ${ENABLE_CODE_COVERAGE}\n"
  160. " ENABLE_MONOTONIC_CLOCK: ${ENABLE_MONOTONIC_CLOCK}\n"
  161. " ENABLE_STDCXX_SYNC: ${ENABLE_STDCXX_SYNC}\n"
  162. " USE_OPENSSL_PC: ${USE_OPENSSL_PC}\n"
  163. " OPENSSL_USE_STATIC_LIBS: ${OPENSSL_USE_STATIC_LIBS}\n"
  164. " USE_BUSY_WAITING: ${USE_BUSY_WAITING}\n"
  165. " USE_GNUSTL: ${USE_GNUSTL}\n"
  166. " ENABLE_SOCK_CLOEXEC: ${ENABLE_SOCK_CLOEXEC}\n"
  167. " ENABLE_SHOW_PROJECT_CONFIG: ${ENABLE_SHOW_PROJECT_CONFIG}\n"
  168. " ENABLE_CLANG_TSA: ${ENABLE_CLANG_TSA}\n"
  169. " ATOMIC_USE_SRT_SYNC_MUTEX: ${ATOMIC_USE_SRT_SYNC_MUTEX}\n"
  170. " Constructed Configuration:\n"
  171. " DISABLE_CXX11: ${DISABLE_CXX11}\n"
  172. " HAVE_INET_PTON: ${HAVE_INET_PTON}\n"
  173. " PTHREAD_LIBRARY: ${PTHREAD_LIBRARY}\n"
  174. " USE_ENCLIB: ${USE_ENCLIB}\n"
  175. "${__ssl_configuration}"
  176. " TARGET_srt: ${TARGET_srt}\n"
  177. " srt_libspec_static: ${srt_libspec_static}\n"
  178. " srt_libspec_shared: ${srt_libspec_shared}\n"
  179. " SRT_LIBS_PRIVATE: ${SRT_LIBS_PRIVATE}\n"
  180. " Target Link Libraries:\n"
  181. " Static: ${static_property_link_libraries}\n"
  182. " Shared: ${shared_property_link_libraries}\n"
  183. "========================================================================\n"
  184. )
  185. endfunction(ShowProjectConfig)