BasicConfigVersion-AnyNewerVersion.cmake.in 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. # This is a basic file for the new style find_package() search mode,
  2. # i.e. Config-mode.
  3. # It is used by WriteBasicConfigVersionFile.cmake as input file for configure_file()
  4. # to create a version-file which can be installed along a config.cmake file.
  5. #
  6. # The created file sets PACKAGE_VERSION_EXACT if the current version string and
  7. # the requested version string are exactly the same and it sets
  8. # PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version.
  9. # The variable CVF_VERSION must be set before calling configure_file().
  10. set(PACKAGE_VERSION "@CVF_VERSION@")
  11. set(PACKAGE_VERSION_EXACT FALSE) # initialize to FALSE
  12. # check that the installed version has the same 32/64bit-ness as the one which is currently searching:
  13. if(NOT "${CMAKE_SIZEOF_VOID_P}" STREQUAL "@CMAKE_SIZEOF_VOID_P@")
  14. math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8")
  15. set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
  16. set(PACKAGE_VERSION_COMPATIBLE FALSE)
  17. else()
  18. if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" )
  19. set(PACKAGE_VERSION_COMPATIBLE FALSE)
  20. else()
  21. set(PACKAGE_VERSION_COMPATIBLE TRUE)
  22. if( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}")
  23. set(PACKAGE_VERSION_EXACT TRUE)
  24. endif()
  25. endif()
  26. endif()