WSL/SLF GitLab Repository

Commit 742b0864 authored by Nander Wever's avatar Nander Wever
Browse files

Updating FindPROJ.cmake to stick to the old PROJ4 interface for as long as it...

Updating FindPROJ.cmake to stick to the old PROJ4 interface for as long as it is available, and switch to PROJ otherwise (version 8.0.0 or higher of libproj). This because we use a function that was only introduced in version 8.0.0.
parent 0242f158
Pipeline #919 passed with stages
in 5 minutes and 51 seconds
......@@ -47,13 +47,7 @@ IF (PROJ_INCLUDE_DIR AND PROJ_LIBRARY)
ENDIF (PROJ_INCLUDE_DIR AND PROJ_LIBRARY)
IF (PROJ_FOUND)
IF (EXISTS ${PROJ_INCLUDE_DIR}/proj.h AND EXISTS ${PROJ_INCLUDE_DIR}/proj_experimental.h)
FILE(READ ${PROJ_INCLUDE_DIR}/proj.h proj_version)
STRING(REGEX REPLACE "^.*PROJ_VERSION_MAJOR +([0-9]+).*$" "\\1" PROJ_VERSION_MAJOR "${proj_version}")
STRING(REGEX REPLACE "^.*PROJ_VERSION_MINOR +([0-9]+).*$" "\\1" PROJ_VERSION_MINOR "${proj_version}")
STRING(REGEX REPLACE "^.*PROJ_VERSION_PATCH +([0-9]+).*$" "\\1" PROJ_VERSION_PATCH "${proj_version}")
STRING(CONCAT PROJ_VERSION_STR "(" ${PROJ_VERSION_MAJOR} "." ${PROJ_VERSION_MINOR} "." ${PROJ_VERSION_PATCH} ")")
ELSE (EXISTS ${PROJ_INCLUDE_DIR}/proj.h AND EXISTS ${PROJ_INCLUDE_DIR}/proj_experimental.h)
IF (EXISTS ${PROJ_INCLUDE_DIR}/proj_api.h)
FILE(READ ${PROJ_INCLUDE_DIR}/proj_api.h proj_version)
STRING(REGEX REPLACE "^.*PJ_VERSION ([0-9]+).*$" "\\1" PJ_VERSION "${proj_version}")
......@@ -64,7 +58,13 @@ IF (PROJ_FOUND)
STRING(CONCAT PROJ_VERSION_STR "(" ${PROJ_VERSION_MAJOR} "." ${PROJ_VERSION_MINOR} "." ${PROJ_VERSION_PATCH} ")")
SET(PROJ4 ON CACHE BOOL "Use the old PROJ API" FORCE)
ENDIF (EXISTS ${PROJ_INCLUDE_DIR}/proj.h AND EXISTS ${PROJ_INCLUDE_DIR}/proj_experimental.h)
ELSE (EXISTS ${PROJ_INCLUDE_DIR}/proj.h)
FILE(READ ${PROJ_INCLUDE_DIR}/proj.h proj_version)
STRING(REGEX REPLACE "^.*PROJ_VERSION_MAJOR +([0-9]+).*$" "\\1" PROJ_VERSION_MAJOR "${proj_version}")
STRING(REGEX REPLACE "^.*PROJ_VERSION_MINOR +([0-9]+).*$" "\\1" PROJ_VERSION_MINOR "${proj_version}")
STRING(REGEX REPLACE "^.*PROJ_VERSION_PATCH +([0-9]+).*$" "\\1" PROJ_VERSION_PATCH "${proj_version}")
STRING(CONCAT PROJ_VERSION_STR "(" ${PROJ_VERSION_MAJOR} "." ${PROJ_VERSION_MINOR} "." ${PROJ_VERSION_PATCH} ")")
ENDIF (EXISTS ${PROJ_INCLUDE_DIR}/proj_api.h)
INCLUDE_DIRECTORIES(BEFORE SYSTEM ${PROJ_INCLUDE_DIR})
MARK_AS_ADVANCED(PROJ_INCLUDE_DIR PROJ_LIBRARY PROJ4)
......
Supports Markdown
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