# 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(bitlib C) 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_TEST ${INSTALL_DATA}/test CACHE PATH "Recommended directory to install tests into.") # Find Lua FIND_PACKAGE(Lua51) INCLUDE_DIRECTORIES( ${LUA_INCLUDE_DIR}) # Build ADD_LIBRARY(bit MODULE lbitlib.c) TARGET_LINK_LIBRARIES(bit ${LUA_LIBRARY}) SET_TARGET_PROPERTIES(bit PROPERTIES PREFIX "") IF(MSVC) SET_TARGET_PROPERTIES(bit PROPERTIES LINK_FLAGS "/DEF:${CMAKE_CURRENT_SOURCE_DIR}/bit.def") ENDIF(MSVC) # Install all files and documentation INSTALL(TARGETS bit DESTINATION ${INSTALL_CMOD}) INSTALL(FILES AUTHORS COPYING ChangeLog NEWS README DESTINATION ${INSTALL_DATA}) INSTALL(FILES find_limits.lua test.lua DESTINATION ${INSTALL_TEST})