1
0

FindSDL_net.cmake 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. FIND_PATH(SDLNET_INCLUDE_DIR SDL_net.h
  15. PATHS
  16. $ENV{SDLNETDIR}
  17. $ENV{SDLDIR}
  18. NO_DEFAULT_PATH
  19. PATH_SUFFIXES include
  20. )
  21. FIND_PATH(SDLNET_INCLUDE_DIR SDL_net.h
  22. PATHS ${CMAKE_PREFIX_PATH} # Unofficial: We are proposing this.
  23. NO_DEFAULT_PATH
  24. PATH_SUFFIXES include
  25. )
  26. FIND_PATH(SDLNET_INCLUDE_DIR SDL_net.h
  27. PATHS
  28. ~/Library/Frameworks
  29. /Library/Frameworks
  30. /usr/local/include/SDL
  31. /usr/include/SDL
  32. /usr/local/include/SDL12
  33. /usr/local/include/SDL11 # FreeBSD ports
  34. /usr/include/SDL12
  35. /usr/include/SDL11
  36. /usr/local/include
  37. /usr/include
  38. /sw/include/SDL # Fink
  39. /sw/include
  40. /opt/local/include/SDL # DarwinPorts
  41. /opt/local/include
  42. /opt/csw/include/SDL # Blastwave
  43. /opt/csw/include
  44. /opt/include/SDL
  45. /opt/include
  46. )
  47. FIND_LIBRARY(SDLNET_LIBRARY
  48. NAMES SDL_net
  49. PATHS
  50. $ENV{SDLNETDIR}
  51. $ENV{SDLDIR}
  52. NO_DEFAULT_PATH
  53. PATH_SUFFIXES lib64 lib
  54. )
  55. FIND_LIBRARY(SDLNET_LIBRARY
  56. NAMES SDL_net
  57. PATHS ${CMAKE_PREFIX_PATH} # Unofficial: We are proposing this.
  58. NO_DEFAULT_PATH
  59. PATH_SUFFIXES lib64 lib
  60. )
  61. FIND_LIBRARY(SDLNET_LIBRARY
  62. NAMES SDL_net
  63. PATHS
  64. ~/Library/Frameworks
  65. /Library/Frameworks
  66. /usr/local
  67. /usr
  68. /sw
  69. /opt/local
  70. /opt/csw
  71. /opt
  72. PATH_SUFFIXES lib64 lib
  73. )
  74. SET(SDLNET_FOUND "NO")
  75. IF(SDLNET_LIBRARY AND SDLNET_INCLUDE_DIR)
  76. SET(SDLNET_FOUND "YES")
  77. ENDIF(SDLNET_LIBRARY AND SDLNET_INCLUDE_DIR)