if (NOT SQLITE3_FOUND)
  find_path(SQLITE3_INCLUDE_DIRS NAMES sqlite3.h
    PATHS
    ${SQLITE3_PKG_INCLUDE_DIRS}
    /usr/include
    /usr/local/include
  )

  find_library(SQLITE3_LIBRARIES NAMES sqlite3
    PATHS
    ${SQLITE3_PKG_LIBRARY_DIRS}
    /usr/lib
    /usr/local/lib
    /usr/lib/x86_64-linux-gnu
  )

if (SQLITE3_INCLUDE_DIRS AND SQLITE3_LIBRARIES)
  set(SQLITE3_FOUND TRUE CACHE INTERNAL "sqlite3 found")
  message(STATUS "Found sqlite3: ${SQLITE3_INCLUDE_DIRS}, ${SQLITE3_LIBRARIES}")
else (SQLITE3_INCLUDE_DIRS AND SQLITE3_LIBRARIES)
  set(SQLITE3_FOUND FALSE CACHE INTERNAL "sqlite3 found")
  message(STATUS "sqlite3 not found.")
endif (SQLITE3_INCLUDE_DIRS AND SQLITE3_LIBRARIES)

MARK_AS_ADVANCED(SQLITE3_INCLUDE_DIRS SQLITE3_LIBRARIES)

endif (NOT SQLITE3_FOUND)