Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix PROJ_HAS_VERSION and also display version in cmake output (#6878)
  • Loading branch information
3nids committed Apr 27, 2018
1 parent 3c1c7fb commit de8f264
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion cmake/FindProj.cmake
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgisapp.cpp
Expand Up @@ -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>";
Expand Down

0 comments on commit de8f264

Please sign in to comment.