|
|
@ -27,16 +27,26 @@ else() |
|
|
|
endif() |
|
|
|
endif() |
|
|
|
endif() |
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
|
|
# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: |
|
|
|
# Check and save build options used to create this package |
|
|
|
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "") |
|
|
|
macro(_check_and_save_build_option OPTION VALUE) |
|
|
|
return() |
|
|
|
if(DEFINED ${PACKAGE_FIND_NAME}_${OPTION} AND |
|
|
|
endif() |
|
|
|
NOT ${PACKAGE_FIND_NAME}_${OPTION} EQUAL VALUE) |
|
|
|
|
|
|
|
set(PACKAGE_VERSION_UNSUITABLE TRUE) |
|
|
|
|
|
|
|
endif() |
|
|
|
|
|
|
|
set(${PACKAGE_FIND_NAME}_${OPTION} ${VALUE}) |
|
|
|
|
|
|
|
endmacro() |
|
|
|
|
|
|
|
_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(BUILD_SHARED_LIBS @protobuf_BUILD_SHARED_LIBS@) |
|
|
|
|
|
|
|
|
|
|
|
# check that the installed version has the same 32/64bit-ness as the one which is currently searching: |
|
|
|
# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: |
|
|
|
if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "@CMAKE_SIZEOF_VOID_P@") |
|
|
|
if(NOT "${CMAKE_SIZEOF_VOID_P}" STREQUAL "" AND NOT "@CMAKE_SIZEOF_VOID_P@" STREQUAL "") |
|
|
|
math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8") |
|
|
|
# check that the installed version has the same 32/64bit-ness as the one which is currently searching: |
|
|
|
set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") |
|
|
|
if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "@CMAKE_SIZEOF_VOID_P@") |
|
|
|
set(PACKAGE_VERSION_UNSUITABLE TRUE) |
|
|
|
math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8") |
|
|
|
|
|
|
|
set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") |
|
|
|
|
|
|
|
set(PACKAGE_VERSION_UNSUITABLE TRUE) |
|
|
|
|
|
|
|
endif() |
|
|
|
endif() |
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
|
|
set(${PACKAGE_FIND_NAME}_VERSION_PRERELEASE "@protobuf_VERSION_PRERELEASE@" PARENT_SCOPE) |
|
|
|
set(${PACKAGE_FIND_NAME}_VERSION_PRERELEASE "@protobuf_VERSION_PRERELEASE@" PARENT_SCOPE) |
|
|
|