# 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_xmlreader C) CMAKE_MINIMUM_REQUIRED(VERSION 2.6 ) # Cmake configuration: SET (CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true) # 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_DOC ${INSTALL_DATA}/doc CACHE PATH "Recommended directory to install documentation 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}) # We need Xml2 to compile FIND_PACKAGE (LibXml2 REQUIRED) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) # Build INCLUDE_DIRECTORIES(.) ADD_LIBRARY(xmlreader MODULE error.c xmlreader.c) TARGET_LINK_LIBRARIES(xmlreader ${LUA_LIBRARY} ${LIBXML2_LIBRARIES}) SET_TARGET_PROPERTIES(xmlreader PROPERTIES PREFIX "") # Install all files and documentation INSTALL (TARGETS xmlreader DESTINATION ${INSTALL_CMOD}) INSTALL (FILES LICENSE README DESTINATION ${INSTALL_DATA}) INSTALL (FILES example.lua DESTINATION ${INSTALL_TEST}) INSTALL (FILES doc/doc_style.css doc/xmlreader.html DESTINATION ${INSTALL_DOC})