From 787b6f7dd7e80348f26ce206c6ab343cae3e6881 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20G=C3=B6rner?= Date: Fri, 13 Nov 2015 18:33:06 +0100 Subject: [PATCH] install lvr-specific Find*.cmake for external modules Nabo and STANN don't have official Find scripts. FindEigen3.cmake is part of cmake 3.*, but lvr still supports 2.8. --- CMakeLists.txt | 6 ++++++ lvrConfig.cmake.in | 9 +++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a8c30c96..db9459e8 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -303,6 +303,12 @@ configure_file(lvrConfig.cmake.in ${CMAKE_BINARY_DIR}/lvrConfig.cmake @ONLY) install(FILES ${CMAKE_BINARY_DIR}/lvrConfig.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/lvr) +install(FILES + CMakeModules/FindEigen3.cmake + CMakeModules/FindNabo.cmake + CMakeModules/FindSTANN.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/lvr/Modules) + ################################################################ # DOCUMENTATION ################################################################ diff --git a/lvrConfig.cmake.in b/lvrConfig.cmake.in index fe5d6b6c..c329e13a 100644 --- a/lvrConfig.cmake.in +++ b/lvrConfig.cmake.in @@ -15,6 +15,8 @@ # ----------------------------------------------------------------- include("${CMAKE_CURRENT_LIST_DIR}/lvrTargets.cmake") +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/Modules") + cmake_policy(PUSH) cmake_policy(SET CMP0012 NEW) @@ -32,7 +34,8 @@ list(APPEND lvr_DEFINITIONS ${VTK_DEFINTIONS}) # nabo if(@NABO_FOUND@) - list(APPEND lvr_INCLUDE_DIRS @NABO_INCLUDE_DIRS@) + find_package(Nabo REQUIRED) + list(APPEND lvr_INCLUDE_DIRS ${NABO_INCLUDE_DIRS}) endif() # pcl @@ -67,7 +70,9 @@ endif() # stann if(@STANN_FOUND@) - list(APPEND lvr_INCLUDE_DIRS @STANN_INCLUDE_DIR@) + set(STANN_DIR @STANN_DIR@) + find_package(STANN REQUIRED) + list(APPEND lvr_INCLUDE_DIRS ${STANN_INCLUDE_DIR}) endif() cmake_policy(POP)