FindCpuid.cmake 931 B

12345678910111213141516171819202122232425262728293031323334
  1. # Find libcpuid
  2. #
  3. # Find the libcpuid includes and library
  4. #
  5. # if you nee to add a custom library search path, do it via via CMAKE_PREFIX_PATH
  6. #
  7. # This module defines
  8. # CPUID_INCLUDE_DIRS, where to find header, etc.
  9. # CPUID_LIBRARIES, the libraries needed to use cpuid.
  10. # CPUID_FOUND, If false, do not try to use cpuid.
  11. # only look in default directories
  12. find_path(
  13. CPUID_INCLUDE_DIR
  14. NAMES libcpuid/libcpuid.h
  15. DOC "libcpuid include dir"
  16. )
  17. find_library(
  18. CPUID_LIBRARY
  19. NAMES cpuid
  20. DOC "libcpuid library"
  21. )
  22. set(CPUID_INCLUDE_DIRS ${CPUID_INCLUDE_DIR})
  23. set(CPUID_LIBRARIES ${CPUID_LIBRARY})
  24. # handle the QUIETLY and REQUIRED arguments and set CPUID_FOUND to TRUE
  25. # if all listed variables are TRUE, hide their existence from configuration view
  26. include(FindPackageHandleStandardArgs)
  27. find_package_handle_standard_args(Cpuid DEFAULT_MSG CPUID_LIBRARY CPUID_INCLUDE_DIR)
  28. mark_as_advanced (CPUID_INCLUDE_DIR CPUID_LIBRARY)