FindSQLite3.cmake 959 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # Find SQLite3
  2. #
  3. # SQLITE3_INCLUDE_DIRS - where to find sqlite3.h header.
  4. # SQLITE3_LIBRARIES - List of SQLite3 libraries.
  5. # SQLITE3_FOUND - True if SQLite3 found.
  6. set(SQLITE3_FOUND false)
  7. find_path(SQLITE3_INCLUDE_DIRS
  8. NAMES
  9. sqlite3.h
  10. PATHS
  11. /usr/include
  12. /usr/local/include
  13. /opt/local/include
  14. /sw/include
  15. )
  16. find_library(SQLITE3_LIBRARIES
  17. NAMES
  18. sqlite3
  19. PATH_SUFFIXES
  20. lib64
  21. lib
  22. PATHS
  23. /usr/lib
  24. /usr/local/lib
  25. /opt/local/lib
  26. /sw/lib
  27. /usr/lib/x86_64-linux-gnu
  28. )
  29. if (SQLITE3_INCLUDE_DIRS AND SQLITE3_LIBRARIES)
  30. set(SQLITE3_FOUND TRUE)
  31. #these next two are needed by the CocosBuildHelpers cocos_find_package macro
  32. set(SQLITE3_INCLUDE_DIR ${SQLITE3_INCLUDE_DIRs})
  33. set(SQLITE3_LIBRARY ${SQLITE3_LIBRARIES})
  34. endif (SQLITE3_INCLUDE_DIRS AND SQLITE3_LIBRARIES)
  35. if (NOT SQLITE3_FOUND)
  36. message(FATAL_ERROR "Could not find Sqlite3")
  37. endif (NOT SQLITE3_FOUND)
  38. mark_as_advanced(SQLITE3_INCLUDE_DIRS SQLITE3_LIBRARIES)