FindSDL_mixer.cmake 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # Locate SDL_mixer library
  2. # This module defines
  3. # SDLMIXER_LIBRARY, the name of the library to link against
  4. # SDLMIXER_FOUND, if false, do not try to link to SDL
  5. # SDLMIXER_INCLUDE_DIR, where to find SDL/SDL.h
  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. # On OSX, this will prefer the Framework version (if found) over others.
  15. # People will have to manually change the cache values of
  16. # SDLMIXER_LIBRARY to override this selection.
  17. FIND_PATH(SDLMIXER_INCLUDE_DIR SDL_mixer.h
  18. ~/Library/Frameworks/SDL_mixer.framework/Headers
  19. /Library/Frameworks/SDL_mixer.framework/Headers
  20. $ENV{SDLDIR}/include
  21. $ENV{SDLMIXERDIR}/include
  22. /usr/include/SDL
  23. /usr/include/SDL12
  24. /usr/include/SDL11
  25. /usr/include
  26. /usr/local/include/SDL
  27. /usr/local/include/SDL12
  28. /usr/local/include/SDL11
  29. /usr/local/include
  30. /sw/include
  31. )
  32. # I'm not sure if I should do a special casing for Apple. It is
  33. # unlikely that other Unix systems will find the framework path.
  34. # But if they do ([Next|Open|GNU]Step?),
  35. # do they want the -framework option also?
  36. IF(${SDLMIXER_INCLUDE_DIR} MATCHES ".framework")
  37. SET (SDLMIXER_LIBRARY "-framework SDL_mixer" CACHE STRING "SDL_mixer framework for OSX")
  38. ELSE(${SDLMIXER_INCLUDE_DIR} MATCHES ".framework")
  39. FIND_LIBRARY(SDLMIXER_LIBRARY
  40. NAMES SDL_mixer
  41. PATHS
  42. $ENV{SDLDIR}/lib
  43. $ENV{SDLMIXERDIR}/lib
  44. /usr/lib
  45. /usr/local/lib
  46. /sw/lib
  47. )
  48. ENDIF(${SDLMIXER_INCLUDE_DIR} MATCHES ".framework")
  49. SET(SDLMIXER_FOUND "NO")
  50. IF(SDLMIXER_LIBRARY)
  51. SET(SDLMIXER_FOUND "YES")
  52. ENDIF(SDLMIXER_LIBRARY)