This repository has been archived by the owner on Nov 20, 2020. It is now read-only.
forked from luarocks/luarocks
/
CMakeLists.txt
55 lines (48 loc) · 2.61 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Copyright (C) 2011 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.
# C project specification is needed as MinGW would not be detected otherwise
project ( luarocks C )
cmake_minimum_required ( VERSION 2.6 )
include ( dist.cmake )
# Settings
set ( LUAROCKS_PREFIX ${CMAKE_INSTALL_PREFIX}/ CACHE STRING "Prefix where LuaRocks should be installed." )
set ( LUAROCKS_SYSCONFDIR ${INSTALL_ETC} CACHE STRING "Location where the config file should be installed." )
set ( LUAROCKS_ROCKS_TREE ${INSTALL_DATA}/rocks CACHE STRING "Root of the local tree of installed rocks." )
set ( LUAROCKS_FORCE_CONFIG true CACHE STRING "Use a single config location. Do not use the LUAROCKS_CONFIG variable or the user's home directory. Useful to avoid conflicts when LuaRocks is embedded within an application. (true|false)" )
set ( LUAROCKS_LUA_BIN lua CACHE STRING "Name of the lua executable." )
set ( LUAROCKS_LUA_LIB lua CACHE STRING "Name of the lua library to link against when using builtin build-type." )
set ( LUAROCKS_LUA_BINDIR ${INSTALL_BIN} CACHE STRING "You can also specify Lua's binary dir." )
set ( LUAROCKS_LUA_INCDIR ${INSTALL_INC} CACHE STRING "You can also specify Lua's includes dir." )
set ( LUAROCKS_LUA_LIBDIR ${INSTALL_LIB} CACHE STRING "You can also specify Lua's libraries dir." )
set ( LUAROCKS_DOWNLOADER curl CACHE STRING "Which tool to use as a downloader. (wget|curl)" )
set ( LUAROCKS_MD5CHECKER md5 CACHE STRING "Which tool to use for checksum. (md5sum|openssl|md5)" )
# System detection
set ( LUAROCKS_UNAME_S Unix CACHE STRING "Detected system." Unknown)
if ( CYGWIN )
set ( LUAROCKS_UNAME_S CYGWIN )
elseif ( MINGW )
set ( LUAROCKS_UNAME_S MINGW )
elseif ( WIN32 )
set ( LUAROCKS_UNAME_S Windows )
elseif ( LINUX )
set ( LUAROCKS_UNAME_S Linux )
elseif ( APPLE )
set ( LUAROCKS_UNAME_S Darwin )
endif ()
# Architecture detection
set ( LUAROCKS_UNAME_M x86 CACHE STRING "Detected architecture." )
if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
set ( LUAROCKS_UNAME_M x86_64 )
endif ()
# Generate site_config.lua file
configure_file ( config.in ${CMAKE_CURRENT_SOURCE_DIR}/src/luarocks/site_config.lua @ONLY )
# Install Everything
install ( DIRECTORY src/luarocks DESTINATION ${INSTALL_LMOD} )
install_lua_executable ( luarocks src/bin/luarocks )
install_lua_executable ( luarocks-admin src/bin/luarocks-admin )
install_data ( COPYING COPYING_7z COPYING_lua README.md )
install_data ( COPYING INTO rocks )
install_test ( test/ )