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)