Skip to content

Commit

Permalink
cmake: fix FindTarantool.cmake module
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ligurio committed Oct 26, 2021
1 parent e03e26f commit ce3aa58
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions cmake/FindTarantool.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ macro(extract_definition name output input)
endmacro()

find_path(TARANTOOL_INCLUDE_DIR tarantool/module.h
HINTS ENV TARANTOOL_DIR
HINTS ${TARANTOOL_DIR} ENV TARANTOOL_DIR
PATH_SUFFIXES include
)

if(TARANTOOL_INCLUDE_DIR)
Expand All @@ -26,22 +27,14 @@ include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(TARANTOOL
REQUIRED_VARS TARANTOOL_INCLUDE_DIR VERSION_VAR TARANTOOL_VERSION)
if(TARANTOOL_FOUND)
set(TARANTOOL_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}/tarantool")
set(TARANTOOL_INSTALL_LUADIR "${CMAKE_INSTALL_DATADIR}/tarantool")
set(TARANTOOL_INCLUDE_DIRS "${TARANTOOL_INCLUDE_DIR}"
"${TARANTOOL_INCLUDE_DIR}/tarantool/")
"${TARANTOOL_INCLUDE_DIR}/tarantool/"
CACHE PATH "Include directories for Tarantool")
set(TARANTOOL_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}/tarantool"
CACHE PATH "Directory for storing Lua modules written in Lua")
set(TARANTOOL_INSTALL_LUADIR "${CMAKE_INSTALL_DATADIR}/tarantool"
CACHE PATH "Directory for storing Lua modules written in C")

if (NOT "${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr/local" AND
NOT "${CMAKE_INSTALL_PREFIX}" STREQUAL "${_install_prefix}")
message(WARNING "Provided CMAKE_INSTALL_PREFIX is different from "
"CMAKE_INSTALL_PREFIX of Tarantool. You might need to set "
"corrent package.path/package.cpath to load this module or "
"change your build prefix:"
"\n"
"cmake . -DCMAKE_INSTALL_PREFIX=${_install_prefix}"
"\n"
)
endif ()
if (NOT TARANTOOL_FIND_QUIETLY AND NOT FIND_TARANTOOL_DETAILS)
set(FIND_TARANTOOL_DETAILS ON CACHE INTERNAL "Details about TARANTOOL")
message(STATUS "Tarantool LUADIR is ${TARANTOOL_INSTALL_LUADIR}")
Expand Down

0 comments on commit ce3aa58

Please sign in to comment.