-
Notifications
You must be signed in to change notification settings - Fork 12
/
CMakeLists.txt
61 lines (51 loc) · 2.25 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
56
57
58
59
60
61
# Copyright (C) 2012 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 type needed for correct library suffix and prefix detection
project ( luadist-git NONE )
cmake_minimum_required ( VERSION 2.8 )
include ( cmake/dist.cmake )
include ( lua )
## LuaDist settings
# Host specific setup
set ( DETECTED_TYPE ${CMAKE_SYSTEM_PROCESSOR} )
set ( DETECTED_ARCH ${CMAKE_SYSTEM_NAME} )
if ( CYGWIN )
# Make sure Cygwin uses correct arch and type.
set ( DETECTED_TYPE x86 )
set ( DETECTED_ARCH Cygwin )
elseif ( MSVC )
set ( DETECTED_TYPE MSVC32 )
endif ( )
if ( DETECTED_ARCH STREQUAL "Darwin" )
# Mac keeps CMAKE_SYSTEM_PROCESSOR set to i386 even on 64bit systems
execute_process ( COMMAND uname -m OUTPUT_VARIABLE DETECTED_TYPE OUTPUT_STRIP_TRAILING_WHITESPACE )
endif ( )
if ( DETECTED_ARCH STREQUAL "Linux" )
message( "DETECTING ...")
# Determine LINUX flavour using lsb_release
execute_process ( COMMAND lsb_release -is OUTPUT_VARIABLE DETECTED_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE )
endif ()
set ( DIST_TYPE ${DETECTED_TYPE} CACHE STRING "Host system type. PLEASE CHECK!" )
set ( DIST_ARCH ${DETECTED_ARCH} CACHE STRING "Host system architecture. PLEASE CHECK!" )
message( "Detected system: ${DETECTED_ARCH}-${DETECTED_TYPE}" )
message( "Configured system: ${DIST_ARCH}-${DIST_TYPE}")
configure_file ( dist/config.lua.in ${CMAKE_CURRENT_BINARY_DIR}/dist/config.lua @ONLY )
# Install files
install_lua_executable ( luadist luadist.lua )
install_lua_module ( dist.config ${CMAKE_CURRENT_BINARY_DIR}/dist/config.lua )
install_lua_module ( dist.constraints dist/constraints.lua )
install_lua_module ( dist.depends dist/depends.lua )
install_lua_module ( dist.git dist/git.lua )
install_lua_module ( dist.init dist/init.lua )
install_lua_module ( dist.manifest dist/manifest.lua )
install_lua_module ( dist.package dist/package.lua )
install_lua_module ( dist.sys dist/sys.lua )
install_lua_module ( dist.utils dist/utils.lua )
install_data ( COPYRIGHT.TXT )
install_data ( README.md )
install_test ( test/ )
# Tests
add_lua_test ( test/test_depends.lua )