@ -17,20 +17,22 @@ endif()
set ( PACKAGE_VERSION_COMPATIBLE TRUE ) # A s s u m e t r u e u n t i l s h o w n o t h e r w i s e
if ( NOT PACKAGE_FIND_VERSION_MAJOR EQUAL "@protobuf_VERSION_MAJOR@" )
set ( PACKAGE_VERSION_COMPATIBLE FALSE )
elseif ( PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION )
set ( PACKAGE_VERSION_COMPATIBLE FALSE )
elseif ( PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION )
# D o n o t m a t c h p r e r e l e a s e v e r s i o n s t o n o n - p r e r e l e a s e v e r s i o n r e q u e s t s .
if ( NOT "@protobuf_VERSION_PRERELEASE@" STREQUAL "" AND PACKAGE_FIND_VERSION_PRERELEASE STREQUAL "" )
message ( AUTHOR_WARNING "To use this prerelease version of ${PACKAGE_FIND_NAME}, set ${PACKAGE_FIND_NAME}_FIND_VERSION_PRERELEASE to '@protobuf_VERSION_PRERELEASE@' or greater." )
if ( PACKAGE_FIND_VERSION ) # O n l y p e r f o r m v e r s i o n c h e c k s i f o n e i s g i v e n
if ( NOT PACKAGE_FIND_VERSION_MAJOR EQUAL "@protobuf_VERSION_MAJOR@" )
set ( PACKAGE_VERSION_COMPATIBLE FALSE )
endif ( )
# N o t r o b u s t l y S e m V e r c o m p l i a n t , b u t p r o t o b u f n e v e r u s e s ' . ' s e p a r a t e d p r e r e l e a s e i d e n t i f i e r s .
if ( PACKAGE_FIND_VERSION_PRERELEASE STRGREATER "@protobuf_VERSION_PRERELEASE@" )
elseif ( PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION )
set ( PACKAGE_VERSION_COMPATIBLE FALSE )
elseif ( PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION )
# D o n o t m a t c h p r e r e l e a s e v e r s i o n s t o n o n - p r e r e l e a s e v e r s i o n r e q u e s t s .
if ( NOT "@protobuf_VERSION_PRERELEASE@" STREQUAL "" AND PACKAGE_FIND_VERSION_PRERELEASE STREQUAL "" )
message ( AUTHOR_WARNING "To use this prerelease version of ${PACKAGE_FIND_NAME}, set ${PACKAGE_FIND_NAME}_FIND_VERSION_PRERELEASE to '@protobuf_VERSION_PRERELEASE@' or greater." )
set ( PACKAGE_VERSION_COMPATIBLE FALSE )
endif ( )
# N o t r o b u s t l y S e m V e r c o m p l i a n t , b u t p r o t o b u f n e v e r u s e s ' . ' s e p a r a t e d p r e r e l e a s e i d e n t i f i e r s .
if ( PACKAGE_FIND_VERSION_PRERELEASE STRGREATER "@protobuf_VERSION_PRERELEASE@" )
set ( PACKAGE_VERSION_COMPATIBLE FALSE )
endif ( )
endif ( )
endif ( )