From 11faa4db672ed61d64fd8a6f1a59114f5b5f2406 Mon Sep 17 00:00:00 2001 From: Paul Ramsey Date: Wed, 18 May 2022 11:24:52 -0700 Subject: [PATCH] Handle case where user sets explicit absolute lib and include dirs, closes GH-608 --- tools/CMakeLists.txt | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index bc0e774b5f..a8c034fb27 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -17,8 +17,16 @@ function(configure_install_geos_config) string(REPLACE " " "\\ " prefix ${CMAKE_INSTALL_PREFIX}) set(exec_prefix "$\{prefix\}") - set(includedir "$\{prefix\}/${CMAKE_INSTALL_INCLUDEDIR}") - set(libdir "$\{exec_prefix\}/${CMAKE_INSTALL_LIBDIR}") + if(IS_ABSOLUTE "${CMAKE_INSTALL_INCLUDEDIR}") + set(includedir "${CMAKE_INSTALL_INCLUDEDIR}") + else() + set(includedir "$\{prefix\}/${CMAKE_INSTALL_INCLUDEDIR}") + endif() + if(IS_ABSOLUTE "${CMAKE_INSTALL_LIBDIR}") + set(libdir "${CMAKE_INSTALL_LIBDIR}") + else() + set(libdir "$\{exec_prefix\}/${CMAKE_INSTALL_LIBDIR}") + endif() set(VERSION_RELEASE ${GEOS_VERSION_MAJOR}) set(VERSION ${GEOS_VERSION}) @@ -42,8 +50,16 @@ endfunction() function(configure_install_geos_pc) string(REPLACE " " "\\ " prefix ${CMAKE_INSTALL_PREFIX}) set(exec_prefix "$\{prefix\}") - set(includedir "$\{prefix\}/${CMAKE_INSTALL_INCLUDEDIR}") - set(libdir "$\{exec_prefix\}/${CMAKE_INSTALL_LIBDIR}") + if(IS_ABSOLUTE "${CMAKE_INSTALL_INCLUDEDIR}") + set(includedir "${CMAKE_INSTALL_INCLUDEDIR}") + else() + set(includedir "$\{prefix\}/${CMAKE_INSTALL_INCLUDEDIR}") + endif() + if(IS_ABSOLUTE "${CMAKE_INSTALL_LIBDIR}") + set(libdir "${CMAKE_INSTALL_LIBDIR}") + else() + set(libdir "$\{exec_prefix\}/${CMAKE_INSTALL_LIBDIR}") + endif() set(VERSION ${GEOS_VERSION}) set(EXTRA_LIBS "-lstdc++") if(HAVE_LIBM)