Skip to content

Commit 17d497e

Browse files
committed
cmake: fix FindTarantool.cmake module
Patch adds a commit 'Fix FindTarantool.cmake script' (c6bd906) that was implemented in http v2 and later reverted in scope of issue with discard v2. Follows up #90 Part of #134
1 parent fa2b5e7 commit 17d497e

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

cmake/FindTarantool.cmake

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ 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 ${TARANTOOL_DIR} ENV TARANTOOL_DIR
13+
PATH_SUFFIXES include
1314
)
1415

1516
if(TARANTOOL_INCLUDE_DIR)
@@ -26,22 +27,14 @@ include(FindPackageHandleStandardArgs)
2627
find_package_handle_standard_args(TARANTOOL
2728
REQUIRED_VARS TARANTOOL_INCLUDE_DIR VERSION_VAR TARANTOOL_VERSION)
2829
if(TARANTOOL_FOUND)
29-
set(TARANTOOL_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}/tarantool")
30-
set(TARANTOOL_INSTALL_LUADIR "${CMAKE_INSTALL_DATADIR}/tarantool")
3130
set(TARANTOOL_INCLUDE_DIRS "${TARANTOOL_INCLUDE_DIR}"
32-
"${TARANTOOL_INCLUDE_DIR}/tarantool/")
31+
"${TARANTOOL_INCLUDE_DIR}/tarantool/"
32+
CACHE PATH "Include directories for Tarantool")
33+
set(TARANTOOL_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}/tarantool"
34+
CACHE PATH "Directory for storing Lua modules written in Lua")
35+
set(TARANTOOL_INSTALL_LUADIR "${CMAKE_INSTALL_DATADIR}/tarantool"
36+
CACHE PATH "Directory for storing Lua modules written in C")
3337

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

0 commit comments

Comments
 (0)