# Copyright (C) 2007-2009 LuaDist. # Created by Peter Kapec # Redistribution and use of this file is allowed according to the terms of the MIT license. # For details see the COPYRIGHT file distributed with LuaDist. # Please note that the package source code is licensed under its own license. PROJECT(lua_tinycdb C) # CMake configuration: CMAKE_MINIMUM_REQUIRED(VERSION 2.6 ) # Where to install module parts: SET (INSTALL_CMOD share/lua/cmod CACHE PATH "Directory to install Lua binary modules.") SET (INSTALL_DATA . CACHE PATH "Directory the package can store documentation, tests or other data in.") SET (INSTALL_EXAMPLE ${INSTALL_DATA}/example CACHE PATH "Recommended directory to install examples into.") SET (INSTALL_TEST ${INSTALL_DATA}/test CACHE PATH "Recommended directory to install tests into.") # We need Lua to compile FIND_PACKAGE (Lua51 REQUIRED) INCLUDE_DIRECTORIES( ${LUA_INCLUDE_DIR}) # Build SET(SRC cdb_find.c cdb_findnext.c cdb_hash.c cdb_init.c cdb_make_add.c cdb_make.c cdb_make_put.c cdb_seek.c cdb_seq.c cdb_unpack.c lcdb.c) ADD_LIBRARY(cdb MODULE ${SRC}) TARGET_LINK_LIBRARIES(cdb ${LUA_LIBRARY} ) SET_TARGET_PROPERTIES(cdb PROPERTIES PREFIX "") # Install all files and documentation INSTALL (TARGETS cdb DESTINATION ${INSTALL_CMOD}) INSTALL (FILES LICENSE DOCUMENTATION.mkd README.mkd cdb.txt DESTINATION ${INSTALL_DATA}) INSTALL (FILES example.lua DESTINATION ${INSTALL_EXAMPLE}) INSTALL (FILES test.lua DESTINATION ${INSTALL_TEST})