You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ti...@apache.org on 2018/10/31 20:54:37 UTC

[mesos] 02/02: Added small style fix-ups for libevent unbundling on CMake builds.

This is an automated email from the ASF dual-hosted git repository.

tillt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit d455e2adf3f66267caf73a56ff0fad56bc009be1
Author: Till Toenshoff <to...@me.com>
AuthorDate: Wed Oct 31 12:45:52 2018 -0700

    Added small style fix-ups for libevent unbundling on CMake builds.
    
    Review: https://reviews.apache.org/r/69216/
---
 3rdparty/cmake/FindLIBEVENT.cmake |  9 +++++++--
 cmake/CompilationConfigure.cmake  | 12 +++++-------
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/3rdparty/cmake/FindLIBEVENT.cmake b/3rdparty/cmake/FindLIBEVENT.cmake
index 5741ef0..13169fa 100644
--- a/3rdparty/cmake/FindLIBEVENT.cmake
+++ b/3rdparty/cmake/FindLIBEVENT.cmake
@@ -18,14 +18,19 @@ include(FindPackageHelper)
 
 # TODO(tillt): Consider moving "_ROOT_DIR" logic into FindPackageHelper.
 if ("${LIBEVENT_ROOT_DIR}" STREQUAL "")
+  # NOTE: If this fails, stderr is ignored, and the output variable is empty.
+  # This has no deleterious effect on our path search.
   execute_process(
     COMMAND brew --prefix libevent
     OUTPUT_VARIABLE LIBEVENT_PREFIX
     OUTPUT_STRIP_TRAILING_WHITESPACE)
 
+  set(POSSIBLE_LIBEVENT_INCLUDE_DIRS "")
+  set(POSSIBLE_LIBEVENT_LIB_DIRS "")
+
   if (NOT "${LIBEVENT_PREFIX}" STREQUAL "")
-    set(POSSIBLE_LIBEVENT_INCLUDE_DIRS ${LIBEVENT_PREFIX}/include)
-    set(POSSIBLE_LIBEVENT_LIB_DIRS ${LIBEVENT_PREFIX}/lib)
+    list(APPEND POSSIBLE_LIBEVENT_INCLUDE_DIRS ${LIBEVENT_PREFIX}/include)
+    list(APPEND POSSIBLE_LIBEVENT_LIB_DIRS ${LIBEVENT_PREFIX}/lib)
   endif()
 
   list(
diff --git a/cmake/CompilationConfigure.cmake b/cmake/CompilationConfigure.cmake
index f6c6e62..2130c9b 100644
--- a/cmake/CompilationConfigure.cmake
+++ b/cmake/CompilationConfigure.cmake
@@ -96,13 +96,11 @@ if (ENABLE_LIBEVENT)
     "Build libprocess with an installed libevent version instead of the bundled."
     FALSE)
 
-  if (UNBUNDLED_LIBEVENT)
-    set(
-      LIBEVENT_ROOT_DIR
-      ""
-      CACHE STRING
-      "Specify the path to libevent, e.g. \"C:\\libevent-Win64\".")
-  endif()
+  set(
+    LIBEVENT_ROOT_DIR
+    ""
+    CACHE STRING
+    "Specify the path to libevent, e.g. \"C:\\libevent-Win64\".")
 endif()
 
 option(