jpayne@68: # This is a basic version file for the Config-mode of find_package(). jpayne@68: # It is used by write_basic_package_version_file() as input file for configure_file() jpayne@68: # to create a version-file which can be installed along a config.cmake file. jpayne@68: # jpayne@68: # The created file sets PACKAGE_VERSION_EXACT if the current version string and jpayne@68: # the requested version string are exactly the same and it sets jpayne@68: # PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version, jpayne@68: # but only if the requested major version is the same as the current one. jpayne@68: # The variable CVF_VERSION must be set before calling configure_file(). jpayne@68: jpayne@68: jpayne@68: set(PACKAGE_VERSION "1.10.0") jpayne@68: jpayne@68: if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) jpayne@68: set(PACKAGE_VERSION_COMPATIBLE FALSE) jpayne@68: else() jpayne@68: jpayne@68: if("1.10.0" MATCHES "^([0-9]+)\\.") jpayne@68: set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}") jpayne@68: else() jpayne@68: set(CVF_VERSION_MAJOR "1.10.0") jpayne@68: endif() jpayne@68: jpayne@68: if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR) jpayne@68: set(PACKAGE_VERSION_COMPATIBLE TRUE) jpayne@68: else() jpayne@68: set(PACKAGE_VERSION_COMPATIBLE FALSE) jpayne@68: endif() jpayne@68: jpayne@68: if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) jpayne@68: set(PACKAGE_VERSION_EXACT TRUE) jpayne@68: endif() jpayne@68: endif() jpayne@68: jpayne@68: jpayne@68: # if the installed project requested no architecture check, don't perform the check jpayne@68: if("FALSE") jpayne@68: return() jpayne@68: endif() jpayne@68: jpayne@68: # if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: jpayne@68: if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "") jpayne@68: return() jpayne@68: endif() jpayne@68: jpayne@68: # check that the installed version has the same 32/64bit-ness as the one which is currently searching: jpayne@68: if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8") jpayne@68: math(EXPR installedBits "8 * 8") jpayne@68: set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") jpayne@68: set(PACKAGE_VERSION_UNSUITABLE TRUE) jpayne@68: endif()