# 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(pluto C) # CMake configuration: CMAKE_MINIMUM_REQUIRED(VERSION 2.6 ) SET (CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true) # Where to install module parts: SET (INSTALL_BIN bin CACHE PATH "Directory to install binaries to.") 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_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 INCLUDE_DIRECTORIES(.) ADD_LIBRARY(pluto MODULE pluto.c pdep.c lzio.c) TARGET_LINK_LIBRARIES(pluto ${LUA_LIBRARY}) SET_TARGET_PROPERTIES(pluto PROPERTIES PREFIX "") # Test files ADD_EXECUTABLE (pptest pptest.c) TARGET_LINK_LIBRARIES (pptest ${LUA_LIBRARIES}) ADD_EXECUTABLE (puptest puptest.c) TARGET_LINK_LIBRARIES (puptest ${LUA_LIBRARIES}) # Install all files and documentation INSTALL (TARGETS pluto DESTINATION ${INSTALL_CMOD}) INSTALL (FILES README THANKS CHANGELOG FILEFORMAT DESTINATION ${INSTALL_DATA}) INSTALL (FILES pptest.lua puptest.lua DESTINATION ${INSTALL_TEST}) INSTALL (TARGETS pptest puptest DESTINATION ${INSTALL_BIN})