Commit f39f7560 authored by Wez Furlong's avatar Wez Furlong Committed by Facebook Github Bot

oss: FindLibEvent.cmake: workaround cmake POLICY annoyances

Summary:
When pulled in as an external project into an environment
that has changed the default cmake policy, the trick we're using
to extract the full library path errors out.  This works around
that issue by saving the policy settings and then setting them
how we need them before restoring them after we're done.

refs https://github.com/facebook/folly/issues/1100

Reviewed By: yfeldblum

Differential Revision: D14766991

fbshipit-source-id: e2506bc0aebd9e66bc70b12c4c538c9e034f9f73
parent a484a114
......@@ -36,7 +36,13 @@ if (TARGET event)
# this results in linker errors.
# To resolve this, we ask cmake to lookup the full path to the library
# and use that instead.
cmake_policy(PUSH)
if(POLICY CMP0026)
# Allow reading the LOCATION property
cmake_policy(SET CMP0026 OLD)
endif()
get_target_property(LIBEVENT_LIB event LOCATION)
cmake_policy(POP)
set(LibEvent_FOUND ${Libevent_FOUND})
if (NOT LibEvent_FIND_QUIETLY)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment