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