Commit 45ade63d authored by Dan Lipsa's avatar Dan Lipsa
Browse files

las find_package GeoTIFF only if WITH_GEOTIFF

parent 4ba0333d
......@@ -4,3 +4,6 @@ superbuild_add_project(las
-DWITH_GDAL:BOOL=FALSE
-DWITH_GEOTIFF:BOOL=FALSE
-DWITH_LASZIP:BOOL=FALSE)
superbuild_apply_patch(las respect-with-geotiff
"find_package GeoTIFF only if WITH_GEOTIFF")
From 4dbc30a7e7e099cbe01a7c192ec19d231cc26894 Mon Sep 17 00:00:00 2001
From: Dan Lipsa <dan.lipsa@kitware.com>
Date: Thu, 19 Oct 2017 12:54:03 -0400
Subject: [PATCH] find_package GeoTIFF only if WITH_GEOTIFF.
---
CMakeLists.txt | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 18336e00..82fc991a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -254,8 +254,9 @@ endif()
# GeoTIFF support - required, default=ON
set(WITH_GEOTIFF TRUE CACHE BOOL "Choose if GeoTIFF support should be built")
-find_package (GeoTIFF 1.3.0 )
-if(GEOTIFF_FOUND)
+if(WITH_GEOTIFF)
+ find_package (GeoTIFF 1.3.0 )
+ if(GEOTIFF_FOUND)
set(WITH_GEOTIFF TRUE)
# Confirm required API is available
include(CheckFunctionExists)
@@ -265,7 +266,7 @@ if(GEOTIFF_FOUND)
mark_as_advanced(CLEAR TIFF_INCLUDE_DIR)
mark_as_advanced(CLEAR TIFF_LIBRARY)
if (WIN32)
- set(TIFF_NAMES libtiff_i)
+ set(TIFF_NAMES libtiff_i)
endif(WIN32)
find_package (TIFF QUIET NO_MODULE)
if (NOT TIFF_FOUND)
@@ -274,16 +275,17 @@ if(GEOTIFF_FOUND)
if (TIFF_FOUND)
include_directories(${TIFF_INCLUDE_DIR})
endif()
- find_package (JPEG NO_MODULE QUIET)
- if (NOT JPEG_FOUND)
- find_package (JPEG)
- endif ()
- find_package (ZLIB NO_MODULE QUIET)
- if (NOT ZLIB_FOUND)
- find_package (ZLIB)
- endif ()
-else()
+ find_package (JPEG NO_MODULE QUIET)
+ if (NOT JPEG_FOUND)
+ find_package (JPEG)
+ endif ()
+ find_package (ZLIB NO_MODULE QUIET)
+ if (NOT ZLIB_FOUND)
+ find_package (ZLIB)
+ endif ()
+ else()
message(FATAL_ERROR "Unable to find sufficient GeoTIFF")
+ endif()
endif()
--
2.11.0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment