Skip to content

Commit d6af0fc

Browse files
authored
Update CMakeLists.txt
1 parent c390572 commit d6af0fc

File tree

1 file changed

+31
-12
lines changed

1 file changed

+31
-12
lines changed

CMakeLists.txt

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ if(WITH_LAS)
6262
list(APPEND RAYTOOLS_INCLUDE ${libLAS_INCLUDE_DIRS})
6363
list(APPEND RAYTOOLS_LINK ${libLAS_LIBRARIES})
6464
endif(WITH_LAS)
65+
6566
if(WITH_QHULL)
6667
# Find the qhull that provides a config with targets first
6768
find_package(Qhull CONFIG QUIET)
@@ -73,18 +74,36 @@ if(WITH_QHULL)
7374
list(APPEND RAYTOOLS_INCLUDE ${QHULL_INCLUDE_DIRS})
7475
list(APPEND RAYTOOLS_LINK ${QHULL_LIBRARIES})
7576
endif(WITH_QHULL)
76-
if(WITH_TIFF)
77-
find_package(GeoTIFF REQUIRED)
78-
find_package(PROJ REQUIRED COMPONENTS proj)
79-
list(APPEND RAYTOOLS_INCLUDE ${GEOTIFF_INCLUDE_DIR})
80-
list(APPEND RAYTOOLS_LINK ${GEOTIFF_LIBRARIES})
81-
find_package(TIFF REQUIRED)
82-
list(APPEND RAYTOOLS_INCLUDE ${TIFF_INCLUDE_DIRS})
83-
list(APPEND RAYTOOLS_LINK ${TIFF_LIBRARIES})
84-
find_package(PROJ REQUIRED CONFIG)
85-
list(APPEND RAYTOOLS_INCLUDE ${PROJ_INCLUDE_DIR})
86-
list(APPEND RAYTOOLS_LINK ${PROJ_LIBRARIES})
87-
endif(WITH_TIFF)
77+
78+
if (WITH_TIFF)
79+
# Find and configure GeoTIFF
80+
find_package(GeoTIFF REQUIRED)
81+
82+
if(GeoTIFF_FOUND)
83+
list(APPEND RAYTOOLS_INCLUDE ${GeoTIFF_INCLUDE_DIR})
84+
list(APPEND RAYTOOLS_LINK ${GeoTIFF_LIBRARIES})
85+
else()
86+
message(FATAL_ERROR "GeoTIFF library not found.")
87+
endif()
88+
89+
# Find and configure TIFF
90+
find_package(TIFF REQUIRED)
91+
if (TIFF_FOUND)
92+
list(APPEND RAYTOOLS_INCLUDE ${TIFF_INCLUDE_DIRS})
93+
list(APPEND RAYTOOLS_LINK ${TIFF_LIBRARIES})
94+
else()
95+
message(FATAL_ERROR "TIFF library not found.")
96+
endif()
97+
98+
# Find and configure PROJ
99+
find_package(PROJ REQUIRED)
100+
if (PROJ_FOUND)
101+
list(APPEND RAYTOOLS_INCLUDE ${PROJ_INCLUDE_DIRS})
102+
list(APPEND RAYTOOLS_LINK ${PROJ_LIBRARIES})
103+
else()
104+
message(FATAL_ERROR "PROJ library not found.")
105+
endif()
106+
endif (WITH_TIFF)
88107

89108
if(WITH_TBB)
90109
# Helper macro to Find TBB prefering TBBConfig, falling back to FindTBB. TBB_LIBRARIES will be defined in both cases.

0 commit comments

Comments
 (0)