From eff20b7c50fca5902415702d1ea996855008fb38 Mon Sep 17 00:00:00 2001 From: Sergey Bronnikov Date: Fri, 22 Oct 2021 17:30:47 +0300 Subject: [PATCH] cmake: fix FindTarantool.cmake module Patch adds a commit 'Fix FindTarantool.cmake script' (c6bd906e0432b39b3fab193a934d96bb0263bf17) that was implemented in http v2 and later reverted in scope of issue with discard v2. Follows up #90 Part of #134 --- CHANGELOG.md | 4 ++++ cmake/FindTarantool.cmake | 23 ++++++++--------------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b68185b..1eca909 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Add workflow that publish rockspec. - Add editorconfig to configure indentation. +### Fixed + +- Fix FindTarantool.cmake module. + ## [2.1.0] - 2020-01-30 ## [2.0.1] - 2019-10-09 diff --git a/cmake/FindTarantool.cmake b/cmake/FindTarantool.cmake index c9a9ba3..a938158 100644 --- a/cmake/FindTarantool.cmake +++ b/cmake/FindTarantool.cmake @@ -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) @@ -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}")