BasicConfigVersion-AnyNewerVersion.cmake.in 1.2 KB

1234567891011121314151617181920212223242526272829
  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. # check that the installed version has the same 32/64bit-ness as the one which is currently searching:
  12. if(NOT "${CMAKE_SIZEOF_VOID_P}" STREQUAL "@CMAKE_SIZEOF_VOID_P@")
  13. math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8")
  14. set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
  15. set(PACKAGE_VERSION_COMPATIBLE FALSE)
  16. else()
  17. if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" )
  18. set(PACKAGE_VERSION_COMPATIBLE FALSE)
  19. else()
  20. set(PACKAGE_VERSION_COMPATIBLE TRUE)
  21. if( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}")
  22. set(PACKAGE_VERSION_EXACT TRUE)
  23. endif()
  24. endif()
  25. endif()