FindBlocksRuntime.cmake 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #.rst:
  2. # FindBlocksRuntime
  3. # -----------------
  4. #
  5. # Find libBlocksRuntime library and headers.
  6. #
  7. # The module defines the following variables:
  8. #
  9. # ##
  10. #
  11. # BlocksRuntime_FOUND - true if libBlocksRuntime was found
  12. # BlocksRuntime_INCLUDE_DIR - include search path
  13. # BlocksRuntime_LIBRARIES - libraries to link
  14. if(BlocksRuntime_INCLUDE_DIR AND BlocksRuntime_LIBRARIES)
  15. set(BlocksRuntime_FOUND TRUE)
  16. else()
  17. find_path(BlocksRuntime_INCLUDE_DIR
  18. NAMES
  19. Blocks.h
  20. HINTS
  21. ${CMAKE_INSTALL_FULL_INCLUDEDIR})
  22. find_library(BlocksRuntime_LIBRARIES
  23. NAMES
  24. BlocksRuntime libBlocksRuntime
  25. HINTS
  26. ${CMAKE_INSTALL_FULL_LIBDIR})
  27. include(FindPackageHandleStandardArgs)
  28. find_package_handle_standard_args(BlocksRuntime
  29. REQUIRED_VARS
  30. BlocksRuntime_LIBRARIES
  31. BlocksRuntime_INCLUDE_DIR)
  32. mark_as_advanced(BlocksRuntime_LIBRARIES BlocksRuntime_INCLUDE_DIR)
  33. endif()
  34. if(BlocksRuntime_FOUND)
  35. if(NOT TARGET BlocksRuntime::BlocksRuntime)
  36. add_library(BlocksRuntime::BlocksRuntime UNKNOWN IMPORTED)
  37. set_target_properties(BlocksRuntime::BlocksRuntime
  38. PROPERTIES
  39. IMPORTED_LOCATION
  40. ${BlocksRuntime_LIBRARIES}
  41. INTERFACE_INCLUDE_DIRECTORIES
  42. ${BlocksRuntime_INCLUDE_DIR})
  43. endif()
  44. endif()