ZMQ.cmake 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #
  2. # ZMQ
  3. #
  4. superbuild_include_once()
  5. set(proj ZMQ)
  6. set(${proj}_enabling_variable ZMQ_LIBRARIES)
  7. set(${${proj}_enabling_variable}_LIBRARY_DIRS ZMQ_LIBRARY_DIRS)
  8. set(${${proj}_enabling_variable}_INCLUDE_DIRS ZMQ_INCLUDE_DIRS)
  9. set(${${proj}_enabling_variable}_FIND_PACKAGE_CMD ZMQ)
  10. set(${proj}_DEPENDENCIES "")
  11. superbuild_include_dependencies(PROJECT_VAR proj)
  12. if(${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj})
  13. message(FATAL_ERROR "Enabling ${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj} is not supported !")
  14. endif()
  15. # Sanity checks
  16. if(DEFINED ZMQ_DIR AND NOT EXISTS ${ZMQ_DIR})
  17. message(FATAL_ERROR "ZMQ_DIR variable is defined but corresponds to non-existing directory")
  18. endif()
  19. if(NOT DEFINED ZMQ_DIR)
  20. set(revision_tag d2c2f96b49ed3835a47e)
  21. if(${proj}_REVISION_TAG)
  22. set(revision_tag ${${proj}_REVISION_TAG})
  23. endif()
  24. set(location_args )
  25. if(${proj}_URL)
  26. set(location_args URL ${${proj}_URL})
  27. elseif(${proj}_GIT_REPOSITORY)
  28. set(location_args GIT_REPOSITORY ${${proj}_GIT_REPOSITORY}
  29. GIT_TAG ${revision_tag})
  30. else()
  31. set(location_args GIT_REPOSITORY "${git_protocol}://github.com/PatrickCheng/zeromq2.git"
  32. GIT_TAG ${revision_tag})
  33. endif()
  34. ExternalProject_Add(${proj}
  35. ${${proj}_EXTERNAL_PROJECT_ARGS}
  36. SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
  37. BINARY_DIR ${proj}-build
  38. PREFIX ${proj}${ep_suffix}
  39. ${location_args}
  40. UPDATE_COMMAND ""
  41. INSTALL_COMMAND ""
  42. CMAKE_GENERATOR ${gen}
  43. LIST_SEPARATOR ${sep}
  44. CMAKE_CACHE_ARGS
  45. ${ep_common_cache_args}
  46. -DBUILD_SHARED_LIBS:BOOL=ON
  47. -DZMQ_BUILD_DEVICES:BOOL=ON
  48. -DZMQ_BUILD_PERFORMANCE_TESTS:BOOL=ON
  49. DEPENDS
  50. ${${proj}_DEPENDENCIES}
  51. )
  52. set(ZMQ_DIR ${CMAKE_BINARY_DIR}/${proj}-build)
  53. else()
  54. superbuild_add_empty_external_project(${proj} "${${proj}_DEPENDENCIES}")
  55. endif()
  56. mark_as_superbuild(
  57. VARS ZMQ_DIR:PATH
  58. LABELS "FIND_PACKAGE"
  59. )