# Copyright (C) 2007-2009 LuaDist. # Created by Peter Drahoš # 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(rings C) CMAKE_MINIMUM_REQUIRED (VERSION 2.6) # Where to install module parts: SET (INSTALL_LMOD share/lua/lmod CACHE PATH "Directory to install Lua modules.") 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}) # Rings modules ADD_LIBRARY(rings MODULE src/rings.c) TARGET_LINK_LIBRARIES(rings ${LUA_LIBRARY}) SET_TARGET_PROPERTIES(rings PROPERTIES PREFIX "") IF(MSVC) SET_TARGET_PROPERTIES(rings PROPERTIES LINK_FLAGS "/DEF:${CMAKE_CURRENT_SOURCE_DIR}/src/rings.def") ENDIF(MSVC) INSTALL (TARGETS rings DESTINATION ${INSTALL_CMOD}) INSTALL (FILES src/stable.lua DESTINATION ${INSTALL_LMOD}) # Install Rings Documentation INSTALL(FILES README DESTINATION ${INSTALL_DATA}) INSTALL(DIRECTORY doc/ DESTINATION ${INSTALL_DOC}) # Rings tests and samples INSTALL(DIRECTORY tests/ DESTINATION ${INSTALL_TEST})