FindOProfile.cmake 909 B

1234567891011121314151617181920212223242526272829303132
  1. # - Try to find OProfile
  2. # Once done this will define
  3. # OPROFILE_FOUND - System has OProfile
  4. # OPROFILE_INCLUDE_DIRS - The OProfile include directories
  5. # OPROFILE_LIBRARIES - The libraries needed to use OProfile
  6. find_path(OPROFILE_INCLUDE_DIR opagent.h)
  7. find_library(OPROFILE_LIBRARY opagent
  8. PATH_SUFFIXES oprofile
  9. )
  10. set(OPROFILE_INCLUDE_DIRS ${OPROFILE_INCLUDE_DIR})
  11. set(OPROFILE_LIBRARIES ${OPROFILE_LIBRARY})
  12. include(FindPackageHandleStandardArgs)
  13. find_package_handle_standard_args(OProfile DEFAULT_MSG
  14. OPROFILE_LIBRARY OPROFILE_INCLUDE_DIR
  15. )
  16. if (OPROFILE_FOUND)
  17. if (NOT TARGET OProfile::OProfile)
  18. add_library(OProfile::OProfile UNKNOWN IMPORTED)
  19. set_target_properties(OProfile::OProfile PROPERTIES
  20. IMPORTED_LOCATION ${OPROFILE_LIBRARIES}
  21. INTERFACE_INCLUDE_DIRECTORIES ${OPROFILE_INCLUDE_DIRS}
  22. )
  23. endif()
  24. endif()
  25. mark_as_advanced(OPROFILE_INCLUDE_DIR OPROFILE_LIBRARY)