Skip to content

Commit 5d6161f

Browse files
committed
Fix installation from non-root users
1 parent a085235 commit 5d6161f

File tree

2 files changed

+19
-34
lines changed

2 files changed

+19
-34
lines changed

cmake/FindTarantool.cmake

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ macro(extract_definition name output input)
99
endmacro()
1010

1111
find_path(TARANTOOL_INCLUDE_DIR tarantool/module.h
12-
HINTS ENV TARANTOOL_DIR
12+
HINTS ENV TARANTOOL_DIR /usr/local/include
1313
)
1414

1515
if(TARANTOOL_INCLUDE_DIR)
@@ -22,30 +22,18 @@ if(TARANTOOL_INCLUDE_DIR)
2222
unset(_config)
2323
endif()
2424

25-
message(STATUS "INCLUDE_DIR ${TARANTOOL_INCLUDE_DIR}")
26-
message(STATUS "LIBDIR ${CMAKE_INSTALL_LIBDIR}")
27-
message(STATUS "PREFIX ${_install_prefix}")
28-
2925
include(FindPackageHandleStandardArgs)
3026
find_package_handle_standard_args(TARANTOOL
3127
REQUIRED_VARS TARANTOOL_INCLUDE_DIR VERSION_VAR TARANTOOL_VERSION)
3228
if(TARANTOOL_FOUND)
33-
set(TARANTOOL_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}/tarantool")
34-
set(TARANTOOL_INSTALL_LUADIR "${CMAKE_INSTALL_DATADIR}/tarantool")
3529
set(TARANTOOL_INCLUDE_DIRS "${TARANTOOL_INCLUDE_DIR}"
36-
"${TARANTOOL_INCLUDE_DIR}/tarantool/")
30+
"${TARANTOOL_INCLUDE_DIR}/tarantool/"
31+
CACHE PATH "Include directories for Tarantool")
32+
set(TARANTOOL_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}/tarantool"
33+
CACHE PATH "Directory for storing Lua modules written in Lua")
34+
set(TARANTOOL_INSTALL_LUADIR "${CMAKE_INSTALL_DATADIR}/tarantool"
35+
CACHE PATH "Directory for storing Lua modules written in C")
3736

38-
if (NOT "${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr/local" AND
39-
NOT "${CMAKE_INSTALL_PREFIX}" STREQUAL "${_install_prefix}")
40-
message(WARNING "Provided CMAKE_INSTALL_PREFIX is different from "
41-
"CMAKE_INSTALL_PREFIX of Tarantool. You might need to set "
42-
"corrent package.path/package.cpath to load this module or "
43-
"change your build prefix:"
44-
"\n"
45-
"cmake . -DCMAKE_INSTALL_PREFIX=${_install_prefix}"
46-
"\n"
47-
)
48-
endif ()
4937
if (NOT TARANTOOL_FIND_QUIETLY AND NOT FIND_TARANTOOL_DETAILS)
5038
set(FIND_TARANTOOL_DETAILS ON CACHE INTERNAL "Details about TARANTOOL")
5139
message(STATUS "Tarantool LUADIR is ${TARANTOOL_INSTALL_LUADIR}")

mqtt-scm-1.rockspec

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
11
package = "mqtt"
22
version = "scm-1"
33
source = {
4-
url = "git://github.com/tarantool/mqtt.git",
5-
tag = "master"
4+
url = "git://github.com/tarantool/mqtt.git",
5+
tag = "master"
66
}
77
description = {
8-
summary = "Mqtt connector for Tarantool",
9-
homepage = "https://github.com/tarantool/mqtt",
10-
license = "MIT"
8+
summary = "Mqtt connector for Tarantool",
9+
homepage = "https://github.com/tarantool/mqtt",
10+
license = "MIT"
1111
}
1212
dependencies = {
13-
"lua >= 5.1"
14-
}
15-
external_dependencies = {
16-
TARANTOOL = {
17-
header = "tarantool/module.h"
18-
},
19-
LIBMOSQUITTO = {
20-
header = "mosquitto.h"
21-
}
13+
"lua >= 5.1"
2214
}
2315
build = {
24-
type = "cmake"
16+
type = "cmake";
17+
variables = {
18+
CMAKE_BUILD_TYPE="RelWithDebInfo";
19+
TARANTOOL_INSTALL_LIBDIR="$(LIBDIR)";
20+
TARANTOOL_INSTALL_LUADIR="$(LUADIR)";
21+
};
2522
}

0 commit comments

Comments
 (0)