@ -17,30 +17,32 @@ 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
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@" )
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
set ( PACKAGE_VERSION_COMPATIBLE FALSE )
if ( NOT PACKAGE_FIND_VERSION_MAJOR EQUAL "@protobuf_VERSION_MAJOR@" )
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 )
set ( PACKAGE_VERSION_COMPATIBLE FALSE )
endif ( )
elseif ( PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION )
# 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 )
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 ( )
endif ( )
endif ( )
# C h e c k a n d s a v e b u i l d o p t i o n s u s e d t o c r e a t e t h i s p a c k a g e
# C h e c k a n d s a v e b u i l d o p t i o n s u s e d t o c r e a t e t h i s p a c k a g e
macro ( _check_and_save_build_option OPTION VALUE )
macro ( _check_and_save_build_option OPTION VALUE )
if ( DEFINED ${ PACKAGE_FIND_NAME } _ ${ OPTION } AND
if ( DEFINED ${ PACKAGE_FIND_NAME } _ ${ OPTION } AND
N O T $ { P A C K A G E _ F I N D _ N A M E } _ $ { O P T I O N } E Q U A L V A L U E )
N O T $ { P A C K A G E _ F I N D _ N A M E } _ $ { O P T I O N } S T R E Q U A L $ { V A L U E } )
set ( PACKAGE_VERSION_UNSUITABLE TRUE )
set ( PACKAGE_VERSION_UNSUITABLE TRUE )
endif ( )
endif ( )
set ( ${ PACKAGE_FIND_NAME } _ ${ OPTION } ${ VALUE } )
set ( ${ PACKAGE_FIND_NAME } _ ${ OPTION } ${ VALUE } PARENT_SCOPE )
endmacro ( )
endmacro ( )
_check_and_save_build_option ( WITH_ZLIB @protobuf_WITH_ZLIB@ )
_check_and_save_build_option ( WITH_ZLIB @protobuf_WITH_ZLIB@ )
_check_and_save_build_option ( MSVC_STATIC_RUNTIME @protobuf_MSVC_STATIC_RUNTIME@ )
_check_and_save_build_option ( MSVC_STATIC_RUNTIME @protobuf_MSVC_STATIC_RUNTIME@ )