Files
pytorch/cmake/Modules/FindZMQ.cmake
Sam Estep 8c798e0622 Forbid trailing whitespace (#53406)
Summary:
Context: https://github.com/pytorch/pytorch/pull/53299#discussion_r587882857

These are the only hand-written parts of this diff:
- the addition to `.github/workflows/lint.yml`
- the file endings changed in these four files (to appease FB-internal land-blocking lints):
  - `GLOSSARY.md`
  - `aten/src/ATen/core/op_registration/README.md`
  - `scripts/README.md`
  - `torch/csrc/jit/codegen/fuser/README.md`

The rest was generated by running this command (on macOS):
```
git grep -I -l ' $' -- . ':(exclude)**/contrib/**' ':(exclude)third_party' | xargs gsed -i 's/ *$//'
```

I looked over the auto-generated changes and didn't see anything that looked problematic.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/53406

Test Plan:
This run (after adding the lint but before removing existing trailing spaces) failed:
- https://github.com/pytorch/pytorch/runs/2043032377

This run (on the tip of this PR) succeeded:
- https://github.com/pytorch/pytorch/runs/2043296348

Reviewed By: walterddr, seemethere

Differential Revision: D26856620

Pulled By: samestep

fbshipit-source-id: 3f0de7f7c2e4b0f1c089eac9b5085a58dd7e0d97
2021-03-05 17:22:55 -08:00

33 lines
1.1 KiB
CMake

# Find the ZMQ libraries
#
# The following variables are optionally searched for defaults
# ZMQ_ROOT_DIR: Base directory where all ZMQ components are found
#
# The following are set after configuration is done:
# ZMQ_FOUND
# ZMQ_INCLUDE_DIR
# ZMQ_LIBRARIES
# ZMQ_VERSION_MAJOR
find_path(ZMQ_INCLUDE_DIR NAMES zmq.h
PATHS ${ZMQ_ROOT_DIR} ${ZMQ_ROOT_DIR}/include)
find_library(ZMQ_LIBRARIES NAMES zmq
PATHS ${ZMQ_ROOT_DIR} ${ZMQ_ROOT_DIR}/lib)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ZMQ DEFAULT_MSG ZMQ_INCLUDE_DIR ZMQ_LIBRARIES)
if(ZMQ_FOUND)
message(STATUS "Found ZMQ (include: ${ZMQ_INCLUDE_DIR}, library: ${ZMQ_LIBRARIES})")
mark_as_advanced(ZMQ_INCLUDE_DIR ZMQ_LIBRARIES)
caffe_parse_header(${ZMQ_INCLUDE_DIR}/zmq.h ZMQ_VERSION_LINES ZMQ_VERSION_MAJOR)
if(${ZMQ_VERSION_MAJOR} VERSION_LESS "3")
message(WARNING "Caffe2 requires zmq version 3 or above, but found " ${ZMQ_VERSION_MAJOR} ". Disabling zmq for now.")
set(ZMQ_FOUND)
else()
endif()
endif()