AllFindModules test: once again expand version checking

This commit is contained in:
Rolf Eike Beer 2012-02-24 20:35:42 +01:00
parent 2437b40933
commit 9271d2f697
1 changed files with 24 additions and 18 deletions

View File

@ -45,25 +45,31 @@ if (NOT QT4_FOUND)
endforeach(FIND_MODULE) endforeach(FIND_MODULE)
endif (NOT QT4_FOUND) endif (NOT QT4_FOUND)
# If any of these modules reported that it was found a version number should have been macro(check_version_string MODULE_NAME VERSION_VAR)
# reported. if (${MODULE_NAME}_FOUND)
set(VERSIONS_REQUIRED if (DEFINED ${VERSION_VAR})
ALSA BISON BZIP2 CUPS CURL DOXYGEN EXPAT FLEX FREETYPE GETTEXT GIF GIT if (NOT ${VERSION_VAR} MATCHES "^[0-9][0-9\\.]*[-A-Za-z_\\+]*[0-9\\.]*$")
ImageMagick JASPER LibArchive LIBXML2 LIBXSLT PERL PKG_CONFIG PostgreSQL message(SEND_ERROR "${VERSION_VAR} has unexpected content ${${VERSION_VAR}}")
SWIG TIFF ZLIB)
foreach(VTEST ${VERSIONS_REQUIRED})
if (${VTEST}_FOUND)
if (DEFINED ${VTEST}_VERSION_STRING)
if (NOT ${VTEST}_VERSION_STRING MATCHES "^[0-9][0-9\\.]*[A-Za-z_]*[0-9\\.]*$")
message(SEND_ERROR "${VTEST}_VERSION_STRING has unexpected content ${${VTEST}_VERSION_STRING}")
endif()
elseif (DEFINED ${VTEST}_VERSION)
if (NOT ${VTEST}_VERSION MATCHES "^[0-9][0-9\\.]*[A-Za-z_]*[0-9\\.]*$")
message(SEND_ERROR "${VTEST}_VERSION has unexpected content ${${VTEST}_VERSION}")
endif() endif()
else() else()
message(SEND_ERROR "${VTEST}_FOUND is set but no version number is defined") message(SEND_ERROR "${MODULE_NAME}_FOUND is set but no version number is defined")
endif() endif()
endif(${VTEST}_FOUND) endif ()
endmacro(check_version_string)
# If any of these modules reported that it was found a version number should have been
# reported.
foreach(VTEST ALSA ARMADILLO BZIP2 CUPS CURL EXPAT FREETYPE GETTEXT GIT HSPELL
JASPER LIBXML2 LIBXSLT PERL PostgreSQL TCLSH TIFF ZLIB)
check_version_string(${VTEST} ${VTEST}_VERSION_STRING)
endforeach(VTEST) endforeach(VTEST)
foreach(VTEST BISON Boost CUDA DOXYGEN FLEX GIF GTK2 LibArchive OPENSCENEGRAPH
RUBY SWIG)
check_version_string(${VTEST} ${VTEST}_VERSION)
endforeach(VTEST)
check_version_string(PYTHONINTERP PYTHON_VERSION_STRING)
check_version_string(SUBVERSION Subversion_VERSION_SVN)
check_version_string(PKGCONFIG PKG_CONFIG_VERSION_STRING)