handle cases when LASZIP and LASLIB have different include paths

This commit is contained in:
Sébastien Loriot 2024-09-03 09:59:02 +02:00
parent ce3e8ae0de
commit e791122b35
2 changed files with 8 additions and 5 deletions

View File

@ -9,14 +9,15 @@
# first look in user defined locations # first look in user defined locations
find_path(LASLIB_INCLUDE_DIR find_path(LASLIB_INCLUDE_DIR
NAMES lasreader.hpp NAMES lasreader.hpp
PATHS /usr/local/include/LASlib/ PATHS /usr/local/include/LASlib/
ENV LASLIB_INC_DIR ENV LASLIB_INC_DIR
) )
find_path(LASZIP_INCLUDE_DIR find_path(LASZIP_INCLUDE_DIR
NAMES mydefs.hpp NAMES mydefs.hpp
PATHS /usr/local/include/LASzip/ PATHS /usr/local/include/LASzip/
${LASLIB_INCLUDE_DIR}/../../LASzip/src ${LASLIB_INCLUDE_DIR}/../../LASzip/src
${LASLIB_INCLUDE_DIR}
) )
find_library(LASLIB_LIBRARIES find_library(LASLIB_LIBRARIES
@ -28,8 +29,10 @@ find_library(LASLIB_LIBRARIES
ENV LASLIB_LIB_DIR 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_FOUND TRUE)
set(LASLIB_USE_FILE "UseLASLIB") set(LASLIB_USE_FILE "UseLASLIB")
endif() endif()

View File

@ -3,4 +3,4 @@
add_definitions(-DCGAL_LINKED_WITH_LASLIB) 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.")