From e791122b35571b00bbed673b70552615e2b68ae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 3 Sep 2024 09:59:02 +0200 Subject: [PATCH] handle cases when LASZIP and LASLIB have different include paths --- Installation/cmake/modules/FindLASLIB.cmake | 11 +++++++---- Installation/cmake/modules/UseLASLIB.cmake | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Installation/cmake/modules/FindLASLIB.cmake b/Installation/cmake/modules/FindLASLIB.cmake index 2353480c245..9c557a6dce5 100644 --- a/Installation/cmake/modules/FindLASLIB.cmake +++ b/Installation/cmake/modules/FindLASLIB.cmake @@ -9,14 +9,15 @@ # first look in user defined locations find_path(LASLIB_INCLUDE_DIR NAMES lasreader.hpp - PATHS /usr/local/include/LASlib/ + PATHS /usr/local/include/LASlib/ ENV LASLIB_INC_DIR ) - + find_path(LASZIP_INCLUDE_DIR NAMES mydefs.hpp PATHS /usr/local/include/LASzip/ ${LASLIB_INCLUDE_DIR}/../../LASzip/src + ${LASLIB_INCLUDE_DIR} ) find_library(LASLIB_LIBRARIES @@ -28,8 +29,10 @@ find_library(LASLIB_LIBRARIES ENV LASLIB_LIB_DIR ) -if(LASLIB_LIBRARIES AND LASLIB_INCLUDE_DIR) +if(LASLIB_LIBRARIES AND LASLIB_INCLUDE_DIR AND LASZIP_INCLUDE_DIR) + if (NOT ${LASLIB_INCLUDE_DIR} STREQUAL ${LASZIP_INCLUDE_DIR}) + list(APPEND LASLIB_INCLUDE_DIR ${LASZIP_INCLUDE_DIR}) + endif() set(LASLIB_FOUND TRUE) set(LASLIB_USE_FILE "UseLASLIB") endif() - diff --git a/Installation/cmake/modules/UseLASLIB.cmake b/Installation/cmake/modules/UseLASLIB.cmake index 1af7a023ceb..f1ffb0bd906 100644 --- a/Installation/cmake/modules/UseLASLIB.cmake +++ b/Installation/cmake/modules/UseLASLIB.cmake @@ -3,4 +3,4 @@ add_definitions(-DCGAL_LINKED_WITH_LASLIB) -message(DEPRECATION "This file UseLASLIB.cmake is deprecated, and the imported target `CGAL::TBB_support` from CGAL_LASLIB_support.cmake should be used instead.") +message(DEPRECATION "This file UseLASLIB.cmake is deprecated, and the imported target `CGAL::LASLIB_support` from CGAL_LASLIB_support.cmake should be used instead.")