FindSDL_net.cmake 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. # Locate SDL_net library
  2. # This module defines
  3. # SDLNET_LIBRARY, the name of the library to link against
  4. # SDLNET_FOUND, if false, do not try to link against
  5. # SDLNET_INCLUDE_DIR, where to find the headers
  6. #
  7. # $SDLDIR is an environment variable that would
  8. # correspond to the ./configure --prefix=$SDLDIR
  9. # used in building SDL.
  10. #
  11. # Created by Eric Wing. This was influenced by the FindSDL.cmake
  12. # module, but with modifications to recognize OS X frameworks and
  13. # additional Unix paths (FreeBSD, etc).
  14. #=============================================================================
  15. # Copyright 2005-2009 Kitware, Inc.
  16. #
  17. # Distributed under the OSI-approved BSD License (the "License");
  18. # see accompanying file Copyright.txt for details.
  19. #
  20. # This software is distributed WITHOUT ANY WARRANTY; without even the
  21. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  22. # See the License for more information.
  23. #=============================================================================
  24. # (To distributed this file outside of CMake, substitute the full
  25. # License text for the above reference.)
  26. FIND_PATH(SDLNET_INCLUDE_DIR SDL_net.h
  27. HINTS
  28. $ENV{SDLNETDIR}
  29. $ENV{SDLDIR}
  30. PATH_SUFFIXES include
  31. PATHS
  32. ~/Library/Frameworks
  33. /Library/Frameworks
  34. /usr/local/include/SDL
  35. /usr/include/SDL
  36. /usr/local/include/SDL12
  37. /usr/local/include/SDL11 # FreeBSD ports
  38. /usr/include/SDL12
  39. /usr/include/SDL11
  40. /usr/local/include
  41. /usr/include
  42. /sw/include/SDL # Fink
  43. /sw/include
  44. /opt/local/include/SDL # DarwinPorts
  45. /opt/local/include
  46. /opt/csw/include/SDL # Blastwave
  47. /opt/csw/include
  48. /opt/include/SDL
  49. /opt/include
  50. )
  51. FIND_LIBRARY(SDLNET_LIBRARY
  52. NAMES SDL_net
  53. HINTS
  54. $ENV{SDLNETDIR}
  55. $ENV{SDLDIR}
  56. PATH_SUFFIXES lib64 lib
  57. PATHS
  58. ~/Library/Frameworks
  59. /Library/Frameworks
  60. /usr/local
  61. /usr
  62. /sw
  63. /opt/local
  64. /opt/csw
  65. /opt
  66. )
  67. SET(SDLNET_FOUND "NO")
  68. IF(SDLNET_LIBRARY AND SDLNET_INCLUDE_DIR)
  69. SET(SDLNET_FOUND "YES")
  70. ENDIF(SDLNET_LIBRARY AND SDLNET_INCLUDE_DIR)