Skip to content

Commit

Permalink
[cmake/FindGEOS] Add FindPackageHandleStandardArgs fallback if GEOS n…
Browse files Browse the repository at this point in the history
…ot found (#1977)

This should make the module slightly more user-friendly by correctly
handling explicit specification of GEOS_INCLUDE_DIR and GEOS_LIBRARY.
  • Loading branch information
mloskot authored and hobu committed Apr 26, 2018
1 parent d73eaf3 commit d42253c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cmake/modules/FindGEOS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,19 @@ IF (GEOS_INCLUDE_DIR AND GEOS_LIBRARY)
SET(GEOS_FOUND TRUE)
ENDIF (GEOS_INCLUDE_DIR AND GEOS_LIBRARY)

if (NOT GEOS_INCLUDE_DIR OR NOT GEOS_LIBRARY)
include(SelectLibraryConfigurations)
select_library_configurations(GEOS)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GEOS REQUIRED_VARS GEOS_LIBRARY GEOS_INCLUDE_DIR)
if(GEOS_FOUND)
set(GEOS_INCLUDE_DIRS ${GEOS_INCLUDE_DIR})
if(NOT GEOS_LIBRARIES)
set(GEOS_LIBRARIES ${GEOS_LIBRARY})
endif()
endif()
endif()

IF (GEOS_FOUND)

IF (NOT GEOS_FIND_QUIETLY)
Expand Down

0 comments on commit d42253c

Please sign in to comment.