FindSQLite3.cmake 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. # Copyright (C) 2007-2009 LuaDist.
  2. # Created by Peter Kapec <[email protected]>
  3. # Redistribution and use of this file is allowed according to the terms of the MIT license.
  4. # For details see the COPYRIGHT file distributed with LuaDist.
  5. # Note:
  6. # Searching headers and libraries is very simple and is NOT as powerful as scripts
  7. # distributed with CMake, because LuaDist defines directories to search for.
  8. # Everyone is encouraged to contact the author with improvements. Maybe this file
  9. # becomes part of CMake distribution sometimes.
  10. # - Find sqlite3
  11. # Find the native SQLITE3 headers and libraries.
  12. #
  13. # SQLITE3_INCLUDE_DIRS - where to find sqlite3.h, etc.
  14. # SQLITE3_LIBRARIES - List of libraries when using sqlite.
  15. # SQLITE3_FOUND - True if sqlite found.
  16. # Look for the header file.
  17. FIND_PATH(SQLITE3_INCLUDE_DIR NAMES sqlite3.h)
  18. # Look for the library.
  19. #FIND_LIBRARY(SQLITE3_LIBRARY NAMES sqlite)
  20. FIND_LIBRARY(SQLITE3_LIBRARY NAMES sqlite3)
  21. # Handle the QUIETLY and REQUIRED arguments and set SQLITE3_FOUND to TRUE if all listed variables are TRUE.
  22. INCLUDE(FindPackageHandleStandardArgs)
  23. FIND_PACKAGE_HANDLE_STANDARD_ARGS(SQLITE3 DEFAULT_MSG SQLITE3_LIBRARY SQLITE3_INCLUDE_DIR)
  24. # Copy the results to the output variables.
  25. IF(SQLITE3_FOUND)
  26. SET(SQLITE3_LIBRARIES ${SQLITE3_LIBRARY})
  27. SET(SQLITE3_INCLUDE_DIRS ${SQLITE3_INCLUDE_DIR})
  28. ELSE(SQLITE3_FOUND)
  29. SET(SQLITE3_LIBRARIES)
  30. SET(SQLITE3_INCLUDE_DIRS)
  31. ENDIF(SQLITE3_FOUND)
  32. MARK_AS_ADVANCED(SQLITE3_INCLUDE_DIRS SQLITE3_LIBRARIES)