@ -17,11 +17,12 @@ 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@" )
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 )
elseif ( PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION )
elseif ( PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION )
set ( PACKAGE_VERSION_COMPATIBLE FALSE )
elseif ( PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION )
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." )
@ -32,15 +33,16 @@ elseif(PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION)
if ( PACKAGE_FIND_VERSION_PRERELEASE STRGREATER "@protobuf_VERSION_PRERELEASE@" )
set ( PACKAGE_VERSION_COMPATIBLE FALSE )
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
macro ( _check_and_save_build_option OPTION VALUE )
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 )
endif ( )
set ( ${ PACKAGE_FIND_NAME } _ ${ OPTION } ${ VALUE } )
set ( ${ PACKAGE_FIND_NAME } _ ${ OPTION } ${ VALUE } PARENT_SCOPE )
endmacro ( )
_check_and_save_build_option ( WITH_ZLIB @protobuf_WITH_ZLIB@ )
_check_and_save_build_option ( MSVC_STATIC_RUNTIME @protobuf_MSVC_STATIC_RUNTIME@ )