Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

Commit

Permalink
Added sqlite driver
Browse files Browse the repository at this point in the history
  • Loading branch information
drahosp committed Aug 24, 2012
1 parent 9e939d9 commit ab9a23c
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 8 deletions.
9 changes: 3 additions & 6 deletions CMakeLists.txt
Expand Up @@ -9,9 +9,6 @@ cmake_minimum_required ( VERSION 2.8 )
include ( cmake/dist.cmake )
include ( lua )

# No default driver to install

# Install documentation
install_data ( README )
install_doc ( doc/ )
install_test ( tests/ )
find_package ( SQLite REQUIRED )
include_directories ( ${SQLITE_INCLUDE_DIRS} src )
install_lua_module ( sqlite src/ls_sqlite.c src/luasql.c LINK ${SQLITE_LIBRARIES} )
52 changes: 52 additions & 0 deletions cmake/FindSQLite.cmake
@@ -0,0 +1,52 @@
###############################################################################
# CMake module to search for SQLite library
#
# On success, the macro sets the following variables:
# SQLITE_FOUND = if the library found
# SQLITE_LIBRARY = full path to the library
# SQLITE_LIBRARIES = full path to the library
# SSQLITE_INCLUDE_DIR = where to find the library headers
#
# Copyright (c) 2009 Mateusz Loskot <mateusz@loskot.net>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
###############################################################################


find_path(SQLITE_INCLUDE_DIR
NAMES sqlite.h
PATH_PREFIXES sqlite
PATHS
/usr/include
/usr/local/include
$ENV{LIB_DIR}/include
$ENV{LIB_DIR}/include/sqlite
$ENV{ProgramFiles}/SQLite/*/include
$ENV{SystemDrive}/SQLite/*/include
)

set(SQLITE_NAMES sqlite)
find_library(SQLITE_LIBRARY
NAMES ${SQLITE_NAMES}
PATHS
/usr/lib
/usr/local/lib
$ENV{LIB_DIR}/lib
$ENV{ProgramFiles}/SQLite/*/lib
$ENV{SystemDrive}/SQLite/*/lib
)

set(SQLITE_LIBRARIES ${SQLITE_LIBRARY})

#message(STATUS ${SQLITE_LIBRARY})
# Handle the QUIETLY and REQUIRED arguments and set SQLITE_FOUND to TRUE
# if all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SQLITE
DEFAULT_MSG
SQLITE_LIBRARY
SQLITE_INCLUDE_DIR)

mark_as_advanced(SQLITE_LIBRARY SQLITE_INCLUDE_DIR SQLITE_LIBRARY)
6 changes: 4 additions & 2 deletions dist.info
@@ -1,14 +1,16 @@
--- This file is part of LuaDist project

name = "luasql"
name = "luasql-sqlite"
version = "2.3.0"

desc = "Database connectivity for Lua"
desc = "Database connectivity for Lua - SQLite driver"
author = "Roberto Ierusalimschy, André Carregal, Tomás Guisasola"
license = "Kepler"
maintainer = "Peter Kapec"
url = "http://www.keplerproject.org/luasql/"

depends = {
"lua ~> 5.1",
"luasql-2.3.0",
"libsqlite > 2.8",
}

0 comments on commit ab9a23c

Please sign in to comment.