Skip to content

Instantly share code, notes, and snippets.

@starius
Created May 2, 2015 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save starius/6115aa80e038f1267d6c to your computer and use it in GitHub Desktop.
Save starius/6115aa80e038f1267d6c to your computer and use it in GitHub Desktop.
lua-npge CMakeLists.txt and rockspec
cmake_minimum_required(VERSION 2.6)
project(lua-npge)
set(INST_LUADIR "/usr/local/share/lua/5.1/"
CACHE STRING "Where to put the lua files")
set(CMAKE_BUILD_TYPE RelWithDebInfo)
if (NOT LUA_INCLUDE_DIR)
message("Using system lua...")
find_package(Lua REQUIRED)
endif()
include_directories(${LUA_INCLUDE_DIR})
if (NOT BOOST_INCLUDE_DIR)
message("Using system boost...")
find_package(Boost 1.42 REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
else()
include_directories(${BOOST_INCLUDE_DIR})
endif()
include_directories(src/npge/cpp)
file(GLOB sources "src/npge/cpp/*.cpp")
add_library(lua-npge-cpp MODULE ${sources})
target_link_libraries(lua-npge-cpp ${LUA_LIBRARIES})
set_target_properties(lua-npge-cpp PROPERTIES
OUTPUT_NAME "cpp"
PREFIX ""
)
if (CMAKE_INSTALL_PREFIX)
install(TARGETS lua-npge-cpp
DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/npge")
install(DIRECTORY src/npge
DESTINATION "${INST_LUADIR}")
endif()
-- lua-npge, Nucleotide PanGenome explorer (Lua module)
-- Copyright (C) 2014-2015 Boris Nagaev
-- See the LICENSE file for terms of use.
package = "lua-npge"
version = "dev-1"
source = {
url = "git://github.com/npge/lua-npge.git"
}
description = {
summary = "Nucleotide PanGenome explorer (Lua module)",
homepage = "https://github.com/npge/lua-npge",
license = "MIT",
}
dependencies = {
"lua >= 5.1",
}
dependencies.platforms = {
unix = {
"alnbox",
"luaposix",
},
}
external_dependencies = {
BOOST = {
header = "boost/foreach.hpp"
}
}
build = {
type = 'cmake',
variables = {
CMAKE_INSTALL_PREFIX = "$(PREFIX)",
INST_LUADIR="$(LUADIR)",
LUA_INCLUDE_DIR = "$(LUA_INCDIR)",
BOOST_INCLUDE_DIR = "$(BOOST_INCDIR)",
BUILD_SHARED_LIBS = "ON",
},
-- Override default build options
platforms = {
windows = {
variables = {
-- windows DLL needs link with importlib.
LUA_LIBRARIES = "$(LUA_LIBDIR)$(LUALIB)",
},
},
},
install = {
bin = {
"src/bin/MakePangenome",
},
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment