[mesos] 02/02: Added ability to specify a root dir for boost and curl with cmake.

2020-05-11 Thread grag
This is an automated email from the ASF dual-hosted git repository.

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

commit 07cd355f90892a897e0b210a8cd0eda6103ae6c9
Author: Andriy Kornatskyy 
AuthorDate: Fri May 8 14:11:10 2020 -0700

Added ability to specify a root dir for boost and curl with cmake.

This closes #361
---
 3rdparty/CMakeLists.txt  | 61 +---
 cmake/CompilationConfigure.cmake | 14 +
 2 files changed, 53 insertions(+), 22 deletions(-)

diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
index 119813e..7b84f12 100644
--- a/3rdparty/CMakeLists.txt
+++ b/3rdparty/CMakeLists.txt
@@ -194,29 +194,34 @@ endfunction()
 # Boost: C++ Libraries.
 # http://www.boost.org
 ###
-EXTERNAL(boost ${BOOST_VERSION} ${CMAKE_CURRENT_BINARY_DIR})
-add_library(boost INTERFACE)
-add_dependencies(boost ${BOOST_TARGET})
-if (CMAKE_CXX_COMPILER_ID MATCHES GNU OR CMAKE_CXX_COMPILER_ID MATCHES Clang)
-  # Headers including Boost 1.65.0 fail to compile with GCC 7.2 and
-  # CLang 3.6 without `-Wno-unused-local-typedefs`.
-  # TODO(andschwa): Remove this when Boost has a resolution.
-  target_compile_options(boost INTERFACE -Wno-unused-local-typedefs)
-endif ()
-target_include_directories(boost INTERFACE ${BOOST_ROOT})
+if ("${BOOST_ROOT_DIR}" STREQUAL "")
+  EXTERNAL(boost ${BOOST_VERSION} ${CMAKE_CURRENT_BINARY_DIR})
+  add_library(boost INTERFACE)
+  add_dependencies(boost ${BOOST_TARGET})
+  if (CMAKE_CXX_COMPILER_ID MATCHES GNU OR CMAKE_CXX_COMPILER_ID MATCHES Clang)
+# Headers including Boost 1.65.0 fail to compile with GCC 7.2 and
+# CLang 3.6 without `-Wno-unused-local-typedefs`.
+# TODO(andschwa): Remove this when Boost has a resolution.
+target_compile_options(boost INTERFACE -Wno-unused-local-typedefs)
+  endif ()
+  target_include_directories(boost INTERFACE ${BOOST_ROOT})
 
-# Patch Boost to avoid repeated "Unknown compiler warnings" on Windows.
-PATCH_CMD(BOOST_PATCH_CMD boost-${BOOST_VERSION}.patch)
+  # Patch Boost to avoid repeated "Unknown compiler warnings" on Windows.
+  PATCH_CMD(BOOST_PATCH_CMD boost-${BOOST_VERSION}.patch)
 
-ExternalProject_Add(
-  ${BOOST_TARGET}
-  PREFIX${BOOST_CMAKE_ROOT}
-  PATCH_COMMAND ${BOOST_PATCH_CMD}
-  CONFIGURE_COMMAND ${CMAKE_NOOP}
-  BUILD_COMMAND ${CMAKE_NOOP}
-  INSTALL_COMMAND   ${CMAKE_NOOP}
-  URL   ${BOOST_URL}
-  URL_HASH  ${BOOST_HASH})
+  ExternalProject_Add(
+${BOOST_TARGET}
+PREFIX${BOOST_CMAKE_ROOT}
+PATCH_COMMAND ${BOOST_PATCH_CMD}
+CONFIGURE_COMMAND ${CMAKE_NOOP}
+BUILD_COMMAND ${CMAKE_NOOP}
+INSTALL_COMMAND   ${CMAKE_NOOP}
+URL   ${BOOST_URL}
+URL_HASH  ${BOOST_HASH})
+else ()
+  add_library(boost INTERFACE)
+  target_include_directories(boost INTERFACE ${BOOST_ROOT_DIR}/include)
+endif ()
 
 
 # moodycamel::ConcurrentQueue: An industrial-strength lock-free queue.
