您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

FindJsonCpp.cmake 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # -*- cmake -*-
  2. # - Find JSONCpp
  3. # Find the JSONCpp includes and library
  4. # This module defines
  5. # JSONCPP_INCLUDE_DIRS, where to find json.h, etc.
  6. # JSONCPP_LIBRARIES, the libraries needed to use jsoncpp.
  7. # JSONCPP_FOUND, If false, do not try to use jsoncpp.
  8. # also defined, but not for general use are
  9. # JSONCPP_LIBRARIES, where to find the jsoncpp library.
  10. FIND_PATH(JSONCPP_INCLUDE_DIRS json/json.h
  11. /usr/include
  12. /usr/local/include
  13. ${CMAKE_SOURCE_DIR}/win32-deps/include
  14. PATH_SUFFIXES jsoncpp/json jsoncpp
  15. )
  16. FIND_LIBRARY(JSONCPP_LIBRARIES NAMES jsoncpp HINTS /usr/lib /usr/local/lib ${CMAKE_SOURCE_DIR}/win32-deps/lib)
  17. IF (JSONCPP_LIBRARIES AND JSONCPP_INCLUDE_DIRS)
  18. SET(JSONCPP_LIBRARIES ${JSONCPP_LIBRARIES})
  19. SET(JSONCPP_FOUND "YES")
  20. ELSE (JSONCPP_LIBRARIES AND JSONCPP_INCLUDE_DIRS)
  21. SET(JSONCPP_FOUND "NO")
  22. ENDIF (JSONCPP_LIBRARIES AND JSONCPP_INCLUDE_DIRS)
  23. IF (JSONCPP_FOUND)
  24. IF (NOT JSONCPP_FIND_QUIETLY)
  25. MESSAGE(STATUS "Found JSONCpp: ${JSONCPP_LIBRARIES}")
  26. ENDIF (NOT JSONCPP_FIND_QUIETLY)
  27. ELSE (JSONCPP_FOUND)
  28. IF (JSONCPP_FIND_REQUIRED)
  29. MESSAGE(FATAL_ERROR "Could not find JSONCPP library include: ${JSONCPP_INCLUDE_DIRS}, lib: ${JSONCPP_LIBRARIES}")
  30. ENDIF (JSONCPP_FIND_REQUIRED)
  31. ENDIF (JSONCPP_FOUND)
  32. # Deprecated declarations.
  33. SET (NATIVE_JSONCPP_INCLUDE_PATH ${JSONCPP_INCLUDE_DIRS} )
  34. GET_FILENAME_COMPONENT (NATIVE_JSONCPP_LIB_PATH ${JSONCPP_LIBRARIES} PATH)
  35. MARK_AS_ADVANCED(
  36. JSONCPP_LIBRARIES
  37. JSONCPP_INCLUDE_DIRS
  38. )