#
# Figure out how the compiler prefers to declare templated functions as friends
# of a templated class.
#
set(ITK_TEMPLATE_FRIEND_FUNCTION_TEST_OUTPUT)
try_compile(ITK_SUPPORTS_TEMPLATED_FRIEND_FUNCTION_WITH_NULL_STRING
      ${ITK_BINARY_DIR}
      ${ITK_SOURCE_DIR}/CMake/itkTestFriendTemplatedFunction.cxx
      COMPILE_DEFINITIONS -DTRY_COMPILE_FRIEND_WITH_NULL_TEMPLATE_STRING
      OUTPUT_VARIABLE ITK_TEMPLATE_FRIEND_FUNCTION_TEST_OUTPUT
      )
if(ITK_SUPPORTS_TEMPLATED_FRIEND_FUNCTION_WITH_NULL_STRING)
if(ITK_TEMPLATE_FRIEND_FUNCTION_TEST_OUTPUT MATCHES "[Ww]arning")
if(NOT ITK_TEMPLATE_FRIEND_FUNCTION_TEST_OUTPUT MATCHES " 0 [Ww]arning")
set(ITK_SUPPORTS_TEMPLATED_FRIEND_FUNCTION_WITH_NULL_STRING CACHE INTERNAL FALSE)
endif()
endif()
endif()

try_compile(ITK_SUPPORTS_TEMPLATED_FRIEND_FUNCTION_WITH_EMPTY_BRACKETS
      ${ITK_BINARY_DIR}
      ${ITK_SOURCE_DIR}/CMake/itkTestFriendTemplatedFunction.cxx
      COMPILE_DEFINITIONS -DTRY_COMPILE_FRIEND_WITH_EMPTY_TEMPLATE_BRACKETS
      OUTPUT_VARIABLE ITK_TEMPLATE_FRIEND_FUNCTION_TEST_OUTPUT
      )
if(ITK_SUPPORTS_TEMPLATED_FRIEND_FUNCTION_WITH_EMPTY_BRACKETS)
if(ITK_TEMPLATE_FRIEND_FUNCTION_TEST_OUTPUT MATCHES "[Ww]arning")
if(NOT ITK_TEMPLATE_FRIEND_FUNCTION_TEST_OUTPUT MATCHES " 0 [Ww]arning")
set(ITK_SUPPORTS_TEMPLATED_FRIEND_FUNCTION_WITH_EMPTY_BRACKETS CACHE INTERNAL FALSE)
endif()
endif()
endif()

try_compile(ITK_SUPPORTS_TEMPLATED_FRIEND_FUNCTION_WITH_TEMPLATE_ARGUMENTS
      ${ITK_BINARY_DIR}
      ${ITK_SOURCE_DIR}/CMake/itkTestFriendTemplatedFunction.cxx
      COMPILE_DEFINITIONS -DTRY_COMPILE_FRIEND_WITH_TEMPLATE_ARGUMENTS
      OUTPUT_VARIABLE ITK_TEMPLATE_FRIEND_FUNCTION_TEST_OUTPUT
      )
if(ITK_SUPPORTS_TEMPLATED_FRIEND_FUNCTION_WITH_TEMPLATE_ARGUMENTS)
if(ITK_TEMPLATE_FRIEND_FUNCTION_TEST_OUTPUT MATCHES "[Ww]arning")
if(NOT ITK_TEMPLATE_FRIEND_FUNCTION_TEST_OUTPUT MATCHES " 0 [Ww]arning")
set(ITK_SUPPORTS_TEMPLATED_FRIEND_FUNCTION_WITH_TEMPLATE_ARGUMENTS CACHE INTERNAL FALSE)
endif()
endif()
endif()


