WtFindSystemLibraries.txt 987 B

123456789101112131415161718192021222324252627282930313233343536
  1. # Checks for libsocket, libm, ... and if we need to specify them
  2. # explicitly
  3. #
  4. # Result variables:
  5. # - WT_SOCKET_LIBRARY: the socket library on this system
  6. # - WT_MATH_LIBRARY: the math library on this system
  7. INCLUDE(CheckFunctionExists)
  8. INCLUDE(CheckLibraryExists)
  9. IF(WIN32)
  10. SET(WT_SOCKET_LIBRARY ws2_32 mswsock)
  11. ELSE(WIN32)
  12. CHECK_FUNCTION_EXISTS(connect SYSTEM_CONNECT_EXISTS)
  13. IF(NOT SYSTEM_CONNECT_EXISTS)
  14. CHECK_LIBRARY_EXISTS(socket connect "" SYSTEM_CONNECT_EXISTS)
  15. IF(SYSTEM_CONNECT_EXISTS)
  16. SET(WT_SOCKET_LIBRARY "socket")
  17. ENDIF(SYSTEM_CONNECT_EXISTS)
  18. ELSE(NOT SYSTEM_CONNECT_EXISTS)
  19. SET(WT_SOCKET_LIBRARY "")
  20. ENDIF(NOT SYSTEM_CONNECT_EXISTS)
  21. ENDIF(WIN32)
  22. CHECK_FUNCTION_EXISTS(sin SYSTEM_SIN_EXISTS)
  23. IF(NOT SYSTEM_SIN_EXISTS)
  24. CHECK_LIBRARY_EXISTS(m sin "" SYSTEM_SIN_EXISTS)
  25. IF(SYSTEM_SIN_EXISTS)
  26. SET(WT_SOCKET_LIBRARY "m")
  27. ENDIF(SYSTEM_SIN_EXISTS)
  28. ELSE(NOT SYSTEM_SIN_EXISTS)
  29. SET(WT_MATH_LIBRARY "")
  30. ENDIF(NOT SYSTEM_SIN_EXISTS)