Discord library in plain C
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

FindJansson.cmake 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # - Try to find Jansson
  2. # Once done this will define
  3. #
  4. # JANSSON_FOUND - system has Jansson
  5. # JANSSON_INCLUDE_DIRS - the Jansson include directory
  6. # JANSSON_LIBRARIES - Link these to use Jansson
  7. #
  8. # Copyright (c) 2011 Lee Hambley <lee.hambley@gmail.com>
  9. #
  10. # Redistribution and use is allowed according to the terms of the New
  11. # BSD license.
  12. # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
  13. #
  14. if (JANSSON_LIBRARIES AND JANSSON_INCLUDE_DIRS)
  15. # in cache already
  16. set(JANSSON_FOUND TRUE)
  17. else (JANSSON_LIBRARIES AND JANSSON_INCLUDE_DIRS)
  18. find_path(JANSSON_INCLUDE_DIR
  19. NAMES
  20. jansson.h
  21. PATHS
  22. /usr/include
  23. /usr/local/include
  24. /opt/local/include
  25. /sw/include
  26. )
  27. find_library(JANSSON_LIBRARY
  28. NAMES
  29. jansson
  30. PATHS
  31. /usr/lib
  32. /usr/local/lib
  33. /opt/local/lib
  34. /sw/lib
  35. )
  36. set(JANSSON_INCLUDE_DIRS
  37. ${JANSSON_INCLUDE_DIR}
  38. )
  39. if (JANSSON_LIBRARY)
  40. set(JANSSON_LIBRARIES
  41. ${JANSSON_LIBRARIES}
  42. ${JANSSON_LIBRARY}
  43. )
  44. endif (JANSSON_LIBRARY)
  45. include(FindPackageHandleStandardArgs)
  46. find_package_handle_standard_args(Jansson DEFAULT_MSG
  47. JANSSON_LIBRARIES JANSSON_INCLUDE_DIRS)
  48. # show the JANSSON_INCLUDE_DIRS and JANSSON_LIBRARIES variables only in the advanced view
  49. mark_as_advanced(JANSSON_INCLUDE_DIRS JANSSON_LIBRARIES)
  50. endif (JANSSON_LIBRARIES AND JANSSON_INCLUDE_DIRS)