Skip to content
Permalink
Browse files

fix PROJ_HAS_VERSION and also display version in cmake output (#6878)

  • Loading branch information
3nids committed Apr 27, 2018
1 parent 3c1c7fb commit de8f264e97b9bd7e25f37102871e4262045d32c2
Showing with 9 additions and 2 deletions.
  1. +8 −1 cmake/FindProj.cmake
  2. +1 −1 src/app/qgisapp.cpp
@@ -57,7 +57,14 @@ IF (PROJ_FOUND)
check_library_exists("${PROJ_LIBRARY}" proj_info "" PROJ_HAS_INFO)

IF (NOT PROJ_FIND_QUIETLY)
MESSAGE(STATUS "Found Proj: ${PROJ_LIBRARY}")
IF (PROJ_HAS_INFO)
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 (PROJ_HAS_INFO)
MESSAGE(STATUS "Found Proj: ${PROJ_LIBRARY} ${PROJ_VERSION_STR}")
ENDIF (NOT PROJ_FIND_QUIETLY)

ELSE (PROJ_FOUND)
@@ -4130,7 +4130,7 @@ void QgisApp::about()

versionString += QLatin1String( "</tr><tr>" );

#if PJ_VERSION >= 500
#if PROJ_HAS_INFO
PJ_INFO info = proj_info();
versionString += "<td>" + tr( "Compiled against PROJ" ) + "</td><td>" + QString::number( PJ_VERSION ) + "</td>";
versionString += "<td>" + tr( "Running against PROJ" ) + "</td><td>" + info.version + "</td>";

0 comments on commit de8f264

Please sign in to comment.
You can’t perform that action at this time.