1
0
mirror of https://github.com/minetest-mods/irc.git synced 2024-12-28 09:40:17 +01:00

Added option to not build luasocket as part of the mod

This commit is contained in:
Diego Martínez 2013-01-09 11:59:11 -02:00
parent 105db6bc60
commit 977bc94f11

View File

@ -5,10 +5,14 @@ cmake_minimum_required(VERSION 2.8)
project(MINETEST_IRC C)
set(MINETEST_IRC_VERSION 0.1.0)
set(MINETEST_IRC_VERSION 0.1.2)
option(LITE_VERSION "Do not build & package luasocket as part of the mod" OFF)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
if(NOT LITE_VERSION)
set(LUA_SRCS
src/lua/lapi.c
src/lua/lcode.c
@ -97,14 +101,22 @@ else() # Possibly Unix
COMPILE_FLAGS "-Wall -Werror")
endif()
set(dir ${CMAKE_CURRENT_BINARY_DIR}/irc/)
if(WIN32)
set(lib "${CMAKE_CURRENT_BINARY_DIR}/luasocket.dll")
else()
set(lib "${CMAKE_CURRENT_BINARY_DIR}/libluasocket.so")
endif()
set(inst_lib COMMAND ${CMAKE_COMMAND} -E copy ${lib} ${dir})
else(NOT LITE_VERSION)
set(inst_lib)
endif(NOT LITE_VERSION)
set(dir ${CMAKE_CURRENT_BINARY_DIR}/irc/)
add_custom_target(pack_mod
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
@ -125,7 +137,7 @@ add_custom_target(pack_mod
COMMAND ${CMAKE_COMMAND} -E copy src/luasocket/tp.lua ${dir}
COMMAND ${CMAKE_COMMAND} -E copy src/luasocket/url.lua ${dir}
COMMAND ${CMAKE_COMMAND} -E copy doc/LICENSE-luasocket.txt ${dir}
COMMAND ${CMAKE_COMMAND} -E copy ${lib} ${dir}
${inst_lib}
# IRC mod
COMMAND ${CMAKE_COMMAND} -E make_directory ${dir}