@@ -861,7 +866,19 @@ if (WIN32)
 COMMAND ${CMAKE_COMMAND} -E copy $ 
${CMAKE_BINARY_DIR}/src/curl.exe
 DEPENDEES build)
 else ()
-  find_package(CURL REQUIRED)
+  if ("${CURL_ROOT_DIR}" STREQUAL "")
+find_package(CURL REQUIRED)
+  else ()
+set(POSSIBLE_CURL_INCLUDE_DIRS ${CURL_ROOT_DIR}/include)
+set(POSSIBLE_CURL_LIB_DIRS ${CURL_ROOT_DIR}/lib)
+
+set(CURL_LIBRARY_NAMES curl)
+
+FIND_PACKAGE_HELPER(CURL curl/curl.h)
+SET(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR})
+SET(CURL_LIBRARIES ${CURL_LIBS})
+  endif ()
+
   add_library(libcurl SHARED IMPORTED)
 
   set_target_properties(
diff --git a/cmake/CompilationConfigure.cmake b/cmake/CompilationConfigure.cmake
index f9511fc..af1a8b5 100644
--- a/cmake/CompilationConfigure.cmake
+++ b/cmake/CompilationConfigure.cmake
@@ -103,6 +103,20 @@ if (ENABLE_LIBEVENT)
 "Specify the path to libevent, e.g. \"C:\\libevent-Win64\".")
 endif()
 
+set(
+  BOOST_ROOT_DIR
+  ""
+  CACHE STRING
+  "Specify the path to boost.")
+
+if (NOT WIN32)
+  set(
+CURL_ROOT_DIR
+""
+CACHE STRING
+"Specify the path to libcurl.")
+endif()
+
 option(
   UNBUNDLED_LEVELDB
   "Build with an installed leveldb version instead of the bundled."



[mesos] 01/02: Fixed the java bindings in the cmake build.

2020-05-11 Thread grag
This is an automated email from the ASF dual-hosted git repository.

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

commit 630dbf7486bfe315472fbcd8d0087f75cd9f3786
Author: Andriy Kornatskyy 
AuthorDate: Fri May 8 14:10:39 2020 -0700

Fixed the java bindings in the cmake build.

This closes #360
---
 src/CMakeLists.txt  | 3 +--
 src/java/CMakeLists.txt | 3 ++-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 96cd867..810acbf 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -627,8 +627,7 @@ target_link_libraries(
   sasl2
   zookeeper
   mesos-protobufs
-  $<$,$>:nvml>
-  $<$:mesos-java>)
+  $<$,$>:nvml>)
 
 if (NOT WIN32)
   target_link_libraries(mesos PUBLIC leveldb)
diff --git a/src/java/CMakeLists.txt b/src/java/CMakeLists.txt
index 29422e9..81eb9b5 100644
--- a/src/java/CMakeLists.txt
+++ b/src/java/CMakeLists.txt
@@ -116,7 +116,8 @@ add_custom_command(
 add_library(mesos-java ${JAVA_SRC} ${JAVA_H})
 
 target_link_libraries(
-  mesos-java
+  mesos-java PUBLIC
+  mesos
   mesos-protobufs
   process
   zookeeper



[mesos] branch master updated (48922e0 -> 07cd355)

2020-05-11 Thread grag
This is an automated email from the ASF dual-hosted git repository.

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


from 48922e0  Updated CHANGELOG for 1.10.0.
 new 630dbf7  Fixed the java bindings in the cmake build.
 new 07cd355  Added ability to specify a root dir for boost and curl with 
cmake.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 3rdparty/CMakeLists.txt  | 61 +---
 cmake/CompilationConfigure.cmake | 14 +
 src/CMakeLists.txt   |  3 +-
 src/java/CMakeLists.txt  |  3 +-
 4 files changed, 56 insertions(+), 25 deletions(-)