You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2017/09/03 12:51:23 UTC
[01/42] mesos git commit: CMake: Bumped minimum required CMake
version to 3.7.0.
Repository: mesos
Updated Branches:
refs/heads/master 899950df2 -> 7f1598bc1
CMake: Bumped minimum required CMake version to 3.7.0.
This is required for the `SOURCE_SUBDIR` functionality of
`ExternalProject_Add`, which is required to avoid a work-around where we
re-implement logic the module can do automatically.
This will also allow us to print timestamps in a cross-platform
manner and append to strings in an obvious manner; among other things.
Review: https://reviews.apache.org/r/61313/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/85bc5819
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/85bc5819
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/85bc5819
Branch: refs/heads/master
Commit: 85bc58196fc2bcb94e8e3193dacf5cc8a2af4301
Parents: 899950d
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Thu Aug 17 15:38:19 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:04 2017 -0700
----------------------------------------------------------------------
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/85bc5819/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 870bd9b..c1126a7 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,7 +17,7 @@
# THE MESOS PROJECT.
####################
if (NOT WIN32)
- cmake_minimum_required(VERSION 2.8.10)
+ cmake_minimum_required(VERSION 3.7.0)
else ()
cmake_minimum_required(VERSION 3.8.0)
endif ()
[30/42] mesos git commit: CMake: Removed `Mesos3rdpartyConfigure`
from `MesosConfigure`.
Posted by jo...@apache.org.
CMake: Removed `Mesos3rdpartyConfigure` from `MesosConfigure`.
The 3rdparty CMake code configures itself now.
Review: https://reviews.apache.org/r/61513/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/529b83b1
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/529b83b1
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/529b83b1
Branch: refs/heads/master
Commit: 529b83b17fbacd7da0ab3d2dadef0d78f1764736
Parents: b4933f1
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Sat Sep 2 20:34:30 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:08 2017 -0700
----------------------------------------------------------------------
CMakeLists.txt | 2 --
cmake/MesosConfigure.cmake | 6 ------
2 files changed, 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/529b83b1/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8e18c2c..a9d2f03 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -38,8 +38,6 @@ set(MESOS_PACKAGE_SOVERSION 0)
# Paths that are searched when `include(...)` is called.
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/3rdparty/cmake)
-list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/3rdparty/libprocess/cmake)
-list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/3rdparty/stout/cmake)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/src/cmake)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/src/examples/cmake)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/src/master/cmake)
http://git-wip-us.apache.org/repos/asf/mesos/blob/529b83b1/cmake/MesosConfigure.cmake
----------------------------------------------------------------------
diff --git a/cmake/MesosConfigure.cmake b/cmake/MesosConfigure.cmake
index 4857a76..93a85e5 100755
--- a/cmake/MesosConfigure.cmake
+++ b/cmake/MesosConfigure.cmake
@@ -50,12 +50,6 @@ enable_testing()
#####################
include(CompilationConfigure)
-# THIRD-PARTY CONFIGURATION.
-############################
-# NOTE: The third-party configuration variables exported here are used
-# throughout the project, so it's important that this config script goes here.
-include(Mesos3rdpartyConfigure)
-
if (BUILD_SHARED_LIBS)
set(MESOS_DEFAULT_LIBRARY_LINKAGE "SHARED")
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
[42/42] mesos git commit: CMake: Used `list(APPEND x ...)` where
appropriate.
Posted by jo...@apache.org.
CMake: Used `list(APPEND x ...)` where appropriate.
Now that the minimum version of CMake has been bumped above 3.0,
we can use `list(APPEND x ...)` instead of `set(x ${x} ...)`.
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/7f1598bc
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/7f1598bc
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/7f1598bc
Branch: refs/heads/master
Commit: 7f1598bc1030e965e4e7bbf4a897ea9aff50a977
Parents: 2572edd
Author: Joseph Wu <jo...@apache.org>
Authored: Sun Sep 3 00:58:38 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:10 2017 -0700
----------------------------------------------------------------------
src/CMakeLists.txt | 19 ++++++-------------
src/tests/CMakeLists.txt | 36 ++++++++++++------------------------
2 files changed, 18 insertions(+), 37 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/7f1598bc/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 590e981..0562b2b 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -244,7 +244,6 @@ configure_file(
# SOURCE FILES FOR THE MESOS LIBRARY.
#####################################
set(AGENT_SRC
- ${AGENT_SRC}
slave/constants.cpp
slave/container_logger.cpp
slave/flags.cpp
@@ -291,8 +290,7 @@ set(AGENT_SRC
slave/resource_estimators/noop.cpp)
if (NOT WIN32)
- set(AGENT_SRC
- ${AGENT_SRC}
+ list(APPEND AGENT_SRC
slave/containerizer/mesos/isolators/environment_secret.cpp
slave/containerizer/mesos/isolators/docker/volume/driver.cpp
slave/containerizer/mesos/isolators/docker/volume/paths.cpp
@@ -312,16 +310,14 @@ set(AUTHENTICATION_SRC
authentication/http/combined_authenticator.cpp)
if (NOT WIN32)
- set(AUTHENTICATION_SRC
- ${AUTHENTICATION_SRC}
+ list(APPEND AUTHENTICATION_SRC
authentication/cram_md5/authenticatee.cpp
authentication/cram_md5/authenticator.cpp
authentication/cram_md5/auxprop.cpp)
endif ()
if (ENABLE_SSL)
- set(AUTHENTICATION_SRC
- ${AUTHENTICATION_SRC}
+ list(APPEND AUTHENTICATION_SRC
authentication/executor/jwt_secret_generator.cpp)
endif ()
@@ -488,8 +484,7 @@ set(STATE_SRC
state/in_memory.cpp)
if (NOT WIN32)
- set(STATE_SRC
- ${STATE_SRC}
+ list(APPEND STATE_SRC
state/leveldb.cpp
state/log.cpp
state/zookeeper.cpp)
@@ -502,8 +497,7 @@ set(URI_SRC
uri/fetchers/curl.cpp)
if (NOT WIN32)
- set(URI_SRC
- ${URI_SRC}
+ list(APPEND URI_SRC
uri/fetchers/docker.cpp
uri/fetchers/hadoop.cpp)
endif ()
@@ -564,8 +558,7 @@ set(MESOS_SRC
${ZOOKEEPER_SRC})
if (NOT WIN32)
- set(MESOS_SRC
- ${MESOS_SRC}
+ list(APPEND MESOS_SRC
${HDFS_SRC}
${LOG_SRC}
${POSIX_SRC})
http://git-wip-us.apache.org/repos/asf/mesos/blob/7f1598bc/src/tests/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
index c7f234b..def233d 100644
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -25,15 +25,13 @@ set(TEST_HELPER_SRC
utils.cpp)
if (NOT WIN32)
- set(TEST_HELPER_SRC
- ${TEST_HELPER_SRC}
+ list(APPEND TEST_HELPER_SRC
kill_policy_test_helper.cpp
containerizer/memory_test_helper.cpp)
endif ()
if (LINUX)
- set(TEST_HELPER_SRC
- ${TEST_HELPER_SRC}
+ list(APPEND TEST_HELPER_SRC
containerizer/capabilities_test_helper.cpp
containerizer/setns_test_helper.cpp)
endif ()
@@ -60,16 +58,14 @@ set(MESOS_TESTS_UTILS_SRC
containerizer/launcher.cpp)
if (NOT WIN32)
- set(MESOS_TESTS_UTILS_SRC
- ${MESOS_TESTS_UTILS_SRC}
+ list(APPEND MESOS_TESTS_UTILS_SRC
kill_policy_test_helper.cpp
script.cpp
containerizer/memory_test_helper.cpp)
endif ()
if (LINUX)
- set(MESOS_TESTS_UTILS_SRC
- ${MESOS_TESTS_UTILS_SRC}
+ list(APPEND MESOS_TESTS_UTILS_SRC
containerizer/capabilities_test_helper.cpp
containerizer/setns_test_helper.cpp)
endif ()
@@ -124,8 +120,7 @@ set(MESOS_TESTS_SRC
zookeeper_url_tests.cpp)
if (HAS_JAVA)
- set(MESOS_TESTS_SRC
- ${MESOS_TESTS_SRC}
+ list(APPEND MESOS_TESTS_SRC
group_tests.cpp
registrar_zookeeper_tests.cpp
zookeeper.cpp
@@ -134,25 +129,21 @@ if (HAS_JAVA)
endif ()
if (ENABLE_SSL)
- set(MESOS_TESTS_SRC
- ${MESOS_TESTS_SRC}
+ list(APPEND MESOS_TESTS_SRC
secret_generator_tests.cpp)
endif ()
-set(MESOS_TESTS_SRC
- ${MESOS_TESTS_SRC}
+list(APPEND MESOS_TESTS_SRC
common/http_tests.cpp
common/recordio_tests.cpp
common/type_utils_tests.cpp)
-set(MESOS_TESTS_SRC
- ${MESOS_TESTS_SRC}
+list(APPEND MESOS_TESTS_SRC
containerizer/containerizer_tests.cpp
containerizer/docker_tests.cpp)
if (NOT WIN32)
- set(MESOS_TESTS_SRC
- ${MESOS_TESTS_SRC}
+ list(APPEND MESOS_TESTS_SRC
authorization_tests.cpp
container_logger_tests.cpp
cram_md5_authentication_tests.cpp
@@ -185,12 +176,10 @@ if (NOT WIN32)
teardown_tests.cpp
upgrade_tests.cpp)
- set(MESOS_TESTS_SRC
- ${MESOS_TESTS_SRC}
+ list(APPEND MESOS_TESTS_SRC
common/command_utils_tests.cpp)
- set(MESOS_TESTS_SRC
- ${MESOS_TESTS_SRC}
+ list(APPEND MESOS_TESTS_SRC
containerizer/appc_spec_tests.cpp
containerizer/composing_containerizer_tests.cpp
containerizer/cpu_isolator_tests.cpp
@@ -212,8 +201,7 @@ if (NOT WIN32)
endif ()
if (LINUX)
- set(MESOS_TESTS_SRC
- ${MESOS_TESTS_SRC}
+ list(APPEND MESOS_TESTS_SRC
ldcache_tests.cpp
ldd_tests.cpp
containerizer/capabilities_tests.cpp
[31/42] mesos git commit: CMake: Added `GET_BYPRODUCTS()` function to
fix Ninja generator.
Posted by jo...@apache.org.
CMake: Added `GET_BYPRODUCTS()` function to fix Ninja generator.
CMake also supports Ninja as a generator, but Ninja requires that each
use of `ExternalProject_Add` specifies its `BUILD_BYPRODUCTS`.
Interestingly, it doesn't care about interface libraries, and
furthermore, it can't derive the dependency from other
information (despite it being available).
Review: https://reviews.apache.org/r/61365
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/01bacdb4
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/01bacdb4
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/01bacdb4
Branch: refs/heads/master
Commit: 01bacdb44ba11afa7f2ec7c0067b3c617aa8b6cc
Parents: 7034aed
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Fri Jul 21 14:27:45 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:08 2017 -0700
----------------------------------------------------------------------
3rdparty/CMakeLists.txt | 41 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/01bacdb4/3rdparty/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
index 09f4061..afd31d1 100755
--- a/3rdparty/CMakeLists.txt
+++ b/3rdparty/CMakeLists.txt
@@ -128,6 +128,23 @@ function(MAKE_INCLUDE_DIR TARGET)
file(MAKE_DIRECTORY ${DIR})
endfunction()
+# This function works around a CMake issue with the Ninja generator where it
+# does not understand imported libraries, and instead needs `BUILD_BYPRODUCTS`
+# explicitly set.
+# https://cmake.org/pipermail/cmake/2015-April/060234.html
+function(GET_BYPRODUCTS TARGET)
+ if (WIN32)
+ get_target_property(DEBUG ${TARGET} IMPORTED_LOCATION_DEBUG)
+ get_target_property(RELEASE ${TARGET} IMPORTED_LOCATION_RELEASE)
+ set(BYPRODUCTS ${DEBUG} ${RELEASE})
+ else ()
+ get_target_property(BYPRODUCTS ${TARGET} IMPORTED_LOCATION)
+ endif ()
+
+ string(TOUPPER ${TARGET} NAME)
+ set(${NAME}_BYPRODUCTS ${BYPRODUCTS} PARENT_SCOPE)
+endfunction()
+
# Third-party libraries. Adds CMake imported or interface targets for each
# dependency. Bundled dependencies are built with `ExternalProject_Add`,
@@ -236,10 +253,12 @@ else ()
endif ()
MAKE_INCLUDE_DIR(glog)
+GET_BYPRODUCTS(glog)
ExternalProject_Add(
${GLOG_TARGET}
PREFIX ${GLOG_CMAKE_ROOT}
+ BUILD_BYPRODUCTS ${GLOG_BYPRODUCTS}
PATCH_COMMAND ${GLOG_PATCH_CMD}
CMAKE_ARGS ${CMAKE_FORWARD_ARGS};-DBUILD_TESTING=OFF
CONFIGURE_COMMAND ${GLOG_CONFIG_CMD}
@@ -325,10 +344,12 @@ set(HTTP_PARSER_PATCH_CMD
${HTTP_PARSER_ROOT}/CMakeLists.txt)
MAKE_INCLUDE_DIR(http_parser)
+GET_BYPRODUCTS(http_parser)
ExternalProject_Add(
${HTTP_PARSER_TARGET}
PREFIX ${HTTP_PARSER_CMAKE_ROOT}
+ BUILD_BYPRODUCTS ${HTTP_PARSER_BYPRODUCTS}
PATCH_COMMAND ${HTTP_PARSER_PATCH_CMD}
CMAKE_ARGS ${CMAKE_FORWARD_ARGS}
INSTALL_COMMAND ${CMAKE_NOOP}
@@ -375,10 +396,12 @@ if (ENABLE_LIBEVENT)
endif ()
MAKE_INCLUDE_DIR(libevent)
+ GET_BYPRODUCTS(libevent)
ExternalProject_Add(
${LIBEVENT_TARGET}
PREFIX ${LIBEVENT_CMAKE_ROOT}
+ BUILD_BYPRODUCTS ${LIBEVENT_BYPRODUCTS}
CMAKE_ARGS ${LIBEVENT_CMAKE_ARGS}
INSTALL_COMMAND ${CMAKE_NOOP}
URL ${LIBEVENT_URL}
@@ -400,10 +423,12 @@ else ()
patch_cmd(${CMAKE_CURRENT_SOURCE_DIR}/libev-4.22.patch LIBEV_PATCH_CMD)
MAKE_INCLUDE_DIR(libev)
+ GET_BYPRODUCTS(libev)
ExternalProject_Add(
${LIBEV_TARGET}
PREFIX ${LIBEV_CMAKE_ROOT}
+ BUILD_BYPRODUCTS ${LIBEV_BYPRODUCTS}
PATCH_COMMAND ${LIBEV_PATCH_CMD}
CONFIGURE_COMMAND ${LIBEV_ROOT}/configure --prefix=${LIBEV_ROOT}-build
BUILD_COMMAND make
@@ -429,10 +454,12 @@ if (WIN32)
INTERFACE_INCLUDE_DIRECTORIES "${LIBAPR_ROOT}/include;${LIBAPR_ROOT}-build")
MAKE_INCLUDE_DIR(apr)
+ GET_BYPRODUCTS(apr)
ExternalProject_Add(
${LIBAPR_TARGET}
PREFIX ${LIBAPR_CMAKE_ROOT}
+ BUILD_BYPRODUCTS ${APR_BYPRODUCTS}
CMAKE_ARGS ${CMAKE_FORWARD_ARGS}
INSTALL_COMMAND ${CMAKE_NOOP}
URL ${LIBAPR_URL}
@@ -492,10 +519,12 @@ if (WIN32)
endif ()
MAKE_INCLUDE_DIR(curl)
+ GET_BYPRODUCTS(curl)
ExternalProject_Add(
${CURL_TARGET}
PREFIX ${CURL_CMAKE_ROOT}
+ BUILD_BYPRODUCTS ${CURL_BYPRODUCTS}
PATCH_COMMAND ${CMAKE_NOOP}
CMAKE_ARGS ${CURL_CMAKE_ARGS}
INSTALL_COMMAND ${CMAKE_NOOP}
@@ -535,10 +564,12 @@ if (WIN32)
INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_ROOT};${ZLIB_ROOT}-build")
MAKE_INCLUDE_DIR(zlib)
+ GET_BYPRODUCTS(zlib)
ExternalProject_Add(
${ZLIB_TARGET}
PREFIX ${ZLIB_CMAKE_ROOT}
+ BUILD_BYPRODUCTS ${ZLIB_BYPRODUCTS}
CMAKE_ARGS ${CMAKE_FORWARD_ARGS}
INSTALL_COMMAND ${CMAKE_NOOP}
URL ${ZLIB_URL}
@@ -599,10 +630,13 @@ endif ()
MAKE_INCLUDE_DIR(gmock)
MAKE_INCLUDE_DIR(gtest)
+GET_BYPRODUCTS(gmock)
+GET_BYPRODUCTS(gtest)
ExternalProject_Add(
${GOOGLETEST_TARGET}
PREFIX ${GOOGLETEST_CMAKE_ROOT}
+ BUILD_BYPRODUCTS ${GMOCK_BYPRODUCTS};${GTEST_BYPRODUCTS}
# NOTE: googletest cannot be built as a shared library, or the test runner
# will crash with a double-free.
CMAKE_ARGS ${CMAKE_FORWARD_ARGS};-DBUILD_SHARED_LIBS=OFF
@@ -653,10 +687,12 @@ else ()
endif ()
MAKE_INCLUDE_DIR(protobuf)
+GET_BYPRODUCTS(protobuf)
ExternalProject_Add(
${PROTOBUF_TARGET}
PREFIX ${PROTOBUF_CMAKE_ROOT}
+ BUILD_BYPRODUCTS ${PROTOBUF_BYPRODUCTS}
SOURCE_SUBDIR cmake
CMAKE_ARGS ${CMAKE_FORWARD_ARGS};-Dprotobuf_BUILD_TESTS=OFF
INSTALL_COMMAND ${CMAKE_NOOP}
@@ -709,10 +745,13 @@ else ()
endif ()
MAKE_INCLUDE_DIR(zookeeper)
+GET_BYPRODUCTS(zookeeper)
+GET_BYPRODUCTS(zk-hashtable)
ExternalProject_Add(
${ZOOKEEPER_TARGET}
PREFIX ${ZOOKEEPER_CMAKE_ROOT}
+ BUILD_BYPRODUCTS ${ZOOKEEPER_BYPRODUCTS};${ZK-HASHTABLE_BYPRODUCTS}
PATCH_COMMAND ${ZOOKEEPER_PATCH_CMD}
SOURCE_SUBDIR src/c
CMAKE_ARGS ${CMAKE_FORWARD_ARGS};-DWANT_CPPUNIT=OFF
@@ -738,10 +777,12 @@ if (NOT WIN32)
patch_cmd(${CMAKE_CURRENT_SOURCE_DIR}/leveldb-${LEVELDB_VERSION}.patch LEVELDB_PATCH_CMD)
MAKE_INCLUDE_DIR(leveldb)
+ GET_BYPRODUCTS(leveldb)
ExternalProject_Add(
${LEVELDB_TARGET}
PREFIX ${LEVELDB_CMAKE_ROOT}
+ BUILD_BYPRODUCTS ${LEVELDB_BYPRODUCTS}
PATCH_COMMAND ${LEVELDB_PATCH_CMD}
CONFIGURE_COMMAND ${CMAKE_NOOP}
BUILD_IN_SOURCE 1
[21/42] mesos git commit: CMake: Cleaned up mesos target linking
rules.
Posted by jo...@apache.org.
CMake: Cleaned up mesos target linking rules.
Now that all the dependencies in 3rdparty are properly hooked up via
CMake targets, we can cleanup upstream targets that depend on them.
Review: https://reviews.apache.org/r/61297/
Review: https://reviews.apache.org/r/61298/
Review: https://reviews.apache.org/r/61299/
Review: https://reviews.apache.org/r/61310/
Review: https://reviews.apache.org/r/61326/
Review: https://reviews.apache.org/r/61341/
Review: https://reviews.apache.org/r/61342/
Review: https://reviews.apache.org/r/61349/
Review: https://reviews.apache.org/r/61356/
Review: https://reviews.apache.org/r/61359/
Review: https://reviews.apache.org/r/61364/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/9cdee131
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/9cdee131
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/9cdee131
Branch: refs/heads/master
Commit: 9cdee131272b5cccc6c953c24537ade4c482e42f
Parents: 57cac23
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Sat Sep 2 15:28:49 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:07 2017 -0700
----------------------------------------------------------------------
3rdparty/cmake/Mesos3rdpartyConfigure.cmake | 14 ------------
cmake/CompilationConfigure.cmake | 9 +-------
cmake/MesosConfigure.cmake | 1 -
src/CMakeLists.txt | 14 ++++--------
src/master/cmake/MasterConfigure.cmake | 27 ++++++------------------
src/slave/cmake/AgentConfigure.cmake | 27 ++++++------------------
src/tests/CMakeLists.txt | 1 -
src/tests/cmake/MesosTestsConfigure.cmake | 10 ++-------
8 files changed, 19 insertions(+), 84 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/9cdee131/3rdparty/cmake/Mesos3rdpartyConfigure.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/cmake/Mesos3rdpartyConfigure.cmake b/3rdparty/cmake/Mesos3rdpartyConfigure.cmake
index 9a3a477..8cec807 100755
--- a/3rdparty/cmake/Mesos3rdpartyConfigure.cmake
+++ b/3rdparty/cmake/Mesos3rdpartyConfigure.cmake
@@ -19,20 +19,6 @@
set(MESOS_3RDPARTY_SRC ${CMAKE_SOURCE_DIR}/3rdparty)
set(MESOS_3RDPARTY_BIN ${CMAKE_BINARY_DIR}/3rdparty)
-if (NOT WIN32)
- # LevelDB does not build on Windows.
- EXTERNAL("leveldb" ${LEVELDB_VERSION} "${MESOS_3RDPARTY_BIN}")
-endif ()
-
-# Convenience variables for include directories of third-party dependencies.
-set(LEVELDB_INCLUDE_DIR ${LEVELDB_ROOT}/include)
-
-# Convenience variables for "lflags", the symbols we pass to CMake to generate
-# things like `-L/path/to/glog` or `-lglog`.
-if (NOT WIN32)
- set(LEVELDB_LFLAG ${LEVELDB_ROOT}/out-static/libleveldb.a)
-endif ()
-
# Configure Windows use of the GNU patch utility;
# we attempt to find it in its default location,
# but this path may be customized.
http://git-wip-us.apache.org/repos/asf/mesos/blob/9cdee131/cmake/CompilationConfigure.cmake
----------------------------------------------------------------------
diff --git a/cmake/CompilationConfigure.cmake b/cmake/CompilationConfigure.cmake
index 2109697..5d54921 100644
--- a/cmake/CompilationConfigure.cmake
+++ b/cmake/CompilationConfigure.cmake
@@ -272,7 +272,7 @@ if (WIN32)
# to give the build system fine-grained control over what code is #ifdef'd
# out in the future. Using only flags defined by our build system to control
# this logic is the clearest and most stable way of accomplishing this.
- list(APPEND MESOS_CPPFLAGS -D__WINDOWS__ -DHAVE_LIBZ)
+ list(APPEND MESOS_CPPFLAGS -D__WINDOWS__)
# Defines to disable warnings generated by Visual Studio when using
# deprecated functions in CRT and the use of insecure functions in CRT.
@@ -317,13 +317,6 @@ if (HAS_AUTHENTICATION)
list(APPEND MESOS_CPPFLAGS -DHAS_AUTHENTICATION=1)
endif ()
-# Enable the INT64 support for PicoJSON.
-# NOTE: PicoJson requires __STDC_FORMAT_MACROS to be defined before importing
-# 'inttypes.h'. Since other libraries may also import this header, it must
-# be globally defined so that PicoJson has access to the macros, regardless
-# of the order of inclusion.
-list(APPEND MESOS_CPPFLAGS -DPICOJSON_USE_INT64 -D__STDC_FORMAT_MACROS)
-
list(APPEND MESOS_CPPFLAGS
-DPKGLIBEXECDIR="${PKG_LIBEXEC_INSTALL_DIR}"
-DLIBDIR="${LIB_INSTALL_DIR}"
http://git-wip-us.apache.org/repos/asf/mesos/blob/9cdee131/cmake/MesosConfigure.cmake
----------------------------------------------------------------------
diff --git a/cmake/MesosConfigure.cmake b/cmake/MesosConfigure.cmake
index 5ecad2c..48cc965 100755
--- a/cmake/MesosConfigure.cmake
+++ b/cmake/MesosConfigure.cmake
@@ -55,7 +55,6 @@ include(CompilationConfigure)
# NOTE: The third-party configuration variables exported here are used
# throughout the project, so it's important that this config script goes here.
include(Mesos3rdpartyConfigure)
-include(Process3rdpartyConfigure)
if (BUILD_SHARED_LIBS)
set(MESOS_DEFAULT_LIBRARY_LINKAGE "SHARED")
http://git-wip-us.apache.org/repos/asf/mesos/blob/9cdee131/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 0bb23d7..2c5fbf6 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -112,12 +112,6 @@ set(INTERNAL_PROTOBUF_SRC
# BUILD PROTOBUFS.
##################
-include_directories(
- ${MESOS_PROTOBUF_HEADER_INCLUDE_DIRS}
- ${PROTOBUF_INCLUDE_DIR})
-
-link_directories(${PROTOBUF_LIB_DIR})
-
add_library(
${MESOS_PROTOBUF_TARGET}
${MESOS_DEFAULT_LIBRARY_LINKAGE}
@@ -125,9 +119,10 @@ add_library(
${INTERNAL_PROTOBUF_SRC}
)
-add_dependencies(${MESOS_PROTOBUF_TARGET} ${PROTOBUF_TARGET})
-
-target_link_libraries(${MESOS_PROTOBUF_TARGET} ${PROTOBUF_LFLAG})
+target_link_libraries(${MESOS_PROTOBUF_TARGET} PUBLIC protobuf)
+target_include_directories(
+ ${MESOS_PROTOBUF_TARGET} PUBLIC
+ ${MESOS_PROTOBUF_HEADER_INCLUDE_DIRS})
if (WIN32)
# Disable all compiler warnings on Protocol Buffers source.
@@ -588,7 +583,6 @@ endif ()
add_dependencies(${MESOS_TARGET} ${MESOS_LIBS_TARGET})
add_dependencies(
${MESOS_LIBS_TARGET}
- ${MESOS_PROTOBUF_TARGET}
${AGENT_DEPENDENCIES}
)
http://git-wip-us.apache.org/repos/asf/mesos/blob/9cdee131/src/master/cmake/MasterConfigure.cmake
----------------------------------------------------------------------
diff --git a/src/master/cmake/MasterConfigure.cmake b/src/master/cmake/MasterConfigure.cmake
index 96f0d5b..a5fbc45 100644
--- a/src/master/cmake/MasterConfigure.cmake
+++ b/src/master/cmake/MasterConfigure.cmake
@@ -14,15 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+# TODO(andschwa): Import this properly.
+set(SASL_LFLAG sasl2)
+
# Define process library dependencies. Tells the process library build targets
# download/configure/build all third-party libraries before attempting to build.
################################################################################
set(MASTER_DEPENDENCIES
${MASTER_DEPENDENCIES}
- ${PROCESS_DEPENDENCIES}
- ${PROCESS_TARGET}
- ${ZOOKEEPER_TARGET}
- ${LEVELDB_TARGET}
make_bin_include_dir
make_bin_src_dir
)
@@ -42,11 +41,6 @@ set(MASTER_INCLUDE_DIRS
set(MASTER_3RDPARTY_INCLUDE_DIRS
${MASTER_3RDPARTY_INCLUDE_DIRS}
- ${PROCESS_INCLUDE_DIRS}
- ${PROCESS_3RDPARTY_INCLUDE_DIRS}
- ${ZOOKEEPER_INCLUDE_DIR}
- ${ZOOKEEPER_INCLUDE_GENDIR}
- ${LEVELDB_INCLUDE_DIR}
)
# Define third-party lib install directories. Used to tell the compiler
@@ -55,8 +49,6 @@ set(MASTER_3RDPARTY_INCLUDE_DIRS
########################################################################
set(MASTER_LIB_DIRS
${MASTER_LIB_DIRS}
- ${PROCESS_LIB_DIRS}
- ${ZOOKEEPER_LIB_DIR}
)
# Define third-party libs. Used to generate flags that the linker uses to
@@ -64,21 +56,14 @@ set(MASTER_LIB_DIRS
#########################################################################
set(MASTER_LIBS
${MASTER_LIBS}
- ${PROCESS_LIBS}
- ${ZOOKEEPER_LFLAG}
- ${PROCESS_TARGET}
+ process
+ zookeeper
)
if (NOT WIN32)
set(MASTER_LIBS
${MASTER_LIBS}
- ${LEVELDB_LFLAG}
+ leveldb
${SASL_LFLAG}
)
endif ()
-
-if (NOT ENABLE_LIBEVENT)
- set(MASTER_LIBS ${MASTER_LIBS} ${LIBEV_LFLAG})
-else ()
- set(MASTER_LIBS ${MASTER_LIBS} ${LIBEVENT_LFLAG})
-endif ()
http://git-wip-us.apache.org/repos/asf/mesos/blob/9cdee131/src/slave/cmake/AgentConfigure.cmake
----------------------------------------------------------------------
diff --git a/src/slave/cmake/AgentConfigure.cmake b/src/slave/cmake/AgentConfigure.cmake
index 0d70f91..4a06a4b 100644
--- a/src/slave/cmake/AgentConfigure.cmake
+++ b/src/slave/cmake/AgentConfigure.cmake
@@ -14,6 +14,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+# TODO(andschwa): Import this properly.
+set(SASL_LFLAG sasl2)
+
set(LOGROTATE_CONTAINER_LOGGER_TARGET logrotate_container_logger
CACHE STRING "Library containing the logrotate container logger."
)
@@ -35,10 +38,6 @@ set(RESOURCE_ESTIMATOR_TARGET fixed_resource_estimator
################################################################################
set(AGENT_DEPENDENCIES
${AGENT_DEPENDENCIES}
- ${PROCESS_DEPENDENCIES}
- ${PROCESS_TARGET}
- ${ZOOKEEPER_TARGET}
- ${LEVELDB_TARGET}
make_bin_include_dir
make_bin_src_dir
)
@@ -58,11 +57,6 @@ set(AGENT_INCLUDE_DIRS
set(AGENT_3RDPARTY_INCLUDE_DIRS
${AGENT_3RDPARTY_INCLUDE_DIRS}
- ${PROCESS_INCLUDE_DIRS}
- ${PROCESS_3RDPARTY_INCLUDE_DIRS}
- ${ZOOKEEPER_INCLUDE_DIR}
- ${ZOOKEEPER_INCLUDE_GENDIR}
- ${LEVELDB_INCLUDE_DIR}
)
# Define third-party lib install directories. Used to tell the compiler
@@ -71,8 +65,6 @@ set(AGENT_3RDPARTY_INCLUDE_DIRS
########################################################################
set(AGENT_LIB_DIRS
${AGENT_LIB_DIRS}
- ${PROCESS_LIB_DIRS}
- ${ZOOKEEPER_LIB_DIR}
)
# Define third-party libs. Used to generate flags that the linker uses to
@@ -80,21 +72,14 @@ set(AGENT_LIB_DIRS
#########################################################################
set(AGENT_LIBS
${AGENT_LIBS}
- ${PROCESS_LIBS}
- ${ZOOKEEPER_LFLAG}
- ${PROCESS_TARGET}
+ process
+ zookeeper
)
if (NOT WIN32)
set(AGENT_LIBS
${AGENT_LIBS}
- ${LEVELDB_LFLAG}
+ leveldb
${SASL_LFLAG}
)
endif ()
-
-if (NOT ENABLE_LIBEVENT)
- set(AGENT_LIBS ${AGENT_LIBS} ${LIBEV_LFLAG})
-else ()
- set(AGENT_LIBS ${AGENT_LIBS} ${LIBEVENT_LFLAG})
-endif ()
http://git-wip-us.apache.org/repos/asf/mesos/blob/9cdee131/src/tests/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
index 57bbe31..ac8db9c 100644
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -14,7 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-include(StoutTestsConfigure)
include(MesosTestsConfigure)
# Sources for a test helper binary.
http://git-wip-us.apache.org/repos/asf/mesos/blob/9cdee131/src/tests/cmake/MesosTestsConfigure.cmake
----------------------------------------------------------------------
diff --git a/src/tests/cmake/MesosTestsConfigure.cmake b/src/tests/cmake/MesosTestsConfigure.cmake
index 48b4d2f..8cf2d7f 100644
--- a/src/tests/cmake/MesosTestsConfigure.cmake
+++ b/src/tests/cmake/MesosTestsConfigure.cmake
@@ -52,7 +52,6 @@ add_definitions(-DSBINDIR="${S_BIN_DIR}")
set(MESOS_TESTS_DEPENDENCIES
${MESOS_TESTS_DEPENDENCIES}
${MESOS_TARGET}
- ${GOOGLETEST_TARGET}
)
# DEFINE THIRD-PARTY INCLUDE DIRECTORIES. Tells compiler toolchain where to get
@@ -66,8 +65,6 @@ set(MESOS_TESTS_INCLUDE_DIRS
set(MESOS_3RDPARTY_TESTS_INCLUDE_DIRS
${MESOS_3RDPARTY_TESTS_INCLUDE_DIRS}
${AGENT_3RDPARTY_INCLUDE_DIRS}
- ${GMOCK_INCLUDE_DIR}
- ${GTEST_INCLUDE_DIR}
)
# DEFINE THIRD-PARTY LIB INSTALL DIRECTORIES. Used to tell the compiler
@@ -76,8 +73,6 @@ set(MESOS_3RDPARTY_TESTS_INCLUDE_DIRS
########################################################################
set(MESOS_TESTS_LIB_DIRS
${MESOS_TESTS_LIB_DIRS}
- ${GMOCK_LIB_DIR}
- ${GTEST_LIB_DIR}
)
# DEFINE THIRD-PARTY LIBS. Used to generate flags that the linker uses to
@@ -86,10 +81,9 @@ set(MESOS_TESTS_LIB_DIRS
set(MESOS_TESTS_LIBS
${MESOS_TESTS_LIBS}
${MESOS_LIBS_TARGET}
- ${PROCESS_TARGET}
${MESOS_LIBS}
- ${GMOCK_LFLAG}
- ${GTEST_LFLAG}
+ process
+ googletest
)
if (NOT WIN32)
[10/42] mesos git commit: CMake: Changed 3rdparty libraries into
imports.
Posted by jo...@apache.org.
CMake: Changed 3rdparty libraries into imports.
Imported libraries are basically targets built outside of the current
CMake project. This includes targets that are built via
`ExternalProject_Add`, which, as the name suggests, is external
to the current project.
This patch changes the following libraries into imported libraries:
* glog
* curl
* protobuf (and protoc)
* zlib
* http-parser
* leveldb
* apr
* svn
* gtest
* libev/libevent
Review: https://reviews.apache.org/r/61291/
Review: https://reviews.apache.org/r/61303/
Review: https://reviews.apache.org/r/61294/
Review: https://reviews.apache.org/r/61312/
Review: https://reviews.apache.org/r/61300/
Review: https://reviews.apache.org/r/61327/
Review: https://reviews.apache.org/r/61334/
Review: https://reviews.apache.org/r/61340/
Review: https://reviews.apache.org/r/61337/
Review: https://reviews.apache.org/r/61344/
Review: https://reviews.apache.org/r/61346/
Review: https://reviews.apache.org/r/61357/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/ad186806
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/ad186806
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/ad186806
Branch: refs/heads/master
Commit: ad186806895e36846e405a2bfd110a88c5b0256a
Parents: 26b2c28
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Wed Aug 16 07:16:33 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:06 2017 -0700
----------------------------------------------------------------------
3rdparty/CMakeLists.txt | 535 ++++++++++++++++++++++++++++++-------------
1 file changed, 379 insertions(+), 156 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/ad186806/3rdparty/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
index 551cdd3..0362be7 100755
--- a/3rdparty/CMakeLists.txt
+++ b/3rdparty/CMakeLists.txt
@@ -100,84 +100,6 @@ foreach (lang C CXX)
endforeach ()
endforeach ()
-# Define build/patch/configure commands for third-party libs.
-#############################################################
-# NOTE: (fix for MESOS-3250) A few third-party libraries (libev, gmock) do not
-# have `make install` commands available, so below we have to add our own
-# "install" commands.
-#
-# The reason is: if we do not, we get runtime library load problems on OS X. In
-# particular, `dydl` will look for these libraries at the prefix we passed to
-# `configure` (or in `/usr/local` if we did not pass a prefix in), but since
-# they don't have a `make install` step, they never get placed in the prefix
-# folder.
-#
-# Our solution is to:
-# (1) make a lib directory inside the Mesos folder for each of the libraries
-# that has no install step, and
-# (2) copy all such libraries into their respective directories.
-#
-# (Note that step (1) is not only convenient, but important: make will add a
-# `lib` to the end of your prefix path when linking, and since the built
-# libraries end up in a `.libs` folder, it's not enough to simply pass the
-# build directory into `configure` as a prefix; so if we're going to move the
-# libraries, we might as well move them to a library folder.)
-if (NOT WIN32)
- set(GLOG_CONFIG_CMD ${GLOG_ROOT}/src/../configure --prefix=${GLOG_LIB_ROOT})
- set(GLOG_BUILD_CMD make libglog.la)
- set(GLOG_INSTALL_CMD make install)
- # Patch glog to deal with a problem that appears when compiling on clang
- # under the C++11 standard. cf. MESOS-860, MESOS-966.
- PATCH_CMD(${MESOS_3RDPARTY_SRC}/glog-${GLOG_VERSION}.patch GLOG_PATCH_CMD)
-
- # NOTE: `libev` is "installed" into a lib directory, see "NOTE: (fix for
- # MESOS-3250)" comment above for explanation.
- set(LIBEV_CONFIG_CMD ${LIBEV_ROOT}/configure --prefix=${LIBEV_ROOT}-lib)
- set(LIBEV_BUILD_CMD make)
- set(LIBEV_INSTALL_CMD mkdir -p ${LIBEV_LIB_ROOT} && cp -r ${LIBEV_ROOT}-build/.libs/. ${LIBEV_LIB_ROOT})
- # Patch libev to keep it from reaping child processes.
- PATCH_CMD(${MESOS_3RDPARTY_SRC}/libev-4.22.patch LIBEV_PATCH_CMD)
-
- set(LIBEVENT_INSTALL_CMD mkdir -p ${LIBEVENT_LIB_ROOT} && cp -r ${LIBEVENT_ROOT}-build/lib/. ${LIBEVENT_LIB_DIR} && cp -r ${LIBEVENT_ROOT}-build/include/. ${LIBEVENT_INCLUDE_DIR} && cp -r ${LIBEVENT_ROOT}/include/. ${LIBEVENT_INCLUDE_DIR})
-else ()
- set(GLOG_INSTALL_CMD ${CMAKE_NOOP})
- set(GLOG_PATCH_CMD ${PATCHEXE_LOCATION} -p1 < ${MESOS_3RDPARTY_SRC}/glog-${GLOG_VERSION}.patch)
-
- set(LIBEVENT_INSTALL_CMD ${CMAKE_NOOP})
-
- set(LIBAPR_INSTALL_CMD ${CMAKE_NOOP})
-endif ()
-
-set(HTTP_PARSER_UPDATE_CMD ${CMAKE_COMMAND} -E copy ${MESOS_3RDPARTY_SRC}/http-parser/CMakeLists.txt.template ${HTTP_PARSER_ROOT}/CMakeLists.txt)
-
-set(LIBEVENT_CMAKE_ARGS
- ${LIBEVENT_CMAKE_ARGS}
- # NOTE: Libevent does not respect the BUILD_SHARED_LIBS global flag.
- -DEVENT__BUILD_SHARED_LIBRARIES=${BUILD_SHARED_LIBS}
- -DEVENT__DISABLE_BENCHMARK=ON
- -DEVENT__DISABLE_TESTS=ON
- -DEVENT__DISABLE_SAMPLES=ON
- )
-
-if (ENABLE_SSL)
- set(LIBEVENT_CMAKE_ARGS
- ${LIBEVENT_CMAKE_ARGS}
- -DEVENT__DISABLE_OPENSSL=OFF
- )
-else ()
- set(LIBEVENT_CMAKE_ARGS
- ${LIBEVENT_CMAKE_ARGS}
- -DEVENT__DISABLE_OPENSSL=ON
- )
-endif ()
-
-if (NOT WIN32)
- set(LIBEVENT_CMAKE_ARGS
- ${LIBEVENT_CMAKE_ARGS}
- -DCMAKE_C_FLAGS=-fPIC
- )
-endif ()
-
# Third-party libraries. Tell the build system how to pull in and build third-
# party libraries at compile time, using the ExternalProject_Add macro.
@@ -221,10 +143,55 @@ ExternalProject_Add(
URL_HASH ${ELFIO_HASH}
)
-# The patch, configure, build, and install commands are stubbed out on Windows
-# builds so that it defaults to build using CMake. This is for the same reason
-# as the GMock code library build, see the call to `ExternalProject_Add` for
-# the GMock project below for more details.
+# glog: Google Logging Library.
+# https://github.com/google/glog
+################################
+EXTERNAL(glog ${GLOG_VERSION} "${MESOS_3RDPARTY_BIN}")
+add_library(glog ${LIBRARY_LINKAGE} IMPORTED)
+add_dependencies(glog ${GLOG_TARGET})
+
+if (WIN32)
+ set(GLOG_PATCH_CMD ${PATCHEXE_LOCATION} -p1 < ${MESOS_3RDPARTY_SRC}/glog-${GLOG_VERSION}.patch)
+ set(GLOG_INSTALL_CMD ${CMAKE_NOOP})
+
+ # NOTE: Windows-specific workaround for a glog issue documented here[1].
+ # Basically, Windows.h and glog/logging.h both define ERROR. Since we don't
+ # need the Windows ERROR, we can use this flag to avoid defining it at all.
+ # Unlike the other fix (defining GLOG_NO_ABBREVIATED_SEVERITIES), this fix
+ # is guaranteed to require no changes to the original Mesos code. See also
+ # the note in the code itself[2].
+ #
+ # [1] https://htmlpreview.github.io/?https://github.com/google/glog/blob/master/doc/glog.html#windows
+ # [2] https://github.com/google/glog/blob/f012836db187d5897d4adaaf621b4d53ae4865da/src/windows/glog/logging.h#L965
+ set(GLOG_COMPILE_DEFINITIONS GOOGLE_GLOG_DLL_DECL= NOGDI NOMINMAX)
+
+ set_target_properties(
+ glog PROPERTIES
+ IMPORTED_LOCATION_DEBUG ${GLOG_ROOT}-build/Debug/glog${LIBRARY_SUFFIX}
+ IMPORTED_LOCATION_RELEASE ${GLOG_ROOT}-build/Release/glog${LIBRARY_SUFFIX}
+ INTERFACE_INCLUDE_DIRECTORIES ${GLOG_ROOT}/src/windows
+ # TODO(andschwa): Remove this when glog is updated.
+ IMPORTED_LINK_INTERFACE_LIBRARIES DbgHelp
+ INTERFACE_COMPILE_DEFINITIONS "${GLOG_COMPILE_DEFINITIONS}")
+else ()
+ # Patch glog to deal with a problem that appears when compiling on clang
+ # under the C++11 standard. cf. MESOS-860, MESOS-966.
+ patch_cmd(${MESOS_3RDPARTY_SRC}/glog-${GLOG_VERSION}.patch GLOG_PATCH_CMD)
+
+ # TODO(andschwa): Build with CMake instead when glog is updated.
+ # NOTE: We only link to the shared library of glog because the static build
+ # doesn't have PIC.
+ set(GLOG_CONFIG_CMD ${GLOG_ROOT}/src/../configure GTEST_CONFIG=no --prefix=${GLOG_ROOT}-build)
+ set(GLOG_BUILD_CMD make)
+ set(GLOG_INSTALL_CMD make install)
+ set_target_properties(
+ glog PROPERTIES
+ IMPORTED_LOCATION ${GLOG_ROOT}-build/lib/libglog${CMAKE_SHARED_LIBRARY_SUFFIX}
+ INTERFACE_INCLUDE_DIRECTORIES ${GLOG_ROOT}-build/include)
+endif ()
+
+MAKE_INCLUDE_DIR(glog)
+
ExternalProject_Add(
${GLOG_TARGET}
PREFIX ${GLOG_CMAKE_ROOT}
@@ -234,8 +201,7 @@ ExternalProject_Add(
BUILD_COMMAND ${GLOG_BUILD_CMD}
INSTALL_COMMAND ${GLOG_INSTALL_CMD}
URL ${GLOG_URL}
- URL_HASH ${GLOG_HASH}
- )
+ URL_HASH ${GLOG_HASH})
ExternalProject_Add(
${PICOJSON_TARGET}
@@ -257,55 +223,194 @@ ExternalProject_Add(
URL_HASH ${NVML_HASH}
)
+# HTTP Parser: HTTP request/response parser for C.
+# https://github.com/nodejs/http-parser
+##################################################
+# TODO: Remove `GLOBAL` when `Process3rdpartyConfigure` is removed.
+EXTERNAL(http_parser ${HTTP_PARSER_VERSION} "${MESOS_3RDPARTY_BIN}")
+add_library(http_parser ${LIBRARY_LINKAGE} IMPORTED GLOBAL)
+add_dependencies(http_parser ${HTTP_PARSER_TARGET})
+set_target_properties(http_parser PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${HTTP_PARSER_ROOT})
+
+# NOTE: http-parser is always built as a static library.
+if (WIN32)
+ set_target_properties(
+ http_parser PROPERTIES
+ IMPORTED_LOCATION_DEBUG ${HTTP_PARSER_ROOT}-build/Debug/http_parser${CMAKE_STATIC_LIBRARY_SUFFIX}
+ IMPORTED_LOCATION_RELEASE ${HTTP_PARSER_ROOT}-build/Release/http_parser${CMAKE_STATIC_LIBRARY_SUFFIX})
+else ()
+ set_target_properties(
+ http_parser PROPERTIES
+ IMPORTED_LOCATION ${HTTP_PARSER_ROOT}-build/libhttp_parser${CMAKE_STATIC_LIBRARY_SUFFIX})
+endif ()
+
+# NOTE: This is used to provide a CMake build for http-parser. We can't just use
+# `add_library(http_parser ...)` because `ExternalProject_Add` extracts the
+# tarball at build time, and `add_library` is a configuration time step.
+set(HTTP_PARSER_PATCH_CMD
+ ${CMAKE_COMMAND} -E copy
+ ${MESOS_3RDPARTY_SRC}/http-parser/CMakeLists.txt.template
+ ${HTTP_PARSER_ROOT}/CMakeLists.txt)
+
+MAKE_INCLUDE_DIR(http_parser)
+
ExternalProject_Add(
${HTTP_PARSER_TARGET}
PREFIX ${HTTP_PARSER_CMAKE_ROOT}
- UPDATE_COMMAND ${HTTP_PARSER_UPDATE_CMD}
+ PATCH_COMMAND ${HTTP_PARSER_PATCH_CMD}
CMAKE_ARGS ${CMAKE_FORWARD_ARGS}
INSTALL_COMMAND ${CMAKE_NOOP}
URL ${HTTP_PARSER_URL}
- URL_HASH ${HTTP_PARSER_HASH}
- )
+ URL_HASH ${HTTP_PARSER_HASH})
+
+
+if (ENABLE_LIBEVENT)
+ # libevent: An event notification library.
+ # http://libevent.org/
+ ##########################################
+ EXTERNAL(libevent ${LIBEVENT_VERSION} "${MESOS_3RDPARTY_BIN}")
+ add_library(libevent ${LIBRARY_LINKAGE} IMPORTED)
+ add_dependencies(libevent ${LIBEVENT_TARGET})
+
+ set_target_properties(
+ libevent PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${LIBEVENT_ROOT}/include;${LIBEVENT_ROOT}-build/include")
+
+ if (WIN32)
+ set_target_properties(
+ libevent PROPERTIES
+ IMPORTED_LOCATION_DEBUG ${LIBEVENT_ROOT}-build/lib/Debug/event${LIBRARY_SUFFIX}
+ IMPORTED_LOCATION_RELEASE ${LIBEVENT_ROOT}-build/lib/Release/event${LIBRARY_SUFFIX})
+ else ()
+ set_target_properties(
+ libevent PROPERTIES
+ IMPORTED_LOCATION ${LIBEVENT_ROOT}-build/lib/libevent${LIBRARY_SUFFIX})
+ endif ()
+
+ set(LIBEVENT_CMAKE_ARGS
+ # NOTE: Libevent does not respect the BUILD_SHARED_LIBS global flag.
+ ${CMAKE_FORWARD_ARGS}
+ -DEVENT__BUILD_SHARED_LIBRARIES=${BUILD_SHARED_LIBS}
+ -DEVENT__DISABLE_OPENSSL=$<NOT:$<BOOL:${ENABLE_SSL}>>
+ -DCMAKE_C_FLAGS=$<IF:$<PLATFORM_ID:Windows>,"",-fPIC>
+ -DEVENT__DISABLE_BENCHMARK=ON
+ -DEVENT__DISABLE_REGRESS=ON
+ -DEVENT__DISABLE_SAMPLES=ON
+ -DEVENT__DISABLE_TESTS=ON)
+
+ if (OPENSSL_ROOT_DIR)
+ list(APPEND LIBEVENT_CMAKE_ARGS -DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR})
+ endif ()
+
+ MAKE_INCLUDE_DIR(libevent)
+
+ ExternalProject_Add(
+ ${LIBEVENT_TARGET}
+ PREFIX ${LIBEVENT_CMAKE_ROOT}
+ CMAKE_ARGS ${LIBEVENT_CMAKE_ARGS}
+ INSTALL_COMMAND ${CMAKE_NOOP}
+ URL ${LIBEVENT_URL}
+ URL_HASH ${LIBEVENT_HASH})
+else ()
+ # libev: Full-featured high-performance event loop.
+ # https://github.com/enki/libev
+ ###################################################
+ EXTERNAL(libev ${LIBEV_VERSION} "${MESOS_3RDPARTY_BIN}")
+ add_library(libev SHARED IMPORTED)
+ add_dependencies(libev ${LIBEV_TARGET})
+
+ set_target_properties(
+ libev PROPERTIES
+ IMPORTED_LOCATION ${LIBEV_ROOT}-build/lib/libev${CMAKE_SHARED_LIBRARY_SUFFIX}
+ INTERFACE_INCLUDE_DIRECTORIES ${LIBEV_ROOT}-build/include)
+
+ # Patch libev to keep it from reaping child processes.
+ patch_cmd(${MESOS_3RDPARTY_SRC}/libev-4.22.patch LIBEV_PATCH_CMD)
+
+ MAKE_INCLUDE_DIR(libev)
-if (NOT ENABLE_LIBEVENT)
ExternalProject_Add(
${LIBEV_TARGET}
PREFIX ${LIBEV_CMAKE_ROOT}
PATCH_COMMAND ${LIBEV_PATCH_CMD}
- CMAKE_ARGS ${CMAKE_FORWARD_ARGS}
- CONFIGURE_COMMAND ${LIBEV_CONFIG_CMD}
- BUILD_COMMAND ${LIBEV_BUILD_CMD}
- INSTALL_COMMAND ${LIBEV_INSTALL_CMD}
+ CONFIGURE_COMMAND ${LIBEV_ROOT}/configure --prefix=${LIBEV_ROOT}-build
+ BUILD_COMMAND make
+ INSTALL_COMMAND make install
URL ${LIBEV_URL}
- URL_HASH ${LIBEV_HASH}
- )
-elseif (ENABLE_LIBEVENT)
- ExternalProject_Add(
- ${LIBEVENT_TARGET}
- PREFIX ${LIBEVENT_CMAKE_ROOT}
- CMAKE_ARGS ${CMAKE_FORWARD_ARGS};${LIBEVENT_CMAKE_ARGS}
- INSTALL_COMMAND ${LIBEVENT_INSTALL_CMD}
- URL ${LIBEVENT_URL}
- URL_HASH ${LIBEVENT_HASH}
- )
+ URL_HASH ${LIBEV_HASH})
endif ()
+
+# APR: The Apache Portable Runtime Project.
+# https://apr.apache.org
+###########################################
if (WIN32)
+ EXTERNAL(libapr ${LIBAPR_VERSION} "${MESOS_3RDPARTY_BIN}")
+ add_library(apr ${LIBRARY_LINKAGE} IMPORTED)
+ add_dependencies(apr ${LIBAPR_TARGET})
+
+ # NOTE: libapr-1 is always a static library on Windows.
+ set_target_properties(
+ apr PROPERTIES
+ IMPORTED_LOCATION_DEBUG ${LIBAPR_ROOT}-build/Debug/libapr-1${CMAKE_STATIC_LIBRARY_SUFFIX}
+ IMPORTED_LOCATION_RELEASE ${LIBAPR_ROOT}-build/Release/libapr-1${CMAKE_STATIC_LIBRARY_SUFFIX}
+ INTERFACE_INCLUDE_DIRECTORIES "${LIBAPR_ROOT}/include;${LIBAPR_ROOT}-build")
+
+ MAKE_INCLUDE_DIR(apr)
+
ExternalProject_Add(
${LIBAPR_TARGET}
PREFIX ${LIBAPR_CMAKE_ROOT}
CMAKE_ARGS ${CMAKE_FORWARD_ARGS}
- INSTALL_COMMAND ${LIBAPR_INSTALL_CMD}
+ INSTALL_COMMAND ${CMAKE_NOOP}
URL ${LIBAPR_URL}
- URL_HASH ${LIBAPR_HASH}
- )
+ URL_HASH ${LIBAPR_HASH})
+else ()
+ find_package(Apr REQUIRED)
+ add_library(apr SHARED IMPORTED)
+
+ set_target_properties(
+ apr PROPERTIES
+ IMPORTED_LOCATION ${APR_LIBS}
+ INTERFACE_INCLUDE_DIRECTORIES ${APR_INCLUDE_DIR})
endif ()
-# Windows third-party libraries. Windows has no package manager, so we download
-# them here.
-###############################################################################
+# Subversion: Enterprise-class centralized version control for the masses.
+# https://subversion.apache.org
+##########################################################################
+if (NOT WIN32)
+ # NOTE: This does not use `FindSubversion` because it finds the `svn`
+ # executable, but we're looking for the library.
+ find_package(Svn REQUIRED)
+ add_library(svn INTERFACE)
+ target_include_directories(svn SYSTEM INTERFACE ${SVN_INCLUDE_DIR})
+
+ # `FindSvn` returns finds three separate libraries.
+ foreach (lib ${SVN_LIBS})
+ get_filename_component(SVN_LIB ${lib} NAME_WE)
+ add_library(${SVN_LIB} SHARED IMPORTED)
+ set_target_properties(${SVN_LIB} PROPERTIES IMPORTED_LOCATION ${lib})
+ target_link_libraries(svn INTERFACE ${SVN_LIB})
+ endforeach ()
+endif ()
+
+
+# curl: Command line tool and library for transferring data with URLs.
+# https://curl.haxx.se
+######################################################################
if (WIN32)
+ EXTERNAL(curl ${CURL_VERSION} "${MESOS_3RDPARTY_BIN}")
+ add_library(curl ${LIBRARY_LINKAGE} IMPORTED)
+ add_dependencies(curl ${CURL_TARGET})
+
+ set_target_properties(
+ curl PROPERTIES
+ IMPORTED_LOCATION_DEBUG ${CURL_ROOT}-build/lib/Debug/libcurl${LIBRARY_SUFFIX}
+ IMPORTED_LOCATION_RELEASE ${CURL_ROOT}-build/lib/Release/libcurl${LIBRARY_SUFFIX}
+ INTERFACE_COMPILE_DEFINITIONS CURL_STATICLIB
+ INTERFACE_INCLUDE_DIRECTORIES ${CURL_ROOT}/include)
+
set(CURL_CMAKE_ARGS ${CMAKE_FORWARD_ARGS} -DBUILD_CURL_TESTS=OFF)
# NOTE: curl does not respect BUILD_SHARED_LIBS.
@@ -314,7 +419,8 @@ if (WIN32)
list(APPEND CURL_CMAKE_ARGS -DCURL_STATICLIB=ON)
endif ()
- # TODO(hausdorff): maybe try to incorporate this into findpackage for Windows
+ MAKE_INCLUDE_DIR(curl)
+
ExternalProject_Add(
${CURL_TARGET}
PREFIX ${CURL_CMAKE_ROOT}
@@ -322,8 +428,41 @@ if (WIN32)
CMAKE_ARGS ${CURL_CMAKE_ARGS}
INSTALL_COMMAND ${CMAKE_NOOP}
URL ${CURL_URL}
- URL_HASH ${CURL_HASH}
- )
+ URL_HASH ${CURL_HASH})
+else ()
+ find_package(CURL REQUIRED)
+ add_library(curl SHARED IMPORTED)
+
+ set_target_properties(
+ curl PROPERTIES
+ IMPORTED_LOCATION ${CURL_LIBRARIES}
+ INTERFACE_INCLUDE_DIRECTORIES ${CURL_INCLUDE_DIRS})
+endif ()
+
+
+# zlib: A Massively Spiffy Yet Delicately Unobtrusive Compression Library.
+# https://zlib.net
+##########################################################################
+if (WIN32)
+ EXTERNAL(zlib ${ZLIB_VERSION} "${MESOS_3RDPARTY_BIN}")
+ add_library(zlib ${LIBRARY_LINKAGE} IMPORTED)
+ add_dependencies(zlib ${ZLIB_TARGET})
+
+ # Zlib generates different libraries depending on the linkage
+ # and configuration. i.e.:
+ # * For a static Debug build: `zlibstaticd.lib`.
+ # * For a shared Release build: `zlib.lib`.
+ if (NOT BUILD_SHARED_LIBS)
+ set(ZLIB_STATIC static)
+ endif ()
+
+ set_target_properties(
+ zlib PROPERTIES
+ IMPORTED_LOCATION_DEBUG ${ZLIB_ROOT}-build/Debug/zlib${ZLIB_STATIC}d${LIBRARY_SUFFIX}
+ IMPORTED_LOCATION_RELEASE ${ZLIB_ROOT}-build/Release/zlib${ZLIB_STATIC}${LIBRARY_SUFFIX}
+ INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_ROOT};${ZLIB_ROOT}-build")
+
+ MAKE_INCLUDE_DIR(zlib)
ExternalProject_Add(
${ZLIB_TARGET}
@@ -331,10 +470,21 @@ if (WIN32)
CMAKE_ARGS ${CMAKE_FORWARD_ARGS}
INSTALL_COMMAND ${CMAKE_NOOP}
URL ${ZLIB_URL}
- URL_HASH ${ZLIB_HASH}
- )
+ URL_HASH ${ZLIB_HASH})
+else ()
+ find_package(ZLIB REQUIRED)
+ add_library(zlib SHARED IMPORTED)
+
+ set_target_properties(
+ zlib PROPERTIES
+ IMPORTED_LOCATION ${ZLIB_LIBRARIES}
+ INTERFACE_INCLUDE_DIRECTORIES ${ZLIB_INCLUDE_DIRS})
endif ()
+set_target_properties(
+ zlib PROPERTIES
+ INTERFACE_COMPILE_DEFINITIONS HAVE_LIBZ)
+
# DEPENDENCIES FOR THE PROCESS LIBRARY TESTS AND STOUT TESTS.
#
@@ -343,57 +493,119 @@ endif ()
###############################################################################
list(
APPEND CMAKE_MODULE_PATH
- ${CMAKE_SOURCE_DIR}/3rdparty/stout/cmake
- )
-# TODO(andschwa): Remove this when gmock and gtest can be included.
-include(StoutTestsConfigure)
+ ${CMAKE_SOURCE_DIR}/3rdparty/stout/cmake)
-set(GOOGLETEST_URL ${FETCH_URL}/googletest-release-${GOOGLETEST_VERSION}.tar.gz)
-set(PROTOBUF_URL ${FETCH_URL}/protobuf-${PROTOBUF_VERSION}.tar.gz)
-# NOTE: `googletest` is "installed" into a lib directory, see "NOTE: (fix for
-# MESOS-3250)" comment above for explanation.
-if (NOT WIN32)
- set(GOOGLETEST_INSTALL_CMD mkdir -p ${GOOGLETEST_ROOT}-lib/lib && cp -r ${GOOGLETEST_ROOT}-build/googlemock/. ${GOOGLETEST_ROOT}-lib/lib)
+# Google Test: Google's C++ test framework (GoogleTest and GoogleMock).
+# https://github.com/google/googletest
+#######################################################################
+EXTERNAL(googletest ${GOOGLETEST_VERSION} "${MESOS_3RDPARTY_BIN}")
+add_library(googletest INTERFACE)
+add_dependencies(googletest ${GOOGLETEST_TARGET})
+target_link_libraries(googletest INTERFACE gmock gtest)
+
+add_library(gmock IMPORTED STATIC)
+add_library(gtest IMPORTED STATIC)
+
+set_target_properties(
+ gmock PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES ${GOOGLETEST_ROOT}/googlemock/include)
+
+set_target_properties(
+ gtest PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES ${GOOGLETEST_ROOT}/googletest/include)
+
+if (WIN32)
+ set_target_properties(
+ gmock PROPERTIES
+ IMPORTED_LOCATION_DEBUG ${GOOGLETEST_ROOT}-build/googlemock/Debug/gmock${CMAKE_STATIC_LIBRARY_SUFFIX}
+ IMPORTED_LOCATION_RELEASE ${GOOGLETEST_ROOT}-build/googlemock/Release/gmock${CMAKE_STATIC_LIBRARY_SUFFIX})
+
+ set_target_properties(
+ gtest PROPERTIES
+ IMPORTED_LOCATION_DEBUG ${GOOGLETEST_ROOT}-build/googlemock/gtest/Debug/gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
+ IMPORTED_LOCATION_RELEASE ${GOOGLETEST_ROOT}-build/googlemock/gtest/Release/gtest${CMAKE_STATIC_LIBRARY_SUFFIX})
else ()
- set(GOOGLETEST_INSTALL_CMD ${CMAKE_NOOP})
+ set_target_properties(
+ gmock PROPERTIES
+ IMPORTED_LOCATION ${GOOGLETEST_ROOT}-build/googlemock/libgmock${CMAKE_STATIC_LIBRARY_SUFFIX})
+
+ set_target_properties(
+ gtest PROPERTIES
+ IMPORTED_LOCATION ${GOOGLETEST_ROOT}-build/googlemock/gtest/libgtest${CMAKE_STATIC_LIBRARY_SUFFIX})
endif ()
+MAKE_INCLUDE_DIR(gmock)
+MAKE_INCLUDE_DIR(gtest)
+
+set(GOOGLETEST_URL ${FETCH_URL}/googletest-release-${GOOGLETEST_VERSION}.tar.gz)
+
ExternalProject_Add(
${GOOGLETEST_TARGET}
PREFIX ${GOOGLETEST_CMAKE_ROOT}
# NOTE: googletest cannot be built as a shared library, or the test runner
# will crash with a double-free.
CMAKE_ARGS ${CMAKE_FORWARD_ARGS};-DBUILD_SHARED_LIBS=OFF
- INSTALL_COMMAND ${GOOGLETEST_INSTALL_CMD}
+ INSTALL_COMMAND ${CMAKE_NOOP}
URL ${GOOGLETEST_URL}
- URL_HASH ${GOOGLETEST_HASH}
- )
+ URL_HASH ${GOOGLETEST_HASH})
-if (NOT WIN32)
- # NOTE: `ExternalProject_Add` is used separately because older versions
- # of CMake used on Linux do not understand the `SOURCE_SUBDIR` command.
- ExternalProject_Add(
- ${PROTOBUF_TARGET}
- PREFIX ${PROTOBUF_CMAKE_ROOT}
- CONFIGURE_COMMAND ${PROTOBUF_ROOT}/configure --prefix=${PROTOBUF_LIB_ROOT}
- BUILD_COMMAND make
- INSTALL_COMMAND make install
- URL ${PROTOBUF_URL}
- URL_HASH ${PROTOBUF_HASH}
- )
+
+# Protocol Buffers: Google's data interchange format.
+# https://developers.google.com/protocol-buffers/
+#####################################################
+EXTERNAL("protobuf" ${PROTOBUF_VERSION} "${MESOS_3RDPARTY_BIN}")
+
+# TODO(andschwa): Move protobufs so these don't have to be GLOBAL.
+add_library(protobuf ${LIBRARY_LINKAGE} IMPORTED GLOBAL)
+
+add_dependencies(protobuf ${PROTOBUF_TARGET})
+add_executable(protoc IMPORTED GLOBAL)
+add_dependencies(protoc ${PROTOBUF_TARGET})
+
+set_target_properties(
+ protobuf PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES ${PROTOBUF_ROOT}/src)
+
+if (WIN32)
+ set_target_properties(
+ protobuf PROPERTIES
+ IMPORTED_LOCATION_DEBUG ${PROTOBUF_ROOT}-build/Debug/libprotobufd${LIBRARY_SUFFIX}
+ IMPORTED_LOCATION_RELEASE ${PROTOBUF_ROOT}-build/Release/libprotobuf${LIBRARY_SUFFIX})
+
+ set_target_properties(
+ protoc PROPERTIES
+ IMPORTED_LOCATION_DEBUG ${PROTOBUF_ROOT}-build/Debug/protoc.exe
+ IMPORTED_LOCATION_RELEASE ${PROTOBUF_ROOT}-build/Release/protoc.exe)
else ()
- ExternalProject_Add(
- ${PROTOBUF_TARGET}
- PREFIX ${PROTOBUF_CMAKE_ROOT}
- SOURCE_SUBDIR cmake
- CMAKE_ARGS ${CMAKE_FORWARD_ARGS};-Dprotobuf_BUILD_TESTS=OFF
- INSTALL_COMMAND ${CMAKE_NOOP}
- URL ${PROTOBUF_URL}
- URL_HASH ${PROTOBUF_HASH}
- )
+ # This is for single-configuration generators such as GNU Make.
+ if (CMAKE_BUILD_TYPE MATCHES DEBUG)
+ set(PROTOBUF_SUFFIX d)
+ endif ()
+
+ set_target_properties(
+ protobuf PROPERTIES
+ IMPORTED_LOCATION ${PROTOBUF_ROOT}-build/libprotobuf${PROTOBUF_SUFFIX}${LIBRARY_SUFFIX})
+
+ set_target_properties(
+ protoc PROPERTIES
+ IMPORTED_LOCATION ${PROTOBUF_ROOT}-build/protoc)
endif ()
+MAKE_INCLUDE_DIR(protobuf)
+
+set(PROTOBUF_URL ${FETCH_URL}/protobuf-${PROTOBUF_VERSION}.tar.gz)
+
+ExternalProject_Add(
+ ${PROTOBUF_TARGET}
+ PREFIX ${PROTOBUF_CMAKE_ROOT}
+ SOURCE_SUBDIR cmake
+ CMAKE_ARGS ${CMAKE_FORWARD_ARGS};-Dprotobuf_BUILD_TESTS=OFF
+ INSTALL_COMMAND ${CMAKE_NOOP}
+ URL ${PROTOBUF_URL}
+ URL_HASH ${PROTOBUF_HASH})
+
+
# BUILDING THE STOUT LIBRARY AND ITS TESTS.
#
# Builds, configures, and compiles the stout library and assorted tests.
@@ -473,21 +685,32 @@ ExternalProject_Add(
URL_HASH ${ZOOKEEPER_HASH})
+# LevelDB: A fast key-value storage library.
+# https://github.com/google/leveldb
+############################################
if (NOT WIN32)
- PATCH_CMD(
- ${MESOS_3RDPARTY_SRC}/leveldb-${LEVELDB_VERSION}.patch
- LEVELDB_PATCH_CMD)
+ # TODO(andschwa): Move leveldb so these don't have to be GLOBAL.
+ EXTERNAL(leveldb ${LEVELDB_VERSION} "${MESOS_3RDPARTY_BIN}")
+ add_library(leveldb STATIC IMPORTED GLOBAL)
+ add_dependencies(leveldb ${LEVELDB_TARGET})
+
+ set_target_properties(
+ leveldb PROPERTIES
+ IMPORTED_LOCATION ${LEVELDB_ROOT}/out-static/libleveldb${CMAKE_STATIC_LIBRARY_SUFFIX}
+ INTERFACE_INCLUDE_DIRECTORIES ${LEVELDB_ROOT}/include)
+
+ patch_cmd(${MESOS_3RDPARTY_SRC}/leveldb-${LEVELDB_VERSION}.patch LEVELDB_PATCH_CMD)
+
+ MAKE_INCLUDE_DIR(leveldb)
- # NOTE: Building leveldb as a shared library is not yet supported.
ExternalProject_Add(
${LEVELDB_TARGET}
- PREFIX ${LEVELDB_TARGET}
+ PREFIX ${LEVELDB_CMAKE_ROOT}
PATCH_COMMAND ${LEVELDB_PATCH_CMD}
CONFIGURE_COMMAND ${CMAKE_NOOP}
BUILD_IN_SOURCE 1
BUILD_COMMAND make OPT=-O2\ -DNDEBUG\ -fPIC all
INSTALL_COMMAND ${CMAKE_NOOP}
URL ${LEVELDB_URL}
- URL_HASH ${LEVELDB_HASH}
- )
+ URL_HASH ${LEVELDB_HASH})
endif ()
[06/42] mesos git commit: CMake: Removed `GroupSource` usage from
`libprocess`.
Posted by jo...@apache.org.
CMake: Removed `GroupSource` usage from `libprocess`.
Source grouping is a cosmetic change that only has an effect if
you load this project into an IDE (such as XCode or Visual Studio).
The existing source grouping is brittle and is not vital for the
CMake build system MVP, so we are removing it to reduce code churn.
Review: https://reviews.apache.org/r/61350/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/96866d2c
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/96866d2c
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/96866d2c
Branch: refs/heads/master
Commit: 96866d2c6105cda479a33371401377a77281a0e9
Parents: ae778e4
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Sat Sep 2 09:07:34 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:05 2017 -0700
----------------------------------------------------------------------
3rdparty/libprocess/cmake/ProcessConfigure.cmake | 17 -----------------
3rdparty/libprocess/src/CMakeLists.txt | 9 ---------
3rdparty/libprocess/src/tests/CMakeLists.txt | 9 ---------
3 files changed, 35 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/96866d2c/3rdparty/libprocess/cmake/ProcessConfigure.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/cmake/ProcessConfigure.cmake b/3rdparty/libprocess/cmake/ProcessConfigure.cmake
index b9281b1..e246eaa 100755
--- a/3rdparty/libprocess/cmake/ProcessConfigure.cmake
+++ b/3rdparty/libprocess/cmake/ProcessConfigure.cmake
@@ -48,23 +48,6 @@ set(PROCESS_PACKAGE_VERSION 0.0.1)
set(PROCESS_PACKAGE_SOVERSION 0)
set(PROCESS_TARGET process-${PROCESS_PACKAGE_VERSION})
-# SOURCE GROUPS. Allows IDEs to group header files for projects taking a
-# dependency on this package.
-########################################################################
-file(
- GLOB_RECURSE
- PROCESS_HEADERS
- "${PROCESS_INCLUDE_DIR}/process/*.hpp"
- )
-
-macro(GROUP_PROCESS_HEADERS)
- GROUP_SOURCE(
- "Libprocess Public Headers"
- "${PROCESS_INCLUDE_DIR}/process"
- "${PROCESS_INCLUDE_DIR}/process"
- "*.h*")
-endmacro()
-
# DEFINE PROCESS LIBRARY DEPENDENCIES. Tells the process library build targets
# download/configure/build all third-party libraries before attempting to build.
################################################################################
http://git-wip-us.apache.org/repos/asf/mesos/blob/96866d2c/3rdparty/libprocess/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/CMakeLists.txt b/3rdparty/libprocess/src/CMakeLists.txt
index fbad7a0..1ffa2c9 100644
--- a/3rdparty/libprocess/src/CMakeLists.txt
+++ b/3rdparty/libprocess/src/CMakeLists.txt
@@ -121,15 +121,6 @@ else ()
)
endif ()
-GROUP_STOUT_HEADERS()
-GROUP_PROCESS_HEADERS()
-
-GROUP_SOURCE(
- "src"
- "${CMAKE_CURRENT_SOURCE_DIR}"
- "${CMAKE_CURRENT_SOURCE_DIR}"
- "*.[ch]*")
-
set_target_properties(
${PROCESS_TARGET} PROPERTIES
VERSION ${PROCESS_PACKAGE_VERSION}
http://git-wip-us.apache.org/repos/asf/mesos/blob/96866d2c/3rdparty/libprocess/src/tests/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/tests/CMakeLists.txt b/3rdparty/libprocess/src/tests/CMakeLists.txt
index 27451c2..dd46bd2 100644
--- a/3rdparty/libprocess/src/tests/CMakeLists.txt
+++ b/3rdparty/libprocess/src/tests/CMakeLists.txt
@@ -78,15 +78,6 @@ link_directories(${PROCESS_TEST_LIB_DIRS})
###############################################################################
add_executable(${PROCESS_TESTS_TARGET} EXCLUDE_FROM_ALL ${PROCESS_TESTS_SRC})
-GROUP_STOUT_HEADERS()
-GROUP_PROCESS_HEADERS()
-
-GROUP_SOURCE(
- "tests"
- "${CMAKE_CURRENT_SOURCE_DIR}"
- "${CMAKE_CURRENT_SOURCE_DIR}"
- "*.[ch]*")
-
# ADD LINKER FLAGS (generates, e.g., -lglog on Linux).
######################################################
target_link_libraries(${PROCESS_TESTS_TARGET} ${PROCESS_TEST_LIBS})
[24/42] mesos git commit: CMake: Enabled building Java artifacts.
Posted by jo...@apache.org.
CMake: Enabled building Java artifacts.
This adds an option "ENABLE_JAVA" (default OFF) which will add Java
artifacts, such as Java protobufs and the Mesos Jar, to the CMake
build tree. These artifact can be built via the `mesos-java` target
and, if enabled, will be built as part of the entire tree.
Review: https://reviews.apache.org/r/61306/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/7c6837cc
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/7c6837cc
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/7c6837cc
Branch: refs/heads/master
Commit: 7c6837cc76db2bb3f5808cf7d842f65be3e008fe
Parents: 9cdee13
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Sat Sep 2 15:47:50 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:07 2017 -0700
----------------------------------------------------------------------
cmake/CompilationConfigure.cmake | 31 ++++++--
cmake/MesosConfigure.cmake | 17 +++-
src/CMakeLists.txt | 141 +++++++++++++++++++++++++++++++++-
src/tests/CMakeLists.txt | 4 +
4 files changed, 184 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/7c6837cc/cmake/CompilationConfigure.cmake
----------------------------------------------------------------------
diff --git a/cmake/CompilationConfigure.cmake b/cmake/CompilationConfigure.cmake
index 5d54921..9df97a8 100644
--- a/cmake/CompilationConfigure.cmake
+++ b/cmake/CompilationConfigure.cmake
@@ -27,6 +27,30 @@ endif ()
option(BUILD_SHARED_LIBS "Build shared libraries." ${DEFAULT_BUILD_SHARED_LIBS})
+option(ENABLE_JAVA "Build Java components. Warning: this is SLOW." OFF)
+if (ENABLE_JAVA)
+ include(FindJava)
+ find_package(Java COMPONENTS Development)
+
+ if (NOT JAVA_FOUND)
+ message(FATAL_ERROR "Java was not found!")
+ endif ()
+
+ include(FindJNI)
+ if (NOT JNI_FOUND)
+ message(FATAL_ERROR "JNI Java libraries were not found!")
+ endif ()
+
+ find_program(MVN mvn)
+ if (NOT MVN)
+ message(FATAL_ERROR "Maven was not found!")
+ endif ()
+
+ if (Java_FOUND AND JNI_FOUND AND MVN)
+ set(HAS_JAVA TRUE)
+ endif ()
+endif ()
+
option(ENABLE_PRECOMPILED_HEADERS
"Enable auto-generated precompiled headers using cotire" ${WIN32})
@@ -376,18 +400,13 @@ configure_file(
@ONLY
)
-# TODO(hausdorff): (MESOS-5902) Populate this value when we integrate Java
-# support.
-set(BUILD_JAVA_JVM_LIBRARY "")
-
# NOTE: The quotes in these definitions are necessary. Without them, the
# preprocessor will interpret the symbols as (e.g.) int literals and uquoted
# identifiers, rather than the string values our code expects.
list(APPEND MESOS_CPPFLAGS
-DUSE_STATIC_LIB
-DUSE_CMAKE_BUILD_CONFIG
- -DBUILD_JAVA_JVM_LIBRARY="${BUILD_JAVA_JVM_LIBRARY}"
- )
+ -DBUILD_JAVA_JVM_LIBRARY="${JAVA_JVM_LIBRARY}")
# TODO(hausdorff): (MESOS-5455) `BUILD_FLAGS` is currently a placeholder value.
add_definitions(${MESOS_CPPFLAGS} -DBUILD_FLAGS="")
http://git-wip-us.apache.org/repos/asf/mesos/blob/7c6837cc/cmake/MesosConfigure.cmake
----------------------------------------------------------------------
diff --git a/cmake/MesosConfigure.cmake b/cmake/MesosConfigure.cmake
index 48cc965..4857a76 100755
--- a/cmake/MesosConfigure.cmake
+++ b/cmake/MesosConfigure.cmake
@@ -90,6 +90,16 @@ add_custom_target(
make_bin_src_dir ALL
COMMAND ${CMAKE_COMMAND} -E make_directory ${MESOS_BIN_SRC_DIR})
+add_custom_target(
+ make_bin_java_dir ALL
+ DEPENDS make_bin_src_dir
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${MESOS_BIN_SRC_DIR}/java/generated)
+
+add_custom_target(
+ make_bin_jni_dir ALL
+ DEPENDS make_bin_src_dir
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${MESOS_BIN_SRC_DIR}/java/jni)
+
# CONFIGURE AGENT.
##################
include(AgentConfigure)
@@ -166,14 +176,17 @@ set(MESOS_PROTOBUF_TARGET mesos-protobufs
# MESOS SCRIPT CONFIGURATION.
#############################
+# Define variables required to configure these scripts,
+# and also the Java build script `mesos.pom.in`.
+set(abs_top_srcdir "${CMAKE_SOURCE_DIR}")
+set(abs_top_builddir "${CMAKE_BINARY_DIR}")
+
if (NOT WIN32)
# Create build bin/ directory. We will place configured scripts here.
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/bin/tmp")
# Define the variables required to configure these scripts.
- set(abs_top_srcdir "${CMAKE_SOURCE_DIR}")
- set(abs_top_builddir "${CMAKE_BINARY_DIR}")
set(VERSION "${PACKAGE_VERSION}")
# Find all scripts to configure. The scripts are in the bin/ directory, and
http://git-wip-us.apache.org/repos/asf/mesos/blob/7c6837cc/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 2c5fbf6..58b24a7 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -132,6 +132,142 @@ if (WIN32)
endif ()
+# BUILD JAVA ARTIFACTS.
+#######################
+if (HAS_JAVA)
+ # Build the Mesos JAR.
+ #
+ # NOTE: We do not utilize CMake's `UseJava` module for a few reasons:
+ # (1) `add_jar()` calls `javac`, but we use Maven.
+ # (2) `add_jar()` does not support something like `IMPORTED`.
+ # (3) `create_javah()` checks the existence of each JAR in the given class
+ # path at configuration time, even though it depends on `mesos-jar` to
+ # run Maven at build time. Coupled with (1) and (2) this makes it
+ # impossible to use.
+ set(MESOS_JAR ${CMAKE_CURRENT_BINARY_DIR}/java/target/mesos-${MESOS_PACKAGE_VERSION}.jar)
+ set(PROTOBUF_JAR ${CMAKE_CURRENT_BINARY_DIR}/java/target/dependency/protobuf-java-3.3.0.jar)
+
+ # This file is generated into the build tree.
+ set(MESOS_JAVA_LIBRARY java/generated/org/apache/mesos/MesosNativeLibrary.java)
+ configure_file(${MESOS_JAVA_LIBRARY}.in ${MESOS_JAVA_LIBRARY})
+
+ set(MESOS_JAR_SRC
+ java/src/org/apache/mesos/ExecutorDriver.java
+ java/src/org/apache/mesos/Executor.java
+ java/src/org/apache/mesos/Log.java
+ java/src/org/apache/mesos/MesosExecutorDriver.java
+ java/src/org/apache/mesos/MesosSchedulerDriver.java
+ java/src/org/apache/mesos/SchedulerDriver.java
+ java/src/org/apache/mesos/Scheduler.java
+ java/src/org/apache/mesos/state/AbstractState.java
+ java/src/org/apache/mesos/state/InMemoryState.java
+ java/src/org/apache/mesos/state/LevelDBState.java
+ java/src/org/apache/mesos/state/LogState.java
+ java/src/org/apache/mesos/state/State.java
+ java/src/org/apache/mesos/state/Variable.java
+ java/src/org/apache/mesos/state/ZooKeeperState.java
+ java/src/org/apache/mesos/v1/scheduler/V1Mesos.java
+ java/src/org/apache/mesos/v1/scheduler/Mesos.java
+ java/src/org/apache/mesos/v1/scheduler/Scheduler.java
+ java/src/org/apache/mesos/v1/scheduler/V0Mesos.java
+ ${CMAKE_CURRENT_BINARY_DIR}/${MESOS_JAVA_LIBRARY})
+
+ configure_file(java/mesos.pom.in java/mesos.pom)
+
+ add_custom_command(
+ COMMENT "Building ${MESOS_JAR} using Maven..."
+ OUTPUT ${MESOS_JAR}
+ COMMAND mvn -B -f mesos.pom clean package
+ DEPENDS ${MESOS_JAR_SRC} ${JAVA_PROTOBUF_SRC}
+ WORKING_DIRECTORY java)
+
+ add_custom_target(mesos-jar DEPENDS ${MESOS_JAR})
+
+ # TODO(andschwa): Build the Example JAR.
+ set(EXAMPLE_JAR_SRC
+ examples/java/TestExceptionFramework.java
+ examples/java/TestExecutor.java
+ examples/java/TestFramework.java
+ examples/java/TestLog.java
+ examples/java/TestMultipleExecutorsFramework.java
+ examples/java/V1TestFramework.java)
+
+ set(JAVA_SRC
+ java/jni/convert.cpp
+ java/jni/construct.cpp
+ java/jni/org_apache_mesos_Log.cpp
+ java/jni/org_apache_mesos_MesosExecutorDriver.cpp
+ java/jni/org_apache_mesos_MesosNativeLibrary.cpp
+ java/jni/org_apache_mesos_MesosSchedulerDriver.cpp
+ java/jni/org_apache_mesos_state_AbstractState.cpp
+ java/jni/org_apache_mesos_state_LevelDBState.cpp
+ java/jni/org_apache_mesos_state_LogState.cpp
+ java/jni/org_apache_mesos_state_Variable.cpp
+ java/jni/org_apache_mesos_state_ZooKeeperState.cpp
+ java/jni/org_apache_mesos_v1_scheduler_V1Mesos.cpp
+ java/jni/org_apache_mesos_v1_scheduler_V0Mesos.cpp
+ jvm/jvm.cpp
+ jvm/org/apache/log4j.cpp
+ jvm/org/apache/zookeeper.cpp)
+
+ # These are generated and so must be included.
+ set(JAVA_H
+ java/jni/org_apache_mesos_Log.h
+ java/jni/org_apache_mesos_MesosExecutorDriver.h
+ java/jni/org_apache_mesos_MesosSchedulerDriver.h
+ java/jni/org_apache_mesos_state_AbstractState.h
+ java/jni/org_apache_mesos_state_LevelDBState.h
+ java/jni/org_apache_mesos_state_LogState.h
+ java/jni/org_apache_mesos_state_Variable.h
+ java/jni/org_apache_mesos_state_ZooKeeperState.h
+ java/jni/org_apache_mesos_v1_scheduler_V1Mesos.h
+ java/jni/org_apache_mesos_v1_scheduler_V0Mesos.h)
+
+ set(JAVA_CLASSES
+ org.apache.mesos.Log
+ org.apache.mesos.MesosExecutorDriver
+ org.apache.mesos.MesosSchedulerDriver
+ org.apache.mesos.state.AbstractState
+ org.apache.mesos.state.LevelDBState
+ org.apache.mesos.state.LogState
+ org.apache.mesos.state.Variable
+ org.apache.mesos.state.ZooKeeperState
+ org.apache.mesos.v1.scheduler.V1Mesos
+ org.apache.mesos.v1.scheduler.V0Mesos)
+
+ # This generates the header files.
+ if (WIN32)
+ set(COLON ";")
+ else ()
+ set(COLON ":")
+ endif ()
+
+ add_custom_command(
+ OUTPUT ${JAVA_H}
+ COMMAND ${Java_JAVAH_EXECUTABLE} -d java/jni -classpath "${MESOS_JAR}${COLON}${PROTOBUF_JAR}" ${JAVA_CLASSES}
+ DEPENDS mesos-jar make_bin_jni_dir)
+
+ # We include the headers here to establish the dependency
+ # on the above custom command.
+ add_library(
+ mesos-java ${MESOS_DEFAULT_LIBRARY_LINKAGE}
+ ${JAVA_SRC}
+ ${JAVA_H})
+
+ target_link_libraries(
+ mesos-java
+ stout
+ zookeeper
+ ${MESOS_PROTOBUF_TARGET}
+ ${JNI_LIBRARIES})
+
+ target_include_directories(
+ mesos-java PUBLIC
+ ${JNI_INCLUDE_DIRS}
+ ${CMAKE_CURRENT_BINARY_DIR}/java/jni)
+endif ()
+
+
# Configure Mesos files.
########################
configure_file(
@@ -588,7 +724,10 @@ add_dependencies(
# ADD LINKER FLAGS (generates, e.g., -lglog on Linux).
######################################################
-target_link_libraries(${MESOS_LIBS_TARGET} ${MESOS_PROTOBUF_TARGET} ${AGENT_LIBS})
+target_link_libraries(${MESOS_LIBS_TARGET} PUBLIC
+ ${MESOS_PROTOBUF_TARGET}
+ ${AGENT_LIBS}
+ $<$<BOOL:${HAS_JAVA}>:mesos-java>)
# BUILD THE MESOS EXECUTABLES.
##############################
http://git-wip-us.apache.org/repos/asf/mesos/blob/7c6837cc/src/tests/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
index ac8db9c..be49b73 100644
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -263,6 +263,10 @@ add_executable(${TEST_HELPER_TARGET} EXCLUDE_FROM_ALL ${TEST_HELPER_SRC})
target_link_libraries(${MESOS_TESTS_TARGET} ${MESOS_TESTS_LIBS})
target_link_libraries(${TEST_HELPER_TARGET} ${MESOS_TESTS_LIBS})
+target_compile_definitions(
+ ${MESOS_TESTS_TARGET} PRIVATE
+ $<$<BOOL:${HAS_JAVA}>:MESOS_HAS_JAVA>)
+
# ADD BINARY DEPENDENCIES (tells CMake what to compile/build first).
####################################################################
add_dependencies(
[22/42] mesos git commit: CMake: Rewrote libprocess build.
Posted by jo...@apache.org.
CMake: Rewrote libprocess build.
Now that all the dependencies of libprocess are import or interface
libraries with their properties properly defined within their respective
targets, we can update the linking rules of libprocess to point to those
dependent targets. CMake will do the rest for us.
Review: https://reviews.apache.org/r/61293/
Review: https://reviews.apache.org/r/61296/
Review: https://reviews.apache.org/r/61305/
Review: https://reviews.apache.org/r/61316/
Review: https://reviews.apache.org/r/61319/
Review: https://reviews.apache.org/r/61321/
Review: https://reviews.apache.org/r/61325/
Review: https://reviews.apache.org/r/61329/
Review: https://reviews.apache.org/r/61332/
Review: https://reviews.apache.org/r/61335/
Review: https://reviews.apache.org/r/61338/
Review: https://reviews.apache.org/r/61353/
Review: https://reviews.apache.org/r/61358/
Review: https://reviews.apache.org/r/61348/
Review: https://reviews.apache.org/r/61363/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/57cac23b
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/57cac23b
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/57cac23b
Branch: refs/heads/master
Commit: 57cac23bbd4b476b38646adc99937767e4a06a92
Parents: 5d4e105
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Sat Sep 2 11:58:33 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:07 2017 -0700
----------------------------------------------------------------------
3rdparty/libprocess/CMakeLists.txt | 6 -
.../cmake/Process3rdpartyConfigure.cmake | 145 ---------------
.../libprocess/cmake/ProcessConfigure.cmake | 179 -------------------
.../cmake/ProcessTestsConfigure.cmake | 74 --------
3rdparty/libprocess/src/CMakeLists.txt | 60 +++----
3rdparty/libprocess/src/tests/CMakeLists.txt | 46 ++---
6 files changed, 39 insertions(+), 471 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/57cac23b/3rdparty/libprocess/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/CMakeLists.txt b/3rdparty/libprocess/CMakeLists.txt
index 6312e20..38522b1 100755
--- a/3rdparty/libprocess/CMakeLists.txt
+++ b/3rdparty/libprocess/CMakeLists.txt
@@ -13,12 +13,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-include(ProcessTestsConfigure)
-# BUILD THE PROCESS LIBRARY.
-############################
add_subdirectory(src)
-
-# PROCESS TESTING INFRASTRUCTURE.
-#################################
add_subdirectory(src/tests)
http://git-wip-us.apache.org/repos/asf/mesos/blob/57cac23b/3rdparty/libprocess/cmake/Process3rdpartyConfigure.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/cmake/Process3rdpartyConfigure.cmake b/3rdparty/libprocess/cmake/Process3rdpartyConfigure.cmake
deleted file mode 100644
index b9d8dc9..0000000
--- a/3rdparty/libprocess/cmake/Process3rdpartyConfigure.cmake
+++ /dev/null
@@ -1,145 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# DEFINE DIRECTORY STRUCTURE FOR THIRD-PARTY LIBS.
-##################################################
-EXTERNAL("boost" ${BOOST_VERSION} "${MESOS_3RDPARTY_BIN}")
-EXTERNAL("concurrentqueue" ${CONCURRENTQUEUE_VERSION} "${MESOS_3RDPARTY_BIN}")
-EXTERNAL("glog" ${GLOG_VERSION} "${MESOS_3RDPARTY_BIN}")
-EXTERNAL("elfio" ${ELFIO_VERSION} "${MESOS_3RDPARTY_BIN}")
-EXTERNAL("picojson" ${PICOJSON_VERSION} "${MESOS_3RDPARTY_BIN}")
-EXTERNAL("http_parser" ${HTTP_PARSER_VERSION} "${MESOS_3RDPARTY_BIN}")
-EXTERNAL("libev" ${LIBEV_VERSION} "${MESOS_3RDPARTY_BIN}")
-EXTERNAL("libevent" ${LIBEVENT_VERSION} "${MESOS_3RDPARTY_BIN}")
-EXTERNAL("libapr" ${LIBAPR_VERSION} "${MESOS_3RDPARTY_BIN}")
-EXTERNAL("nvml" ${NVML_VERSION} "${MESOS_3RDPARTY_BIN}")
-EXTERNAL("protobuf" ${PROTOBUF_VERSION} "${MESOS_3RDPARTY_BIN}")
-
-if (WIN32)
- # NOTE: We expect cURL and zlib exist on Unix (usually pulled in with a
- # package manager), but Windows has no package manager, so we have to go
- # get it.
- EXTERNAL("curl" ${CURL_VERSION} "${MESOS_3RDPARTY_BIN}")
- EXTERNAL("zlib" ${ZLIB_VERSION} "${MESOS_3RDPARTY_BIN}")
-endif ()
-
-# Intermediate convenience variables for oddly-structured directories.
-set(GLOG_LIB_ROOT ${GLOG_ROOT}-lib/lib)
-set(PROTOBUF_LIB_ROOT ${PROTOBUF_ROOT}-lib/lib)
-set(LIBEV_LIB_ROOT ${LIBEV_ROOT}-lib/lib)
-set(LIBEVENT_LIB_ROOT ${LIBEVENT_ROOT}-lib/lib)
-
-# Convenience variables for include directories of third-party dependencies.
-set(PROCESS_INCLUDE_DIR ${MESOS_3RDPARTY_SRC}/libprocess/include)
-
-set(BOOST_INCLUDE_DIR ${BOOST_ROOT})
-set(CONCURRENTQUEUE_INCLUDE_DIR ${CONCURRENTQUEUE_ROOT})
-set(ELFIO_INCLUDE_DIR ${ELFIO_ROOT})
-set(GPERFTOOLS_INCLUDE_DIR ${GPERFTOOLS}/src)
-set(HTTP_PARSER_INCLUDE_DIR ${HTTP_PARSER_ROOT})
-set(LIBEV_INCLUDE_DIR ${LIBEV_ROOT})
-set(NVML_INCLUDE_DIR ${NVML_ROOT})
-set(PICOJSON_INCLUDE_DIR ${PICOJSON_ROOT})
-
-if (WIN32)
- set(APR_INCLUDE_DIR ${LIBAPR_ROOT}/include ${LIBAPR_ROOT}-build)
- set(CURL_INCLUDE_DIR ${CURL_ROOT}/include)
- set(GLOG_INCLUDE_DIR ${GLOG_ROOT}/src/windows)
- set(PROTOBUF_INCLUDE_DIR ${PROTOBUF_ROOT}/src)
- set(LIBEVENT_INCLUDE_DIR
- ${LIBEVENT_ROOT}/include
- ${LIBEVENT_ROOT}-build/include)
- set(ZLIB_INCLUDE_DIR ${ZLIB_ROOT} ${ZLIB_ROOT}-build)
-else ()
- set(GLOG_INCLUDE_DIR ${GLOG_LIB_ROOT}/include)
- set(PROTOBUF_INCLUDE_DIR ${PROTOBUF_LIB_ROOT}/include)
- set(LIBEVENT_INCLUDE_DIR ${LIBEVENT_LIB_ROOT}/include)
-endif ()
-
-# Convenience variables for `lib` directories of built third-party dependencies.
-set(LIBEV_LIB_DIR ${LIBEV_ROOT}-build/.libs)
-
-if (WIN32)
- set(HTTP_PARSER_LIB_DIR ${HTTP_PARSER_ROOT}-build)
- set(CURL_LIB_DIR ${CURL_ROOT}-build/lib)
- set(GLOG_LIB_DIR ${GLOG_ROOT}-build)
- set(LIBEVENT_LIB_DIR ${LIBEVENT_ROOT}-build/lib)
- set(PROTOBUF_LIB_DIR ${PROTOBUF_ROOT}-build)
- set(ZLIB_LIB_DIR ${ZLIB_ROOT}-build)
-else ()
- set(HTTP_PARSER_LIB_DIR ${HTTP_PARSER_ROOT}-build)
- set(GLOG_LIB_DIR ${GLOG_LIB_ROOT}/lib)
- set(LIBEVENT_LIB_DIR ${LIBEVENT_LIB_ROOT}/lib)
- set(PROTOBUF_LIB_DIR ${PROTOBUF_LIB_ROOT}/lib)
-endif ()
-
-# Convenience variables for "lflags", the symbols we pass to CMake to generate
-# things like `-L/path/to/glog` or `-lglog`.
-set(HTTP_PARSER_LFLAG http_parser)
-set(LIBEV_LFLAG ev)
-set(LIBEVENT_LFLAG event)
-set(GLOG_LFLAG glog)
-
-if (WIN32)
- # Necessary because the lib names for (e.g.) curl are generated incorrectly
- # on Windows. That is, on *nix, the curl binary should be (e.g.) libcurl.so,
- # and on Windows it should be curl.lib. But on Windows, it's actually
- # libcurl.lib. Hence, we have to special case it here because CMake assumes
- # the library names are generated correctly.
- set(CURL_LFLAG libcurl)
-
- set(PROTOBUF_LFLAG libprotobuf)
-
- # The generator expression below appends the letter "d"
- # when building the Debug configuration.
- string(APPEND PROTOBUF_LFLAG $<$<CONFIG:Debug>:d>)
-
- # Zlib generates different libraries depending on the linkage
- # and configuration. i.e.:
- # * For a static Debug build: `zlibstaticd`.
- # * For a shared Release build: `zlib`.
- set(ZLIB_LFLAG zlib)
-
- if (NOT BUILD_SHARED_LIBS)
- string(APPEND ZLIB_LFLAG static)
- endif ()
-
- string(APPEND ZLIB_LFLAG $<$<CONFIG:Debug>:d>)
-
- # Windows requires Dbghelp.lib when linking to glog.
- # NOTE: CMake's dependency graph does not pull in the `Dbghelp` library
- # automatically as the glog dependency is added into Mesos as an
- # "external" project. If we were to, instead, add glog's CMake files
- # to the build system directly (such as, as a git submodule), glog's
- # targets would be inherited.
- set(GLOG_LFLAG glog Dbghelp)
-else ()
- set(CURL_LFLAG curl)
- set(DL_LFLAG dl)
- set(PROTOBUF_LFLAG protobuf)
- set(SASL_LFLAG sasl2)
-endif ()
-
-# Convenience variable for `protoc`, the Protobuf compiler.
-if (NOT WIN32)
- set(PROTOC ${PROTOBUF_LIB_ROOT}/bin/protoc)
-else ()
- set(PROTOC ${PROTOBUF_ROOT}-build/$<CONFIG>/protoc.exe)
-endif ()
-
-# Configure the process library, the last of our third-party libraries.
-#######################################################################
-include(ProcessConfigure)
http://git-wip-us.apache.org/repos/asf/mesos/blob/57cac23b/3rdparty/libprocess/cmake/ProcessConfigure.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/cmake/ProcessConfigure.cmake b/3rdparty/libprocess/cmake/ProcessConfigure.cmake
deleted file mode 100755
index e246eaa..0000000
--- a/3rdparty/libprocess/cmake/ProcessConfigure.cmake
+++ /dev/null
@@ -1,179 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-###############################################################
-# This file exports variables needed to link to third-party libs. These are
-# used throughout the Mesos project.
-#
-# This includes things like:
-# * Components defining the public interface, like which headers we need in
-# order to link to libprocess.
-# * Where to look to find built libraries.
-# * Version information of the third-party libraries in use.
-#
-# This does not include:
-# * Where to find include headers for tests -- the rest of Mesos does not
-# need this information.
-# * Any information about how to build these libraries. That's in
-# libprocess/CMakeLists.txt
-# * Information required to build third-party libraries, wuch as what source
-# files we need to compile libprocess.
-# * Build commands actually used to compile (e.g.) libprocess.
-#
-# Rationale: Autoconf makes linking to third party dependencies as simple as
-# pointing at the underlying makefile. In CMake, this is harder because we do
-# not assume there are Makefiles at all. Thus, it is useful to export variables
-# with things like which header files you need to include to link to third
-# party libraries, and where in the directory tree you need to look to get the
-# actual libraries.
-
-if (ENABLE_SSL)
- find_package(OpenSSL REQUIRED)
-endif ()
-
-set(PROCESS_PACKAGE_VERSION 0.0.1)
-set(PROCESS_PACKAGE_SOVERSION 0)
-set(PROCESS_TARGET process-${PROCESS_PACKAGE_VERSION})
-
-# DEFINE PROCESS LIBRARY DEPENDENCIES. Tells the process library build targets
-# download/configure/build all third-party libraries before attempting to build.
-################################################################################
-set(PROCESS_DEPENDENCIES
- ${PROCESS_DEPENDENCIES}
- ${HTTP_PARSER_TARGET}
- ${CONCURRENTQUEUE_TARGET}
- )
-
-if (NOT ENABLE_LIBEVENT)
- set(PROCESS_DEPENDENCIES ${PROCESS_DEPENDENCIES} ${LIBEV_TARGET})
-else ()
- set(PROCESS_DEPENDENCIES ${PROCESS_DEPENDENCIES} ${LIBEVENT_TARGET})
-endif ()
-
-if (WIN32)
- set(PROCESS_DEPENDENCIES
- ${PROCESS_DEPENDENCIES}
- ${GZIP_TARGET}
- )
-endif ()
-
-# DEFINE THIRD-PARTY INCLUDE DIRECTORIES. Tells compiler toolchain where to get
-# headers for our third party libs (e.g., -I/path/to/glog on Linux).
-###############################################################################
-set(PROCESS_INCLUDE_DIRS
- ${PROCESS_INCLUDE_DIRS}
- ${PROCESS_INCLUDE_DIR}
- )
-
-set(PROCESS_3RDPARTY_INCLUDE_DIRS
- ${PROCESS_3RDPARTY_INCLUDE_DIRS}
- ${HTTP_PARSER_INCLUDE_DIR}
- ${CONCURRENTQUEUE_INCLUDE_DIR}
- )
-
-if (NOT ENABLE_LIBEVENT)
- set(PROCESS_3RDPARTY_INCLUDE_DIRS
- ${PROCESS_3RDPARTY_INCLUDE_DIRS}
- ${LIBEV_INCLUDE_DIR}
- )
-else ()
- set(PROCESS_3RDPARTY_INCLUDE_DIRS
- ${PROCESS_3RDPARTY_INCLUDE_DIRS}
- ${LIBEVENT_INCLUDE_DIR}
- )
-endif ()
-
-if (ENABLE_SSL)
- set(PROCESS_3RDPARTY_INCLUDE_DIRS
- ${PROCESS_3RDPARTY_INCLUDE_DIRS}
- ${OPENSSL_INCLUDE_DIR}
- )
-endif ()
-
-if (HAS_GPERFTOOLS)
- set(PROCESS_3RDPARTY_INCLUDE_DIRS ${PROCESS_3RDPARTY_INCLUDE_DIRS} ${GPERFTOOLS_INCLUDE_DIR})
-endif ()
-
-if (WIN32)
- set(PROCESS_3RDPARTY_INCLUDE_DIRS
- ${PROCESS_3RDPARTY_INCLUDE_DIRS}
- ${ZLIB_INCLUDE_DIR}
- )
-endif ()
-
-# DEFINE THIRD-PARTY LIB INSTALL DIRECTORIES. Used to tell the compiler
-# toolchain where to find our third party libs (e.g., -L/path/to/glog on
-# Linux).
-########################################################################
-set(PROCESS_LIB_DIRS
- ${PROCESS_LIB_DIRS}
- ${HTTP_PARSER_LIB_DIR}
- )
-
-if (NOT ENABLE_LIBEVENT)
- set(PROCESS_LIB_DIRS ${PROCESS_LIB_DIRS} ${LIBEV_LIB_DIR})
-else ()
- set(PROCESS_LIB_DIRS ${PROCESS_LIB_DIRS} ${LIBEVENT_LIB_DIR})
-endif ()
-
-if (WIN32)
- set(PROCESS_LIB_DIRS
- ${PROCESS_LIB_DIRS}
- ${ZLIB_LIB_DIR}
- )
-endif ()
-
-# DEFINE THIRD-PARTY LIBS. Used to generate flags that the linker uses to
-# include our third-party libs (e.g., -lglog on Linux).
-#########################################################################
-find_package(Threads REQUIRED)
-
-set(PROCESS_LIBS
- ${PROCESS_LIBS}
- stout
- ${HTTP_PARSER_LFLAG}
- )
-
-if (NOT ENABLE_LIBEVENT)
- set(PROCESS_LIBS ${PROCESS_LIBS} ${LIBEV_LFLAG})
-else ()
- set(PROCESS_LIBS ${PROCESS_LIBS} ${LIBEVENT_LFLAG})
-endif ()
-
-if (ENABLE_SSL)
- set(PROCESS_LIBS
- ${PROCESS_LIBS}
- ${OPENSSL_LIBRARIES}
- )
-endif ()
-
-if (NOT WIN32)
- find_package(ZLIB REQUIRED)
-
- # TODO(hausdorff): (MESOS-3396) The `LINUX` flag comes from MesosConfigure;
- # when we port the bootstrap script to CMake, we should also copy this
- # logic into .cmake files in the Stout and Process libraries'
- # folders individually.
- if (LINUX)
- set(PROCESS_LIBS ${PROCESS_LIBS} rt)
- endif ()
-
- set(PROCESS_LIBS
- ${PROCESS_LIBS}
- ${ZLIB_LIBRARIES}
- pthread
- )
-endif ()
http://git-wip-us.apache.org/repos/asf/mesos/blob/57cac23b/3rdparty/libprocess/cmake/ProcessTestsConfigure.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/cmake/ProcessTestsConfigure.cmake b/3rdparty/libprocess/cmake/ProcessTestsConfigure.cmake
deleted file mode 100644
index b5454d4..0000000
--- a/3rdparty/libprocess/cmake/ProcessTestsConfigure.cmake
+++ /dev/null
@@ -1,74 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# TODO(andschwa): Remove this when gmock and gtest can be included.
-include(StoutTestsConfigure)
-
-set(
- PROCESS_TESTS_TARGET libprocess-tests
- CACHE STRING "Target we use to refer to tests for the process library")
-
-# DEFINE PROCESS TEST LIBRARY DEPENDENCIES. Tells the process library build
-# tests target download/configure/build all third-party libraries before
-# attempting to build.
-###########################################################################
-set(PROCESS_TEST_DEPENDENCIES
- ${PROCESS_TEST_DEPENDENCIES}
- ${PROCESS_DEPENDENCIES}
- ${PROCESS_TARGET}
- ${GOOGLETEST_TARGET}
- )
-
-# DEFINE THIRD-PARTY INCLUDE DIRECTORIES. Tells compiler toolchain where to get
-# headers for our third party libs (e.g., -I/path/to/glog on Linux).
-###############################################################################
-set(PROCESS_TEST_INCLUDE_DIRS
- ${PROCESS_TEST_INCLUDE_DIRS}
- ${PROCESS_3RDPARTY_INCLUDE_DIRS}
- ${GMOCK_INCLUDE_DIR}
- ${GTEST_INCLUDE_DIR}
- src
- )
-
-set(PROCESS_TEST_INCLUDE_DIRS
- ${PROCESS_TEST_INCLUDE_DIRS}
- ${PROCESS_INCLUDE_DIRS}
- ../ # includes, e.g., decoder.hpp
- )
-
-# DEFINE THIRD-PARTY LIB INSTALL DIRECTORIES. Used to tell the compiler
-# toolchain where to find our third party libs (e.g., -L/path/to/glog on
-# Linux).
-########################################################################
-set(PROCESS_TEST_LIB_DIRS
- ${PROCESS_TEST_LIB_DIRS}
- ${PROCESS_LIB_DIRS}
- ${CMAKE_CURRENT_BINARY_DIR}/.. # libprocess directory.
-
- ${GMOCK_LIB_DIR}
- ${GTEST_LIB_DIR}
- )
-
-# DEFINE THIRD-PARTY LIBS. Used to generate flags that the linker uses to
-# include our third-party libs (e.g., -lglog on Linux).
-#########################################################################
-set(PROCESS_TEST_LIBS
- ${PROCESS_TEST_LIBS}
- ${PROCESS_TARGET}
- ${PROCESS_LIBS}
- ${GMOCK_LFLAG}
- ${GTEST_LFLAG}
- )
http://git-wip-us.apache.org/repos/asf/mesos/blob/57cac23b/3rdparty/libprocess/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/CMakeLists.txt b/3rdparty/libprocess/src/CMakeLists.txt
index ac2846f..348398a 100644
--- a/3rdparty/libprocess/src/CMakeLists.txt
+++ b/3rdparty/libprocess/src/CMakeLists.txt
@@ -14,6 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+# OpenSSL: Cryptography and SSL/TLS Toolkit.
+# https://www.openssl.org
+############################################
+if (ENABLE_SSL)
+ find_package(OpenSSL REQUIRED)
+endif ()
+
+
# SOURCE FILES FOR THE PROCESS LIBRARY.
#######################################
@@ -97,41 +105,25 @@ if (ENABLE_SSL)
endif ()
endif ()
-# INCLUDE DIRECTIVES FOR PROCESS LIBRARY (generates, e.g., -I/path/to/thing
-# on Linux).
-###########################################################################
-include_directories(SYSTEM ${PROCESS_3RDPARTY_INCLUDE_DIRS})
-include_directories(${PROCESS_INCLUDE_DIRS})
-
-# LINKING LIBRARIES BY DIRECTORY (might generate, e.g., -L/path/to/thing on
-# Linux).
-###########################################################################
-link_directories(${PROCESS_LIB_DIRS})
-
-# THE PROCESS LIBRARY (generates, e.g., libprocess.so, etc., on Linux).
-#######################################################################
-add_library(${PROCESS_TARGET} ${PROCESS_SRC})
+add_library(process ${PROCESS_SRC})
-set_target_properties(
- ${PROCESS_TARGET} PROPERTIES
- VERSION ${PROCESS_PACKAGE_VERSION}
- SOVERSION ${PROCESS_PACKAGE_SOVERSION}
- )
-
-add_dependencies(${PROCESS_TARGET} ${PROCESS_DEPENDENCIES})
-
-# ADD LINKER FLAGS (generates, e.g., -lglog on Linux).
-######################################################
-target_link_libraries(${PROCESS_TARGET} ${PROCESS_LIBS})
+target_link_libraries(
+ process PUBLIC
+ stout
+ http_parser
+ $<$<BOOL:${ENABLE_SSL}>:OpenSSL::SSL>
+ $<$<BOOL:${ENABLE_SSL}>:OpenSSL::Crypto>)
-if (ENABLE_LOCK_FREE_RUN_QUEUE)
- target_compile_definitions(${PROCESS_TARGET} PRIVATE LOCK_FREE_RUN_QUEUE)
-endif ()
+target_link_libraries(
+ process PRIVATE
+ concurrentqueue
+ $<IF:$<BOOL:${ENABLE_LIBEVENT}>,libevent,libev>)
-if (ENABLE_LOCK_FREE_EVENT_QUEUE)
- target_compile_definitions(${PROCESS_TARGET} PRIVATE LOCK_FREE_EVENT_QUEUE)
-endif ()
+target_compile_definitions(
+ process PRIVATE
+ $<$<BOOL:${ENABLE_LOCK_FREE_RUN_QUEUE}>:LOCK_FREE_RUN_QUEUE>
+ $<$<BOOL:${ENABLE_LOCK_FREE_EVENT_QUEUE}>:LOCK_FREE_EVENT_QUEUE>
+ $<$<BOOL:${ENABLE_LAST_IN_FIRST_OUT_FIXED_SIZE_SEMAPHORE}>:LAST_IN_FIRST_OUT_FIXED_SIZE_SEMAPHORE>)
-if (ENABLE_LAST_IN_FIRST_OUT_FIXED_SIZE_SEMAPHORE)
- target_compile_definitions(${PROCESS_TARGET} PRIVATE LAST_IN_FIRST_OUT_FIXED_SIZE_SEMAPHORE)
-endif ()
+target_include_directories(process PUBLIC ../include)
+target_include_directories(process PRIVATE .)
http://git-wip-us.apache.org/repos/asf/mesos/blob/57cac23b/3rdparty/libprocess/src/tests/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/tests/CMakeLists.txt b/3rdparty/libprocess/src/tests/CMakeLists.txt
index dd46bd2..c96db50 100644
--- a/3rdparty/libprocess/src/tests/CMakeLists.txt
+++ b/3rdparty/libprocess/src/tests/CMakeLists.txt
@@ -59,45 +59,25 @@ if (ENABLE_SSL)
)
endif ()
+add_library(process-interface INTERFACE)
+target_link_libraries(process-interface INTERFACE process googletest)
+target_include_directories(process-interface INTERFACE ..)
-# ADDITIONAL CPP FLAGS FOR PROCESS TEST BINARY (e.g., -DBUILD_DIR=...).
-#######################################################################
-add_definitions("-DBUILD_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\"")
+add_executable(libprocess-tests EXCLUDE_FROM_ALL ${PROCESS_TESTS_SRC})
+target_link_libraries(libprocess-tests PRIVATE process-interface)
-# INCLUDE DIRECTIVES FOR PROCESS TEST BINARY (generates, e.g., -I/path/to/thing
-# on Linux).
-###############################################################################
-include_directories(${PROCESS_TEST_INCLUDE_DIRS})
+target_compile_definitions(
+ libprocess-tests PRIVATE
+ BUILD_DIR="${CMAKE_CURRENT_BINARY_DIR}")
-# LINKING LIBRARIES BY DIRECTORY (might generate, e.g., -L/path/to/thing on
-# Linux).
-###########################################################################
-link_directories(${PROCESS_TEST_LIB_DIRS})
-
-# THE PROCESS TEST EXECUTABLE (generates, e.g., libprocess-tests, etc., on Linux).
-###############################################################################
-add_executable(${PROCESS_TESTS_TARGET} EXCLUDE_FROM_ALL ${PROCESS_TESTS_SRC})
-
-# ADD LINKER FLAGS (generates, e.g., -lglog on Linux).
-######################################################
-target_link_libraries(${PROCESS_TESTS_TARGET} ${PROCESS_TEST_LIBS})
-
-# ADD BINARY DEPENDENCIES (tells CMake what to compile/build first).
-####################################################################
-add_dependencies(${PROCESS_TESTS_TARGET} ${PROCESS_TEST_DEPENDENCIES})
-
-# ADDITIONAL EXECUTABLE(s).
-###########################
add_executable(test-linkee EXCLUDE_FROM_ALL test_linkee.cpp)
-target_link_libraries(test-linkee ${PROCESS_TEST_LIBS})
-add_dependencies(${PROCESS_TESTS_TARGET} test-linkee)
+target_link_libraries(test-linkee PRIVATE process-interface)
+add_dependencies(libprocess-tests test-linkee)
if (ENABLE_SSL)
add_executable(ssl-client EXCLUDE_FROM_ALL ssl_client.cpp)
- target_link_libraries(ssl-client ${PROCESS_TEST_LIBS})
- add_dependencies(${PROCESS_TESTS_TARGET} ssl-client)
+ target_link_libraries(ssl-client PRIVATE process-interface)
+ add_dependencies(libprocess-tests ssl-client)
endif ()
-# ADD TEST TARGET (runs when you do, e.g., `make check`).
-#########################################################
-add_test(NAME ProcessTests COMMAND ${PROCESS_TESTS_TARGET})
+add_test(NAME ProcessTests COMMAND libprocess-tests)
[37/42] mesos git commit: CMake: Refactored build system.
Posted by jo...@apache.org.
CMake: Refactored build system.
This commit deletes extraneous CMake code. With a proper CMake
dependency graph, CMake automatically calculates the correct compiler
and linker options based on the traversal of the graph, and the
properties of each target. With the correct importing of the 3rdparty
dependencies, this allows us to remove all uses of deprecated CMake
commands such as `include_directories`, `link_directories`, and
`link_libraries`. These commands rely on setting directory-wide
side-effects, unlike their explicit `target_include_directories`
counterparts, which instead add the information to the dependency graph.
By utilizing CMake's dependency graph, most uses of `add_dependencies`
were removed, as an implicit dependency is created when
`target_link_libraries` is used. Note that there are explicit cases of
manually dependencies, such as module libraries which are not linked and
therefore are not automatically added to the graph.
Furthermore, superfluous variables were removed. Due to how the original
system was written (based on copying a working template), many variables
were introduced that contained single items, such that the declaration
and interpolation of the variable became far more verbose than simply
using the contents directly. Variables holding target names were also
removed, as they were redundant. See the changes to
`src/master/CMakeLists.txt` for an example of an executable's build
going from twelve logical lines of code to two.
"Configuration" files such as `AgentConfigure.cmake`, were deleted in
their entirety, because the information they provided was redundant when
using the CMake dependency graph. The only CMake configuration files
remaining are for actual project configuration.
Review: https://reviews.apache.org/r/61753/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/d10fd9b8
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/d10fd9b8
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/d10fd9b8
Branch: refs/heads/master
Commit: d10fd9b8aa1f0bcdd596fb8e6d37e0629d9e8174
Parents: 4a430e3
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Thu Aug 17 15:39:16 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:09 2017 -0700
----------------------------------------------------------------------
CMakeLists.txt | 4 -
cmake/CompilationConfigure.cmake | 1 +
cmake/MesosConfigure.cmake | 81 -------
src/CMakeLists.txt | 266 +++++++++-------------
src/checks/CMakeLists.txt | 29 +--
src/cli/CMakeLists.txt | 29 +--
src/docker/CMakeLists.txt | 31 +--
src/examples/CMakeLists.txt | 199 +++++-----------
src/examples/cmake/ExamplesConfigure.cmake | 51 -----
src/launcher/CMakeLists.txt | 49 +---
src/local/CMakeLists.txt | 29 +--
src/log/CMakeLists.txt | 29 +--
src/master/CMakeLists.txt | 36 +--
src/master/cmake/MasterConfigure.cmake | 69 ------
src/slave/CMakeLists.txt | 29 +--
src/slave/cmake/AgentConfigure.cmake | 85 -------
src/slave/container_loggers/CMakeLists.txt | 35 +--
src/slave/containerizer/mesos/CMakeLists.txt | 58 +----
src/slave/qos_controllers/CMakeLists.txt | 24 +-
src/slave/resource_estimators/CMakeLists.txt | 25 +-
src/tests/CMakeLists.txt | 189 +++++++--------
src/tests/cmake/MesosTestsConfigure.cmake | 96 --------
src/usage/CMakeLists.txt | 19 +-
23 files changed, 333 insertions(+), 1130 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/d10fd9b8/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 797fe2c..b506c78 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,10 +39,6 @@ set(MESOS_PACKAGE_SOVERSION 0)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/3rdparty/cmake)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/src/cmake)
-list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/src/examples/cmake)
-list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/src/master/cmake)
-list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/src/slave/cmake)
-list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/src/tests/cmake)
# Macros.
include(Versions)
http://git-wip-us.apache.org/repos/asf/mesos/blob/d10fd9b8/cmake/CompilationConfigure.cmake
----------------------------------------------------------------------
diff --git a/cmake/CompilationConfigure.cmake b/cmake/CompilationConfigure.cmake
index 8a94cd8..9aca1ca 100644
--- a/cmake/CompilationConfigure.cmake
+++ b/cmake/CompilationConfigure.cmake
@@ -26,6 +26,7 @@ else ()
endif ()
option(BUILD_SHARED_LIBS "Build shared libraries." ${DEFAULT_BUILD_SHARED_LIBS})
+set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
option(ENABLE_JAVA "Build Java components. Warning: this is SLOW." OFF)
if (ENABLE_JAVA)
http://git-wip-us.apache.org/repos/asf/mesos/blob/d10fd9b8/cmake/MesosConfigure.cmake
----------------------------------------------------------------------
diff --git a/cmake/MesosConfigure.cmake b/cmake/MesosConfigure.cmake
old mode 100755
new mode 100644
index 93a85e5..c5435f8
--- a/cmake/MesosConfigure.cmake
+++ b/cmake/MesosConfigure.cmake
@@ -50,13 +50,6 @@ enable_testing()
#####################
include(CompilationConfigure)
-if (BUILD_SHARED_LIBS)
- set(MESOS_DEFAULT_LIBRARY_LINKAGE "SHARED")
- set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
-else ()
- set(MESOS_DEFAULT_LIBRARY_LINKAGE "STATIC")
-endif ()
-
# DEFINE DIRECTORY STRUCTURE MESOS PROJECT.
###########################################
set(MESOS_SRC_DIR ${CMAKE_SOURCE_DIR}/src)
@@ -94,80 +87,6 @@ add_custom_target(
DEPENDS make_bin_src_dir
COMMAND ${CMAKE_COMMAND} -E make_directory ${MESOS_BIN_SRC_DIR}/java/jni)
-# CONFIGURE AGENT.
-##################
-include(AgentConfigure)
-
-# CONFIGURE MASTER.
-##################
-include(MasterConfigure)
-
-# CONFIGURE EXAMPLE MODULES AND FRAMEWORKS.
-###########################################
-include(ExamplesConfigure)
-
-# DEFINE MESOS BUILD TARGETS.
-#############################
-set(
- AGENT_TARGET mesos-agent
- CACHE STRING "Target we use to refer to agent executable")
-
-set(
- DEFAULT_EXECUTOR_TARGET mesos-default-executor
- CACHE STRING "Target for the default executor")
-
-set(
- MESOS_CONTAINERIZER mesos-containerizer
- CACHE STRING "Target for containerizer")
-
-set(
- MESOS_DOCKER_EXECUTOR mesos-docker-executor
- CACHE STRING "Target for docker executor")
-
-set(
- MESOS_EXECUTOR mesos-executor
- CACHE STRING "Target for command executor")
-
-set(
- MESOS_FETCHER mesos-fetcher
- CACHE STRING "Target for fetcher")
-
-if (NOT WIN32)
- set(
- MESOS_IO_SWITCHBOARD mesos-io-switchboard
- CACHE STRING "Target for the IO switchboard")
-
- set(
- MESOS_CNI_PORT_MAPPER mesos-cni-port-mapper
- CACHE STRING "Target for the CNI port-mapper plugin")
-endif ()
-
-set(
- MESOS_MASTER mesos-master
- CACHE STRING "Target for master")
-
-set(
- MESOS_TCP_CONNECT mesos-tcp-connect
- CACHE STRING "Target for tcp-connect")
-
-set(
- MESOS_USAGE mesos-usage
- CACHE STRING "Target for usage")
-
-# MESOS LIBRARY CONFIGURATION.
-##############################
-set(
- MESOS_TARGET mesos-and-binaries
- CACHE STRING "Target that includes libmesos and all required binaries")
-
-add_custom_target(${MESOS_TARGET} ALL)
-
-set(MESOS_LIBS_TARGET mesos-${MESOS_PACKAGE_VERSION}
- CACHE STRING "Library of master and agent code")
-
-set(MESOS_PROTOBUF_TARGET mesos-protobufs
- CACHE STRING "Library of protobuf definitions used by Mesos")
-
# MESOS SCRIPT CONFIGURATION.
#############################
# Define variables required to configure these scripts,
http://git-wip-us.apache.org/repos/asf/mesos/blob/d10fd9b8/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5edfb6f..18fb4c1 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -74,23 +74,29 @@ PROTOC_GENERATE(INTERNAL TARGET master/registry)
# BUILD PROTOBUFS.
##################
+# This must always be built as a shared library because of the following issue:
+# https://github.com/google/protobuf/issues/1941
+#
+# Unfortunately, this is not supported on Windows. But because modules are not
+# yet supported either, for now we can build it statically.
+if (WIN32)
+ set(MESOS_PROTOBUFS_LINKAGE STATIC)
+else ()
+ set(MESOS_PROTOBUFS_LINKAGE SHARED)
+endif ()
+
add_library(
- ${MESOS_PROTOBUF_TARGET}
- ${MESOS_DEFAULT_LIBRARY_LINKAGE}
+ mesos-protobufs ${MESOS_PROTOBUFS_LINKAGE}
${PUBLIC_PROTOBUF_SRC}
- ${INTERNAL_PROTOBUF_SRC}
- )
+ ${INTERNAL_PROTOBUF_SRC})
-target_link_libraries(${MESOS_PROTOBUF_TARGET} PUBLIC protobuf)
+target_link_libraries(mesos-protobufs PUBLIC protobuf)
target_include_directories(
- ${MESOS_PROTOBUF_TARGET} PUBLIC
- ${MESOS_PROTOBUF_HEADER_INCLUDE_DIRS})
+ mesos-protobufs PUBLIC ${MESOS_PROTOBUF_HEADER_INCLUDE_DIRS})
if (WIN32)
# Disable all compiler warnings on Protocol Buffers source.
- set_target_properties(
- ${MESOS_PROTOBUF_TARGET}
- PROPERTIES COMPILE_FLAGS "/w")
+ target_compile_options(mesos-protobufs PRIVATE "/w")
endif ()
@@ -211,22 +217,20 @@ if (HAS_JAVA)
# We include the headers here to establish the dependency
# on the above custom command.
- add_library(
- mesos-java ${MESOS_DEFAULT_LIBRARY_LINKAGE}
- ${JAVA_SRC}
- ${JAVA_H})
+ add_library(mesos-java ${JAVA_SRC} ${JAVA_H})
target_link_libraries(
mesos-java
- stout
+ mesos-protobufs
+ process
zookeeper
- ${MESOS_PROTOBUF_TARGET}
${JNI_LIBRARIES})
target_include_directories(
mesos-java PUBLIC
${JNI_INCLUDE_DIRS}
- ${CMAKE_CURRENT_BINARY_DIR}/java/jni)
+ ${CMAKE_CURRENT_BINARY_DIR}/java/jni
+ ${MESOS_PUBLIC_INCLUDE_DIR})
endif ()
@@ -234,8 +238,8 @@ endif ()
########################
configure_file(
${MESOS_PUBLIC_INCLUDE_DIR}/mesos/version.hpp.in
- ${MESOS_BIN_INCLUDE_DIR}/mesos/version.hpp
- )
+ ${MESOS_BIN_INCLUDE_DIR}/mesos/version.hpp)
+
# SOURCE FILES FOR THE MESOS LIBRARY.
#####################################
@@ -284,8 +288,7 @@ set(AGENT_SRC
slave/containerizer/mesos/provisioner/docker/puller.cpp
slave/containerizer/mesos/provisioner/docker/registry_puller.cpp
slave/containerizer/mesos/provisioner/docker/store.cpp
- slave/resource_estimators/noop.cpp
- )
+ slave/resource_estimators/noop.cpp)
if (NOT WIN32)
set(AGENT_SRC
@@ -298,40 +301,34 @@ if (NOT WIN32)
slave/containerizer/mesos/isolators/network/cni/spec.cpp
slave/containerizer/mesos/isolators/posix/disk.cpp
slave/containerizer/mesos/isolators/posix/rlimits.cpp
- slave/containerizer/mesos/isolators/volume/sandbox_path.cpp
- )
+ slave/containerizer/mesos/isolators/volume/sandbox_path.cpp)
endif ()
set(APPC_SRC
- appc/spec.cpp
- )
+ appc/spec.cpp)
set(AUTHENTICATION_SRC
authentication/http/basic_authenticator_factory.cpp
- authentication/http/combined_authenticator.cpp
- )
+ authentication/http/combined_authenticator.cpp)
if (NOT WIN32)
set(AUTHENTICATION_SRC
${AUTHENTICATION_SRC}
authentication/cram_md5/authenticatee.cpp
authentication/cram_md5/authenticator.cpp
- authentication/cram_md5/auxprop.cpp
- )
+ authentication/cram_md5/auxprop.cpp)
endif ()
if (ENABLE_SSL)
set(AUTHENTICATION_SRC
${AUTHENTICATION_SRC}
- authentication/executor/jwt_secret_generator.cpp
- )
+ authentication/executor/jwt_secret_generator.cpp)
endif ()
set(AUTHORIZER_SRC
authorizer/acls.cpp
authorizer/authorizer.cpp
- authorizer/local/authorizer.cpp
- )
+ authorizer/local/authorizer.cpp)
set(COMMON_SRC
common/attributes.cpp
@@ -344,42 +341,33 @@ set(COMMON_SRC
common/roles.cpp
common/type_utils.cpp
common/validation.cpp
- common/values.cpp
- )
+ common/values.cpp)
set(DOCKER_SRC
docker/docker.cpp
- docker/spec.cpp
- )
+ docker/spec.cpp)
set(EXECUTOR_SRC
exec/exec.cpp
executor/executor.cpp
- executor/v0_v1executor.cpp
- )
+ executor/v0_v1executor.cpp)
set(FILES_SRC
- files/files.cpp
- )
+ files/files.cpp)
set(HDFS_SRC
- ${HDFS_SRC}
- hdfs/hdfs.cpp
- )
+ hdfs/hdfs.cpp)
set(HEALTH_CHECK_SRC
checks/checker.cpp
checks/checker_process.cpp
- checks/health_checker.cpp
- )
+ checks/health_checker.cpp)
set(INTERNAL_SRC
internal/devolve.cpp
- internal/evolve.cpp
- )
+ internal/evolve.cpp)
set(LINUX_SRC
- ${LINUX_SRC}
linux/capabilities.cpp
linux/cgroups.cpp
linux/fs.cpp
@@ -419,15 +407,12 @@ set(LINUX_SRC
slave/containerizer/mesos/isolators/volume/secret.cpp
slave/containerizer/mesos/provisioner/backends/aufs.cpp
slave/containerizer/mesos/provisioner/backends/bind.cpp
- slave/containerizer/mesos/provisioner/backends/overlay.cpp
- )
+ slave/containerizer/mesos/provisioner/backends/overlay.cpp)
set(LOCAL_SRC
- local/local.cpp
- )
+ local/local.cpp)
set(LOG_SRC
- ${LOG_SRC}
log/catchup.cpp
log/consensus.cpp
log/coordinator.cpp
@@ -440,16 +425,13 @@ set(LOG_SRC
log/tool/benchmark.cpp
log/tool/initialize.cpp
log/tool/read.cpp
- log/tool/replica.cpp
- )
+ log/tool/replica.cpp)
set(LOGGING_SRC
logging/flags.cpp
- logging/logging.cpp
- )
+ logging/logging.cpp)
set(MASTER_SRC
- ${MASTER_SRC}
master/flags.cpp
master/http.cpp
master/maintenance.cpp
@@ -471,26 +453,20 @@ set(MASTER_SRC
master/contender/zookeeper.cpp
master/detector/detector.cpp
master/detector/standalone.cpp
- master/detector/zookeeper.cpp
- )
+ master/detector/zookeeper.cpp)
set(MESSAGES_SRC
- ${MESSAGES_SRC}
- messages/messages.cpp
- )
+ messages/messages.cpp)
set(MODULE_SRC
hook/manager.cpp
- module/manager.cpp
- )
+ module/manager.cpp)
set(OCI_SRC
- oci/spec.cpp
- )
+ oci/spec.cpp)
set(POSIX_SRC
- posix/rlimits.cpp
- )
+ posix/rlimits.cpp)
set(RESOURCE_PROVIDER_SRC
resource_provider/daemon.cpp
@@ -499,22 +475,17 @@ set(RESOURCE_PROVIDER_SRC
resource_provider/local.cpp
resource_provider/manager.cpp
resource_provider/validation.cpp
- resource_provider/storage/provider.cpp
- )
+ resource_provider/storage/provider.cpp)
set(SCHEDULER_SRC
sched/sched.cpp
- scheduler/scheduler.cpp
- )
+ scheduler/scheduler.cpp)
set(SECRET_SRC
- secret/resolver.cpp
- )
+ secret/resolver.cpp)
set(STATE_SRC
- ${STATE_SRC}
- state/in_memory.cpp
- )
+ state/in_memory.cpp)
if (NOT WIN32)
set(STATE_SRC
@@ -528,53 +499,43 @@ set(URI_SRC
uri/fetcher.cpp
uri/utils.cpp
uri/fetchers/copy.cpp
- uri/fetchers/curl.cpp
- )
+ uri/fetchers/curl.cpp)
if (NOT WIN32)
set(URI_SRC
${URI_SRC}
uri/fetchers/docker.cpp
- uri/fetchers/hadoop.cpp
- )
+ uri/fetchers/hadoop.cpp)
endif ()
set(USAGE_SRC
- usage/usage.cpp
- )
+ usage/usage.cpp)
set(V1_SRC
v1/attributes.cpp
v1/mesos.cpp
v1/resources.cpp
- v1/values.cpp
- )
+ v1/values.cpp)
set(VERSION_SRC
- version/version.cpp
- )
+ version/version.cpp)
set(WATCHER_SRC
- watcher/whitelist_watcher.cpp
- )
+ watcher/whitelist_watcher.cpp)
set(WIN32_SRC
- ${WIN32_SRC}
slave/containerizer/mesos/isolators/environment_secret.cpp
slave/containerizer/mesos/isolators/filesystem/posix.cpp
- slave/containerizer/mesos/isolators/filesystem/windows.cpp
- )
+ slave/containerizer/mesos/isolators/filesystem/windows.cpp)
set(ZOOKEEPER_SRC
zookeeper/authentication.cpp
zookeeper/contender.cpp
zookeeper/detector.cpp
zookeeper/zookeeper.cpp
- zookeeper/group.cpp
- )
+ zookeeper/group.cpp)
set(MESOS_SRC
- ${MESOS_SRC}
${AGENT_SRC}
${APPC_SRC}
${AUTHENTICATION_SRC}
@@ -608,8 +569,7 @@ if (NOT WIN32)
${MESOS_SRC}
${HDFS_SRC}
${LOG_SRC}
- ${POSIX_SRC}
- )
+ ${POSIX_SRC})
endif ()
# Include source for linux build.
@@ -622,12 +582,6 @@ if (WIN32)
set(MESOS_SRC ${MESOS_SRC} ${WIN32_SRC})
endif ()
-# INCLUDE DIRECTIVES FOR MESOS LIBRARY (generates, e.g., -I/path/to/thing
-# on Linux).
-#########################################################################
-include_directories(SYSTEM ${AGENT_3RDPARTY_INCLUDE_DIRS})
-include_directories(${AGENT_INCLUDE_DIRS})
-
# Generate all binaries in the same folder.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/src)
if (WIN32)
@@ -642,69 +596,63 @@ if (WIN32)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/src/.libs)
endif ()
-# LINKING LIBRARIES BY DIRECTORY (might generate, e.g., -L/path/to/thing on
-# Linux).
-###########################################################################
-link_directories(${AGENT_LIB_DIRS})
-# THE MESOS LIBRARY (generates, e.g., libmesos.so, etc., on Linux).
-###################################################################
-add_library(${MESOS_LIBS_TARGET} ${MESOS_DEFAULT_LIBRARY_LINKAGE} ${MESOS_SRC})
+# THE MESOS LIBRARY (generates, e.g., libmesos.so on Linux).
+############################################################
+add_library(mesos ${MESOS_SRC})
+
set_target_properties(
- ${MESOS_LIBS_TARGET} PROPERTIES
+ mesos PROPERTIES
VERSION ${MESOS_PACKAGE_VERSION}
- SOVERSION ${MESOS_PACKAGE_SOVERSION}
- )
+ SOVERSION ${MESOS_PACKAGE_SOVERSION})
-if (ENABLE_PRECOMPILED_HEADERS)
- # These exluded headers either cause namespace resolution issues or
- # are problematic for incremental builds.
- set_property(DIRECTORY
- PROPERTY COTIRE_PREFIX_HEADER_IGNORE_PATH
- "${CMAKE_SOURCE_DIR}/include/mesos/authentication/http/basic_authenticator_factory.hpp"
- "${CMAKE_SOURCE_DIR}/include/mesos/authentication/http/combined_authenticator.hpp"
- "${CMAKE_SOURCE_DIR}/src/sched/constants.hpp"
- "${CMAKE_SOURCE_DIR}/src/sched/flags.hpp"
- "${CMAKE_BINARY_DIR}/src/common/build_config.hpp")
-
- # For now, we include agent headers, because the Windows build currently
- # does not build all of the Mesos master (only enough for testing the agent).
- set_property(DIRECTORY
- PROPERTY COTIRE_PREFIX_HEADER_INCLUDE_PATH
- "${AGENT_INCLUDE_DIRS};${AGENT_3RDPARTY_INCLUDE_DIRS}")
-
- cotire(${MESOS_LIBS_TARGET})
+target_include_directories(
+ mesos PUBLIC
+ ${MESOS_PUBLIC_INCLUDE_DIR}
+
+ # Contains (e.g.) compiled *.pb.h files.
+ ${MESOS_BIN_INCLUDE_DIR}
+ ${MESOS_BIN_INCLUDE_DIR}/mesos
+ ${MESOS_BIN_SRC_DIR}
+ ${MESOS_SRC_DIR})
+
+target_link_libraries(
+ mesos PUBLIC
+ process
+ zookeeper
+ mesos-protobufs
+ $<$<PLATFORM_ID:Linux>:nvml>
+ $<$<BOOL:${HAS_JAVA}>:mesos-java>)
+
+if (NOT WIN32)
+ target_link_libraries(mesos PUBLIC leveldb sasl2)
endif ()
-# ADD LIBRARY DEPENDENCIES (tells CMake what to compile/build first).
-####################################################################
-add_dependencies(${MESOS_TARGET} ${MESOS_LIBS_TARGET})
-add_dependencies(
- ${MESOS_LIBS_TARGET}
- ${AGENT_DEPENDENCIES}
- )
+if (ENABLE_PRECOMPILED_HEADERS)
+ set_target_properties(
+ mesos PROPERTIES
+ COTIRE_ADD_UNITY_BUILD FALSE
+ COTIRE_PREFIX_HEADER_INCLUDE_PATH "${CMAKE_SOURCE_DIR}/3rdparty;${CMAKE_BINARY_DIR}/3rdparty")
+
+ cotire(mesos)
+endif ()
-# ADD LINKER FLAGS (generates, e.g., -lglog on Linux).
-######################################################
-target_link_libraries(${MESOS_LIBS_TARGET} PUBLIC
- ${MESOS_PROTOBUF_TARGET}
- ${AGENT_LIBS}
- $<$<BOOL:${HAS_JAVA}>:mesos-java>)
# BUILD THE MESOS EXECUTABLES.
##############################
-add_subdirectory(checks/)
-add_subdirectory(cli/)
-add_subdirectory(docker/)
-add_subdirectory(examples/)
-add_subdirectory(launcher/)
-add_subdirectory(local/)
-add_subdirectory(log/)
-add_subdirectory(master/)
-add_subdirectory(slave/)
-add_subdirectory(slave/containerizer/mesos/)
-add_subdirectory(usage/)
+add_subdirectory(checks)
+add_subdirectory(cli)
+add_subdirectory(docker)
+add_subdirectory(examples)
+add_subdirectory(launcher)
+add_subdirectory(local)
+add_subdirectory(log)
+add_subdirectory(master)
+add_subdirectory(slave)
+add_subdirectory(slave/containerizer/mesos)
+add_subdirectory(usage)
+
# BUILD THE MESOS TESTS.
-#########################################################
-add_subdirectory(tests/)
+########################
+add_subdirectory(tests)
http://git-wip-us.apache.org/repos/asf/mesos/blob/d10fd9b8/src/checks/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/checks/CMakeLists.txt b/src/checks/CMakeLists.txt
index 4854b27..a3a6aed 100644
--- a/src/checks/CMakeLists.txt
+++ b/src/checks/CMakeLists.txt
@@ -14,32 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# THE MESOS TCP CONNECT SOURCE.
-###############################
-set(MESOS_TCP_CONNECT_SRC
- ${MESOS_TCP_CONNECT_SRC}
- tcp_connect.cpp
- )
-
-# INCLUDE DIRECTIVES FOR MESOS TCP CONNECT EXECUTABLE (generates, e.g.,
-# -I/path/to/thing on Linux).
-#######################################################################
-include_directories(${AGENT_INCLUDE_DIRS})
-
-# LINKING LIBRARIES BY DIRECTORY (might generate, e.g., -L/path/to/thing on
-# Linux).
-###########################################################################
-link_directories(${AGENT_LIB_DIRS})
-
# THE MESOS TCP CONNECT EXECUTABLE.
###################################
-add_executable(${MESOS_TCP_CONNECT} ${MESOS_TCP_CONNECT_SRC})
-
-# ADD LINKER FLAGS (generates, e.g., -lglog on Linux).
-######################################################
-target_link_libraries(${MESOS_TCP_CONNECT} ${AGENT_LIBS} ${MESOS_LIBS_TARGET})
-
-# ADD BINARY DEPENDENCIES (tells CMake what to compile/build first).
-####################################################################
-add_dependencies(${MESOS_TARGET} ${MESOS_TCP_CONNECT})
-add_dependencies(${MESOS_TCP_CONNECT} ${MESOS_LIBS_TARGET})
+add_executable(mesos-tcp-connect tcp_connect.cpp)
+target_link_libraries(mesos-tcp-connect PRIVATE mesos)
http://git-wip-us.apache.org/repos/asf/mesos/blob/d10fd9b8/src/cli/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/cli/CMakeLists.txt b/src/cli/CMakeLists.txt
index 056d1d7..06d9e62 100644
--- a/src/cli/CMakeLists.txt
+++ b/src/cli/CMakeLists.txt
@@ -16,28 +16,9 @@
# TODO(josephw): Enable this on Windows after sorting out the dependencies.
if (NOT WIN32)
-
-set(MESOS_EXECUTE_TARGET mesos-execute
- CACHE STRING "Utility used to schedule and run a command in a mesos cluster.")
-
-# THE MESOS-EXECUTE SOURCE.
-###########################
-set(MESOS_EXECUTE_SRC
- ${MESOS_EXECUTE_SRC}
- execute.cpp
- )
-
-# THE MESOS EXECUTE.
-#######################
-add_executable(${MESOS_EXECUTE_TARGET} ${MESOS_EXECUTE_SRC})
-
-# ADD LINKER FLAGS (generates, e.g., -lglog on Linux).
-######################################################
-target_link_libraries(${MESOS_EXECUTE_TARGET} ${MESOS_LIBS_TARGET})
-
-# ADD BINARY DEPENDENCIES (tells CMake what to compile/build first).
-####################################################################
-add_dependencies(${MESOS_TARGET} ${MESOS_EXECUTE_TARGET})
-add_dependencies(${MESOS_EXECUTE_TARGET} ${MESOS_LIBS_TARGET})
-
+ # THE MESOS EXECUTE.
+ # Utility used to schedule and run a command in a mesos cluster.
+ ################################################################
+ add_executable(mesos-execute execute.cpp)
+ target_link_libraries(mesos-execute PRIVATE mesos)
endif ()
http://git-wip-us.apache.org/repos/asf/mesos/blob/d10fd9b8/src/docker/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/docker/CMakeLists.txt b/src/docker/CMakeLists.txt
index 2d7c30d..1196664 100644
--- a/src/docker/CMakeLists.txt
+++ b/src/docker/CMakeLists.txt
@@ -14,34 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-
-# THE DOCKER EXECUTOR SOURCE.
-#############################
-set(DOCKER_EXECUTOR_SRC
- ${DOCKER_EXECUTOR_SRC}
- executor.cpp
- )
-
-# INCLUDE DIRECTIVES FOR DOCKER EXECUTOR EXECUTABLE (generates, e.g.,
-# -I/path/to/thing on Linux).
-#####################################################################
-include_directories(SYSTEM ${AGENT_3RDPARTY_INCLUDE_DIRS})
-include_directories(${AGENT_INCLUDE_DIRS})
-
-# LINKING LIBRARIES BY DIRECTORY (might generate, e.g., -L/path/to/thing on
-# Linux).
-###########################################################################
-link_directories(${AGENT_LIB_DIRS})
-
# THE DOCKER EXECUTOR EXECUTABLE.
#################################
-add_executable(${MESOS_DOCKER_EXECUTOR} ${DOCKER_EXECUTOR_SRC})
-
-# ADD LINKER FLAGS (generates, e.g., -lglog on Linux).
-######################################################
-target_link_libraries(${MESOS_DOCKER_EXECUTOR} ${AGENT_LIBS} ${MESOS_LIBS_TARGET})
-
-# ADD BINARY DEPENDENCIES (tells CMake what to compile/build first).
-####################################################################
-add_dependencies(${MESOS_TARGET} ${MESOS_DOCKER_EXECUTOR})
-add_dependencies(${MESOS_DOCKER_EXECUTOR} ${MESOS_LIBS_TARGET})
+add_executable(mesos-docker-executor executor.cpp)
+target_link_libraries(mesos-docker-executor PRIVATE mesos)
http://git-wip-us.apache.org/repos/asf/mesos/blob/d10fd9b8/src/examples/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/examples/CMakeLists.txt b/src/examples/CMakeLists.txt
index e8b7ea4..d4f1af4 100644
--- a/src/examples/CMakeLists.txt
+++ b/src/examples/CMakeLists.txt
@@ -14,145 +14,72 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# Test module sources.
-######################
-set(TEST_ALLOCATOR_SRC test_allocator_module.cpp)
-set(TEST_ANONYMOUS_SRC test_anonymous_module.cpp)
-set(TEST_AUTHENTICATION_SRC test_authentication_modules.cpp)
-set(TEST_AUTHORIZER_SRC test_authorizer_module.cpp)
-set(TEST_CONTAINER_LOGGER_SRC test_container_logger_module.cpp)
-set(TEST_EXAMPLEMODULE_SRC example_module_impl.cpp)
-set(TEST_HOOK_SRC test_hook_module.cpp)
-set(TEST_HTTPAUTHENTICATOR_SRC test_http_authenticator_module.cpp)
-set(TEST_ISOLATOR_SRC test_isolator_module.cpp)
-set(TEST_MASTER_CONTENDER_SRC test_master_contender_module.cpp)
-set(TEST_MASTER_DETECTOR_SRC test_master_detector_module.cpp)
-set(TEST_QOS_CONTROLLER_SRC test_qos_controller_module.cpp)
-set(TEST_RESOURCE_ESTIMATOR_SRC test_resource_estimator_module.cpp)
-
-
-# Example framework and executor sources.
-#########################################
-set(BALLOON_EXECUTOR_SRC balloon_executor.cpp)
-set(BALLOON_FRAMEWORK_SRC balloon_framework.cpp)
-set(DISK_FULL_FRAMEWORK_SRC disk_full_framework.cpp)
-set(DOCKER_NO_EXECUTOR_FRAMEWORK_SRC docker_no_executor_framework.cpp)
-set(DYNAMIC_RESERVATION_FRAMEWORK_SRC dynamic_reservation_framework.cpp)
-set(LOAD_GENERATOR_FRAMEWORK_SRC load_generator_framework.cpp)
-set(LONG_LIVED_EXECUTOR_SRC long_lived_executor.cpp)
-set(LONG_LIVED_FRAMEWORK_SRC long_lived_framework.cpp)
-set(NO_EXECUTOR_FRAMEWORK_SRC no_executor_framework.cpp)
-set(PERSISTENT_VOLUME_FRAMEWORK_SRC persistent_volume_framework.cpp)
-set(TEST_EXECUTOR_SRC test_executor.cpp)
-set(TEST_FRAMEWORK_SRC test_framework.cpp)
-set(TEST_HTTP_EXECUTOR_SRC test_http_executor.cpp)
-set(TEST_HTTP_FRAMEWORK_SRC test_http_framework.cpp)
-
-
-# Build the test modules.
-#########################
-# NOTE: Modules are not supported on Windows.
-if (NOT WIN32)
- add_library(${TEST_ALLOCATOR} SHARED EXCLUDE_FROM_ALL ${TEST_ALLOCATOR_SRC})
- add_library(${TEST_ANONYMOUS} SHARED EXCLUDE_FROM_ALL ${TEST_ANONYMOUS_SRC})
- add_library(${TEST_AUTHENTICATION} SHARED EXCLUDE_FROM_ALL ${TEST_AUTHENTICATION_SRC})
- add_library(${TEST_AUTHORIZER} SHARED EXCLUDE_FROM_ALL ${TEST_AUTHORIZER_SRC})
- add_library(${TEST_CONTAINER_LOGGER} SHARED EXCLUDE_FROM_ALL ${TEST_CONTAINER_LOGGER_SRC})
- add_library(${TEST_EXAMPLEMODULE} SHARED EXCLUDE_FROM_ALL ${TEST_EXAMPLEMODULE_SRC})
- add_library(${TEST_HOOK} SHARED EXCLUDE_FROM_ALL ${TEST_HOOK_SRC})
- add_library(${TEST_HTTPAUTHENTICATOR} SHARED EXCLUDE_FROM_ALL ${TEST_HTTPAUTHENTICATOR_SRC})
- add_library(${TEST_ISOLATOR} SHARED EXCLUDE_FROM_ALL ${TEST_ISOLATOR_SRC})
- add_library(${TEST_MASTER_CONTENDER} SHARED EXCLUDE_FROM_ALL ${TEST_MASTER_CONTENDER_SRC})
- add_library(${TEST_MASTER_DETECTOR} SHARED EXCLUDE_FROM_ALL ${TEST_MASTER_DETECTOR_SRC})
- add_library(${TEST_QOS_CONTROLLER} SHARED EXCLUDE_FROM_ALL ${TEST_QOS_CONTROLLER_SRC})
- add_library(${TEST_RESOURCE_ESTIMATOR} SHARED EXCLUDE_FROM_ALL ${TEST_RESOURCE_ESTIMATOR_SRC})
-endif ()
-
-
-# Build the example frameworks and executors.
-#############################################
-# TODO(josephw): The scheduler driver is current not built on Windows.
if (NOT WIN32)
- add_executable(${BALLOON_EXECUTOR} ${BALLOON_EXECUTOR_SRC})
- add_executable(${BALLOON_FRAMEWORK} ${BALLOON_FRAMEWORK_SRC})
- add_executable(${DISK_FULL_FRAMEWORK} ${DISK_FULL_FRAMEWORK_SRC})
- add_executable(${DOCKER_NO_EXECUTOR_FRAMEWORK} ${DOCKER_NO_EXECUTOR_FRAMEWORK_SRC})
- add_executable(${DYNAMIC_RESERVATION_FRAMEWORK} ${DYNAMIC_RESERVATION_FRAMEWORK_SRC})
- add_executable(${LOAD_GENERATOR_FRAMEWORK} ${LOAD_GENERATOR_FRAMEWORK_SRC})
- add_executable(${LONG_LIVED_EXECUTOR} ${LONG_LIVED_EXECUTOR_SRC})
- add_executable(${LONG_LIVED_FRAMEWORK} ${LONG_LIVED_FRAMEWORK_SRC})
- add_executable(${NO_EXECUTOR_FRAMEWORK} ${NO_EXECUTOR_FRAMEWORK_SRC})
- add_executable(${PERSISTENT_VOLUME_FRAMEWORK} ${PERSISTENT_VOLUME_FRAMEWORK_SRC})
- add_executable(${TEST_EXECUTOR} ${TEST_EXECUTOR_SRC})
- add_executable(${TEST_FRAMEWORK} ${TEST_FRAMEWORK_SRC})
- add_executable(${TEST_HTTP_EXECUTOR} ${TEST_HTTP_EXECUTOR_SRC})
- add_executable(${TEST_HTTP_FRAMEWORK} ${TEST_HTTP_FRAMEWORK_SRC})
-endif ()
+ # Build the test modules.
+ #########################
+ # NOTE: Modules are not supported on Windows.
+ add_library(testallocator SHARED EXCLUDE_FROM_ALL test_allocator_module.cpp)
+ add_library(testanonymous SHARED EXCLUDE_FROM_ALL test_anonymous_module.cpp)
+ add_library(testauthentication SHARED EXCLUDE_FROM_ALL test_authentication_modules.cpp)
+ add_library(testauthorizer SHARED EXCLUDE_FROM_ALL test_authorizer_module.cpp)
+ add_library(testcontainer_logger SHARED EXCLUDE_FROM_ALL test_container_logger_module.cpp)
+ add_library(examplemodule SHARED EXCLUDE_FROM_ALL example_module_impl.cpp)
+ add_library(testhook SHARED EXCLUDE_FROM_ALL test_hook_module.cpp)
+ add_library(testhttpauthenticator SHARED EXCLUDE_FROM_ALL test_http_authenticator_module.cpp)
+ add_library(testisolator SHARED EXCLUDE_FROM_ALL test_isolator_module.cpp)
+ add_library(testmastercontender SHARED EXCLUDE_FROM_ALL test_master_contender_module.cpp)
+ add_library(testmasterdetector SHARED EXCLUDE_FROM_ALL test_master_detector_module.cpp)
+ add_library(testqos_controller SHARED EXCLUDE_FROM_ALL test_qos_controller_module.cpp)
+ add_library(testresource_estimator SHARED EXCLUDE_FROM_ALL test_resource_estimator_module.cpp)
-# ADD LINKER FLAGS (generates, e.g., -lglog on Linux).
-######################################################
-if (NOT WIN32)
- target_link_libraries(${TEST_ALLOCATOR} ${MESOS_LIBS_TARGET})
- target_link_libraries(${TEST_ANONYMOUS} ${MESOS_LIBS_TARGET})
- target_link_libraries(${TEST_AUTHENTICATION} ${MESOS_LIBS_TARGET})
- target_link_libraries(${TEST_AUTHORIZER} ${MESOS_LIBS_TARGET})
- target_link_libraries(${TEST_CONTAINER_LOGGER} ${MESOS_LIBS_TARGET})
- target_link_libraries(${TEST_EXAMPLEMODULE} ${MESOS_LIBS_TARGET})
- target_link_libraries(${TEST_HOOK} ${MESOS_LIBS_TARGET})
- target_link_libraries(${TEST_HTTPAUTHENTICATOR} ${MESOS_LIBS_TARGET})
- target_link_libraries(${TEST_ISOLATOR} ${MESOS_LIBS_TARGET})
- target_link_libraries(${TEST_MASTER_CONTENDER} ${MESOS_LIBS_TARGET})
- target_link_libraries(${TEST_MASTER_DETECTOR} ${MESOS_LIBS_TARGET})
- target_link_libraries(${TEST_QOS_CONTROLLER} ${MESOS_LIBS_TARGET})
- target_link_libraries(${TEST_RESOURCE_ESTIMATOR} ${MESOS_LIBS_TARGET})
+ # Build the example frameworks and executors.
+ #############################################
+ # TODO(josephw): The scheduler driver is current not built on Windows.
+ add_executable(balloon-executor balloon_executor.cpp)
+ add_executable(balloon-framework balloon_framework.cpp)
+ add_executable(disk-full-framework disk_full_framework.cpp)
+ add_executable(docker-no-executor-framework docker_no_executor_framework.cpp)
+ add_executable(dynamic-reservation-framework dynamic_reservation_framework.cpp)
+ add_executable(load-generator-framework load_generator_framework.cpp)
+ add_executable(long-lived-executor long_lived_executor.cpp)
+ add_executable(long-lived-framework long_lived_framework.cpp)
+ add_executable(no-executor-framework no_executor_framework.cpp)
+ add_executable(persistent-volume-framework persistent_volume_framework.cpp)
+ add_executable(test-executor test_executor.cpp)
+ add_executable(test-framework test_framework.cpp)
+ add_executable(test-http-executor test_http_executor.cpp)
+ add_executable(test-http-framework test_http_framework.cpp)
- target_link_libraries(${BALLOON_EXECUTOR} ${MESOS_LIBS_TARGET})
- target_link_libraries(${BALLOON_FRAMEWORK} ${MESOS_LIBS_TARGET})
- target_link_libraries(${DISK_FULL_FRAMEWORK} ${MESOS_LIBS_TARGET})
- target_link_libraries(${DOCKER_NO_EXECUTOR_FRAMEWORK} ${MESOS_LIBS_TARGET})
- target_link_libraries(${DYNAMIC_RESERVATION_FRAMEWORK} ${MESOS_LIBS_TARGET})
- target_link_libraries(${LOAD_GENERATOR_FRAMEWORK} ${MESOS_LIBS_TARGET})
- target_link_libraries(${LONG_LIVED_EXECUTOR} ${MESOS_LIBS_TARGET})
- target_link_libraries(${LONG_LIVED_FRAMEWORK} ${MESOS_LIBS_TARGET})
- target_link_libraries(${NO_EXECUTOR_FRAMEWORK} ${MESOS_LIBS_TARGET})
- target_link_libraries(${PERSISTENT_VOLUME_FRAMEWORK} ${MESOS_LIBS_TARGET})
- target_link_libraries(${TEST_EXECUTOR} ${MESOS_LIBS_TARGET})
- target_link_libraries(${TEST_FRAMEWORK} ${MESOS_LIBS_TARGET})
- target_link_libraries(${TEST_HTTP_EXECUTOR} ${MESOS_LIBS_TARGET})
- target_link_libraries(${TEST_HTTP_FRAMEWORK} ${MESOS_LIBS_TARGET})
-endif ()
-
-
-# ADD BINARY DEPENDENCIES (tells CMake what to compile/build first).
-####################################################################
-if (NOT WIN32)
- add_dependencies(${TEST_ALLOCATOR} ${MESOS_LIBS_TARGET})
- add_dependencies(${TEST_ANONYMOUS} ${MESOS_LIBS_TARGET})
- add_dependencies(${TEST_AUTHENTICATION} ${MESOS_LIBS_TARGET})
- add_dependencies(${TEST_AUTHORIZER} ${MESOS_LIBS_TARGET})
- add_dependencies(${TEST_CONTAINER_LOGGER} ${MESOS_LIBS_TARGET})
- add_dependencies(${TEST_EXAMPLEMODULE} ${MESOS_LIBS_TARGET})
- add_dependencies(${TEST_HOOK} ${MESOS_LIBS_TARGET})
- add_dependencies(${TEST_HTTPAUTHENTICATOR} ${MESOS_LIBS_TARGET})
- add_dependencies(${TEST_ISOLATOR} ${MESOS_LIBS_TARGET})
- add_dependencies(${TEST_MASTER_CONTENDER} ${MESOS_LIBS_TARGET})
- add_dependencies(${TEST_MASTER_DETECTOR} ${MESOS_LIBS_TARGET})
- add_dependencies(${TEST_QOS_CONTROLLER} ${MESOS_LIBS_TARGET})
- add_dependencies(${TEST_RESOURCE_ESTIMATOR} ${MESOS_LIBS_TARGET})
+ # NOTE: Do not replace this with `link_libraries()`. While it may result in
+ # less code, it is deprecated and relies on side effects instead of
+ # explicitness.
+ target_link_libraries(testallocator PRIVATE mesos)
+ target_link_libraries(testanonymous PRIVATE mesos)
+ target_link_libraries(testauthentication PRIVATE mesos)
+ target_link_libraries(testauthorizer PRIVATE mesos)
+ target_link_libraries(testcontainer_logger PRIVATE mesos)
+ target_link_libraries(examplemodule PRIVATE mesos)
+ target_link_libraries(testhook PRIVATE mesos)
+ target_link_libraries(testhttpauthenticator PRIVATE mesos)
+ target_link_libraries(testisolator PRIVATE mesos)
+ target_link_libraries(testmastercontender PRIVATE mesos)
+ target_link_libraries(testmasterdetector PRIVATE mesos)
+ target_link_libraries(testqos_controller PRIVATE mesos)
+ target_link_libraries(testresource_estimator PRIVATE mesos)
- add_dependencies(${BALLOON_EXECUTOR} ${MESOS_LIBS_TARGET})
- add_dependencies(${BALLOON_FRAMEWORK} ${MESOS_LIBS_TARGET})
- add_dependencies(${DISK_FULL_FRAMEWORK} ${MESOS_LIBS_TARGET})
- add_dependencies(${DOCKER_NO_EXECUTOR_FRAMEWORK} ${MESOS_LIBS_TARGET})
- add_dependencies(${DYNAMIC_RESERVATION_FRAMEWORK} ${MESOS_LIBS_TARGET})
- add_dependencies(${LOAD_GENERATOR_FRAMEWORK} ${MESOS_LIBS_TARGET})
- add_dependencies(${LONG_LIVED_EXECUTOR} ${MESOS_LIBS_TARGET})
- add_dependencies(${LONG_LIVED_FRAMEWORK} ${MESOS_LIBS_TARGET})
- add_dependencies(${NO_EXECUTOR_FRAMEWORK} ${MESOS_LIBS_TARGET})
- add_dependencies(${PERSISTENT_VOLUME_FRAMEWORK} ${MESOS_LIBS_TARGET})
- add_dependencies(${TEST_EXECUTOR} ${MESOS_LIBS_TARGET})
- add_dependencies(${TEST_FRAMEWORK} ${MESOS_LIBS_TARGET})
- add_dependencies(${TEST_HTTP_EXECUTOR} ${MESOS_LIBS_TARGET})
- add_dependencies(${TEST_HTTP_FRAMEWORK} ${MESOS_LIBS_TARGET})
+ target_link_libraries(balloon-executor PRIVATE mesos)
+ target_link_libraries(balloon-framework PRIVATE mesos)
+ target_link_libraries(disk-full-framework PRIVATE mesos)
+ target_link_libraries(docker-no-executor-framework PRIVATE mesos)
+ target_link_libraries(dynamic-reservation-framework PRIVATE mesos)
+ target_link_libraries(load-generator-framework PRIVATE mesos)
+ target_link_libraries(long-lived-executor PRIVATE mesos)
+ target_link_libraries(long-lived-framework PRIVATE mesos)
+ target_link_libraries(no-executor-framework PRIVATE mesos)
+ target_link_libraries(persistent-volume-framework PRIVATE mesos)
+ target_link_libraries(test-executor PRIVATE mesos)
+ target_link_libraries(test-framework PRIVATE mesos)
+ target_link_libraries(test-http-executor PRIVATE mesos)
+ target_link_libraries(test-http-framework PRIVATE mesos)
endif ()
http://git-wip-us.apache.org/repos/asf/mesos/blob/d10fd9b8/src/examples/cmake/ExamplesConfigure.cmake
----------------------------------------------------------------------
diff --git a/src/examples/cmake/ExamplesConfigure.cmake b/src/examples/cmake/ExamplesConfigure.cmake
deleted file mode 100644
index d85da4e..0000000
--- a/src/examples/cmake/ExamplesConfigure.cmake
+++ /dev/null
@@ -1,51 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Define test module library targets.
-#####################################
-# These libraries are usually the default implementation
-# of the module pulled out into a shared library.
-set(TEST_ALLOCATOR testallocator)
-set(TEST_ANONYMOUS testanonymous)
-set(TEST_AUTHENTICATION testauthentication)
-set(TEST_AUTHORIZER testauthorizer)
-set(TEST_CONTAINER_LOGGER testcontainer_logger)
-set(TEST_EXAMPLEMODULE examplemodule)
-set(TEST_HOOK testhook)
-set(TEST_HTTPAUTHENTICATOR testhttpauthenticator)
-set(TEST_ISOLATOR testisolator)
-set(TEST_MASTER_CONTENDER testmastercontender)
-set(TEST_MASTER_DETECTOR testmasterdetector)
-set(TEST_QOS_CONTROLLER testqos_controller)
-set(TEST_RESOURCE_ESTIMATOR testresource_estimator)
-
-
-# Define example framework and executor targets.
-################################################
-set(BALLOON_EXECUTOR balloon-executor)
-set(BALLOON_FRAMEWORK balloon-framework)
-set(DISK_FULL_FRAMEWORK disk-full-framework)
-set(DOCKER_NO_EXECUTOR_FRAMEWORK docker-no-executor-framework)
-set(DYNAMIC_RESERVATION_FRAMEWORK dynamic-reservation-framework)
-set(LOAD_GENERATOR_FRAMEWORK load-generator-framework)
-set(LONG_LIVED_EXECUTOR long-lived-executor)
-set(LONG_LIVED_FRAMEWORK long-lived-framework)
-set(NO_EXECUTOR_FRAMEWORK no-executor-framework)
-set(PERSISTENT_VOLUME_FRAMEWORK persistent-volume-framework)
-set(TEST_EXECUTOR test-executor)
-set(TEST_FRAMEWORK test-framework)
-set(TEST_HTTP_EXECUTOR test-http-executor)
-set(TEST_HTTP_FRAMEWORK test-http-framework)
http://git-wip-us.apache.org/repos/asf/mesos/blob/d10fd9b8/src/launcher/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/launcher/CMakeLists.txt b/src/launcher/CMakeLists.txt
index 97edc4a..c7a83d4 100644
--- a/src/launcher/CMakeLists.txt
+++ b/src/launcher/CMakeLists.txt
@@ -14,52 +14,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# THE MESOS LAUNCHER EXECUTOR SOURCE.
-#####################################
-set(DEFAULT_EXECUTOR_SRC
- ${DEFAULT_EXECUTOR_SRC}
- default_executor.cpp
- )
-
-set(EXECUTOR_EXECUTABLE_SRC
- ${EXECUTOR_EXECUTABLE_SRC}
- executor.cpp
- )
-
-# THE MESOS LAUNCHER FETCHER SOURCE.
-####################################
-set(FETCHER_EXECUTABLE_SRC fetcher.cpp)
-
# THE LAUNCHER EXECUTOR AND FETCHER EXECUTABLES.
################################################
-add_executable(${DEFAULT_EXECUTOR_TARGET} ${DEFAULT_EXECUTOR_SRC})
-add_executable(${MESOS_EXECUTOR} ${EXECUTOR_EXECUTABLE_SRC})
-
-if (NOT WIN32)
- add_executable(${MESOS_FETCHER} ${FETCHER_EXECUTABLE_SRC})
-endif ()
-
-# ADD LINKER FLAGS (generates, e.g., -lglog on Linux).
-######################################################
-target_link_libraries(${DEFAULT_EXECUTOR_TARGET} ${MESOS_LIBS_TARGET})
-target_link_libraries(${MESOS_EXECUTOR} ${MESOS_LIBS_TARGET})
-
-if (NOT WIN32)
- target_link_libraries(${MESOS_FETCHER} ${MESOS_LIBS_TARGET})
-endif ()
-
-# ADD BINARY DEPENDENCIES (tells CMake what to compile/build first).
-####################################################################
-add_dependencies(
- ${MESOS_TARGET}
- ${DEFAULT_EXECUTOR_TARGET}
- ${MESOS_EXECUTOR}
- )
+add_executable(mesos-default-executor default_executor.cpp)
+target_link_libraries(mesos-default-executor PRIVATE mesos)
-add_dependencies(${DEFAULT_EXECUTOR_TARGET} ${MESOS_LIBS_TARGET})
-add_dependencies(${MESOS_EXECUTOR} ${MESOS_LIBS_TARGET})
+add_executable(mesos-executor executor.cpp)
+target_link_libraries(mesos-executor PRIVATE mesos)
if (NOT WIN32)
- add_dependencies(${MESOS_TARGET} ${MESOS_FETCHER})
- add_dependencies(${MESOS_FETCHER} ${MESOS_LIBS_TARGET})
+ add_executable(mesos-fetcher fetcher.cpp)
+ target_link_libraries(mesos-fetcher PRIVATE mesos)
endif ()
http://git-wip-us.apache.org/repos/asf/mesos/blob/d10fd9b8/src/local/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/local/CMakeLists.txt b/src/local/CMakeLists.txt
index 7c9a718..5e5bee3 100644
--- a/src/local/CMakeLists.txt
+++ b/src/local/CMakeLists.txt
@@ -16,28 +16,9 @@
# TODO(josephw): Enable this on Windows after sorting out the dependencies.
if (NOT WIN32)
-
-set(MESOS_LOCAL_TARGET mesos-local
- CACHE STRING "Used to start a local mesos cluster for testing purposes.")
-
-# THE MESOS-LOCAL SOURCE.
-#########################
-set(MESOS_LOCAL_SRC
- ${MESOS_LOCAL_SRC}
- main.cpp
- )
-
-# THE MESOS LOCAL EXECUTABLE.
-#############################
-add_executable(${MESOS_LOCAL_TARGET} ${MESOS_LOCAL_SRC})
-
-# ADD LINKER FLAGS (generates, e.g., -lglog on Linux).
-######################################################
-target_link_libraries(${MESOS_LOCAL_TARGET} ${MESOS_LIBS_TARGET})
-
-# ADD BINARY DEPENDENCIES (tells CMake what to compile/build first).
-####################################################################
-add_dependencies(${MESOS_TARGET} ${MESOS_LOCAL_TARGET})
-add_dependencies(${MESOS_LOCAL_TARGET} ${MESOS_LIBS_TARGET})
-
+ # THE MESOS LOCAL EXECUTABLE.
+ # Used to start a local mesos cluster for testing purposes.
+ ###########################################################
+ add_executable(mesos-local main.cpp)
+ target_link_libraries(mesos-local PRIVATE mesos)
endif ()
http://git-wip-us.apache.org/repos/asf/mesos/blob/d10fd9b8/src/log/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/log/CMakeLists.txt b/src/log/CMakeLists.txt
index 2fad6cc..1c94470 100644
--- a/src/log/CMakeLists.txt
+++ b/src/log/CMakeLists.txt
@@ -16,28 +16,9 @@
# TODO(josephw): Enable this on Windows after sorting out the dependencies.
if (NOT WIN32)
-
-set(MESOS_LOG_TARGET mesos-log
- CACHE STRING "Utility used to interact with the replicated log.")
-
-# THE MESOS-LOG SOURCE.
-###########################
-set(MESOS_LOG_SRC
- ${MESOS_LOG_SRC}
- main.cpp
- )
-
-# THE MESOS LOG.
-###########################################
-add_executable(${MESOS_LOG_TARGET} ${MESOS_LOG_SRC})
-
-# ADD LINKER FLAGS (generates, e.g., -lglog on Linux).
-######################################################
-target_link_libraries(${MESOS_LOG_TARGET} ${MESOS_LIBS_TARGET})
-
-# ADD BINARY DEPENDENCIES (tells CMake what to compile/build first).
-####################################################################
-add_dependencies(${MESOS_TARGET} ${MESOS_LOG_TARGET})
-add_dependencies(${MESOS_LOG_TARGET} ${MESOS_LIBS_TARGET})
-
+ # THE MESOS LOG.
+ # Utility used to interact with the replicated log.
+ ###################################################
+ add_executable(mesos-log main.cpp)
+ target_link_libraries(mesos-log PRIVATE mesos)
endif ()
http://git-wip-us.apache.org/repos/asf/mesos/blob/d10fd9b8/src/master/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/master/CMakeLists.txt b/src/master/CMakeLists.txt
index 0062fb3..ec55211 100644
--- a/src/master/CMakeLists.txt
+++ b/src/master/CMakeLists.txt
@@ -16,36 +16,8 @@
# TODO(josephw): Enable this on Windows after sorting out the dependencies.
if (NOT WIN32)
-
-# THE MASTER SOURCE.
-###################
-set(MASTER_EXECUTABLE_SRC
- ${MASTER_EXECUTABLE_SRC}
- main.cpp
- )
-
-# INCLUDE DIRECTIVES FOR MASTER EXECUTABLE (generates, e.g., -I/path/to/thing
-# on Linux).
-############################################################################
-include_directories(SYSTEM ${MASTER_3RDPARTY_INCLUDE_DIRS})
-include_directories(${MASTER_INCLUDE_DIRS})
-
-# LINKING LIBRARIES BY DIRECTORY (might generate, e.g., -L/path/to/thing on
-# Linux).
-###########################################################################
-link_directories(${MASTER_LIB_DIRS})
-
-# THE MASTER EXECUTABLE.
-#######################
-add_executable(${MESOS_MASTER} ${MASTER_EXECUTABLE_SRC})
-
-# ADD LINKER FLAGS (generates, e.g., -lglog on Linux).
-######################################################
-target_link_libraries(${MESOS_MASTER} ${MASTER_LIBS} ${MESOS_LIBS_TARGET})
-
-# ADD BINARY DEPENDENCIES (tells CMake what to compile/build first).
-####################################################################
-add_dependencies(${MESOS_TARGET} ${MESOS_MASTER})
-add_dependencies(${MESOS_MASTER} ${MESOS_LIBS_TARGET})
-
+ # THE MASTER EXECUTABLE.
+ ########################
+ add_executable(mesos-master main.cpp)
+ target_link_libraries(mesos-master PRIVATE mesos)
endif ()
http://git-wip-us.apache.org/repos/asf/mesos/blob/d10fd9b8/src/master/cmake/MasterConfigure.cmake
----------------------------------------------------------------------
diff --git a/src/master/cmake/MasterConfigure.cmake b/src/master/cmake/MasterConfigure.cmake
deleted file mode 100644
index a5fbc45..0000000
--- a/src/master/cmake/MasterConfigure.cmake
+++ /dev/null
@@ -1,69 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# TODO(andschwa): Import this properly.
-set(SASL_LFLAG sasl2)
-
-# Define process library dependencies. Tells the process library build targets
-# download/configure/build all third-party libraries before attempting to build.
-################################################################################
-set(MASTER_DEPENDENCIES
- ${MASTER_DEPENDENCIES}
- make_bin_include_dir
- make_bin_src_dir
- )
-
-# Define third-party include directories. Tells compiler toolchain where to get
-# headers for our third party libs (e.g., -I/path/to/glog on Linux).
-###############################################################################
-set(MASTER_INCLUDE_DIRS
- ${MASTER_INCLUDE_DIRS}
- ${MESOS_PUBLIC_INCLUDE_DIR}
- # Contains (e.g.) compiled *.pb.h files.
- ${MESOS_BIN_INCLUDE_DIR}
- ${MESOS_BIN_INCLUDE_DIR}/mesos
- ${MESOS_BIN_SRC_DIR}
- ${MESOS_SRC_DIR}
- )
-
-set(MASTER_3RDPARTY_INCLUDE_DIRS
- ${MASTER_3RDPARTY_INCLUDE_DIRS}
- )
-
-# Define third-party lib install directories. Used to tell the compiler
-# toolchain where to find our third party libs (e.g., -L/path/to/glog on
-# Linux).
-########################################################################
-set(MASTER_LIB_DIRS
- ${MASTER_LIB_DIRS}
- )
-
-# Define third-party libs. Used to generate flags that the linker uses to
-# include our third-party libs (e.g., -lglog on Linux).
-#########################################################################
-set(MASTER_LIBS
- ${MASTER_LIBS}
- process
- zookeeper
- )
-
-if (NOT WIN32)
- set(MASTER_LIBS
- ${MASTER_LIBS}
- leveldb
- ${SASL_LFLAG}
- )
-endif ()
http://git-wip-us.apache.org/repos/asf/mesos/blob/d10fd9b8/src/slave/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/slave/CMakeLists.txt b/src/slave/CMakeLists.txt
index 9dbadca..6f08f3d 100644
--- a/src/slave/CMakeLists.txt
+++ b/src/slave/CMakeLists.txt
@@ -14,37 +14,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# THE AGENT SOURCE.
-###################
-set(AGENT_EXECUTABLE_SRC
- ${AGENT_EXECUTABLE_SRC}
- main.cpp
- )
-
add_subdirectory(container_loggers)
add_subdirectory(qos_controllers)
add_subdirectory(resource_estimators)
-# INCLUDE DIRECTIVES FOR AGENT EXECUTABLE (generates, e.g., -I/path/to/thing
-# on Linux).
-############################################################################
-include_directories(SYSTEM ${AGENT_3RDPARTY_INCLUDE_DIRS})
-include_directories(${AGENT_INCLUDE_DIRS})
-
-# LINKING LIBRARIES BY DIRECTORY (might generate, e.g., -L/path/to/thing on
-# Linux).
-###########################################################################
-link_directories(${AGENT_LIB_DIRS})
# THE AGENT EXECUTABLE.
#######################
-add_executable(${AGENT_TARGET} ${AGENT_EXECUTABLE_SRC})
-
-# ADD LINKER FLAGS (generates, e.g., -lglog on Linux).
-######################################################
-target_link_libraries(${AGENT_TARGET} ${AGENT_LIBS} ${MESOS_LIBS_TARGET})
-
-# ADD BINARY DEPENDENCIES (tells CMake what to compile/build first).
-####################################################################
-add_dependencies(${MESOS_TARGET} ${AGENT_TARGET})
-add_dependencies(${AGENT_TARGET} ${MESOS_LIBS_TARGET})
+add_executable(mesos-agent main.cpp)
+target_link_libraries(mesos-agent PRIVATE mesos)
http://git-wip-us.apache.org/repos/asf/mesos/blob/d10fd9b8/src/slave/cmake/AgentConfigure.cmake
----------------------------------------------------------------------
diff --git a/src/slave/cmake/AgentConfigure.cmake b/src/slave/cmake/AgentConfigure.cmake
deleted file mode 100644
index 4a06a4b..0000000
--- a/src/slave/cmake/AgentConfigure.cmake
+++ /dev/null
@@ -1,85 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# TODO(andschwa): Import this properly.
-set(SASL_LFLAG sasl2)
-
-set(LOGROTATE_CONTAINER_LOGGER_TARGET logrotate_container_logger
- CACHE STRING "Library containing the logrotate container logger."
- )
-
-set(MESOS_LOGROTATE_LOGGER_TARGET mesos-logrotate-logger
- CACHE STRING "Executable used by the logrotate container logger."
- )
-
-set(QOS_CONTROLLER_TARGET load_qos_controller
- CACHE STRING "Library containing the load qos controller."
- )
-
-set(RESOURCE_ESTIMATOR_TARGET fixed_resource_estimator
- CACHE STRING "Library containing the fixed resource estimator."
- )
-
-# Define process library dependencies. Tells the process library build targets
-# download/configure/build all third-party libraries before attempting to build.
-################################################################################
-set(AGENT_DEPENDENCIES
- ${AGENT_DEPENDENCIES}
- make_bin_include_dir
- make_bin_src_dir
- )
-
-# Define third-party include directories. Tells compiler toolchain where to get
-# headers for our third party libs (e.g., -I/path/to/glog on Linux).
-###############################################################################
-set(AGENT_INCLUDE_DIRS
- ${AGENT_INCLUDE_DIRS}
- ${MESOS_PUBLIC_INCLUDE_DIR}
- # Contains (e.g.) compiled *.pb.h files.
- ${MESOS_BIN_INCLUDE_DIR}
- ${MESOS_BIN_INCLUDE_DIR}/mesos
- ${MESOS_BIN_SRC_DIR}
- ${MESOS_SRC_DIR}
- )
-
-set(AGENT_3RDPARTY_INCLUDE_DIRS
- ${AGENT_3RDPARTY_INCLUDE_DIRS}
- )
-
-# Define third-party lib install directories. Used to tell the compiler
-# toolchain where to find our third party libs (e.g., -L/path/to/glog on
-# Linux).
-########################################################################
-set(AGENT_LIB_DIRS
- ${AGENT_LIB_DIRS}
- )
-
-# Define third-party libs. Used to generate flags that the linker uses to
-# include our third-party libs (e.g., -lglog on Linux).
-#########################################################################
-set(AGENT_LIBS
- ${AGENT_LIBS}
- process
- zookeeper
- )
-
-if (NOT WIN32)
- set(AGENT_LIBS
- ${AGENT_LIBS}
- leveldb
- ${SASL_LFLAG}
- )
-endif ()
http://git-wip-us.apache.org/repos/asf/mesos/blob/d10fd9b8/src/slave/container_loggers/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/slave/container_loggers/CMakeLists.txt b/src/slave/container_loggers/CMakeLists.txt
index c0774ce..b4f79a4 100644
--- a/src/slave/container_loggers/CMakeLists.txt
+++ b/src/slave/container_loggers/CMakeLists.txt
@@ -14,36 +14,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# Logrotate container logger sources.
-#####################################
-set(LOGROTATE_CONTAINER_LOGGER_SRC lib_logrotate.cpp)
-set(MESOS_LOGROTATE_LOGGER_SRC logrotate.cpp)
-
# Build the container logger module.
####################################
# NOTE: Modules are not supported on Windows.
if (NOT WIN32)
- add_library(${LOGROTATE_CONTAINER_LOGGER_TARGET} SHARED ${LOGROTATE_CONTAINER_LOGGER_SRC})
- add_executable(${MESOS_LOGROTATE_LOGGER_TARGET} ${MESOS_LOGROTATE_LOGGER_SRC})
-endif ()
+ # NOTE: This library uses underscores because of a hard-coded expectation of
+ # `src/tests/module`.
+ add_library(logrotate_container_logger SHARED lib_logrotate.cpp)
+ target_link_libraries(logrotate_container_logger PRIVATE mesos)
-# ADD LINKER FLAGS (generates, e.g., -lglog on Linux).
-######################################################
-if (NOT WIN32)
- target_link_libraries(${LOGROTATE_CONTAINER_LOGGER_TARGET} ${MESOS_LIBS_TARGET})
- target_link_libraries(${MESOS_LOGROTATE_LOGGER_TARGET} ${MESOS_LIBS_TARGET})
-endif ()
-
-# ADD BINARY DEPENDENCIES (tells CMake what to compile/build first).
-####################################################################
-if (NOT WIN32)
- add_dependencies(${MESOS_TARGET} ${LOGROTATE_CONTAINER_LOGGER_TARGET})
+ # NOTE: This does not link to the above library because this is a
+ # light-weight companion binary which can be run independently.
+ add_executable(mesos-logrotate-logger logrotate.cpp)
+ target_link_libraries(mesos-logrotate-logger PRIVATE mesos)
add_dependencies(
- ${LOGROTATE_CONTAINER_LOGGER_TARGET}
- ${MESOS_LIBS_TARGET}
- ${MESOS_LOGROTATE_LOGGER_TARGET}
- )
-
- add_dependencies(${MESOS_LOGROTATE_LOGGER_TARGET} ${MESOS_LIBS_TARGET})
+ logrotate_container_logger
+ mesos-logrotate-logger)
endif ()
http://git-wip-us.apache.org/repos/asf/mesos/blob/d10fd9b8/src/slave/containerizer/mesos/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/CMakeLists.txt b/src/slave/containerizer/mesos/CMakeLists.txt
index fa2043e..ba1f92f 100644
--- a/src/slave/containerizer/mesos/CMakeLists.txt
+++ b/src/slave/containerizer/mesos/CMakeLists.txt
@@ -14,59 +14,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# SOURCE FILES FOR THE CONTAINERIZER.
-#####################################
-set(CONTAINERIZER_EXECUTABLE_SRC
- ${CONTAINERIZER_EXECUTABLE_SRC}
- main.cpp
- )
-
-if (NOT WIN32)
- set(MESOS_IO_SWITCHBOARD_SRC
- ${MESOS_IO_SWITCHBOARD_SRC}
- io/switchboard_main.cpp
- )
-
- set(MESOS_CNI_PORT_MAPPER_SRC
- ${MESOS_CNI_PORT_MAPPER_SRC}
- isolators/network/cni/plugins/port_mapper/main.cpp
- isolators/network/cni/plugins/port_mapper/port_mapper.cpp
- )
-endif ()
-
# THE CONTAINERIZER EXECUTABLE.
###############################
-add_executable(${MESOS_CONTAINERIZER} ${CONTAINERIZER_EXECUTABLE_SRC})
-if (NOT WIN32)
- add_executable(${MESOS_IO_SWITCHBOARD} ${MESOS_IO_SWITCHBOARD_SRC})
- add_executable(${MESOS_CNI_PORT_MAPPER} ${MESOS_CNI_PORT_MAPPER_SRC})
-endif ()
+add_executable(mesos-containerizer main.cpp)
+target_link_libraries(mesos-containerizer PRIVATE mesos)
-# ADD LINKER FLAGS (generates, e.g., -lglog on Linux).
-######################################################
-target_link_libraries(${MESOS_CONTAINERIZER} ${AGENT_LIBS} ${MESOS_LIBS_TARGET})
if (NOT WIN32)
- target_link_libraries(
- ${MESOS_IO_SWITCHBOARD}
- ${AGENT_LIBS}
- ${MESOS_LIBS_TARGET})
-
- target_link_libraries(
- ${MESOS_CNI_PORT_MAPPER}
- ${AGENT_LIBS}
- ${MESOS_LIBS_TARGET})
-endif ()
+ add_executable(mesos-io-switchboard io/switchboard_main.cpp)
+ target_link_libraries(mesos-io-switchboard PRIVATE mesos)
-# ADD BINARY DEPENDENCIES (tells CMake what to compile/build first).
-####################################################################
-add_dependencies(${MESOS_TARGET} ${MESOS_CONTAINERIZER})
-if (NOT WIN32)
- add_dependencies(${MESOS_TARGET} ${MESOS_IO_SWITCHBOARD})
- add_dependencies(${MESOS_TARGET} ${MESOS_CNI_PORT_MAPPER})
-endif ()
+ add_executable(
+ mesos-cni-port-mapper
+ isolators/network/cni/plugins/port_mapper/main.cpp
+ isolators/network/cni/plugins/port_mapper/port_mapper.cpp)
-add_dependencies(${MESOS_CONTAINERIZER} ${MESOS_LIBS_TARGET})
-if (NOT WIN32)
- add_dependencies(${MESOS_IO_SWITCHBOARD} ${MESOS_LIBS_TARGET})
- add_dependencies(${MESOS_CNI_PORT_MAPPER} ${MESOS_LIBS_TARGET})
+ target_link_libraries(mesos-cni-port-mapper PRIVATE mesos)
endif ()
http://git-wip-us.apache.org/repos/asf/mesos/blob/d10fd9b8/src/slave/qos_controllers/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/slave/qos_controllers/CMakeLists.txt b/src/slave/qos_controllers/CMakeLists.txt
index 65ab338..ff9cc15 100644
--- a/src/slave/qos_controllers/CMakeLists.txt
+++ b/src/slave/qos_controllers/CMakeLists.txt
@@ -14,22 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# THE QOS_CONTROLLER SOURCE.
-############################
-set(QOS_CONTROLLER_SRC
- ${QOS_CONTROLLER_SRC}
- load.cpp
- )
-
-# THE AGENT EXECUTABLE.
-#######################
-add_library(${QOS_CONTROLLER_TARGET} ${MESOS_DEFAULT_LIBRARY_LINKAGE} ${QOS_CONTROLLER_SRC})
-
-# ADD LINKER FLAGS (generates, e.g., -lglog on Linux).
-######################################################
-target_link_libraries(${QOS_CONTROLLER_TARGET} ${AGENT_LIBS} ${MESOS_LIBS_TARGET})
-
-# ADD BINARY DEPENDENCIES (tells CMake what to compile/build first).
-####################################################################
-add_dependencies(${MESOS_TARGET} ${QOS_CONTROLLER_TARGET})
-add_dependencies(${QOS_CONTROLLER_TARGET} ${MESOS_LIBS_TARGET})
+# THE LOAD QOS CONTROLLER LIBRARY.
+##################################
+# NOTE: This library uses underscores to be consistent with other modules.
+add_library(load_qos_controller load.cpp)
+target_link_libraries(load_qos_controller PRIVATE mesos)
http://git-wip-us.apache.org/repos/asf/mesos/blob/d10fd9b8/src/slave/resource_estimators/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/slave/resource_estimators/CMakeLists.txt b/src/slave/resource_estimators/CMakeLists.txt
index 1d28bd4..6f32421 100644
--- a/src/slave/resource_estimators/CMakeLists.txt
+++ b/src/slave/resource_estimators/CMakeLists.txt
@@ -14,22 +14,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# THE RESOURCE_ESTIMATOR SOURCE.
-################################
-set(RESOURCE_ESTIMATOR_SRC
- ${RESOURCE_ESTIMATOR_SRC}
- fixed.cpp
- )
-
-# THE AGENT EXECUTABLE.
-#######################
-add_library(${RESOURCE_ESTIMATOR_TARGET} ${MESOS_DEFAULT_LIBRARY_LINKAGE} ${RESOURCE_ESTIMATOR_SRC})
-
-# ADD LINKER FLAGS (generates, e.g., -lglog on Linux).
-######################################################
-target_link_libraries(${RESOURCE_ESTIMATOR_TARGET} ${AGENT_LIBS} ${MESOS_LIBS_TARGET})
-
-# ADD BINARY DEPENDENCIES (tells CMake what to compile/build first).
-####################################################################
-add_dependencies(${MESOS_TARGET} ${RESOURCE_ESTIMATOR_TARGET})
-add_dependencies(${RESOURCE_ESTIMATOR_TARGET} ${MESOS_LIBS_TARGET})
+# THE FIXED RESOURCE ESTIMATOR.
+###############################
+# NOTE: This library uses underscores because of a hard-coded expectation of
+# `src/tests/oversubscription_tests.cpp`.
+add_library(fixed_resource_estimator fixed.cpp)
+target_link_libraries(fixed_resource_estimator PRIVATE mesos)
http://git-wip-us.apache.org/repos/asf/mesos/blob/d10fd9b8/src/tests/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
index 2d4eed2..c7f234b 100644
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -14,40 +14,34 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-include(MesosTestsConfigure)
-
# Sources for a test helper binary.
###################################
set(TEST_HELPER_SRC
- ${TEST_HELPER_SRC}
active_user_test_helper.cpp
flags.cpp
http_server_test_helper.cpp
resources_utils.cpp
test_helper_main.cpp
- utils.cpp
- )
+ utils.cpp)
if (NOT WIN32)
set(TEST_HELPER_SRC
${TEST_HELPER_SRC}
kill_policy_test_helper.cpp
- containerizer/memory_test_helper.cpp
- )
+ containerizer/memory_test_helper.cpp)
endif ()
if (LINUX)
set(TEST_HELPER_SRC
${TEST_HELPER_SRC}
containerizer/capabilities_test_helper.cpp
- containerizer/setns_test_helper.cpp
- )
+ containerizer/setns_test_helper.cpp)
endif ()
+
# Test utilities.
#################
set(MESOS_TESTS_UTILS_SRC
- ${MESOS_TESTS_UTILS_SRC}
active_user_test_helper.cpp
cluster.cpp
containerizer.cpp
@@ -63,30 +57,27 @@ set(MESOS_TESTS_UTILS_SRC
module.cpp
resources_utils.cpp
utils.cpp
- containerizer/launcher.cpp
- )
+ containerizer/launcher.cpp)
if (NOT WIN32)
set(MESOS_TESTS_UTILS_SRC
${MESOS_TESTS_UTILS_SRC}
kill_policy_test_helper.cpp
script.cpp
- containerizer/memory_test_helper.cpp
- )
+ containerizer/memory_test_helper.cpp)
endif ()
if (LINUX)
set(MESOS_TESTS_UTILS_SRC
${MESOS_TESTS_UTILS_SRC}
containerizer/capabilities_test_helper.cpp
- containerizer/setns_test_helper.cpp
- )
+ containerizer/setns_test_helper.cpp)
endif ()
+
# All the test sources.
#######################
set(MESOS_TESTS_SRC
- ${MESOS_TESTS_SRC}
${MESOS_TESTS_UTILS_SRC}
anonymous_tests.cpp
api_tests.cpp
@@ -130,8 +121,7 @@ set(MESOS_TESTS_SRC
uri_tests.cpp
uri_fetcher_tests.cpp
values_tests.cpp
- zookeeper_url_tests.cpp
- )
+ zookeeper_url_tests.cpp)
if (HAS_JAVA)
set(MESOS_TESTS_SRC
@@ -146,22 +136,19 @@ endif ()
if (ENABLE_SSL)
set(MESOS_TESTS_SRC
${MESOS_TESTS_SRC}
- secret_generator_tests.cpp
- )
+ secret_generator_tests.cpp)
endif ()
set(MESOS_TESTS_SRC
${MESOS_TESTS_SRC}
common/http_tests.cpp
common/recordio_tests.cpp
- common/type_utils_tests.cpp
- )
+ common/type_utils_tests.cpp)
set(MESOS_TESTS_SRC
${MESOS_TESTS_SRC}
containerizer/containerizer_tests.cpp
- containerizer/docker_tests.cpp
- )
+ containerizer/docker_tests.cpp)
if (NOT WIN32)
set(MESOS_TESTS_SRC
@@ -196,13 +183,11 @@ if (NOT WIN32)
slave_recovery_tests.cpp
state_tests.cpp
teardown_tests.cpp
- upgrade_tests.cpp
- )
+ upgrade_tests.cpp)
set(MESOS_TESTS_SRC
${MESOS_TESTS_SRC}
- common/command_utils_tests.cpp
- )
+ common/command_utils_tests.cpp)
set(MESOS_TESTS_SRC
${MESOS_TESTS_SRC}
@@ -223,8 +208,7 @@ if (NOT WIN32)
containerizer/provisioner_backend_tests.cpp
containerizer/provisioner_docker_tests.cpp
containerizer/provisioner_paths_tests.cpp
- containerizer/volume_sandbox_path_isolator_tests.cpp
- )
+ containerizer/volume_sandbox_path_isolator_tests.cpp)
endif ()
if (LINUX)
@@ -250,84 +234,109 @@ if (LINUX)
containerizer/sched_tests.cpp
containerizer/volume_host_path_isolator_tests.cpp
containerizer/volume_image_isolator_tests.cpp
- containerizer/volume_secret_isolator_tests.cpp
- )
+ containerizer/volume_secret_isolator_tests.cpp)
endif ()
-# INCLUDE DIRECTIVES (generates, e.g., -I/path/to/thing on Linux).
-##################################################################
-include_directories(SYSTEM ${MESOS_3RDPARTY_TESTS_INCLUDE_DIRS})
-include_directories(${MESOS_TESTS_INCLUDE_DIRS})
-# LINKING LIBRARIES (might generate, e.g., -L/path/to/thing on Linux).
-######################################################################
-link_directories(${MESOS_TESTS_LIB_DIRS})
+# THE TEST AND HELPER EXECUTABLES.
+##################################
+add_library(mesos-tests-interface INTERFACE)
+target_link_libraries(mesos-tests-interface INTERFACE mesos googletest)
-# THE TEST AND HELPER EXECUTABLEs (generates, e.g., stout-tests, etc., on Linux).
-#################################$###############################################
-add_executable(${MESOS_TESTS_TARGET} EXCLUDE_FROM_ALL ${MESOS_TESTS_SRC})
-add_executable(${TEST_HELPER_TARGET} EXCLUDE_FROM_ALL ${TEST_HELPER_SRC})
+if (NOT WIN32)
+ target_link_libraries(
+ mesos-tests-interface INTERFACE
+ load_qos_controller
+ fixed_resource_estimator
+ logrotate_container_logger)
+endif ()
+
+target_compile_definitions(
+ mesos-tests-interface INTERFACE
+ SOURCE_DIR="${CMAKE_SOURCE_DIR}"
+ BUILD_DIR="${CMAKE_BINARY_DIR}"
+ PKGLIBEXECDIR="${PKG_LIBEXEC_INSTALL_DIR}"
+ TESTLIBEXECDIR="${TEST_LIB_EXEC_DIR}"
+ PKGMODULEDIR="${PKG_MODULE_DIR}"
+ SBINDIR="${S_BIN_DIR}")
-# ADD LINKER FLAGS (generates, e.g., -lglog on Linux).
-######################################################
-target_link_libraries(${MESOS_TESTS_TARGET} ${MESOS_TESTS_LIBS})
-target_link_libraries(${TEST_HELPER_TARGET} ${MESOS_TESTS_LIBS})
+add_executable(mesos-tests EXCLUDE_FROM_ALL ${MESOS_TESTS_SRC})
+target_link_libraries(mesos-tests PRIVATE mesos-tests-interface)
target_compile_definitions(
- ${MESOS_TESTS_TARGET} PRIVATE
+ mesos-tests PRIVATE
$<$<BOOL:${HAS_JAVA}>:MESOS_HAS_JAVA>)
-# ADD BINARY DEPENDENCIES (tells CMake what to compile/build first).
-####################################################################
+# Helper to run tests that require a subprocess.
+add_executable(test-helper EXCLUDE_FROM_ALL ${TEST_HELPER_SRC})
+target_link_libraries(test-helper PRIVATE mesos-tests-interface)
+
+# The tests require these binaries.
add_dependencies(
- ${MESOS_TESTS_TARGET}
- ${MESOS_TESTS_DEPENDENCIES}
- ${TEST_HELPER_TARGET}
- )
+ mesos-tests
+ test-helper
+ mesos-agent
+ mesos-default-executor
+ mesos-docker-executor
+ mesos-executor
+ mesos-containerizer
+ mesos-tcp-connect
+ mesos-usage)
if (NOT WIN32)
- # The tests require all the test modules.
+ # The tests require these binaries.
+ # NOTE: These binaries do not yet build on Windows.
+ add_dependencies(
+ mesos-tests
+ mesos-execute
+ mesos-fetcher
+ mesos-log
+ mesos-local
+ mesos-master
+ mesos-io-switchboard
+ mesos-cni-port-mapper
+ mesos-logrotate-logger)
+
+ # The tests require all the test modules. These are not directly linked but
+ # instead loaded at runtime, hence the manual dependency here.
# NOTE: Modules are not supported on Windows.
add_dependencies(
- ${MESOS_TESTS_TARGET}
- ${TEST_ALLOCATOR}
- ${TEST_ANONYMOUS}
- ${TEST_AUTHENTICATION}
- ${TEST_AUTHORIZER}
- ${TEST_CONTAINER_LOGGER}
- ${TEST_EXAMPLEMODULE}
- ${TEST_HOOK}
- ${TEST_HTTPAUTHENTICATOR}
- ${TEST_ISOLATOR}
- ${TEST_MASTER_CONTENDER}
- ${TEST_MASTER_DETECTOR}
- ${TEST_QOS_CONTROLLER}
- ${TEST_RESOURCE_ESTIMATOR}
- )
+ mesos-tests
+ testallocator
+ testanonymous
+ testauthentication
+ testauthorizer
+ testcontainer_logger
+ examplemodule
+ testhook
+ testhttpauthenticator
+ testisolator
+ testmastercontender
+ testmasterdetector
+ testqos_controller
+ testresource_estimator)
# The tests require all the example frameworks and executors.
- # TODO(josephw): The scheduler driver is current not built on Windows.
+ # TODO(josephw): The scheduler driver is currently not built on Windows.
add_dependencies(
- ${MESOS_TESTS_TARGET}
- ${BALLOON_EXECUTOR}
- ${BALLOON_FRAMEWORK}
- ${DISK_FULL_FRAMEWORK}
- ${DOCKER_NO_EXECUTOR_FRAMEWORK}
- ${DYNAMIC_RESERVATION_FRAMEWORK}
- ${LOAD_GENERATOR_FRAMEWORK}
- ${LONG_LIVED_EXECUTOR}
- ${LONG_LIVED_FRAMEWORK}
- ${NO_EXECUTOR_FRAMEWORK}
- ${PERSISTENT_VOLUME_FRAMEWORK}
- ${TEST_EXECUTOR}
- ${TEST_FRAMEWORK}
- ${TEST_HTTP_EXECUTOR}
- ${TEST_HTTP_FRAMEWORK}
- )
+ mesos-tests
+ balloon-executor
+ balloon-framework
+ disk-full-framework
+ docker-no-executor-framework
+ dynamic-reservation-framework
+ load-generator-framework
+ long-lived-executor
+ long-lived-framework
+ no-executor-framework
+ persistent-volume-framework
+ test-executor
+ test-framework
+ test-http-executor
+ test-http-framework)
endif ()
-add_dependencies(${TEST_HELPER_TARGET} ${MESOS_TESTS_DEPENDENCIES})
# ADD TEST TARGET (runs when you do, e.g., `make check`).
#########################################################
-add_test(NAME MesosTests COMMAND ${MESOS_TESTS_TARGET})
+add_test(NAME MesosTests COMMAND mesos-tests)
http://git-wip-us.apache.org/repos/asf/mesos/blob/d10fd9b8/src/tests/cmake/MesosTestsConfigure.cmake
----------------------------------------------------------------------
diff --git a/src/tests/cmake/MesosTestsConfigure.cmake b/src/tests/cmake/MesosTestsConfigure.cmake
deleted file mode 100644
index 8cf2d7f..0000000
--- a/src/tests/cmake/MesosTestsConfigure.cmake
+++ /dev/null
@@ -1,96 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-set(
- MESOS_TESTS_TARGET mesos-tests
- CACHE STRING "Target we use to refer to tests for the mesos"
- )
-
-set(
- TEST_HELPER_TARGET test-helper
- CACHE STRING "Test helper target to run tests that require a subprocess"
- )
-
-# COMPILER CONFIGURATION.
-#########################
-# NOTE: On Windows, these paths should be Windows-style, with '\' characters
-# separating path components. Unfortunately, CMake does not escape these
-# slashes in path strings, so when we pass them as preprocessor flags,
-# a string like `C:\src` will look to the standard Windows API like a
-# string with an escaped '\s' character.
-#
-# On the other hand, Windows APIs are happy to take Unix-style paths as
-# arguments. So, to unblock making the agent tests work, we simply use
-# Unix paths here.
-set(CURRENT_CMAKE_SOURCE_DIR ${CMAKE_SOURCE_DIR})
-set(CURRENT_CMAKE_BUILD_DIR ${CMAKE_BINARY_DIR})
-
-add_definitions(-DSOURCE_DIR="${CURRENT_CMAKE_SOURCE_DIR}")
-add_definitions(-DBUILD_DIR="${CURRENT_CMAKE_BUILD_DIR}")
-
-add_definitions(-DPKGLIBEXECDIR="${PKG_LIBEXEC_INSTALL_DIR}")
-add_definitions(-DTESTLIBEXECDIR="${TEST_LIB_EXEC_DIR}")
-add_definitions(-DPKGMODULEDIR="${PKG_MODULE_DIR}")
-add_definitions(-DSBINDIR="${S_BIN_DIR}")
-
-# DEFINE PROCESS LIBRARY DEPENDENCIES. Tells the process library build targets
-# download/configure/build all third-party libraries before attempting to build.
-################################################################################
-set(MESOS_TESTS_DEPENDENCIES
- ${MESOS_TESTS_DEPENDENCIES}
- ${MESOS_TARGET}
- )
-
-# DEFINE THIRD-PARTY INCLUDE DIRECTORIES. Tells compiler toolchain where to get
-# headers for our third party libs (e.g., -I/path/to/glog on Linux)..
-###############################################################################
-set(MESOS_TESTS_INCLUDE_DIRS
- ${MESOS_TESTS_INCLUDE_DIRS}
- ${AGENT_INCLUDE_DIRS}
- )
-
-set(MESOS_3RDPARTY_TESTS_INCLUDE_DIRS
- ${MESOS_3RDPARTY_TESTS_INCLUDE_DIRS}
- ${AGENT_3RDPARTY_INCLUDE_DIRS}
- )
-
-# DEFINE THIRD-PARTY LIB INSTALL DIRECTORIES. Used to tell the compiler
-# toolchain where to find our third party libs (e.g., -L/path/to/glog on
-# Linux).
-########################################################################
-set(MESOS_TESTS_LIB_DIRS
- ${MESOS_TESTS_LIB_DIRS}
- )
-
-# DEFINE THIRD-PARTY LIBS. Used to generate flags that the linker uses to
-# include our third-party libs (e.g., -lglog on Linux).
-#########################################################################
-set(MESOS_TESTS_LIBS
- ${MESOS_TESTS_LIBS}
- ${MESOS_LIBS_TARGET}
- ${MESOS_LIBS}
- process
- googletest
- )
-
-if (NOT WIN32)
- set(MESOS_TESTS_LIBS
- ${MESOS_TESTS_LIBS}
- ${QOS_CONTROLLER_TARGET}
- ${RESOURCE_ESTIMATOR_TARGET}
- ${LOGROTATE_CONTAINER_LOGGER_TARGET}
- )
-endif ()
http://git-wip-us.apache.org/repos/asf/mesos/blob/d10fd9b8/src/usage/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/usage/CMakeLists.txt b/src/usage/CMakeLists.txt
index fc87b29..e51fe1e 100644
--- a/src/usage/CMakeLists.txt
+++ b/src/usage/CMakeLists.txt
@@ -14,22 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# THE MESOS USAGE SOURCE.
-#########################
-set(USAGE_EXECUTABLE_SRC
- ${USAGE_EXECUTABLE_SRC}
- main.cpp
- )
-
# THE USAGE EXECUTABLE.
#######################
-add_executable(${MESOS_USAGE} ${USAGE_EXECUTABLE_SRC})
-
-# ADD LINKER FLAGS (generates, e.g., -lglog on Linux).
-######################################################
-target_link_libraries(${MESOS_USAGE} ${AGENT_LIBS} ${MESOS_LIBS_TARGET})
-
-# ADD BINARY DEPENDENCIES (tells CMake what to compile/build first).
-####################################################################
-add_dependencies(${MESOS_TARGET} ${MESOS_USAGE})
-add_dependencies(${MESOS_USAGE} ${MESOS_LIBS_TARGET})
+add_executable(mesos-usage main.cpp)
+target_link_libraries(mesos-usage PRIVATE mesos)
[14/42] mesos git commit: CMake: Updated the ZooKeeper patch.
Posted by jo...@apache.org.
CMake: Updated the ZooKeeper patch.
This patch was generated with ZOOKEEPER-2841 and ZOOKEEPER-1643 (the
original patch). This adds a CMake build system to ZooKeeper and fixes
the Windows build. The exact patch lives at:
https://github.com/andschwa/zookeeper/tree/cmake-backport-3.4.8
Note that the deletion of the .sln file was removed in comparison to the
PR to backport these patches to ZooKeeper's 3.4 branch. This is because
the file is committed with CRLF line endings, but the generated patch
does not include them. This confuses GNU Patch, and the easiest solution
was to ignore the deletion of the file.
When PR #313 is accepted to ZooKeeper and the next patch version of 3.4
is released, we can replace the tarball and delete this patch.
Review: https://reviews.apache.org/r/61308/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/c16e4fb0
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/c16e4fb0
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/c16e4fb0
Branch: refs/heads/master
Commit: c16e4fb0eff5af7dd952ed8df6a6d3a904ea3039
Parents: a155f51
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Thu Aug 17 12:52:03 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:06 2017 -0700
----------------------------------------------------------------------
3rdparty/zookeeper-3.4.8.patch | 1748 ++++++++++++++++++++++++++++++++++-
1 file changed, 1741 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/c16e4fb0/3rdparty/zookeeper-3.4.8.patch
----------------------------------------------------------------------
diff --git a/3rdparty/zookeeper-3.4.8.patch b/3rdparty/zookeeper-3.4.8.patch
index 486df1a..c532a69 100644
--- a/3rdparty/zookeeper-3.4.8.patch
+++ b/3rdparty/zookeeper-3.4.8.patch
@@ -1,8 +1,1211 @@
-diff --git a/src/c/src/mt_adaptor.c b/src/c/src/mt_adaptor.c
-index 7dc7878..9c62991 100644
---- a/src/c/src/mt_adaptor.c
-+++ b/src/c/src/mt_adaptor.c
-@@ -483,13 +483,7 @@ int32_t inc_ref_counter(zhandle_t* zh,int i)
+diff --git c/src/c/CMakeLists.txt w/src/c/CMakeLists.txt
+new file mode 100644
+index 000000000..0f256b59c
+--- /dev/null
++++ w/src/c/CMakeLists.txt
+@@ -0,0 +1,237 @@
++# Licensed to the Apache Software Foundation (ASF) under one
++# or more contributor license agreements. See the NOTICE file
++# distributed with this work for additional information
++# regarding copyright ownership. The ASF licenses this file
++# to you under the Apache License, Version 2.0 (the
++# "License"); you may not use this file except in compliance
++# with the License. You may obtain a copy of the License at
++#
++# http://www.apache.org/licenses/LICENSE-2.0
++#
++# Unless required by applicable law or agreed to in writing, software
++# distributed under the License is distributed on an "AS IS" BASIS,
++# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++# See the License for the specific language governing permissions and
++# limitations under the License.
++
++cmake_minimum_required(VERSION 3.6)
++
++project(zookeeper VERSION 3.4.8)
++set(email user@zookeeper.apache.org)
++set(description "zookeeper C client")
++
++# general options
++include_directories(include tests generated ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
++if(UNIX)
++ add_compile_options(-Wall -fPIC)
++elseif(WIN32)
++ add_compile_options(/W3)
++endif()
++add_definitions(-DUSE_STATIC_LIB)
++
++# TODO: Enable /WX and /W4 on Windows. Currently there are ~1000 warnings.
++# TODO: Add Solaris support.
++# TODO: Add a shared library option.
++# TODO: Specify symbols to export.
++# TODO: Generate doxygen documentation.
++
++# Sync API option
++option(WANT_SYNCAPI "Enables Sync API support" ON)
++if(WANT_SYNCAPI)
++ add_definitions(-DTHREADED)
++ if(WIN32)
++ # Note that the generator expression ensures that `/MTd` is used when Debug
++ # configurations are built.
++ add_compile_options(/MT$<$<CONFIG:Debug>:d>)
++ endif()
++endif()
++
++# CppUnit option
++if(WIN32 OR APPLE)
++ # The tests do not yet compile on Windows or macOS,
++ # so we set this to off by default.
++ #
++ # Note that CMake does not have expressions except in conditionals,
++ # so we're left with this if/else/endif pattern.
++ set(DEFAULT_WANT_CPPUNIT OFF)
++else()
++ set(DEFAULT_WANT_CPPUNIT ON)
++endif()
++option(WANT_CPPUNIT "Enables CppUnit and tests" ${DEFAULT_WANT_CPPUNIT})
++
++# The function `to_have(in out)` converts a header name like `arpa/inet.h`
++# into an Autotools style preprocessor definition `HAVE_ARPA_INET_H`.
++# This is then set or unset in `configure_file()` step.
++#
++# Note that CMake functions do not have return values; instead an "out"
++# variable must be passed, and explicitly set with parent scope.
++function(to_have in out)
++ string(TOUPPER ${in} str)
++ string(REGEX REPLACE "/|\\." "_" str ${str})
++ set(${out} "HAVE_${str}" PARENT_SCOPE)
++endfunction()
++
++# include file checks
++foreach(f generated/zookeeper.jute.h generated/zookeeper.jute.c)
++ if(EXISTS "${CMAKE_SOURCE_DIR}/${f}")
++ to_have(${f} name)
++ set(${name} 1)
++ else()
++ message(FATAL_ERROR
++ "jute files are missing!\n"
++ "Please run 'ant compile_jute' while in the ZooKeeper top level directory.")
++ endif()
++endforeach()
++
++# header checks
++include(CheckIncludeFile)
++set(check_headers
++ arpa/inet.h
++ dlfcn.h
++ fcntl.h
++ inttypes.h
++ memory.h
++ netdb.h
++ netinet/in.h
++ stdint.h
++ stdlib.h
++ string.h
++ strings.h
++ sys/socket.h
++ sys/stat.h
++ sys/time.h
++ sys/types.h
++ unistd.h
++ sys/utsname.h)
++
++foreach(f ${check_headers})
++ to_have(${f} name)
++ check_include_file(${f} ${name})
++endforeach()
++
++# function checks
++include(CheckFunctionExists)
++set(check_functions
++ getcwd
++ gethostbyname
++ gethostname
++ getlogin
++ getpwuid_r
++ gettimeofday
++ getuid
++ memmove
++ memset
++ poll
++ socket
++ strchr
++ strdup
++ strerror
++ strtol)
++
++foreach(fn ${check_functions})
++ to_have(${fn} name)
++ check_function_exists(${fn} ${name})
++endforeach()
++
++# library checks
++set(check_libraries rt m pthread)
++foreach(lib ${check_libraries})
++ to_have("lib${lib}" name)
++ find_library(${name} ${lib})
++endforeach()
++
++# IPv6 check
++include(CheckStructHasMember)
++check_struct_has_member("struct sockaddr_in6" sin6_addr "netinet/in.h" ZOO_IPV6_ENABLED)
++
++# configure
++configure_file(cmake_config.h.in ${CMAKE_SOURCE_DIR}/include/config.h)
++
++# hashtable library
++set(hashtable_sources src/hashtable/hashtable_itr.c src/hashtable/hashtable.c)
++add_library(hashtable STATIC ${hashtable_sources})
++target_link_libraries(hashtable PUBLIC $<$<PLATFORM_ID:Linux>:m>)
++
++# zookeeper library
++set(zookeeper_sources
++ src/zookeeper.c
++ src/recordio.c
++ generated/zookeeper.jute.c
++ src/zk_log.c
++ src/zk_hashtable.c)
++
++if(WANT_SYNCAPI)
++ list(APPEND zookeeper_sources src/mt_adaptor.c)
++else()
++ list(APPEND zookeeper_sources src/st_adaptor.c)
++endif()
++
++if(WIN32)
++ list(APPEND zookeeper_sources src/winport.c)
++endif()
++
++add_library(zookeeper STATIC ${zookeeper_sources})
++target_link_libraries(zookeeper PUBLIC
++ hashtable
++ $<$<PLATFORM_ID:Linux>:rt> # clock_gettime
++ $<$<PLATFORM_ID:Windows>:ws2_32>) # Winsock 2.0
++
++if(WANT_SYNCAPI AND NOT WIN32)
++ find_package(Threads REQUIRED)
++ target_link_libraries(zookeeper PUBLIC Threads::Threads)
++endif()
++
++# cli executable
++add_executable(cli src/cli.c)
++target_link_libraries(cli zookeeper)
++
++# load_gen executable
++if(WANT_SYNCAPI AND NOT WIN32)
++ add_executable(load_gen src/load_gen.c)
++ target_link_libraries(load_gen zookeeper)
++endif()
++
++# tests
++set(test_sources
++ tests/TestDriver.cc
++ tests/LibCMocks.cc
++ tests/LibCSymTable.cc
++ tests/MocksBase.cc
++ tests/ZKMocks.cc
++ tests/Util.cc
++ tests/ThreadingUtil.cc
++ tests/TestZookeeperInit.cc
++ tests/TestZookeeperClose.cc
++ tests/TestClientRetry.cc
++ tests/TestOperations.cc
++ tests/TestMulti.cc
++ tests/TestWatchers.cc
++ tests/TestClient.cc)
++
++if(WANT_SYNCAPI)
++ list(APPEND test_sources tests/PthreadMocks.cc)
++endif()
++
++if(WANT_CPPUNIT)
++ add_executable(zktest ${test_sources})
++ target_compile_definitions(zktest
++ PRIVATE -DZKSERVER_CMD="${CMAKE_SOURCE_DIR}/tests/zkServer.sh")
++ # TODO: Use `find_library()` for `cppunit`.
++ target_link_libraries(zktest zookeeper cppunit dl)
++
++ # This reads the link flags from the file `tests/wrappers.opt` into
++ # the variable `symbol_wrappers` for use in `target_link_libraries`.
++ # It is a holdover from the original build system.
++ file(STRINGS tests/wrappers.opt symbol_wrappers)
++ if(WANT_SYNCAPI)
++ file(STRINGS tests/wrappers-mt.opt symbol_wrappers_mt)
++ endif()
++
++ target_link_libraries(zktest ${symbol_wrappers} ${symbol_wrappers_mt})
++
++ enable_testing()
++ add_test(NAME zktest_runner COMMAND zktest)
++ set_property(TEST zktest_runner PROPERTY ENVIRONMENT
++ "ZKROOT=${CMAKE_SOURCE_DIR}/../.."
++ "CLASSPATH=$CLASSPATH:$CLOVER_HOME/lib/clover.jar")
++endif()
+diff --git c/src/c/Cli.vcproj w/src/c/Cli.vcproj
+deleted file mode 100644
+index 39ed8a429..000000000
+--- c/src/c/Cli.vcproj
++++ /dev/null
+@@ -1,210 +0,0 @@
+-<?xml version="1.0" encoding="Windows-1252"?>
+-<VisualStudioProject
+- ProjectType="Visual C++"
+- Version="9.00"
+- Name="Cli"
+- ProjectGUID="{050228F9-070F-4806-A2B5-E6B95D8EC4AF}"
+- RootNamespace="Cli"
+- Keyword="Win32Proj"
+- TargetFrameworkVersion="196613"
+- >
+- <Platforms>
+- <Platform
+- Name="Win32"
+- />
+- </Platforms>
+- <ToolFiles>
+- </ToolFiles>
+- <Configurations>
+- <Configuration
+- Name="Debug|Win32"
+- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+- IntermediateDirectory="$(ConfigurationName)"
+- ConfigurationType="1"
+- CharacterSet="1"
+- >
+- <Tool
+- Name="VCPreBuildEventTool"
+- />
+- <Tool
+- Name="VCCustomBuildTool"
+- />
+- <Tool
+- Name="VCXMLDataGeneratorTool"
+- />
+- <Tool
+- Name="VCWebServiceProxyGeneratorTool"
+- />
+- <Tool
+- Name="VCMIDLTool"
+- />
+- <Tool
+- Name="VCCLCompilerTool"
+- Optimization="0"
+- AdditionalIncludeDirectories="$(ZOOKEEPER_HOME)\src\c\src;$(ZOOKEEPER_HOME)\src\c\include;$(ZOOKEEPER_HOME)\src\c;$(ZOOKEEPER_HOME)\src\c\generated"
+- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;THREADED"
+- MinimalRebuild="true"
+- BasicRuntimeChecks="3"
+- RuntimeLibrary="3"
+- UsePrecompiledHeader="0"
+- WarningLevel="3"
+- DebugInformationFormat="4"
+- CompileAs="1"
+- />
+- <Tool
+- Name="VCManagedResourceCompilerTool"
+- />
+- <Tool
+- Name="VCResourceCompilerTool"
+- />
+- <Tool
+- Name="VCPreLinkEventTool"
+- />
+- <Tool
+- Name="VCLinkerTool"
+- AdditionalDependencies="Ws2_32.lib zookeeper_d.lib"
+- OutputFile="$(OutDir)\$(ProjectName).exe"
+- LinkIncremental="2"
+- AdditionalLibraryDirectories="$(ZOOKEEPER_HOME)\src\c\Debug"
+- GenerateDebugInformation="true"
+- SubSystem="1"
+- TargetMachine="1"
+- />
+- <Tool
+- Name="VCALinkTool"
+- />
+- <Tool
+- Name="VCManifestTool"
+- />
+- <Tool
+- Name="VCXDCMakeTool"
+- />
+- <Tool
+- Name="VCBscMakeTool"
+- />
+- <Tool
+- Name="VCFxCopTool"
+- />
+- <Tool
+- Name="VCAppVerifierTool"
+- />
+- <Tool
+- Name="VCPostBuildEventTool"
+- />
+- </Configuration>
+- <Configuration
+- Name="Release|Win32"
+- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+- IntermediateDirectory="$(ConfigurationName)"
+- ConfigurationType="1"
+- CharacterSet="1"
+- WholeProgramOptimization="1"
+- >
+- <Tool
+- Name="VCPreBuildEventTool"
+- />
+- <Tool
+- Name="VCCustomBuildTool"
+- />
+- <Tool
+- Name="VCXMLDataGeneratorTool"
+- />
+- <Tool
+- Name="VCWebServiceProxyGeneratorTool"
+- />
+- <Tool
+- Name="VCMIDLTool"
+- />
+- <Tool
+- Name="VCCLCompilerTool"
+- Optimization="2"
+- EnableIntrinsicFunctions="true"
+- AdditionalIncludeDirectories="$(ZOOKEEPER_HOME)\src\c\src;$(ZOOKEEPER_HOME)\src\c\include;$(ZOOKEEPER_HOME)\src\c;$(ZOOKEEPER_HOME)\src\c\generated"
+- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;THREADED"
+- RuntimeLibrary="2"
+- EnableFunctionLevelLinking="true"
+- UsePrecompiledHeader="0"
+- WarningLevel="3"
+- DebugInformationFormat="3"
+- CompileAs="1"
+- />
+- <Tool
+- Name="VCManagedResourceCompilerTool"
+- />
+- <Tool
+- Name="VCResourceCompilerTool"
+- />
+- <Tool
+- Name="VCPreLinkEventTool"
+- />
+- <Tool
+- Name="VCLinkerTool"
+- AdditionalDependencies="Ws2_32.lib zookeeper.lib"
+- LinkIncremental="1"
+- AdditionalLibraryDirectories="$(ZOOKEEPER_HOME)\src\c\Release"
+- GenerateDebugInformation="true"
+- SubSystem="1"
+- OptimizeReferences="2"
+- EnableCOMDATFolding="2"
+- TargetMachine="1"
+- />
+- <Tool
+- Name="VCALinkTool"
+- />
+- <Tool
+- Name="VCManifestTool"
+- />
+- <Tool
+- Name="VCXDCMakeTool"
+- />
+- <Tool
+- Name="VCBscMakeTool"
+- />
+- <Tool
+- Name="VCFxCopTool"
+- />
+- <Tool
+- Name="VCAppVerifierTool"
+- />
+- <Tool
+- Name="VCPostBuildEventTool"
+- />
+- </Configuration>
+- </Configurations>
+- <References>
+- </References>
+- <Files>
+- <Filter
+- Name="Source Files"
+- Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+- >
+- <File
+- RelativePath=".\src\cli.c"
+- >
+- <FileConfiguration
+- Name="Debug|Win32"
+- >
+- <Tool
+- Name="VCCLCompilerTool"
+- AdditionalIncludeDirectories="$(ZOOKEEPER_HOME)\src\c\include;$(ZOOKEEPER_HOME)\src\c;$(ZOOKEEPER_HOME)\src\c\src"
+- />
+- </FileConfiguration>
+- </File>
+- </Filter>
+- <Filter
+- Name="Header Files"
+- Filter="h;hpp;hxx;hm;inl;inc;xsd"
+- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+- >
+- </Filter>
+- <Filter
+- Name="Resource Files"
+- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+- >
+- </Filter>
+- </Files>
+- <Globals>
+- </Globals>
+-</VisualStudioProject>
+diff --git c/src/c/README w/src/c/README
+index 0b31d0a7a..4f1ad7abf 100644
+--- c/src/c/README
++++ w/src/c/README
+@@ -71,6 +71,28 @@ tar downloaded from Apache please skip to step 2.
+ default only HTML documentation is generated. For information on
+ other document formats please use "./configure --help"
+
++Alternatively you can use the CMake build system. On Windows, this is required.
++Follow steps 1 and 2 above, and then continue here.
++
++1) do a "cmake [OPTIONS]" to generate the makefile or msbuild files (the correct
++ build system will be generated based on your platform). Some options from above
++ are supported:
++ -DCMAKE_BUILD_TYPE Debug by default, Release enables optimzation etc.
++ -DWANT_SYNCAPI ON by default, OFF disables the Sync API support
++ -DWANT_CPPUNIT ON except on Windows, OFF disables the tests
++ -DBUILD_SHARED_LIBS not yet supported, only static libraries are built
++ other CMake options see "cmake --help" for generic options, such as generator
++
++2) do a "cmake --build ." to build the default targets. Alternatively you can
++ invoke "make" or "msbuild" manually. If the tests were enabled, use "ctest -V"
++ to run them.
++
++Current limitations of the CMake build system include lack of Solaris support,
++no shared library option, no explicitly exported symbols (all are exported by
++default), no versions on the libraries, and no documentation generation.
++Features of CMake include a single, easily consumed cross-platform build system
++to generate the ZooKeeper C Client libraries for any project, with little to no
++configuration.
+
+ USING THE CLIENT
+
+diff --git c/src/c/cmake_config.h.in w/src/c/cmake_config.h.in
+new file mode 100644
+index 000000000..55efd8a86
+--- /dev/null
++++ w/src/c/cmake_config.h.in
+@@ -0,0 +1,154 @@
++/**
++ * Licensed to the Apache Software Foundation (ASF) under one
++ * or more contributor license agreements. See the NOTICE file
++ * distributed with this work for additional information
++ * regarding copyright ownership. The ASF licenses this file
++ * to you under the Apache License, Version 2.0 (the
++ * "License"); you may not use this file except in compliance
++ * with the License. You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ */
++
++#ifndef CONFIG_H_
++#define CONFIG_H_
++
++/* Define to 1 if you have the <arpa/inet.h> header file. */
++#cmakedefine HAVE_ARPA_INET_H 1
++
++/* Define to 1 if you have the <dlfcn.h> header file. */
++#cmakedefine HAVE_DLFCN_H 1
++
++/* Define to 1 if you have the <fcntl.h> header file. */
++#cmakedefine HAVE_FCNTL_H 1
++
++/* Define to 1 if you have the file `generated/zookeeper.jute.c'. */
++#cmakedefine HAVE_GENERATED_ZOOKEEPER_JUTE_C 1
++
++/* Define to 1 if you have the file `generated/zookeeper.jute.h'. */
++#cmakedefine HAVE_GENERATED_ZOOKEEPER_JUTE_H 1
++
++/* Define to 1 if you have the `getcwd' function. */
++#cmakedefine HAVE_GETCWD 1
++
++/* Define to 1 if you have the `gethostbyname' function. */
++#cmakedefine HAVE_GETHOSTBYNAME 1
++
++/* Define to 1 if you have the `gethostname' function. */
++#cmakedefine HAVE_GETHOSTNAME 1
++
++/* Define to 1 if you have the `getlogin' function. */
++#cmakedefine HAVE_GETLOGIN 1
++
++/* Define to 1 if you have the `getpwuid_r' function. */
++#cmakedefine HAVE_GETPWUID_R 1
++
++/* Define to 1 if you have the `gettimeofday' function. */
++#cmakedefine HAVE_GETTIMEOFDAY 1
++
++/* Define to 1 if you have the `getuid' function. */
++#cmakedefine HAVE_GETUID 1
++
++/* Define to 1 if you have the <inttypes.h> header file. */
++#cmakedefine HAVE_INTTYPES_H 1
++
++/* Define to 1 if you have the `rt' library (-lrt). */
++#cmakedefine HAVE_LIBRT 1
++
++/* Define to 1 if you have the `memmove' function. */
++#cmakedefine HAVE_MEMMOVE 1
++
++/* Define to 1 if you have the <memory.h> header file. */
++#cmakedefine HAVE_MEMORY_H 1
++
++/* Define to 1 if you have the `memset' function. */
++#cmakedefine HAVE_MEMSET 1
++
++/* Define to 1 if you have the <netdb.h> header file. */
++#cmakedefine HAVE_NETDB_H 1
++
++/* Define to 1 if you have the <netinet/in.h> header file. */
++#cmakedefine HAVE_NETINET_IN_H 1
++
++/* Define to 1 if you have the `poll' function. */
++#cmakedefine HAVE_POLL 1
++
++/* Define to 1 if you have the `socket' function. */
++#cmakedefine HAVE_SOCKET 1
++
++/* Define to 1 if you have the <stdint.h> header file. */
++#cmakedefine HAVE_STDINT_H 1
++
++/* Define to 1 if you have the <stdlib.h> header file. */
++#cmakedefine HAVE_STDLIB_H 1
++
++/* Define to 1 if you have the `strchr' function. */
++#cmakedefine HAVE_STRCHR 1
++
++/* Define to 1 if you have the `strdup' function. */
++#cmakedefine HAVE_STRDUP 1
++
++/* Define to 1 if you have the `strerror' function. */
++#cmakedefine HAVE_STRERROR 1
++
++/* Define to 1 if you have the <strings.h> header file. */
++#cmakedefine HAVE_STRINGS_H 1
++
++/* Define to 1 if you have the <string.h> header file. */
++#cmakedefine HAVE_STRING_H 1
++
++/* Define to 1 if you have the `strtol' function. */
++#cmakedefine HAVE_STRTOL 1
++
++/* Define to 1 if you have the <sys/socket.h> header file. */
++#cmakedefine HAVE_SYS_SOCKET_H 1
++
++/* Define to 1 if you have the <sys/stat.h> header file. */
++#cmakedefine HAVE_SYS_STAT_H 1
++
++/* Define to 1 if you have the <sys/time.h> header file. */
++#cmakedefine HAVE_SYS_TIME_H 1
++
++/* Define to 1 if you have the <sys/types.h> header file. */
++#cmakedefine HAVE_SYS_TYPES_H 1
++
++/* Define to 1 if you have the <sys/utsname.h> header file. */
++#cmakedefine HAVE_SYS_UTSNAME_H 1
++
++/* Define to 1 if you have the <unistd.h> header file. */
++#cmakedefine HAVE_UNISTD_H 1
++
++/* Define to 1 if IPv6 support is available. */
++#cmakedefine ZOO_IPV6_ENABLED 1
++
++/* poll() second argument type */
++#define POLL_NFDS_TYPE nfds_t
++
++/* Name of package */
++#define PACKAGE "${PROJECT_NAME}"
++
++/* Define to the address where bug reports for this package should be sent. */
++#define PACKAGE_BUGREPORT "${email}"
++
++/* Define to the full name of this package. */
++#define PACKAGE_NAME "${description}"
++
++/* Define to the full name and version of this package. */
++#define PACKAGE_STRING "${description} ${PROJECT_VERSION}"
++
++/* Define to the one symbol short name of this package. */
++#define PACKAGE_TARNAME "${PROJECT_NAME}"
++
++/* Define to the version of this package. */
++#define PACKAGE_VERSION "${PROJECT_VERSION}"
++
++/* Version number of package */
++#define VERSION "${PROJECT_VERSION}"
++
++#endif
+diff --git c/src/c/include/recordio.h w/src/c/include/recordio.h
+index 90f458b4a..eed5f99c2 100644
+--- c/src/c/include/recordio.h
++++ w/src/c/include/recordio.h
+@@ -19,11 +19,12 @@
+ #define __RECORDIO_H__
+
+ #include <sys/types.h>
+-#ifndef WIN32
+-#define STRUCT_INITIALIZER(l,r) .l = r
+-#else
+-#define STRUCT_INITIALIZER(l,r) r
++#include <stdint.h> /* for int64_t */
++#ifdef WIN32
+ #include "winconfig.h"
++#define STRUCT_INITIALIZER(l,r) r
++#else
++#define STRUCT_INITIALIZER(l,r) .l = r
+ #endif
+
+ #ifdef __cplusplus
+diff --git c/src/c/include/winconfig.h w/src/c/include/winconfig.h
+index 06c377e93..c273a932a 100644
+--- c/src/c/include/winconfig.h
++++ w/src/c/include/winconfig.h
+@@ -1,196 +1,15 @@
+-/* Define to 1 if you have the <arpa/inet.h> header file. */
+-#undef HAVE_ARPA_INET_H
+-
+-/* Define to 1 if you have the <dlfcn.h> header file. */
+-#undef HAVE_DLFCN_H
+-
+-/* Define to 1 if you have the <fcntl.h> header file. */
+-#undef HAVE_FCNTL_H
+-
+-/* Define to 1 if you have the file `generated/zookeeper.jute.c'. */
+-#define HAVE_GENERATED_ZOOKEEPER_JUTE_C 1
+-
+-/* Define to 1 if you have the file `generated/zookeeper.jute.h'. */
+-#define HAVE_GENERATED_ZOOKEEPER_JUTE_H 1
+-
+-/* Define to 1 if you have the `getcwd' function. */
+-#undef HAVE_GETCWD
+-
+-/* Define to 1 if you have the `gethostbyname' function. */
+-#undef HAVE_GETHOSTBYNAME
+-
+-/* Define to 1 if you have the `gethostname' function. */
+-#define HAVE_GETHOSTNAME 1
+-
+-/* Define to 1 if you have the `getlogin' function. */
+-#undef HAVE_GETLOGIN
+-
+-/* Define to 1 if you have the `getpwuid_r' function. */
+-#undef HAVE_GETPWUID_R
+-
+-/* Define to 1 if you have the `gettimeofday' function. */
+-#undef HAVE_GETTIMEOFDAY
+-
+-/* Define to 1 if you have the `getuid' function. */
+-#undef HAVE_GETUID
+-
+-/* Define to 1 if you have the <inttypes.h> header file. */
+-#undef HAVE_INTTYPES_H
+-
+-/* Define to 1 if you have the `memmove' function. */
+-#undef HAVE_MEMMOVE
+-
+-/* Define to 1 if you have the <memory.h> header file. */
+-#undef HAVE_MEMORY_H
+-
+-/* Define to 1 if you have the `memset' function. */
+-#undef HAVE_MEMSET
+-
+-/* Define to 1 if you have the <netdb.h> header file. */
+-#undef HAVE_NETDB_H
+-
+-/* Define to 1 if you have the <netinet/in.h> header file. */
+-#undef HAVE_NETINET_IN_H
+-
+-/* Define to 1 if you have the `poll' function. */
+-#undef HAVE_POLL
+-
+-/* Define to 1 if you have the `socket' function. */
+-#undef HAVE_SOCKET
+-
+-/* Define to 1 if you have the <stdint.h> header file. */
+-#undef HAVE_STDINT_H
+-
+-/* Define to 1 if you have the <stdlib.h> header file. */
+-#define HAVE_STDLIB_H 1
+-
+-/* Define to 1 if you have the `strchr' function. */
+-#define HAVE_STRCHR 1
+-
+-/* Define to 1 if you have the `strdup' function. */
+-#define HAVE_STRDUP 1
+-
+-/* Define to 1 if you have the `strerror' function. */
+-#define HAVE_STRERROR 1
+-
+-/* Define to 1 if you have the <strings.h> header file. */
+-#undef HAVE_STRINGS_H
+-
+-/* Define to 1 if you have the <string.h> header file. */
+-#undef HAVE_STRING_H
+-
+-/* Define to 1 if you have the `strtol' function. */
+-#undef HAVE_STRTOL
+-
+-/* Define to 1 if you have the <sys/socket.h> header file. */
+-#undef HAVE_SYS_SOCKET_H
+-
+-/* Define to 1 if you have the <sys/stat.h> header file. */
+-#undef HAVE_SYS_STAT_H
+-
+-/* Define to 1 if you have the <sys/time.h> header file. */
+-#undef HAVE_SYS_TIME_H
+-
+-/* Define to 1 if you have the <sys/types.h> header file. */
+-#undef HAVE_SYS_TYPES_H
+-
+-/* Define to 1 if you have the <sys/utsname.h> header file. */
+-#undef HAVE_SYS_UTSNAME_H
+-
+-/* Define to 1 if you have the <unistd.h> header file. */
+-#undef HAVE_UNISTD_H
+-
+-/* Define to the sub-directory in which libtool stores uninstalled libraries.
+- */
+-#define LT_OBJDIR
+-
+-/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+-/* #undef NO_MINUS_C_MINUS_O */
+-
+-/* Name of package */
+-#define PACKAGE "c-client-src"
+-
+-/* Define to the address where bug reports for this package should be sent. */
+-#define PACKAGE_BUGREPORT "user@zookeeper.apache.org"
+-
+-/* Define to the full name of this package. */
+-#define PACKAGE_NAME "zookeeper C client"
+-
+-/* Define to the full name and version of this package. */
+-#define PACKAGE_STRING "zookeeper C client 3.4.8 win32"
+-
+-/* Define to the one symbol short name of this package. */
+-#define PACKAGE_TARNAME "c-client-src"
+-
+-/* Define to the home page for this package. */
+-#define PACKAGE_URL ""
+-
+-/* Define to the version of this package. */
+-#define PACKAGE_VERSION "3.4.8"
+-
+-/* poll() second argument type */
+-#define POLL_NFDS_TYPE
+-
+-/* Define to 1 if you have the ANSI C header files. */
+-#define STDC_HEADERS
+-
+-/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+-#define TIME_WITH_SYS_TIME
+-
+-/* Version number of package */
+-#define VERSION "3.4.8"
+-
+-/* Define to empty if `const' does not conform to ANSI C. */
+-/* #undef const */
++#ifndef WINCONFIG_H_
++#define WINCONFIG_H_
+
+ /* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+ #ifndef __cplusplus
+ #define inline __inline
+ #endif
+-#ifdef WIN32
++
+ #define __attribute__(x)
+ #define __func__ __FUNCTION__
+
+-#ifndef _WIN32_WINNT_NT4
+-#define _WIN32_WINNT_NT4 0x0400
+-#endif
+-
+-#define NTDDI_VERSION _WIN32_WINNT_NT4
+-#define _WIN32_WINNT _WIN32_WINNT_NT4
+-
+-#define _CRT_SECURE_NO_WARNINGS
+-#define WIN32_LEAN_AND_MEAN
+-#include <Windows.h>
+-#include <Winsock2.h>
+-#include <winstdint.h>
+-#include <process.h>
+-#include <ws2tcpip.h>
+-#undef AF_INET6
+-#undef min
+-#undef max
+-
+-#include <errno.h>
+-
+-#define strtok_r strtok_s
+-#define localtime_r(a,b) localtime_s(b,a)
+-#define get_errno() errno=GetLastError()
+-#define random rand
+-#define snprintf _snprintf
+-
+-#define ACL ZKACL // Conflict with windows API
+-
+-#define EAI_ADDRFAMILY WSAEINVAL
+-#define EHOSTDOWN EPIPE
+-#define ESTALE ENODEV
+-
+-#ifndef EWOULDBLOCK
+-#define EWOULDBLOCK WSAEWOULDBLOCK
+-#endif
+-
+-#ifndef EINPROGRESS
+-#define EINPROGRESS WSAEINPROGRESS
+-#endif
+-
+-typedef int pid_t;
++#define ACL ZKACL /* Conflict with windows API */
++
+ #endif
+diff --git c/src/c/include/winstdint.h w/src/c/include/winstdint.h
+deleted file mode 100644
+index d02608a59..000000000
+--- c/src/c/include/winstdint.h
++++ /dev/null
+@@ -1,247 +0,0 @@
+-// ISO C9x compliant stdint.h for Microsoft Visual Studio
+-// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
+-//
+-// Copyright (c) 2006-2008 Alexander Chemeris
+-//
+-// Redistribution and use in source and binary forms, with or without
+-// modification, are permitted provided that the following conditions are met:
+-//
+-// 1. Redistributions of source code must retain the above copyright notice,
+-// this list of conditions and the following disclaimer.
+-//
+-// 2. Redistributions in binary form must reproduce the above copyright
+-// notice, this list of conditions and the following disclaimer in the
+-// documentation and/or other materials provided with the distribution.
+-//
+-// 3. The name of the author may be used to endorse or promote products
+-// derived from this software without specific prior written permission.
+-//
+-// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+-// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+-// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+-// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+-// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+-// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+-// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+-// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-//
+-///////////////////////////////////////////////////////////////////////////////
+-
+-#ifndef _MSC_VER // [
+-#error "Use this header only with Microsoft Visual C++ compilers!"
+-#endif // _MSC_VER ]
+-
+-#ifndef _MSC_STDINT_H_ // [
+-#define _MSC_STDINT_H_
+-
+-#if _MSC_VER > 1000
+-#pragma once
+-#endif
+-
+-#include <limits.h>
+-
+-// For Visual Studio 6 in C++ mode and for many Visual Studio versions when
+-// compiling for ARM we should wrap <wchar.h> include with 'extern "C++" {}'
+-// or compiler give many errors like this:
+-// error C2733: second C linkage of overloaded function 'wmemchr' not allowed
+-#ifdef __cplusplus
+-extern "C" {
+-#endif
+-# include <wchar.h>
+-#ifdef __cplusplus
+-}
+-#endif
+-
+-// Define _W64 macros to mark types changing their size, like intptr_t.
+-#ifndef _W64
+-# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
+-# define _W64 __w64
+-# else
+-# define _W64
+-# endif
+-#endif
+-
+-
+-// 7.18.1 Integer types
+-
+-// 7.18.1.1 Exact-width integer types
+-
+-// Visual Studio 6 and Embedded Visual C++ 4 doesn't
+-// realize that, e.g. char has the same size as __int8
+-// so we give up on __intX for them.
+-#if (_MSC_VER < 1300)
+- typedef signed char int8_t;
+- typedef signed short int16_t;
+- typedef signed int int32_t;
+- typedef unsigned char uint8_t;
+- typedef unsigned short uint16_t;
+- typedef unsigned int uint32_t;
+-#else
+- typedef signed __int8 int8_t;
+- typedef signed __int16 int16_t;
+- typedef signed __int32 int32_t;
+- typedef unsigned __int8 uint8_t;
+- typedef unsigned __int16 uint16_t;
+- typedef unsigned __int32 uint32_t;
+-#endif
+-typedef signed __int64 int64_t;
+-typedef unsigned __int64 uint64_t;
+-
+-
+-// 7.18.1.2 Minimum-width integer types
+-typedef int8_t int_least8_t;
+-typedef int16_t int_least16_t;
+-typedef int32_t int_least32_t;
+-typedef int64_t int_least64_t;
+-typedef uint8_t uint_least8_t;
+-typedef uint16_t uint_least16_t;
+-typedef uint32_t uint_least32_t;
+-typedef uint64_t uint_least64_t;
+-
+-// 7.18.1.3 Fastest minimum-width integer types
+-typedef int8_t int_fast8_t;
+-typedef int16_t int_fast16_t;
+-typedef int32_t int_fast32_t;
+-typedef int64_t int_fast64_t;
+-typedef uint8_t uint_fast8_t;
+-typedef uint16_t uint_fast16_t;
+-typedef uint32_t uint_fast32_t;
+-typedef uint64_t uint_fast64_t;
+-
+-// 7.18.1.4 Integer types capable of holding object pointers
+-#ifdef _WIN64 // [
+- typedef signed __int64 intptr_t;
+- typedef unsigned __int64 uintptr_t;
+-#else // _WIN64 ][
+- typedef _W64 signed int intptr_t;
+- typedef _W64 unsigned int uintptr_t;
+-#endif // _WIN64 ]
+-
+-// 7.18.1.5 Greatest-width integer types
+-typedef int64_t intmax_t;
+-typedef uint64_t uintmax_t;
+-
+-
+-// 7.18.2 Limits of specified-width integer types
+-
+-#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259
+-
+-// 7.18.2.1 Limits of exact-width integer types
+-#define INT8_MIN ((int8_t)_I8_MIN)
+-#define INT8_MAX _I8_MAX
+-#define INT16_MIN ((int16_t)_I16_MIN)
+-#define INT16_MAX _I16_MAX
+-#define INT32_MIN ((int32_t)_I32_MIN)
+-#define INT32_MAX _I32_MAX
+-#define INT64_MIN ((int64_t)_I64_MIN)
+-#define INT64_MAX _I64_MAX
+-#define UINT8_MAX _UI8_MAX
+-#define UINT16_MAX _UI16_MAX
+-#define UINT32_MAX _UI32_MAX
+-#define UINT64_MAX _UI64_MAX
+-
+-// 7.18.2.2 Limits of minimum-width integer types
+-#define INT_LEAST8_MIN INT8_MIN
+-#define INT_LEAST8_MAX INT8_MAX
+-#define INT_LEAST16_MIN INT16_MIN
+-#define INT_LEAST16_MAX INT16_MAX
+-#define INT_LEAST32_MIN INT32_MIN
+-#define INT_LEAST32_MAX INT32_MAX
+-#define INT_LEAST64_MIN INT64_MIN
+-#define INT_LEAST64_MAX INT64_MAX
+-#define UINT_LEAST8_MAX UINT8_MAX
+-#define UINT_LEAST16_MAX UINT16_MAX
+-#define UINT_LEAST32_MAX UINT32_MAX
+-#define UINT_LEAST64_MAX UINT64_MAX
+-
+-// 7.18.2.3 Limits of fastest minimum-width integer types
+-#define INT_FAST8_MIN INT8_MIN
+-#define INT_FAST8_MAX INT8_MAX
+-#define INT_FAST16_MIN INT16_MIN
+-#define INT_FAST16_MAX INT16_MAX
+-#define INT_FAST32_MIN INT32_MIN
+-#define INT_FAST32_MAX INT32_MAX
+-#define INT_FAST64_MIN INT64_MIN
+-#define INT_FAST64_MAX INT64_MAX
+-#define UINT_FAST8_MAX UINT8_MAX
+-#define UINT_FAST16_MAX UINT16_MAX
+-#define UINT_FAST32_MAX UINT32_MAX
+-#define UINT_FAST64_MAX UINT64_MAX
+-
+-// 7.18.2.4 Limits of integer types capable of holding object pointers
+-#ifdef _WIN64 // [
+-# define INTPTR_MIN INT64_MIN
+-# define INTPTR_MAX INT64_MAX
+-# define UINTPTR_MAX UINT64_MAX
+-#else // _WIN64 ][
+-# define INTPTR_MIN INT32_MIN
+-# define INTPTR_MAX INT32_MAX
+-# define UINTPTR_MAX UINT32_MAX
+-#endif // _WIN64 ]
+-
+-// 7.18.2.5 Limits of greatest-width integer types
+-#define INTMAX_MIN INT64_MIN
+-#define INTMAX_MAX INT64_MAX
+-#define UINTMAX_MAX UINT64_MAX
+-
+-// 7.18.3 Limits of other integer types
+-
+-#ifdef _WIN64 // [
+-# define PTRDIFF_MIN _I64_MIN
+-# define PTRDIFF_MAX _I64_MAX
+-#else // _WIN64 ][
+-# define PTRDIFF_MIN _I32_MIN
+-# define PTRDIFF_MAX _I32_MAX
+-#endif // _WIN64 ]
+-
+-#define SIG_ATOMIC_MIN INT_MIN
+-#define SIG_ATOMIC_MAX INT_MAX
+-
+-#ifndef SIZE_MAX // [
+-# ifdef _WIN64 // [
+-# define SIZE_MAX _UI64_MAX
+-# else // _WIN64 ][
+-# define SIZE_MAX _UI32_MAX
+-# endif // _WIN64 ]
+-#endif // SIZE_MAX ]
+-
+-// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>
+-#ifndef WCHAR_MIN // [
+-# define WCHAR_MIN 0
+-#endif // WCHAR_MIN ]
+-#ifndef WCHAR_MAX // [
+-# define WCHAR_MAX _UI16_MAX
+-#endif // WCHAR_MAX ]
+-
+-#define WINT_MIN 0
+-#define WINT_MAX _UI16_MAX
+-
+-#endif // __STDC_LIMIT_MACROS ]
+-
+-
+-// 7.18.4 Limits of other integer types
+-
+-#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260
+-
+-// 7.18.4.1 Macros for minimum-width integer constants
+-
+-#define INT8_C(val) val##i8
+-#define INT16_C(val) val##i16
+-#define INT32_C(val) val##i32
+-#define INT64_C(val) val##i64
+-
+-#define UINT8_C(val) val##ui8
+-#define UINT16_C(val) val##ui16
+-#define UINT32_C(val) val##ui32
+-#define UINT64_C(val) val##ui64
+-
+-// 7.18.4.2 Macros for greatest-width integer constants
+-#define INTMAX_C INT64_C
+-#define UINTMAX_C UINT64_C
+-
+-#endif // __STDC_CONSTANT_MACROS ]
+-
+-
+-#endif // _MSC_STDINT_H_ ]
+diff --git c/src/c/include/zookeeper.h w/src/c/include/zookeeper.h
+index 7d1066a93..b0bb09e3f 100644
+--- c/src/c/include/zookeeper.h
++++ w/src/c/include/zookeeper.h
+@@ -20,12 +20,18 @@
+ #define ZOOKEEPER_H_
+
+ #include <stdlib.h>
++
++/* we must not include config.h as a public header */
+ #ifndef WIN32
+ #include <sys/socket.h>
+ #include <sys/time.h>
+-#else
+-#include "winconfig.h"
+ #endif
++
++#ifdef WIN32
++#include <winsock2.h> /* must always be included before ws2tcpip.h */
++#include <ws2tcpip.h> /* for struct sock_addr and socklen_t */
++#endif
++
+ #include <stdio.h>
+ #include <ctype.h>
+
+diff --git c/src/c/src/load_gen.c w/src/c/src/load_gen.c
+index 72b595076..0410ca137 100644
+--- c/src/c/src/load_gen.c
++++ w/src/c/src/load_gen.c
+@@ -19,13 +19,9 @@
+ #include <zookeeper.h>
+ #include "zookeeper_log.h"
+ #include <errno.h>
+-#ifndef WIN32
+ #ifdef THREADED
+ #include <pthread.h>
+ #endif
+-#else
+-#include "win32port.h"
+-#endif
+ #include <string.h>
+ #include <stdlib.h>
+
+diff --git c/src/c/src/mt_adaptor.c w/src/c/src/mt_adaptor.c
+index 7dc78789f..52d86d5d9 100644
+--- c/src/c/src/mt_adaptor.c
++++ w/src/c/src/mt_adaptor.c
+@@ -19,7 +19,7 @@
+ #define THREADED
+ #endif
+
+-#ifndef DLL_EXPORT
++#if !defined(DLL_EXPORT) && !defined(USE_STATIC_LIB)
+ # define USE_STATIC_LIB
+ #endif
+
+@@ -373,8 +373,7 @@ void *do_io(void *v)
+ int interest;
+ int timeout;
+ int maxfd=1;
+- int rc;
+-
++
+ zookeeper_interest(zh, &fd, &interest, &tv);
+ if (fd != -1) {
+ fds[1].fd=fd;
+@@ -436,7 +435,7 @@ void *do_io(void *v)
+ }
+ #endif
+ // dispatch zookeeper events
+- rc = zookeeper_process(zh, interest);
++ zookeeper_process(zh, interest);
+ // check the current state of the zhandle and terminate
+ // if it is_unrecoverable()
+ if(is_unrecoverable(zh))
+@@ -483,25 +482,9 @@ int32_t inc_ref_counter(zhandle_t* zh,int i)
int32_t fetch_and_add(volatile int32_t* operand, int incr)
{
#ifndef WIN32
@@ -15,5 +1218,536 @@ index 7dc7878..9c62991 100644
- return result;
+ return __sync_fetch_and_add(operand, incr);
#else
- volatile int32_t result;
- _asm
+- volatile int32_t result;
+- _asm
+- {
+- mov eax, operand; //eax = v;
+- mov ebx, incr; // ebx = i;
+- mov ecx, 0x0; // ecx = 0;
+- lock xadd dword ptr [eax], ecx;
+- lock xadd dword ptr [eax], ebx;
+- mov result, ecx; // result = ebx;
+- }
+- return result;
++ return InterlockedExchangeAdd(operand, incr);
+ #endif
+ }
+
+diff --git c/src/c/src/recordio.c w/src/c/src/recordio.c
+index 41797fbc9..e5944d6be 100644
+--- c/src/c/src/recordio.c
++++ w/src/c/src/recordio.c
+@@ -23,6 +23,8 @@
+ #include <stdlib.h>
+ #ifndef WIN32
+ #include <netinet/in.h>
++#else
++#include <winsock2.h> /* for _htonl and _ntohl */
+ #endif
+
+ void deallocate_String(char **s)
+diff --git c/src/c/src/winport.c w/src/c/src/winport.c
+index aeef3a84e..3592ea149 100644
+--- c/src/c/src/winport.c
++++ w/src/c/src/winport.c
+@@ -18,8 +18,10 @@
+
+ #ifdef WIN32
+ #include "winport.h"
+-#include <winsock2.h>
+-#include <ws2tcpip.h>
++#include <stdlib.h>
++#include <stdint.h> /* for int64_t */
++#include <winsock2.h> /* must always be included before ws2tcpip.h */
++#include <ws2tcpip.h> /* for SOCKET */
+
+ int pthread_mutex_lock(pthread_mutex_t* _mutex ){
+ int rc = WaitForSingleObject( *_mutex, // handle to mutex
+@@ -255,6 +257,14 @@ int pthread_setspecific(pthread_key_t key, const void *value)
+ return ((rc != 0 ) ? 0 : GetLastError());
+ }
+
++int gettimeofday(struct timeval *tp, void *tzp) {
++ int64_t now = 0;
++ if (tzp != 0) { errno = EINVAL; return -1; }
++ GetSystemTimeAsFileTime( (LPFILETIME)&now );
++ tp->tv_sec = (long)(now / 10000000 - 11644473600LL);
++ tp->tv_usec = (now / 10) % 1000000;
++ return 0;
++}
+
+ int close(SOCKET fd) {
+ return closesocket(fd);
+diff --git c/src/c/src/winport.h w/src/c/src/winport.h
+index 32272c03d..da6028cd3 100644
+--- c/src/c/src/winport.h
++++ w/src/c/src/winport.h
+@@ -25,9 +25,31 @@
+ #define WINPORT_H_
+
+ #ifdef WIN32
+-#include <winconfig.h>
++#include "winconfig.h"
++
++#define _WINSOCK_DEPRECATED_NO_WARNINGS
++#include <winsock2.h> /* must always be included before ws2tcpip.h */
++#include <ws2tcpip.h> /* for struct sock_addr used in zookeeper.h */
++
++/* POSIX names are deprecated, use ISO conformant names instead. */
++#define strdup _strdup
++#define getcwd _getcwd
++#define getpid _getpid
++
++/* Windows "secure" versions of POSIX reentrant functions */
++#define strtok_r strtok_s
++#define localtime_r(a,b) localtime_s(b,a)
++
++/* After this version of MSVC, snprintf became a defined function,
++ and so cannot be redefined, nor can #ifndef be used to guard it. */
++#if ((defined(_MSC_VER) && _MSC_VER < 1900) || !defined(_MSC_VER))
++#define snprintf _snprintf
++#endif
++
++
+ #include <errno.h>
+ #include <process.h>
++#include <stdint.h> /* for int64_t */
+ #include <stdlib.h>
+ #include <malloc.h>
+
+@@ -105,14 +127,7 @@ int pthread_key_delete(pthread_key_t key);
+ void *pthread_getspecific(pthread_key_t key);
+ int pthread_setspecific(pthread_key_t key, const void *value);
+
+-inline int gettimeofday(struct timeval *tp, void *tzp) {
+- int64_t now = 0;
+- if (tzp != 0) { errno = EINVAL; return -1; }
+- GetSystemTimeAsFileTime( (LPFILETIME)&now );
+- tp->tv_sec = (long)(now / 10000000 - 11644473600LL);
+- tp->tv_usec = (now / 10) % 1000000;
+- return 0;
+-}
++int gettimeofday(struct timeval *tp, void *tzp);
+ int close(SOCKET fd);
+ int Win32WSAStartup();
+ void Win32WSACleanup();
+diff --git c/src/c/src/zk_log.c w/src/c/src/zk_log.c
+index 37ff856ca..6b4fdfa2b 100644
+--- c/src/c/src/zk_log.c
++++ w/src/c/src/zk_log.c
+@@ -16,13 +16,16 @@
+ * limitations under the License.
+ */
+
+-#ifndef DLL_EXPORT
++#if !defined(DLL_EXPORT) && !defined(USE_STATIC_LIB)
+ # define USE_STATIC_LIB
+ #endif
+
+ #include "zookeeper_log.h"
+ #ifndef WIN32
+ #include <unistd.h>
++#else
++typedef DWORD pid_t;
++#include <process.h> /* for getpid */
+ #endif
+
+ #include <stdarg.h>
+diff --git c/src/c/src/zookeeper.c w/src/c/src/zookeeper.c
+index 1ba90afa2..9b837f227 100644
+--- c/src/c/src/zookeeper.c
++++ w/src/c/src/zookeeper.c
+@@ -16,7 +16,7 @@
+ * limitations under the License.
+ */
+
+-#ifndef DLL_EXPORT
++#if !defined(DLL_EXPORT) && !defined(USE_STATIC_LIB)
+ # define USE_STATIC_LIB
+ #endif
+
+@@ -24,6 +24,7 @@
+ #define USE_IPV6
+ #endif
+
++#include "config.h"
+ #include <zookeeper.h>
+ #include <zookeeper.jute.h>
+ #include <proto.h>
+@@ -41,16 +42,33 @@
+ #include <stdarg.h>
+ #include <limits.h>
+
+-#ifndef WIN32
++#ifdef HAVE_SYS_TIME_H
+ #include <sys/time.h>
++#endif
++
++#ifdef HAVE_SYS_SOCKET_H
+ #include <sys/socket.h>
++#endif
++
++#ifdef HAVE_POLL
+ #include <poll.h>
++#endif
++
++#ifdef HAVE_NETINET_IN_H
+ #include <netinet/in.h>
+ #include <netinet/tcp.h>
++#endif
++
++#ifdef HAVE_ARPA_INET_H
+ #include <arpa/inet.h>
++#endif
++
++#ifdef HAVE_NETDB_H
+ #include <netdb.h>
+-#include <unistd.h>
+-#include "config.h"
++#endif
++
++#ifdef HAVE_UNISTD_H
++#include <unistd.h> // needed for _POSIX_MONOTONIC_CLOCK
+ #endif
+
+ #ifdef HAVE_SYS_UTSNAME_H
+@@ -61,6 +79,15 @@
+ #include <pwd.h>
+ #endif
+
++#ifdef WIN32
++#define random rand /* replace POSIX random with Windows rand */
++#include <process.h> /* for getpid */
++#include <direct.h> /* for getcwd */
++#define EAI_ADDRFAMILY WSAEINVAL /* is this still needed? */
++#define EHOSTDOWN EPIPE
++#define ESTALE ENODEV
++#endif
++
+ #define IF_DEBUG(x) if(logLevel==ZOO_LOG_LEVEL_DEBUG) {x;}
+
+ const int ZOOKEEPER_WRITE = 1 << 0;
+@@ -1611,7 +1638,16 @@ int zookeeper_interest(zhandle_t *zh, int *fd, int *interest,
+ #endif
+ rc = connect(zh->fd, (struct sockaddr*) &zh->addrs[zh->connect_index], sizeof(struct sockaddr_in));
+ #ifdef WIN32
+- get_errno();
++ errno = GetLastError();
++
++#ifndef EWOULDBLOCK
++#define EWOULDBLOCK WSAEWOULDBLOCK
++#endif
++
++#ifndef EINPROGRESS
++#define EINPROGRESS WSAEINPROGRESS
++#endif
++
+ #if _MSC_VER >= 1600
+ switch (errno) {
+ case WSAEWOULDBLOCK:
+diff --git c/src/c/zookeeper.vcproj w/src/c/zookeeper.vcproj
+deleted file mode 100644
+index dc3ab43e3..000000000
+--- c/src/c/zookeeper.vcproj
++++ /dev/null
+@@ -1,300 +0,0 @@
+-???<?xml version="1.0" encoding="UTF-8"?>
+-<VisualStudioProject
+- ProjectType="Visual C++"
+- Version="9.00"
+- Name="zookeeper"
+- ProjectGUID="{5754FB2B-5EA5-4988-851D-908CA533A626}"
+- RootNamespace="zookeeper"
+- Keyword="Win32Proj"
+- TargetFrameworkVersion="0"
+- >
+- <Platforms>
+- <Platform
+- Name="Win32"
+- />
+- </Platforms>
+- <ToolFiles>
+- </ToolFiles>
+- <Configurations>
+- <Configuration
+- Name="Debug|Win32"
+- OutputDirectory="Debug"
+- IntermediateDirectory="Debug"
+- ConfigurationType="2"
+- CharacterSet="2"
+- >
+- <Tool
+- Name="VCPreBuildEventTool"
+- />
+- <Tool
+- Name="VCCustomBuildTool"
+- />
+- <Tool
+- Name="VCXMLDataGeneratorTool"
+- />
+- <Tool
+- Name="VCWebServiceProxyGeneratorTool"
+- />
+- <Tool
+- Name="VCMIDLTool"
+- />
+- <Tool
+- Name="VCCLCompilerTool"
+- Optimization="0"
+- AdditionalIncludeDirectories="$(ZOOKEEPER_HOME)\src\c\include;$(ZOOKEEPER_HOME)\src\c\generated;$(ZOOKEEPER_HOME)\src\c;$(ZOOKEEPER_HOME)\src\c\src\hashtable"
+- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;ZOOKEEPER_EXPORTS;DLL_EXPORT;THREADED"
+- MinimalRebuild="true"
+- BasicRuntimeChecks="3"
+- RuntimeLibrary="3"
+- UsePrecompiledHeader="0"
+- WarningLevel="3"
+- Detect64BitPortabilityProblems="false"
+- DebugInformationFormat="4"
+- CompileAs="1"
+- />
+- <Tool
+- Name="VCManagedResourceCompilerTool"
+- />
+- <Tool
+- Name="VCResourceCompilerTool"
+- />
+- <Tool
+- Name="VCPreLinkEventTool"
+- />
+- <Tool
+- Name="VCLinkerTool"
+- AdditionalDependencies="ws2_32.lib"
+- OutputFile="$(OutDir)\$(ProjectName).dll"
+- LinkIncremental="1"
+- AdditionalLibraryDirectories=""
+- GenerateDebugInformation="true"
+- SubSystem="2"
+- RandomizedBaseAddress="1"
+- DataExecutionPrevention="0"
+- ImportLibrary=".\Debug/zookeeper_d.lib"
+- TargetMachine="1"
+- />
+- <Tool
+- Name="VCALinkTool"
+- />
+- <Tool
+- Name="VCManifestTool"
+- />
+- <Tool
+- Name="VCXDCMakeTool"
+- />
+- <Tool
+- Name="VCBscMakeTool"
+- />
+- <Tool
+- Name="VCFxCopTool"
+- />
+- <Tool
+- Name="VCAppVerifierTool"
+- />
+- <Tool
+- Name="VCPostBuildEventTool"
+- />
+- </Configuration>
+- <Configuration
+- Name="Release|Win32"
+- OutputDirectory="Release"
+- IntermediateDirectory="Release"
+- ConfigurationType="2"
+- >
+- <Tool
+- Name="VCPreBuildEventTool"
+- />
+- <Tool
+- Name="VCCustomBuildTool"
+- />
+- <Tool
+- Name="VCXMLDataGeneratorTool"
+- />
+- <Tool
+- Name="VCWebServiceProxyGeneratorTool"
+- />
+- <Tool
+- Name="VCMIDLTool"
+- />
+- <Tool
+- Name="VCCLCompilerTool"
+- AdditionalIncludeDirectories="$(ZOOKEEPER_HOME)\src\c\generated;$(ZOOKEEPER_HOME)\src\c;$(ZOOKEEPER_HOME)\src\c\include"
+- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;ZOOKEEPER_EXPORTS;DLL_EXPORT;THREADED"
+- RuntimeLibrary="2"
+- UsePrecompiledHeader="0"
+- WarningLevel="3"
+- Detect64BitPortabilityProblems="true"
+- DebugInformationFormat="3"
+- CompileAs="1"
+- />
+- <Tool
+- Name="VCManagedResourceCompilerTool"
+- />
+- <Tool
+- Name="VCResourceCompilerTool"
+- />
+- <Tool
+- Name="VCPreLinkEventTool"
+- />
+- <Tool
+- Name="VCLinkerTool"
+- AdditionalDependencies="WS2_32.lib"
+- LinkIncremental="2"
+- GenerateDebugInformation="true"
+- SubSystem="2"
+- OptimizeReferences="2"
+- EnableCOMDATFolding="2"
+- TargetMachine="1"
+- />
+- <Tool
+- Name="VCALinkTool"
+- />
+- <Tool
+- Name="VCManifestTool"
+- />
+- <Tool
+- Name="VCXDCMakeTool"
+- />
+- <Tool
+- Name="VCBscMakeTool"
+- />
+- <Tool
+- Name="VCFxCopTool"
+- />
+- <Tool
+- Name="VCAppVerifierTool"
+- />
+- <Tool
+- Name="VCPostBuildEventTool"
+- />
+- </Configuration>
+- </Configurations>
+- <References>
+- </References>
+- <Files>
+- <Filter
+- Name="Header Files"
+- Filter="h;hpp;hxx;hm;inl;inc;xsd"
+- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+- >
+- <File
+- RelativePath=".\src\hashtable\hashtable.h"
+- >
+- </File>
+- <File
+- RelativePath=".\src\hashtable\hashtable_itr.h"
+- >
+- </File>
+- <File
+- RelativePath=".\src\hashtable\hashtable_private.h"
+- >
+- </File>
+- <File
+- RelativePath=".\include\proto.h"
+- >
+- </File>
+- <File
+- RelativePath=".\include\recordio.h"
+- >
+- </File>
+- <File
+- RelativePath=".\include\winconfig.h"
+- >
+- <FileConfiguration
+- Name="Debug|Win32"
+- >
+- <Tool
+- Name="VCCLCompilerTool"
+- />
+- </FileConfiguration>
+- </File>
+- <File
+- RelativePath=".\src\winport.h"
+- >
+- </File>
+- <File
+- RelativePath=".\include\winstdint.h"
+- >
+- </File>
+- <File
+- RelativePath=".\src\zk_adaptor.h"
+- >
+- </File>
+- <File
+- RelativePath=".\src\zk_hashtable.h"
+- >
+- </File>
+- <File
+- RelativePath=".\include\zookeeper.h"
+- >
+- </File>
+- <File
+- RelativePath=".\generated\zookeeper.jute.h"
+- >
+- </File>
+- <File
+- RelativePath=".\include\zookeeper_log.h"
+- >
+- </File>
+- <File
+- RelativePath=".\include\zookeeper_version.h"
+- >
+- </File>
+- </Filter>
+- <Filter
+- Name="Resource Files"
+- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+- >
+- </Filter>
+- <Filter
+- Name="Source Files"
+- Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+- >
+- <File
+- RelativePath=".\src\hashtable\hashtable.c"
+- >
+- </File>
+- <File
+- RelativePath=".\src\hashtable\hashtable_itr.c"
+- >
+- </File>
+- <File
+- RelativePath=".\src\mt_adaptor.c"
+- >
+- </File>
+- <File
+- RelativePath=".\src\recordio.c"
+- >
+- </File>
+- <File
+- RelativePath=".\src\winport.c"
+- >
+- </File>
+- <File
+- RelativePath=".\src\zk_hashtable.c"
+- >
+- </File>
+- <File
+- RelativePath=".\src\zk_log.c"
+- >
+- </File>
+- <File
+- RelativePath=".\src\zookeeper.c"
+- >
+- </File>
+- <File
+- RelativePath=".\generated\zookeeper.jute.c"
+- >
+- </File>
+- </Filter>
+- <File
+- RelativePath=".\ClassDiagram1.cd"
+- >
+- </File>
+- </Files>
+- <Globals>
+- </Globals>
+-</VisualStudioProject>
[17/42] mesos git commit: CMake: Added variables for library linkage
and suffixes.
Posted by jo...@apache.org.
CMake: Added variables for library linkage and suffixes.
These variables will be used to name imported libraries, which will
(with some exceptions) depend on the global linkage (shared/static)
of Mesos.
Review: https://reviews.apache.org/r/61285/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/0be34152
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/0be34152
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/0be34152
Branch: refs/heads/master
Commit: 0be341527956344eec56886ebc28653eaa813ed5
Parents: db716d7
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Wed Aug 16 07:23:04 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:06 2017 -0700
----------------------------------------------------------------------
3rdparty/CMakeLists.txt | 9 +++++++++
1 file changed, 9 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/0be34152/3rdparty/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
index a503194..e27d20d 100755
--- a/3rdparty/CMakeLists.txt
+++ b/3rdparty/CMakeLists.txt
@@ -16,6 +16,15 @@
include(ExternalProject)
+if (BUILD_SHARED_LIBS)
+ set(LIBRARY_LINKAGE SHARED)
+ set(LIBRARY_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
+else ()
+ set(LIBRARY_LINKAGE STATIC)
+ set(LIBRARY_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX})
+endif ()
+
+
# Define sources of third-party dependencies.
#############################################
if (REBUNDLED)
[12/42] mesos git commit: CMake: Supported finding homebrew
subversion libraries on macOS.
Posted by jo...@apache.org.
CMake: Supported finding homebrew subversion libraries on macOS.
This prefers the `brew` subversion package on macOS over the system
libraries.
Review: https://reviews.apache.org/r/61343/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/a155f51d
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/a155f51d
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/a155f51d
Branch: refs/heads/master
Commit: a155f51d9f2cb7ebfeea80c79c0a9b523974f464
Parents: ea39e12
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Sat Sep 2 08:14:16 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:06 2017 -0700
----------------------------------------------------------------------
3rdparty/stout/cmake/FindSvn.cmake | 9 +++++++++
1 file changed, 9 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/a155f51d/3rdparty/stout/cmake/FindSvn.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/stout/cmake/FindSvn.cmake b/3rdparty/stout/cmake/FindSvn.cmake
index 63aff9d..15ec6ed 100644
--- a/3rdparty/stout/cmake/FindSvn.cmake
+++ b/3rdparty/stout/cmake/FindSvn.cmake
@@ -16,12 +16,21 @@
include(FindPackageHelper)
+# 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 subversion
+ OUTPUT_VARIABLE SVN_PREFIX
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
set(POSSIBLE_SVN_INCLUDE_DIRS
+ ${SVN_PREFIX}/include/subversion-1
/usr/include/subversion-1
/usr/local/include/subversion-1
)
set(POSSIBLE_SVN_LIB_DIRS
+ ${SVN_PREFIX}/lib
/usr/lib
/usr/local/lib
)
[32/42] mesos git commit: CMake: Updated `check` and `tests` targets.
Posted by jo...@apache.org.
CMake: Updated `check` and `tests` targets.
Target names are being removed from variables, as they introduce
unnecessary noise.
Review: https://reviews.apache.org/r/61516/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/fb00e73f
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/fb00e73f
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/fb00e73f
Branch: refs/heads/master
Commit: fb00e73fb2bc58b4447592cb101e8e7667111d77
Parents: f1a28fa
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Sat Sep 2 21:53:48 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:08 2017 -0700
----------------------------------------------------------------------
CMakeLists.txt | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/fb00e73f/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a9d2f03..797fe2c 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -60,17 +60,8 @@ add_subdirectory(src)
# TESTS.
########
-add_custom_target(
- check ${STOUT_TESTS_TARGET}
- COMMAND ${PROCESS_TESTS_TARGET}
- COMMAND ${MESOS_TESTS_TARGET}
- DEPENDS ${STOUT_TESTS_TARGET} ${PROCESS_TESTS_TARGET} ${MESOS_TESTS_TARGET}
- )
-
-add_custom_target(
- tests
- DEPENDS ${STOUT_TESTS_TARGET} ${PROCESS_TESTS_TARGET} ${MESOS_TESTS_TARGET}
- )
+add_custom_target(check COMMAND ctest -V -C $<CONFIG> DEPENDS tests)
+add_custom_target(tests DEPENDS stout-tests libprocess-tests mesos-tests)
# PACKAGING.
############
[39/42] mesos git commit: CMake: Used `list(APPEND x ...)` where
appropriate (stout).
Posted by jo...@apache.org.
CMake: Used `list(APPEND x ...)` where appropriate (stout).
Now that the minimum version of CMake has been bumped above 3.0,
we can use `list(APPEND x ...)` instead of `set(x ${x} ...)`.
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/fc6c0dcb
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/fc6c0dcb
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/fc6c0dcb
Branch: refs/heads/master
Commit: fc6c0dcbad6ee803987c977abcb36ad76670e6f0
Parents: 3628c39
Author: Joseph Wu <jo...@apache.org>
Authored: Sun Sep 3 00:56:53 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:09 2017 -0700
----------------------------------------------------------------------
3rdparty/stout/tests/CMakeLists.txt | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/fc6c0dcb/3rdparty/stout/tests/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/stout/tests/CMakeLists.txt b/3rdparty/stout/tests/CMakeLists.txt
index 8a87672..6e5773f 100644
--- a/3rdparty/stout/tests/CMakeLists.txt
+++ b/3rdparty/stout/tests/CMakeLists.txt
@@ -55,8 +55,7 @@ set(STOUT_ROOT_TESTS_SRC
version_tests.cpp)
if (NOT WIN32)
- set(STOUT_ROOT_TESTS_SRC
- ${STOUT_ROOT_TESTS_SRC}
+ list(APPEND STOUT_ROOT_TESTS_SRC
protobuf_tests.cpp
protobuf_tests.pb.cc
svn_tests.cpp)
@@ -72,14 +71,14 @@ set(STOUT_OS_TESTS_SRC
os/systems_tests.cpp)
if (NOT WIN32)
- set(STOUT_OS_TESTS_SRC
- ${STOUT_OS_TESTS_SRC}
+ list(APPEND STOUT_OS_TESTS_SRC
os/sendfile_tests.cpp
os/signals_tests.cpp)
endif ()
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
- set(STOUT_ROOT_TESTS_SRC ${STOUT_ROOT_TESTS_SRC} proc_tests.cpp)
+ list(APPEND STOUT_ROOT_TESTS_SRC
+ proc_tests.cpp)
endif ()
set(STOUT_TESTS_SRC
[36/42] mesos git commit: CMake: Normalized trailing parentheses
style.
Posted by jo...@apache.org.
CMake: Normalized trailing parentheses style.
This removes dangling parentheses from CMake files setting variables
or calling functions.
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/3628c39f
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/3628c39f
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/3628c39f
Branch: refs/heads/master
Commit: 3628c39fb38a99bfc6b5747b5856d99ad4404332
Parents: 21f7837
Author: Joseph Wu <jo...@apache.org>
Authored: Sun Sep 3 00:43:41 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:09 2017 -0700
----------------------------------------------------------------------
3rdparty/cmake/PatchCommand.cmake | 3 +--
3rdparty/http-parser/CMakeLists.txt.template | 4 +---
CMakeLists.txt | 3 +--
cmake/CompilationConfigure.cmake | 15 +++++----------
cmake/MesosConfigure.cmake | 3 +--
src/CMakeLists.txt | 3 +--
6 files changed, 10 insertions(+), 21 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/3628c39f/3rdparty/cmake/PatchCommand.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/cmake/PatchCommand.cmake b/3rdparty/cmake/PatchCommand.cmake
index 4dd6639..d4353d8 100644
--- a/3rdparty/cmake/PatchCommand.cmake
+++ b/3rdparty/cmake/PatchCommand.cmake
@@ -37,8 +37,7 @@ if (WIN32)
"Also delete CMakeCache.txt to clear the cache. "
"Mesos for Windows requires GnuWin32 patch.exe "
"to apply updates. You may get it from "
- "http://gnuwin32.sourceforge.net/packages/patch.htm"
- )
+ "http://gnuwin32.sourceforge.net/packages/patch.htm")
else ()
message(
STATUS
http://git-wip-us.apache.org/repos/asf/mesos/blob/3628c39f/3rdparty/http-parser/CMakeLists.txt.template
----------------------------------------------------------------------
diff --git a/3rdparty/http-parser/CMakeLists.txt.template b/3rdparty/http-parser/CMakeLists.txt.template
index 9a67197..4ad3db0 100644
--- a/3rdparty/http-parser/CMakeLists.txt.template
+++ b/3rdparty/http-parser/CMakeLists.txt.template
@@ -26,10 +26,8 @@ project(http-parser)
include_directories(.)
set(HTTP_PARSER_SRC
- ${HTTP_PARSER_SRC}
http_parser.c
- http_parser.h
- )
+ http_parser.h)
add_definitions(-D HTTP_PARSER_STRICT=0)
add_definitions(-fPIC)
http://git-wip-us.apache.org/repos/asf/mesos/blob/3628c39f/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b506c78..e08fcef 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -81,8 +81,7 @@ set(CPACK_SOURCE_IGNORE_FILES
/mpi/;
/site/;
/support/;
- ${CMAKE_BINARY_DIR};
- )
+ ${CMAKE_BINARY_DIR};)
# Convert the ignore list to a string (as required by CPack).
set(CPACK_SOURCE_IGNORE_FILES "${CPACK_SOURCE_IGNORE_FILES}")
http://git-wip-us.apache.org/repos/asf/mesos/blob/3628c39f/cmake/CompilationConfigure.cmake
----------------------------------------------------------------------
diff --git a/cmake/CompilationConfigure.cmake b/cmake/CompilationConfigure.cmake
index 9aca1ca..9f692b0 100644
--- a/cmake/CompilationConfigure.cmake
+++ b/cmake/CompilationConfigure.cmake
@@ -80,8 +80,7 @@ if (WIN32)
message(
FATAL_ERROR
"The x64 toolset MUST be used. See MESOS-6720 for details. "
- "Please use `cmake -T ${PREFERRED_TOOLSET}`."
- )
+ "Please use `cmake -T ${PREFERRED_TOOLSET}`.")
endif ()
endif ()
@@ -188,8 +187,7 @@ if (WIN32)
message(
WARNING
"Mesos is deprecating support for ${CMAKE_GENERATOR}. "
- "Please use ${PREFERRED_GENERATOR}."
- )
+ "Please use ${PREFERRED_GENERATOR}.")
endif ()
# We don't support compilation against mingw headers (which, e.g., Clang on
@@ -299,8 +297,7 @@ if (WIN32)
list(APPEND MESOS_CPPFLAGS
-D_SCL_SECURE_NO_WARNINGS
-D_CRT_SECURE_NO_WARNINGS
- -D_CRT_NONSTDC_NO_WARNINGS
- )
+ -D_CRT_NONSTDC_NO_WARNINGS)
# Directory structure definitions.
# TODO(hausdorff): (MESOS-5455) These are placeholder values.
@@ -328,8 +325,7 @@ list(APPEND MESOS_CPPFLAGS
-DPKGLIBEXECDIR="${PKG_LIBEXEC_INSTALL_DIR}"
-DLIBDIR="${LIB_INSTALL_DIR}"
-DVERSION="${PACKAGE_VERSION}"
- -DPKGDATADIR="${DATA_INSTALL_PREFIX}"
- )
+ -DPKGDATADIR="${DATA_INSTALL_PREFIX}")
if (ENABLE_SSL)
list(APPEND MESOS_CPPFLAGS -DUSE_SSL_SOCKET=1)
@@ -375,8 +371,7 @@ endif ()
configure_file(
"${CMAKE_SOURCE_DIR}/src/common/build_config.hpp.in"
"${CMAKE_BINARY_DIR}/src/common/build_config.hpp"
- @ONLY
- )
+ @ONLY)
# NOTE: The quotes in these definitions are necessary. Without them, the
# preprocessor will interpret the symbols as (e.g.) int literals and uquoted
http://git-wip-us.apache.org/repos/asf/mesos/blob/3628c39f/cmake/MesosConfigure.cmake
----------------------------------------------------------------------
diff --git a/cmake/MesosConfigure.cmake b/cmake/MesosConfigure.cmake
index c5435f8..0954a9c 100644
--- a/cmake/MesosConfigure.cmake
+++ b/cmake/MesosConfigure.cmake
@@ -65,8 +65,7 @@ set(
${MESOS_BIN_INCLUDE_DIR}
${MESOS_BIN_INCLUDE_DIR}/mesos
${MESOS_BIN_SRC_DIR}
- ${MESOS_SRC_DIR}
- )
+ ${MESOS_SRC_DIR})
# Make directories that generated Mesos code goes into.
add_custom_target(
http://git-wip-us.apache.org/repos/asf/mesos/blob/3628c39f/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 18fb4c1..590e981 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -561,8 +561,7 @@ set(MESOS_SRC
${V1_SRC}
${VERSION_SRC}
${WATCHER_SRC}
- ${ZOOKEEPER_SRC}
- )
+ ${ZOOKEEPER_SRC})
if (NOT WIN32)
set(MESOS_SRC
[16/42] mesos git commit: CMake: Added workaround for imported
library include directory bug.
Posted by jo...@apache.org.
CMake: Added workaround for imported library include directory bug.
The include directory for imported libraries must exist, otherwise
CMake will error out. This is internally inconsistent with
`include_directories()`, which does not require directories given
to the function to exist.
Review: https://reviews.apache.org/r/61302/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/5c52e467
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/5c52e467
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/5c52e467
Branch: refs/heads/master
Commit: 5c52e467a905450d20bf4990ede1d39a145f8d95
Parents: 0be3415
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Thu Aug 17 12:20:05 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:06 2017 -0700
----------------------------------------------------------------------
3rdparty/CMakeLists.txt | 9 +++++++++
1 file changed, 9 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/5c52e467/3rdparty/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
index e27d20d..26ccb70 100755
--- a/3rdparty/CMakeLists.txt
+++ b/3rdparty/CMakeLists.txt
@@ -182,6 +182,15 @@ endif ()
# Third-party libraries. Tell the build system how to pull in and build third-
# party libraries at compile time, using the ExternalProject_Add macro.
##############################################################################
+
+# This function works around a CMake issue with setting include directories of
+# imported libraries built with `ExternalProject_Add`.
+# https://gitlab.kitware.com/cmake/cmake/issues/15052
+function(MAKE_INCLUDE_DIR TARGET)
+ get_target_property(DIR ${TARGET} INTERFACE_INCLUDE_DIRECTORIES)
+ file(MAKE_DIRECTORY ${DIR})
+endfunction()
+
ExternalProject_Add(
${BOOST_TARGET}
PREFIX ${BOOST_CMAKE_ROOT}
[05/42] mesos git commit: CMake: Added `stout` interface library.
Posted by jo...@apache.org.
CMake: Added `stout` interface library.
CMake provides a mechanism for dealing with header only libraries such
as stout: an interface library. Thus CMake will treat stout as a
"library" and automatically add the necessary compiler and link
information to targets which depend on stout.
Review: https://reviews.apache.org/r/61286/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/3b9658a6
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/3b9658a6
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/3b9658a6
Branch: refs/heads/master
Commit: 3b9658a63aa948487f6a08e7bfdb90918f3648c5
Parents: 85bc581
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Mon Aug 7 16:58:50 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:05 2017 -0700
----------------------------------------------------------------------
3rdparty/stout/CMakeLists.txt | 36 +++++++++++++++++++
3rdparty/stout/cmake/StoutConfigure.cmake | 7 +---
3rdparty/stout/cmake/StoutTestsConfigure.cmake | 8 -----
3rdparty/stout/tests/CMakeLists.txt | 39 +++++++++------------
4 files changed, 53 insertions(+), 37 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/3b9658a6/3rdparty/stout/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/stout/CMakeLists.txt b/3rdparty/stout/CMakeLists.txt
new file mode 100644
index 0000000..9fcde58
--- /dev/null
+++ b/3rdparty/stout/CMakeLists.txt
@@ -0,0 +1,36 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+include(StoutConfigure)
+
+# TODO(andschwa): Remove this when all libraries are fully qualified.
+link_directories(${STOUT_LIB_DIRS})
+
+# THE STOUT LIBRARY INTERFACE
+#############################
+add_library(stout INTERFACE)
+
+# TODO(andschwa): Remove this when all dependencies have top-level targets.
+add_dependencies(stout ${STOUT_DEPENDENCIES})
+
+target_include_directories(stout INTERFACE
+ include/
+ ${STOUT_3RDPARTY_INCLUDE_DIRS})
+
+target_link_libraries(stout INTERFACE
+ ${STOUT_LIBS})
+
+add_subdirectory(tests)
http://git-wip-us.apache.org/repos/asf/mesos/blob/3b9658a6/3rdparty/stout/cmake/StoutConfigure.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/stout/cmake/StoutConfigure.cmake b/3rdparty/stout/cmake/StoutConfigure.cmake
index 69474a8..48b153a 100644
--- a/3rdparty/stout/cmake/StoutConfigure.cmake
+++ b/3rdparty/stout/cmake/StoutConfigure.cmake
@@ -47,7 +47,7 @@ macro(GROUP_STOUT_HEADERS)
"*.h*")
endmacro()
-# DEFINE PROCESS LIBRARY DEPENDENCIES. Tells the process library build targets
+# DEFINE STOUT LIBRARY DEPENDENCIES. Tells the stout library build targets
# download/configure/build all third-party libraries before attempting to build.
################################################################################
set(STOUT_DEPENDENCIES
@@ -91,11 +91,6 @@ if (WIN32)
)
endif ()
-set(STOUT_INCLUDE_DIRS
- ${STOUT_INCLUDE_DIRS}
- ${STOUT_INCLUDE_DIR}
- )
-
# DEFINE THIRD-PARTY LIB INSTALL DIRECTORIES. Used to tell the compiler
# toolchain where to find our third party libs (e.g., -L/path/to/glog on
# Linux).
http://git-wip-us.apache.org/repos/asf/mesos/blob/3b9658a6/3rdparty/stout/cmake/StoutTestsConfigure.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/stout/cmake/StoutTestsConfigure.cmake b/3rdparty/stout/cmake/StoutTestsConfigure.cmake
index 43baaca..b6e9902 100644
--- a/3rdparty/stout/cmake/StoutTestsConfigure.cmake
+++ b/3rdparty/stout/cmake/StoutTestsConfigure.cmake
@@ -31,10 +31,6 @@
# for the core dependencies (e.g., where to find the .so/.dll files) without
# having to also export the variables for test-only dependencies.
-set(
- STOUT_TESTS_TARGET stout-tests
- CACHE STRING "Target we use to refer to tests for the stout library")
-
# COMPILER CONFIGURATION.
#########################
EXTERNAL("googletest" ${GOOGLETEST_VERSION} "${MESOS_3RDPARTY_BIN}")
@@ -62,7 +58,6 @@ set(GTEST_LFLAG gtest)
################################################################################
set(STOUT_TEST_DEPENDENCIES
${STOUT_TEST_DEPENDENCIES}
- ${STOUT_DEPENDENCIES}
${GOOGLETEST_TARGET}
)
@@ -71,7 +66,6 @@ set(STOUT_TEST_DEPENDENCIES
###############################################################################
set(STOUT_TEST_3RDPARTY_INCLUDE_DIRS
${STOUT_TEST_3RDPARTY_INCLUDE_DIRS}
- ${STOUT_3RDPARTY_INCLUDE_DIRS}
${GMOCK_INCLUDE_DIR}
${GTEST_INCLUDE_DIR}
)
@@ -82,7 +76,6 @@ set(STOUT_TEST_3RDPARTY_INCLUDE_DIRS
########################################################################
set(STOUT_TEST_LIB_DIRS
${STOUT_TEST_LIB_DIRS}
- ${STOUT_LIB_DIRS}
${GMOCK_LIB_DIR}
${GTEST_LIB_DIR}
)
@@ -92,7 +85,6 @@ set(STOUT_TEST_LIB_DIRS
#########################################################################
set(STOUT_TEST_LIBS
${STOUT_TEST_LIBS}
- ${STOUT_LIBS}
${GMOCK_LFLAG}
)
http://git-wip-us.apache.org/repos/asf/mesos/blob/3b9658a6/3rdparty/stout/tests/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/stout/tests/CMakeLists.txt b/3rdparty/stout/tests/CMakeLists.txt
index 953be64..74b8758 100644
--- a/3rdparty/stout/tests/CMakeLists.txt
+++ b/3rdparty/stout/tests/CMakeLists.txt
@@ -14,6 +14,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+# TODO(andschwa): Remove this when gmock and gtest can be included.
+include(StoutTestsConfigure)
+
# STOUT TESTS.
##############
set(STOUT_ROOT_TESTS_SRC
@@ -95,18 +98,6 @@ set(STOUT_TESTS_SRC
${STOUT_OS_TESTS_SRC}
)
-# INCLUDE DIRECTIVES FOR STOUT TEST BINARY (generates, e.g., -I/path/to/thing
-# on Linux).
-#############################################################################
-include_directories(SYSTEM ${STOUT_TEST_3RDPARTY_INCLUDE_DIRS})
-include_directories(${STOUT_INCLUDE_DIRS})
-include_directories(${CMAKE_CURRENT_BINARY_DIR})
-
-# LINKING LIBRARIES BY DIRECTORY (might generate, e.g., -L/path/to/thing on
-# Linux).
-###########################################################################
-link_directories(${STOUT_TEST_LIB_DIRS})
-
# THE C++ PROTOCOL BUFFER CODE (protobuf_tests.pb.h and protobuf_tests.pb.cc).
##############################################################################
add_custom_command(
@@ -117,10 +108,6 @@ add_custom_command(
${CMAKE_SOURCE_DIR}/3rdparty/stout/tests/protobuf_tests.proto
DEPENDS ${CMAKE_SOURCE_DIR}/3rdparty/stout/tests/protobuf_tests.proto)
-# THE STOUT TEST EXECUTABLE (generates, e.g., stout-tests, etc., on Linux).
-###########################################################################
-add_executable(${STOUT_TESTS_TARGET} EXCLUDE_FROM_ALL ${STOUT_TESTS_SRC})
-
GROUP_STOUT_HEADERS()
GROUP_SOURCE(
@@ -129,14 +116,20 @@ GROUP_SOURCE(
"${CMAKE_CURRENT_SOURCE_DIR}"
"*.[ch]*")
-# ADD LINKER FLAGS (generates, e.g., -lglog on Linux).
-######################################################
-target_link_libraries(${STOUT_TESTS_TARGET} ${STOUT_TEST_LIBS})
+# TODO(andschwa): Remove when gmock and gtest are top-level targets.
+link_directories(${STOUT_TEST_LIB_DIRS})
+
+add_executable(stout-tests EXCLUDE_FROM_ALL ${STOUT_TESTS_SRC})
+
+# TODO(andschwa): Remove when gmock and gtest are top-level targets.
+add_dependencies(stout-tests ${STOUT_TEST_DEPENDENCIES})
+target_include_directories(stout-tests PRIVATE
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${STOUT_TEST_3RDPARTY_INCLUDE_DIRS})
-# ADD BINARY DEPENDENCIES (tells CMake what to compile/build first).
-####################################################################
-add_dependencies(${STOUT_TESTS_TARGET} ${STOUT_TEST_DEPENDENCIES})
+# TODO(andschwa): Link to gmock and gtest explicitly.
+target_link_libraries(stout-tests stout ${STOUT_TEST_LIBS})
# ADD TEST TARGET (runs when you do, e.g., `make check`).
#########################################################
-add_test(NAME StoutTests COMMAND ${STOUT_TESTS_TARGET})
+add_test(NAME StoutTests COMMAND stout-tests)
[15/42] mesos git commit: CMake: Changed 3rdparty header libraries
into interfaces.
Posted by jo...@apache.org.
CMake: Changed 3rdparty header libraries into interfaces.
These rebundled packages are header-only library,
so it should be treated by CMake as an interface library:
* boost
* concurrentqueue
* elfio
* picojson
* nvml
Review: https://reviews.apache.org/r/61314/
Review: https://reviews.apache.org/r/61318/
Review: https://reviews.apache.org/r/61320/
Review: https://reviews.apache.org/r/61323/
Review: https://reviews.apache.org/r/61330/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/d431bbc0
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/d431bbc0
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/d431bbc0
Branch: refs/heads/master
Commit: d431bbc044bb422daa323328d810d8a943a02d3b
Parents: ad18680
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Thu Aug 17 15:47:03 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:06 2017 -0700
----------------------------------------------------------------------
3rdparty/CMakeLists.txt | 71 +++++++++++++++++++++++++++++++++++++-------
1 file changed, 61 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/d431bbc0/3rdparty/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
index 0362be7..eb258b3 100755
--- a/3rdparty/CMakeLists.txt
+++ b/3rdparty/CMakeLists.txt
@@ -113,6 +113,14 @@ function(MAKE_INCLUDE_DIR TARGET)
file(MAKE_DIRECTORY ${DIR})
endfunction()
+# Boost: C++ Libraries.
+# http://www.boost.org
+#######################
+EXTERNAL(boost ${BOOST_VERSION} "${MESOS_3RDPARTY_BIN}")
+add_library(boost INTERFACE)
+add_dependencies(boost ${BOOST_TARGET})
+target_include_directories(boost SYSTEM INTERFACE ${BOOST_ROOT})
+
ExternalProject_Add(
${BOOST_TARGET}
PREFIX ${BOOST_CMAKE_ROOT}
@@ -120,8 +128,16 @@ ExternalProject_Add(
BUILD_COMMAND ${CMAKE_NOOP}
INSTALL_COMMAND ${CMAKE_NOOP}
URL ${BOOST_URL}
- URL_HASH ${BOOST_HASH}
- )
+ URL_HASH ${BOOST_HASH})
+
+
+# moodycamel::ConcurrentQueue: An industrial-strength lock-free queue.
+# https://github.com/cameron314/concurrentqueue
+######################################################################
+EXTERNAL(concurrentqueue ${CONCURRENTQUEUE_VERSION} "${MESOS_3RDPARTY_BIN}")
+add_library(concurrentqueue INTERFACE)
+add_dependencies(concurrentqueue ${CONCURRENTQUEUE_TARGET})
+target_include_directories(concurrentqueue SYSTEM INTERFACE ${CONCURRENTQUEUE_ROOT})
ExternalProject_Add(
${CONCURRENTQUEUE_TARGET}
@@ -130,8 +146,16 @@ ExternalProject_Add(
BUILD_COMMAND ${CMAKE_NOOP}
INSTALL_COMMAND ${CMAKE_NOOP}
URL ${CONCURRENTQUEUE_URL}
- URL_HASH ${CONCURRENTQUEUE_HASH}
- )
+ URL_HASH ${CONCURRENTQUEUE_HASH})
+
+
+# ELFIO: library for reading and generating ELF files.
+# http://elfio.sourceforge.net
+######################################################
+EXTERNAL(elfio ${ELFIO_VERSION} "${MESOS_3RDPARTY_BIN}")
+add_library(elfio INTERFACE)
+add_dependencies(elfio ${ELFIO_TARGET})
+target_include_directories(elfio SYSTEM INTERFACE ${ELFIO_ROOT})
ExternalProject_Add(
${ELFIO_TARGET}
@@ -140,8 +164,8 @@ ExternalProject_Add(
BUILD_COMMAND ${CMAKE_NOOP}
INSTALL_COMMAND ${CMAKE_NOOP}
URL ${ELFIO_URL}
- URL_HASH ${ELFIO_HASH}
- )
+ URL_HASH ${ELFIO_HASH})
+
# glog: Google Logging Library.
# https://github.com/google/glog
@@ -203,6 +227,25 @@ ExternalProject_Add(
URL ${GLOG_URL}
URL_HASH ${GLOG_HASH})
+
+# PicoJSON: JSON parser / serializer.
+# https://github.com/kazuho/picojson
+#####################################
+EXTERNAL(picojson ${PICOJSON_VERSION} "${MESOS_3RDPARTY_BIN}")
+add_library(picojson INTERFACE)
+add_dependencies(picojson ${PICOJSON_TARGET})
+target_include_directories(picojson SYSTEM INTERFACE ${PICOJSON_ROOT})
+
+# Enable the INT64 support for PicoJSON.
+# NOTE: PicoJson requires __STDC_FORMAT_MACROS to be defined before importing
+# 'inttypes.h'. Since other libraries may also import this header, it must
+# be globally defined so that PicoJSON has access to the macros, regardless
+# of the order of inclusion.
+target_compile_definitions(
+ picojson INTERFACE
+ PICOJSON_USE_INT64
+ __STDC_FORMAT_MACROS)
+
ExternalProject_Add(
${PICOJSON_TARGET}
PREFIX ${PICOJSON_CMAKE_ROOT}
@@ -210,8 +253,16 @@ ExternalProject_Add(
BUILD_COMMAND ${CMAKE_NOOP}
INSTALL_COMMAND ${CMAKE_NOOP}
URL ${PICOJSON_URL}
- URL_HASH ${PICOJSON_HASH}
- )
+ URL_HASH ${PICOJSON_HASH})
+
+
+# NVML: NVIDIA Management Library.
+# https://developer.nvidia.com/nvidia-management-library-nvml
+#############################################################
+EXTERNAL(nvml ${NVML_VERSION} "${MESOS_3RDPARTY_BIN}")
+add_library(nvml INTERFACE)
+add_dependencies(nvml ${NVML_TARGET})
+target_include_directories(nvml SYSTEM INTERFACE ${NVML_ROOT})
ExternalProject_Add(
${NVML_TARGET}
@@ -220,8 +271,8 @@ ExternalProject_Add(
BUILD_COMMAND ${CMAKE_NOOP}
INSTALL_COMMAND ${CMAKE_NOOP}
URL ${NVML_URL}
- URL_HASH ${NVML_HASH}
- )
+ URL_HASH ${NVML_HASH})
+
# HTTP Parser: HTTP request/response parser for C.
# https://github.com/nodejs/http-parser
[33/42] mesos git commit: Windows: Changed linking of `IPHlpAPI`
library.
Posted by jo...@apache.org.
Windows: Changed linking of `IPHlpAPI` library.
While the `#pragma comment(lib...)` method works with MSVC, it is
inconsistent with how we link to the rest of the Windows libraries. So
it was deleted and `IPHlpAPI` was added to stout's Windows dependencies.
Furthermore, the `<iphlpapi.h>` header was removed from the individual
files and placed in `windows.hpp` to ensure it is included in the
correct order with respect to the other Windows headers.
Review: https://reviews.apache.org/r/61597/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/79acae23
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/79acae23
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/79acae23
Branch: refs/heads/master
Commit: 79acae23acea99d7b953713a58008f9b31204258
Parents: fb00e73
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Sat Sep 2 23:20:34 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:08 2017 -0700
----------------------------------------------------------------------
3rdparty/stout/CMakeLists.txt | 2 +-
3rdparty/stout/include/stout/windows.hpp | 1 +
3rdparty/stout/include/stout/windows/ip.hpp | 3 ---
3rdparty/stout/include/stout/windows/mac.hpp | 4 +---
3rdparty/stout/include/stout/windows/net.hpp | 3 ---
5 files changed, 3 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/79acae23/3rdparty/stout/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/stout/CMakeLists.txt b/3rdparty/stout/CMakeLists.txt
index 7f43b95..145b772 100644
--- a/3rdparty/stout/CMakeLists.txt
+++ b/3rdparty/stout/CMakeLists.txt
@@ -32,6 +32,6 @@ target_link_libraries(
zlib
$<$<PLATFORM_ID:Linux>:rt dl svn>
$<$<PLATFORM_ID:Darwin>:svn>
- $<$<PLATFORM_ID:Windows>:ws2_32 Mswsock Secur32 Userenv>)
+ $<$<PLATFORM_ID:Windows>:Ws2_32 IPHlpAPI Mswsock Secur32 Userenv>)
add_subdirectory(tests)
http://git-wip-us.apache.org/repos/asf/mesos/blob/79acae23/3rdparty/stout/include/stout/windows.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/windows.hpp b/3rdparty/stout/include/stout/windows.hpp
index 92db727..1d865f8 100644
--- a/3rdparty/stout/include/stout/windows.hpp
+++ b/3rdparty/stout/include/stout/windows.hpp
@@ -27,6 +27,7 @@
// re-definitions. This is a known pattern in the windows community.
#include <WS2tcpip.h>
#include <Winsock2.h>
+#include <iphlpapi.h>
#include <mswsock.h>
#include <winioctl.h>
#include <Windows.h>
http://git-wip-us.apache.org/repos/asf/mesos/blob/79acae23/3rdparty/stout/include/stout/windows/ip.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/windows/ip.hpp b/3rdparty/stout/include/stout/windows/ip.hpp
index 76f23c8..d7738f2 100644
--- a/3rdparty/stout/include/stout/windows/ip.hpp
+++ b/3rdparty/stout/include/stout/windows/ip.hpp
@@ -13,9 +13,6 @@
#ifndef __STOUT_WINDOWS_IP_HPP__
#define __STOUT_WINDOWS_IP_HPP__
-#include <iphlpapi.h>
-#pragma comment(lib, "IPHLPAPI.lib")
-
#include <string>
#include <stout/error.hpp>
http://git-wip-us.apache.org/repos/asf/mesos/blob/79acae23/3rdparty/stout/include/stout/windows/mac.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/windows/mac.hpp b/3rdparty/stout/include/stout/windows/mac.hpp
index 09c4c96..3ebf4e1 100644
--- a/3rdparty/stout/include/stout/windows/mac.hpp
+++ b/3rdparty/stout/include/stout/windows/mac.hpp
@@ -13,9 +13,6 @@
#ifndef __STOUT_WINDOWS_MAC_HPP__
#define __STOUT_WINDOWS_MAC_HPP__
-#include <iphlpapi.h>
-#pragma comment(lib, "IPHLPAPI.lib")
-
#include <algorithm>
#include <vector>
@@ -23,6 +20,7 @@
#include <stout/none.hpp>
#include <stout/result.hpp>
#include <stout/stringify.hpp>
+#include <stout/windows.hpp>
// Network utilities.
http://git-wip-us.apache.org/repos/asf/mesos/blob/79acae23/3rdparty/stout/include/stout/windows/net.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/windows/net.hpp b/3rdparty/stout/include/stout/windows/net.hpp
index 1418b5c..364509f 100644
--- a/3rdparty/stout/include/stout/windows/net.hpp
+++ b/3rdparty/stout/include/stout/windows/net.hpp
@@ -13,9 +13,6 @@
#ifndef __STOUT_WINDOWS_NET_HPP__
#define __STOUT_WINDOWS_NET_HPP__
-#include <iphlpapi.h>
-#pragma comment(lib, "IPHLPAPI.lib")
-
#include <set>
#include <string>
#include <vector>
[29/42] mesos git commit: Updated `CompilationConfigure.cmake` for
imported libraries.
Posted by jo...@apache.org.
Updated `CompilationConfigure.cmake` for imported libraries.
Windows and Linux have converged on several libraries (ZooKeeper,
Protobuf, and libevent) such that the same bundled version is used, so
the warning message was updated.
Third-party specific compilation flags were moved to the import of each
library, so this configuration no longer needs to include it.
The minimum CMake version was updated and supports `string(TIMESTAMP)`,
deprecating the `date` work-around.
Review: https://reviews.apache.org/r/61515/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/f1a28fa1
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/f1a28fa1
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/f1a28fa1
Branch: refs/heads/master
Commit: f1a28fa1dfca36b76606bce129e3a32f6a557c4a
Parents: 529b83b
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Tue Aug 8 10:54:09 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:08 2017 -0700
----------------------------------------------------------------------
cmake/CompilationConfigure.cmake | 32 ++++----------------------------
1 file changed, 4 insertions(+), 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/f1a28fa1/cmake/CompilationConfigure.cmake
----------------------------------------------------------------------
diff --git a/cmake/CompilationConfigure.cmake b/cmake/CompilationConfigure.cmake
index 9df97a8..8a94cd8 100644
--- a/cmake/CompilationConfigure.cmake
+++ b/cmake/CompilationConfigure.cmake
@@ -133,13 +133,10 @@ if (WIN32 AND REBUNDLED)
message(
WARNING
"On Windows, the required versions of:\n"
- " * ZooKeeper\n"
- " * protobuf\n"
- " * glog\n"
- " * libevent\n"
" * curl\n"
- " * libapr\n"
+ " * apr\n"
" * zlib\n"
+ " * glog\n"
"do not come rebundled in the Mesos repository. They will be downloaded from "
"the Internet, even though the `REBUNDLED` flag was set.")
endif ()
@@ -255,7 +252,7 @@ if (WIN32)
# COFF/PE and friends are somewhat limited in the number of sections they
# allow for an object file. We use this to avoid those problems.
- string(APPEND CMAKE_CXX_FLAGS " /bigobj -DGOOGLE_GLOG_DLL_DECL= /vd2 /permissive-")
+ string(APPEND CMAKE_CXX_FLAGS " /bigobj /vd2 /permissive-")
# Build against the multi-threaded version of the C runtime library (CRT).
if (BUILD_SHARED_LIBS)
@@ -268,10 +265,6 @@ if (WIN32)
else ()
# Use static CRT.
set(CRT " /MT")
-
- # TODO(andschwa): Define this closer to its usage; anything that includes
- # `curl.h` has to set this so that the declspec is correct.
- string(APPEND CMAKE_CXX_FLAGS " -DCURL_STATICLIB")
endif ()
# NOTE: We APPEND ${CRT} rather than REPLACE so it gets picked up by
@@ -318,17 +311,6 @@ if (WIN32)
set(TEST_LIB_EXEC_DIR "WARNINGDONOTUSEME")
set(PKG_MODULE_DIR "WARNINGDONOTUSEME")
set(S_BIN_DIR "WARNINGDONOTUSEME")
-
- # Windows-specific workaround for a glog issue documented here[1].
- # Basically, Windows.h and glog/logging.h both define ERROR. Since we don't
- # need the Windows ERROR, we can use this flag to avoid defining it at all.
- # Unlike the other fix (defining GLOG_NO_ABBREVIATED_SEVERITIES), this fix
- # is guaranteed to require no changes to the original Mesos code. See also
- # the note in the code itself[2].
- #
- # [1] https://google-glog.googlecode.com/svn/trunk/doc/glog.html#windows
- # [2] https://code.google.com/p/google-glog/source/browse/trunk/src/windows/glog/logging.h?r=113
- list(APPEND MESOS_CPPFLAGS -DNOGDI -DNOMINMAX)
endif ()
# GLOBAL CONFIGURATION.
@@ -354,15 +336,10 @@ endif ()
# Calculate some build information.
string(TIMESTAMP BUILD_DATE "%Y-%m-%d %H:%M:%S UTC" UTC)
+string(TIMESTAMP BUILD_TIME "%s" UTC)
if (WIN32)
- string(TIMESTAMP BUILD_TIME "%s" UTC)
set(BUILD_USER "$ENV{USERNAME}")
else ()
- execute_process(
- COMMAND date +%s
- OUTPUT_VARIABLE BUILD_TIME
- OUTPUT_STRIP_TRAILING_WHITESPACE
- )
set(BUILD_USER "$ENV{USER}")
endif ()
@@ -404,7 +381,6 @@ configure_file(
# preprocessor will interpret the symbols as (e.g.) int literals and uquoted
# identifiers, rather than the string values our code expects.
list(APPEND MESOS_CPPFLAGS
- -DUSE_STATIC_LIB
-DUSE_CMAKE_BUILD_CONFIG
-DBUILD_JAVA_JVM_LIBRARY="${JAVA_JVM_LIBRARY}")
[03/42] mesos git commit: CMake: Removed `GroupSource.cmake`.
Posted by jo...@apache.org.
CMake: Removed `GroupSource.cmake`.
While we want to group sources, this current solution is not
working as intended. We will consider looking into grouping
source again in future.
Review: https://reviews.apache.org/r/61351/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/b8d187f3
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/b8d187f3
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/b8d187f3
Branch: refs/heads/master
Commit: b8d187f338efb27d11f85921955dc0ee93ae501a
Parents: 96866d2
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Sat Sep 2 09:34:32 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:05 2017 -0700
----------------------------------------------------------------------
3rdparty/stout/cmake/GroupSource.cmake | 110 ----------------------------
1 file changed, 110 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/b8d187f3/3rdparty/stout/cmake/GroupSource.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/stout/cmake/GroupSource.cmake b/3rdparty/stout/cmake/GroupSource.cmake
deleted file mode 100644
index 7ed0b19..0000000
--- a/3rdparty/stout/cmake/GroupSource.cmake
+++ /dev/null
@@ -1,110 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-###############################################################
-# GROUP_SOURCE takes a directory root and recursively groups source files by
-# folder, so they can be displayed hierarchically in IDEs such as XCode or
-# Visual Studio. NOTE: Source files are only displayed if they are added for
-# compilation. If a file is not compiled, it will not show up in the IDE.
-#
-# Parameters:
-# GROUP_NAME Specifies group name of this directory tree. For example,
-# the directory tree `src/slave/` would fall under the group
-# name "Agent Source Files".
-# ROOT_DIRECTORY Root of the directory tree to generate source groups for.
-# RELATIVE_TO Directory to create source group tree relative to. For
-# example, if you want to the code in `src/slave` to show up
-# in the directory tree under a folder called `slave/` (i.e.,
-# omitting the `src/` component), then you would provite a
-# ROOT_DIRECTORY `src/slave` RELATIVE_TO `slave/`.
-# SOURCE_PATTERN Pattern (glob) of source files to match (e.g, *.cpp).
-function(GROUP_SOURCE GROUP_NAME ROOT_DIRECTORY RELATIVE_TO SOURCE_PATTERN)
- file(
- GLOB_RECURSE
- SOURCE_FILES
- RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
- "${ROOT_DIRECTORY}/${SOURCE_PATTERN}"
- )
-
- # Extremely inefficient method of recursively creating a source group for
- # every subdirectory that contains a source file. In other words, if we have
- # a folder structure like `slave/containerizer/`, we want a source group for
- # both `slave/` and `slave/containerizer/`, so that the IDE structures the
- # source tree hierarchically. This loop is so inefficient because CMake does
- # not support a set data structure, it is hard to do better than this and
- # still be cross-platform.
- #
- # The way this loop functions is to:
- # (1) Loop over every source file found in any subdirectory rooted at
- # `ROOT_DIRECTORY`
- # (2) For each source file, obtain the directory it exists in. For example if
- # the source file is `slave/containerizer/containerizer.cpp`, then the
- # directory `slave/containerizer/`.
- # (3) Create a source group for the directory. The source group for the
- # directory consists of any file that is in the directory, not including
- # files that are in subdirectories. In the example above, this would be
- # something like `slave/containerizer/*.cpp`.
- #
- # NOTE: This operation is so inefficient because it occurs for every
- # source file, rather than every unique directory. So, every time we
- # encounter a source file in any directory, we will add a source group
- # for its source directory.
- #
- # NOTE: This operation will also add every source file to the source
- # group, but only the source files that both appear in this source group,
- # and which users actually pass to the target for compilation will appear
- # in the IDE's source group.
- foreach (SOURCE_FILE ${SOURCE_FILES})
- # Get relative directory of source file, use to generate a source group
- # that resembles the directory tree.
- get_filename_component(SOURCE_FILE_REALPATH ${SOURCE_FILE} REALPATH)
-
- file(RELATIVE_PATH SOURCE_FILE_RELATIVE
- ${RELATIVE_TO} ${SOURCE_FILE_REALPATH})
-
- get_filename_component(
- SOURCE_DIRECTORY_RELATIVE
- ${SOURCE_FILE_RELATIVE}
- PATH)
-
- set(SOURCE_GROUP "${GROUP_NAME}\\${SOURCE_DIRECTORY_RELATIVE}")
-
- # This is necessary because source group names require '\' rather than '/'
- # as separators, in order to make a hierarchical source tree. This is
- # primarily because the source group construct was originally designed for
- # Visual Studio projects.
- string(REGEX REPLACE "/" "\\\\" SOURCE_GROUP ${SOURCE_GROUP})
-
- # Get all files in `SOURCE_DIRECTORY`, and create a source group for it.
- # NOTE: It is important concatinate `SOURCE_FILE` with the relative-to root
- # we passed to `file` above; if we don't, we will get an empty string when
- # `RELATIVE_TO` is the same as the current source directory, which in turn
- # will cause the call to `file` below to return no source files.
- get_filename_component(
- SOURCE_DIRECTORY
- "${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_FILE}"
- PATH)
-
- file(
- GLOB
- SOURCE_GROUP_FILES
- RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
- "${SOURCE_DIRECTORY}/${SOURCE_PATTERN}"
- )
-
- source_group(${SOURCE_GROUP} FILES ${SOURCE_GROUP_FILES})
- endforeach ()
-endfunction()
[26/42] mesos git commit: CMake: Cleaned up 3rdparty CMake helper
modules.
Posted by jo...@apache.org.
CMake: Cleaned up 3rdparty CMake helper modules.
This removes `Mesos3rdpartyConfigure.cmake` entirely, as the only
necessary code in it was moved to `PatchCommand.cmake`, which was
consolidated from `libprocess/cmake/macros` to `cmake`.
`External.cmake` was similarly moved.
The `patch_cmd` function was fixed to work on Windows, allowing
`3rdparty/CMakeLists.txt` to be cleaned up further by consolidating the
setting of different patch commands.
Review: https://reviews.apache.org/r/61512/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/bf6ad1f5
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/bf6ad1f5
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/bf6ad1f5
Branch: refs/heads/master
Commit: bf6ad1f58ec8aa33352024db74adc0bca0932bc1
Parents: 01bacdb
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Mon Aug 7 14:35:31 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:08 2017 -0700
----------------------------------------------------------------------
3rdparty/CMakeLists.txt | 31 +++----
3rdparty/cmake/External.cmake | 80 +++++++++++++++++
3rdparty/cmake/Mesos3rdpartyConfigure.cmake | 89 -------------------
3rdparty/cmake/PatchCommand.cmake | 108 +++++++++++++++++++++++
4 files changed, 200 insertions(+), 108 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/bf6ad1f5/3rdparty/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
index afd31d1..431260a 100755
--- a/3rdparty/CMakeLists.txt
+++ b/3rdparty/CMakeLists.txt
@@ -63,10 +63,8 @@ include(ExternalProject)
# This adds our FindApr and FindSvn packages.
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/stout/cmake)
-# This adds our `external()` and `patch_command()` functions.
-list(APPEND CMAKE_MODULE_PATH
- ${CMAKE_CURRENT_SOURCE_DIR}/libprocess/cmake/macros)
-
+# This adds our `EXTERNAL()` and `PATCH_CMD()` functions.
+list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(External)
include(PatchCommand)
@@ -212,8 +210,12 @@ EXTERNAL(glog ${GLOG_VERSION} ${CMAKE_CURRENT_BINARY_DIR})
add_library(glog ${LIBRARY_LINKAGE} IMPORTED)
add_dependencies(glog ${GLOG_TARGET})
+# Patch glog to deal with a problem that appears when compiling on clang
+# under the C++11 standard. cf. MESOS-860, MESOS-966.
+# On Windows, patch it to enable stack tracing.
+PATCH_CMD(GLOG_PATCH_CMD glog-${GLOG_VERSION}.patch)
+
if (WIN32)
- set(GLOG_PATCH_CMD ${PATCHEXE_LOCATION} -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/glog-${GLOG_VERSION}.patch)
set(GLOG_INSTALL_CMD ${CMAKE_NOOP})
# NOTE: Windows-specific workaround for a glog issue documented here[1].
@@ -236,16 +238,13 @@ if (WIN32)
IMPORTED_LINK_INTERFACE_LIBRARIES DbgHelp
INTERFACE_COMPILE_DEFINITIONS "${GLOG_COMPILE_DEFINITIONS}")
else ()
- # Patch glog to deal with a problem that appears when compiling on clang
- # under the C++11 standard. cf. MESOS-860, MESOS-966.
- patch_cmd(${CMAKE_CURRENT_SOURCE_DIR}/glog-${GLOG_VERSION}.patch GLOG_PATCH_CMD)
-
# TODO(andschwa): Build with CMake instead when glog is updated.
# NOTE: We only link to the shared library of glog because the static build
# doesn't have PIC.
set(GLOG_CONFIG_CMD ${GLOG_ROOT}/src/../configure GTEST_CONFIG=no --prefix=${GLOG_ROOT}-build)
set(GLOG_BUILD_CMD make)
set(GLOG_INSTALL_CMD make install)
+
set_target_properties(
glog PROPERTIES
IMPORTED_LOCATION ${GLOG_ROOT}-build/lib/libglog${CMAKE_SHARED_LIBRARY_SUFFIX}
@@ -420,7 +419,7 @@ else ()
INTERFACE_INCLUDE_DIRECTORIES ${LIBEV_ROOT}-build/include)
# Patch libev to keep it from reaping child processes.
- patch_cmd(${CMAKE_CURRENT_SOURCE_DIR}/libev-4.22.patch LIBEV_PATCH_CMD)
+ PATCH_CMD(LIBEV_PATCH_CMD libev-${LIBEV_VERSION}.patch)
MAKE_INCLUDE_DIR(libev)
GET_BYPRODUCTS(libev)
@@ -716,6 +715,8 @@ set_target_properties(
INTERFACE_LINK_LIBRARIES zk-hashtable
INTERFACE_COMPILE_DEFINITIONS "${ZOOKEEPER_COMPILE_DEFINITIONS}")
+PATCH_CMD(ZOOKEEPER_PATCH_CMD zookeeper-${ZOOKEEPER_VERSION}.patch)
+
if (WIN32)
set_target_properties(
zookeeper PROPERTIES
@@ -726,12 +727,6 @@ if (WIN32)
zk-hashtable PROPERTIES
IMPORTED_LOCATION_DEBUG ${ZOOKEEPER_ROOT}-build/Debug/hashtable${CMAKE_STATIC_LIBRARY_SUFFIX}
IMPORTED_LOCATION_RELEASE ${ZOOKEEPER_ROOT}-build/Release/hashtable${CMAKE_STATIC_LIBRARY_SUFFIX})
-
- # Set the patch command which will utilize patch.exe in temp location for no elevation prompt
- # NOTE: We do not specify the `--binary` patch option here because the
- # files being modified are extracted with CRLF (Windows) line endings
- # already. The `--binary` option will instead fail to apply the patch.
- set(ZOOKEEPER_PATCH_CMD ${PATCHEXE_LOCATION} -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/zookeeper-${ZOOKEEPER_VERSION}.patch)
else ()
set_target_properties(
zookeeper PROPERTIES
@@ -740,8 +735,6 @@ else ()
set_target_properties(
zk-hashtable PROPERTIES
IMPORTED_LOCATION ${ZOOKEEPER_ROOT}-build/libhashtable${CMAKE_STATIC_LIBRARY_SUFFIX})
-
- patch_cmd(${CMAKE_CURRENT_SOURCE_DIR}/zookeeper-${ZOOKEEPER_VERSION}.patch ZOOKEEPER_PATCH_CMD)
endif ()
MAKE_INCLUDE_DIR(zookeeper)
@@ -774,7 +767,7 @@ if (NOT WIN32)
IMPORTED_LOCATION ${LEVELDB_ROOT}/out-static/libleveldb${CMAKE_STATIC_LIBRARY_SUFFIX}
INTERFACE_INCLUDE_DIRECTORIES ${LEVELDB_ROOT}/include)
- patch_cmd(${CMAKE_CURRENT_SOURCE_DIR}/leveldb-${LEVELDB_VERSION}.patch LEVELDB_PATCH_CMD)
+ PATCH_CMD(LEVELDB_PATCH_CMD leveldb-${LEVELDB_VERSION}.patch)
MAKE_INCLUDE_DIR(leveldb)
GET_BYPRODUCTS(leveldb)
http://git-wip-us.apache.org/repos/asf/mesos/blob/bf6ad1f5/3rdparty/cmake/External.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/cmake/External.cmake b/3rdparty/cmake/External.cmake
new file mode 100644
index 0000000..5bc51bd
--- /dev/null
+++ b/3rdparty/cmake/External.cmake
@@ -0,0 +1,80 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+###############################################################
+# EXTERNAL defines a few variables that make it easy for us to track the
+# directory structure of a dependency. In particular, if our library's name is
+# boost, we will define the following variables:
+#
+# BOOST_VERSION (e.g., 1.53.0)
+# BOOST_TARGET (a target folder name to put dep in e.g., boost-1.53.0)
+# BOOST_CMAKE_ROOT (where to have CMake put the uncompressed source, e.g.,
+# build/3rdparty/boost-1.53.0)
+# BOOST_ROOT (where the code goes in various stages of build, e.g.,
+# build/.../boost-1.53.0/src, which might contain folders
+# build-1.53.0-build, -lib, and so on, for each build step
+# that dependency has)
+function(EXTERNAL
+ LIB_NAME
+ LIB_VERSION
+ BIN_ROOT)
+
+ string(TOUPPER ${LIB_NAME} LIB_NAME_UPPER)
+
+ # Names of variables we will set in this function.
+ set(VERSION_VAR ${LIB_NAME_UPPER}_VERSION) # e.g., BOOST_VERSION
+ set(TARGET_VAR ${LIB_NAME_UPPER}_TARGET) # e.g., BOOST_TARGET
+ set(CMAKE_ROOT_VAR ${LIB_NAME_UPPER}_CMAKE_ROOT) # e.g., BOOST_CMAKE_ROOT
+ set(ROOT_VAR ${LIB_NAME_UPPER}_ROOT) # e.g., BOOST_ROOT
+
+ # Generate data that we will put in the above variables.
+ # NOTE: bundled packages are untar'd into the BIN_ROOT, which is why we're
+ # pointing the source root into BIN_ROOT rather than SRC_ROOT.
+ # TODO(hausdorff): SRC_DATA doesn't work for HTTP, LIBEV, GMOCK, or GTEST.
+ set(VERSION_DATA ${LIB_VERSION})
+ set(TARGET_DATA ${LIB_NAME}-${VERSION_DATA})
+ set(CMAKE_ROOT_DATA ${BIN_ROOT}/${TARGET_DATA})
+ set(ROOT_DATA ${CMAKE_ROOT_DATA}/src/${TARGET_DATA})
+
+ # Finally, EXPORT THE ABOVE VARIABLES. We take the data variables we just
+ # defined, and export them to variables in the parent scope.
+ #
+ # NOTE: The "export" step is different from the "define the data vars" step
+ # because an expression like ${VERSION_VAR} will evaluate to
+ # something like "BOOST_VERSION", not something like "1.53.0". That
+ # is: to get the version in the parent scope we would do something
+ # like ${BOOST_VERSION}, which might evaluate to something like
+ # "1.53.0". So in this function, if you wanted to generate (e.g.) the
+ # target variable, it is not sufficient to write
+ # "${LIB_NAME}-${VERSION_VAR}", because this would result in
+ # something like "boost-BOOST_VERSION" when what we really wanted was
+ # "boost-1.53.0". Hence, these two steps are different.
+ set(${VERSION_VAR} # e.g., 1.53.0
+ ${VERSION_DATA}
+ PARENT_SCOPE)
+
+ set(${TARGET_VAR} # e.g., boost-1.53.0
+ ${TARGET_DATA}
+ PARENT_SCOPE)
+
+ set(${CMAKE_ROOT_VAR} # e.g., build/3rdparty/boost-1.53.0
+ ${CMAKE_ROOT_DATA}
+ PARENT_SCOPE)
+
+ set(${ROOT_VAR} # e.g., build/.../boost-1.53.0/src
+ ${ROOT_DATA}
+ PARENT_SCOPE)
+endfunction()
http://git-wip-us.apache.org/repos/asf/mesos/blob/bf6ad1f5/3rdparty/cmake/Mesos3rdpartyConfigure.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/cmake/Mesos3rdpartyConfigure.cmake b/3rdparty/cmake/Mesos3rdpartyConfigure.cmake
deleted file mode 100755
index e53ef2b..0000000
--- a/3rdparty/cmake/Mesos3rdpartyConfigure.cmake
+++ /dev/null
@@ -1,89 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Configure Windows use of the GNU patch utility;
-# we attempt to find it in its default location,
-# but this path may be customized.
-#################################################
-if (WIN32)
- set(PROGRAMFILESX86 "PROGRAMFILES(X86)")
- set(PATCHEXE_DEFAULT_LOCATION $ENV{${PROGRAMFILESX86}}/GnuWin32/bin)
-
- set(PATCHEXE_PATH
- ${PATCHEXE_DEFAULT_LOCATION}
- CACHE PATH "Path for GnuWin32 patch.exe")
-
- set(
- GNUWIN32_PATCH_EXECUTABLE
- ${PATCHEXE_PATH}/patch.exe
- CACHE PATH "Full path for GnuWin32 patch.exe")
-
- if (NOT EXISTS ${GNUWIN32_PATCH_EXECUTABLE})
- message(
- FATAL_ERROR
- "GnuWin32 patch.exe was not found. Use -DPATCHEXE_PATH to "
- "provide the local path of GnuWin32 patch.exe. "
- "Also delete CMakeCache.txt to clear the cache. "
- "Mesos for Windows requires GnuWin32 patch.exe "
- "to apply updates. You may get it from "
- "http://gnuwin32.sourceforge.net/packages/patch.htm"
- )
- else ()
- message(
- STATUS
- "GnuWin32 patch.exe exists at: "
- ${GNUWIN32_PATCH_EXECUTABLE})
-
- # Since Windows Vista patch.exe has been reqesting elevation to work
- # even though it is not required to apply patches. So to avoid a prompt
- # for elevation a manifest will be applied to patch.exe in the current
- # user temp directory.
-
- # First: Copy patch.exe and patch.exe.manifest to the user temp dir where
- # elevation is not required. 'Set \Users\<user>\AppData\Local\Temp' dir.
- set(USER_TMP_DIR "TMP")
-
- # Set full path for temp location of patch.exe.
- set(PATCHEXE_LOCATION $ENV{${USER_TMP_DIR}}/patch.exe)
-
- # Set full path for patch.exe.manifest.
- set(PATCHMANIFEST_LOCATION ${CMAKE_SOURCE_DIR}/3rdparty/patch.exe.manifest)
-
- # Set full path for temp location of patch.exe.manifest.
- set(PATCHMANIFEST_TMP_LOCATION $ENV{${USER_TMP_DIR}}/patch.exe.manifest)
-
- # Copy patch.exe and path.exe.manifest to temp location.
- configure_file(
- ${GNUWIN32_PATCH_EXECUTABLE}
- ${PATCHEXE_LOCATION}
- COPYONLY)
- configure_file(
- ${PATCHMANIFEST_LOCATION}
- ${PATCHMANIFEST_TMP_LOCATION}
- COPYONLY)
-
- # Second: Apply manifest to patch command.
- set(
- APPLY_PATCH_MANIFEST_COMMAND
- "mt.exe"
- -manifest mt ${PATCHMANIFEST_TMP_LOCATION}
- -outputresource:${PATCHEXE_LOCATION};1)
-
- add_custom_command(
- OUTPUT patch.exe
- COMMAND ${APPLY_PATCH_MANIFEST_COMMAND})
- endif ()
-endif ()
http://git-wip-us.apache.org/repos/asf/mesos/blob/bf6ad1f5/3rdparty/cmake/PatchCommand.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/cmake/PatchCommand.cmake b/3rdparty/cmake/PatchCommand.cmake
new file mode 100644
index 0000000..4dd6639
--- /dev/null
+++ b/3rdparty/cmake/PatchCommand.cmake
@@ -0,0 +1,108 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Find and fix GNU Patch for Windows.
+#####################################
+if (WIN32)
+ set(PROGRAMFILESX86 "PROGRAMFILES(X86)")
+ set(PATCHEXE_DEFAULT_LOCATION $ENV{${PROGRAMFILESX86}}/GnuWin32/bin)
+
+ set(PATCHEXE_PATH
+ ${PATCHEXE_DEFAULT_LOCATION}
+ CACHE PATH "Path for GnuWin32 patch.exe")
+
+ set(
+ GNUWIN32_PATCH_EXECUTABLE
+ ${PATCHEXE_PATH}/patch.exe
+ CACHE PATH "Full path for GnuWin32 patch.exe")
+
+ if (NOT EXISTS ${GNUWIN32_PATCH_EXECUTABLE})
+ message(
+ FATAL_ERROR
+ "GnuWin32 patch.exe was not found. Use -DPATCHEXE_PATH to "
+ "provide the local path of GnuWin32 patch.exe. "
+ "Also delete CMakeCache.txt to clear the cache. "
+ "Mesos for Windows requires GnuWin32 patch.exe "
+ "to apply updates. You may get it from "
+ "http://gnuwin32.sourceforge.net/packages/patch.htm"
+ )
+ else ()
+ message(
+ STATUS
+ "GnuWin32 patch.exe exists at: "
+ ${GNUWIN32_PATCH_EXECUTABLE})
+
+ # Since Windows Vista patch.exe has been reqesting elevation to work
+ # even though it is not required to apply patches. So to avoid a prompt
+ # for elevation a manifest will be applied to patch.exe in the current
+ # user temp directory.
+
+ # First: Copy patch.exe and patch.exe.manifest to the user temp dir where
+ # elevation is not required. 'Set \Users\<user>\AppData\Local\Temp' dir.
+ set(USER_TMP_DIR "TMP")
+
+ # Set full path for temp location of patch.exe.
+ set(PATCHEXE_LOCATION $ENV{${USER_TMP_DIR}}/patch.exe)
+
+ # Set full path for patch.exe.manifest.
+ set(PATCHMANIFEST_LOCATION ${CMAKE_SOURCE_DIR}/3rdparty/patch.exe.manifest)
+
+ # Set full path for temp location of patch.exe.manifest.
+ set(PATCHMANIFEST_TMP_LOCATION $ENV{${USER_TMP_DIR}}/patch.exe.manifest)
+
+ # Copy patch.exe and path.exe.manifest to temp location.
+ configure_file(
+ ${GNUWIN32_PATCH_EXECUTABLE}
+ ${PATCHEXE_LOCATION}
+ COPYONLY)
+ configure_file(
+ ${PATCHMANIFEST_LOCATION}
+ ${PATCHMANIFEST_TMP_LOCATION}
+ COPYONLY)
+
+ # Second: Apply manifest to patch command.
+ set(
+ APPLY_PATCH_MANIFEST_COMMAND
+ "mt.exe"
+ -manifest mt ${PATCHMANIFEST_TMP_LOCATION}
+ -outputresource:${PATCHEXE_LOCATION};1)
+
+ add_custom_command(
+ OUTPUT patch.exe
+ COMMAND ${APPLY_PATCH_MANIFEST_COMMAND})
+ endif ()
+endif ()
+
+# PATCH_CMD generates a patch command given a patch file. If the path is not
+# absolute, it's resolved to the current source directory. It stores the command
+# in the variable name supplied.
+################################################################################
+function(PATCH_CMD CMD_VAR PATCH_FILE)
+ get_filename_component(PATCH_PATH ${PATCH_FILE} ABSOLUTE)
+ if (WIN32)
+ # Set the patch command which will utilize patch.exe in temp location for no elevation prompt
+ # NOTE: We do not specify the `--binary` patch option here because the
+ # files being modified are extracted with CRLF (Windows) line endings
+ # already. The `--binary` option will instead fail to apply the patch.
+ set (${CMD_VAR}
+ ${PATCHEXE_LOCATION} -p1 < ${PATCH_PATH}
+ PARENT_SCOPE)
+ else ()
+ set (${CMD_VAR}
+ test ! -e ${PATCH_PATH} || patch -p1 < ${PATCH_PATH}
+ PARENT_SCOPE)
+ endif ()
+endfunction()
[19/42] mesos git commit: CMake: Updated stout test linking rules.
Posted by jo...@apache.org.
CMake: Updated stout test linking rules.
Now that all the dependencies of tests are import or interface
libraries with their properties properly defined within their respective
targets, we can update the linking rules of the tests to point to those
dependent targets. CMake will do the rest for us.
Review: https://reviews.apache.org/r/61347/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/5d4e1056
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/5d4e1056
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/5d4e1056
Branch: refs/heads/master
Commit: 5d4e1056cce15d80ccda904a5b7c219dadbf9c64
Parents: 4c62721
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Sat Sep 2 13:00:53 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:07 2017 -0700
----------------------------------------------------------------------
3rdparty/stout/cmake/StoutTestsConfigure.cmake | 96 ---------------------
3rdparty/stout/tests/CMakeLists.txt | 29 ++-----
2 files changed, 8 insertions(+), 117 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/5d4e1056/3rdparty/stout/cmake/StoutTestsConfigure.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/stout/cmake/StoutTestsConfigure.cmake b/3rdparty/stout/cmake/StoutTestsConfigure.cmake
deleted file mode 100644
index b6e9902..0000000
--- a/3rdparty/stout/cmake/StoutTestsConfigure.cmake
+++ /dev/null
@@ -1,96 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-###############################################################
-# Defines the variables useful for tests, and exports them to the scope of
-# any file includes this file. There are a few important consequence of this:
-#
-# * This file MUST be included before the third-party dependencies like gmock
-# are configured/built/downloaded (if you're doing this). If this code isn't
-# run first, then we won't know (e.g.) what folders to unpack the code to.
-# * This file ONLY defines and exports variables for third-party dependencies
-# that are required by the test suite, but are not a dependency that
-# libprocess core takes. That is, this file handles the gmock dependency,
-# but not the glog dependency (which the process library itself takes a
-# dependency on).
-# * This file and the config file for the libprocess "core" dependencies
-# (e.g. glog, boost, etc.) are separate so that we can export the variables
-# for the core dependencies (e.g., where to find the .so/.dll files) without
-# having to also export the variables for test-only dependencies.
-
-# COMPILER CONFIGURATION.
-#########################
-EXTERNAL("googletest" ${GOOGLETEST_VERSION} "${MESOS_3RDPARTY_BIN}")
-
-# Convenience variables for include directories of third-party dependencies.
-set(GMOCK_INCLUDE_DIR ${GOOGLETEST_ROOT}/googlemock/include)
-set(GTEST_INCLUDE_DIR ${GOOGLETEST_ROOT}/googletest/include)
-
-# Convenience variables for `lib` directories of built third-party dependencies.
-if (WIN32)
- set(GMOCK_LIB_DIR ${GOOGLETEST_ROOT}-build/googlemock)
- set(GTEST_LIB_DIR ${GOOGLETEST_ROOT}-build/googlemock/gtest)
-else ()
- set(GMOCK_LIB_DIR ${GOOGLETEST_ROOT}-lib/lib)
- set(GTEST_LIB_DIR ${GOOGLETEST_ROOT}-lib/lib/gtest)
-endif ()
-
-# Convenience variables for "lflags", the symbols we pass to CMake to generate
-# things like `-L/path/to/glog` or `-lglog`.
-set(GMOCK_LFLAG gmock)
-set(GTEST_LFLAG gtest)
-
-# DEFINE PROCESS LIBRARY DEPENDENCIES. Tells the process library build targets
-# download/configure/build all third-party libraries before attempting to build.
-################################################################################
-set(STOUT_TEST_DEPENDENCIES
- ${STOUT_TEST_DEPENDENCIES}
- ${GOOGLETEST_TARGET}
- )
-
-# DEFINE THIRD-PARTY INCLUDE DIRECTORIES. Tells compiler toolchain where to get
-# headers for our third party libs (e.g., -I/path/to/glog on Linux)..
-###############################################################################
-set(STOUT_TEST_3RDPARTY_INCLUDE_DIRS
- ${STOUT_TEST_3RDPARTY_INCLUDE_DIRS}
- ${GMOCK_INCLUDE_DIR}
- ${GTEST_INCLUDE_DIR}
- )
-
-# DEFINE THIRD-PARTY LIB INSTALL DIRECTORIES. Used to tell the compiler
-# toolchain where to find our third party libs (e.g., -L/path/to/glog on
-# Linux).
-########################################################################
-set(STOUT_TEST_LIB_DIRS
- ${STOUT_TEST_LIB_DIRS}
- ${GMOCK_LIB_DIR}
- ${GTEST_LIB_DIR}
- )
-
-# DEFINE THIRD-PARTY LIBS. Used to generate flags that the linker uses to
-# include our third-party libs (e.g., -lglog on Linux).
-#########################################################################
-set(STOUT_TEST_LIBS
- ${STOUT_TEST_LIBS}
- ${GMOCK_LFLAG}
- )
-
-if (NOT WIN32)
- set(STOUT_TEST_LIBS
- ${STOUT_TEST_LIBS}
- ${GTEST_LFLAG}
- )
-endif ()
http://git-wip-us.apache.org/repos/asf/mesos/blob/5d4e1056/3rdparty/stout/tests/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/stout/tests/CMakeLists.txt b/3rdparty/stout/tests/CMakeLists.txt
index f18dabd..eb1c97e 100644
--- a/3rdparty/stout/tests/CMakeLists.txt
+++ b/3rdparty/stout/tests/CMakeLists.txt
@@ -14,9 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# TODO(andschwa): Remove this when gmock and gtest can be included.
-include(StoutTestsConfigure)
-
# STOUT TESTS.
##############
set(STOUT_ROOT_TESTS_SRC
@@ -87,7 +84,7 @@ if (NOT WIN32)
)
endif ()
-if (LINUX)
+if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(STOUT_ROOT_TESTS_SRC ${STOUT_ROOT_TESTS_SRC} proc_tests.cpp)
endif ()
@@ -102,25 +99,15 @@ set(STOUT_TESTS_SRC
##############################################################################
add_custom_command(
OUTPUT protobuf_tests.pb.h protobuf_tests.pb.cc
- COMMAND ${PROTOC}
- -I${CMAKE_SOURCE_DIR}/3rdparty/stout/tests
- --cpp_out=.
- ${CMAKE_SOURCE_DIR}/3rdparty/stout/tests/protobuf_tests.proto
- DEPENDS ${CMAKE_SOURCE_DIR}/3rdparty/stout/tests/protobuf_tests.proto)
-
-# TODO(andschwa): Remove when gmock and gtest are top-level targets.
-link_directories(${STOUT_TEST_LIB_DIRS})
+ COMMAND protoc
+ -I${CMAKE_CURRENT_SOURCE_DIR}
+ --cpp_out=${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/protobuf_tests.proto
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/protobuf_tests.proto)
add_executable(stout-tests EXCLUDE_FROM_ALL ${STOUT_TESTS_SRC})
-
-# TODO(andschwa): Remove when gmock and gtest are top-level targets.
-add_dependencies(stout-tests ${STOUT_TEST_DEPENDENCIES})
-target_include_directories(stout-tests PRIVATE
- ${CMAKE_CURRENT_BINARY_DIR}
- ${STOUT_TEST_3RDPARTY_INCLUDE_DIRS})
-
-# TODO(andschwa): Link to gmock and gtest explicitly.
-target_link_libraries(stout-tests stout ${STOUT_TEST_LIBS})
+target_link_libraries(stout-tests PRIVATE stout googletest)
+target_include_directories(stout-tests PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
# ADD TEST TARGET (runs when you do, e.g., `make check`).
#########################################################
[04/42] mesos git commit: CMake: Linked `libprocess` to `stout`
interface library.
Posted by jo...@apache.org.
CMake: Linked `libprocess` to `stout` interface library.
This follows up on https://reviews.apache.org/r/61286/
which changed stout to an interface library. With this change,
downstream users of stout no longer need to know the directories
of stout. Instead, including stout in `target_link_libraries`
is sufficient.
Review: https://reviews.apache.org/r/61288/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/cd7ec918
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/cd7ec918
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/cd7ec918
Branch: refs/heads/master
Commit: cd7ec918a3627b817a69ca0e942bd5d1441d987e
Parents: 3b9658a
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Mon Aug 7 18:16:33 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:05 2017 -0700
----------------------------------------------------------------------
.../libprocess/cmake/Process3rdpartyConfigure.cmake | 4 ----
3rdparty/libprocess/cmake/ProcessConfigure.cmake | 14 +++++---------
3rdparty/libprocess/cmake/ProcessTestsConfigure.cmake | 1 +
3 files changed, 6 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/cd7ec918/3rdparty/libprocess/cmake/Process3rdpartyConfigure.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/cmake/Process3rdpartyConfigure.cmake b/3rdparty/libprocess/cmake/Process3rdpartyConfigure.cmake
index 3e621f9..b9d8dc9 100644
--- a/3rdparty/libprocess/cmake/Process3rdpartyConfigure.cmake
+++ b/3rdparty/libprocess/cmake/Process3rdpartyConfigure.cmake
@@ -16,8 +16,6 @@
# DEFINE DIRECTORY STRUCTURE FOR THIRD-PARTY LIBS.
##################################################
-set(STOUT ${MESOS_3RDPARTY_SRC}/stout)
-
EXTERNAL("boost" ${BOOST_VERSION} "${MESOS_3RDPARTY_BIN}")
EXTERNAL("concurrentqueue" ${CONCURRENTQUEUE_VERSION} "${MESOS_3RDPARTY_BIN}")
EXTERNAL("glog" ${GLOG_VERSION} "${MESOS_3RDPARTY_BIN}")
@@ -46,7 +44,6 @@ set(LIBEVENT_LIB_ROOT ${LIBEVENT_ROOT}-lib/lib)
# Convenience variables for include directories of third-party dependencies.
set(PROCESS_INCLUDE_DIR ${MESOS_3RDPARTY_SRC}/libprocess/include)
-set(STOUT_INCLUDE_DIR ${STOUT}/include)
set(BOOST_INCLUDE_DIR ${BOOST_ROOT})
set(CONCURRENTQUEUE_INCLUDE_DIR ${CONCURRENTQUEUE_ROOT})
@@ -145,5 +142,4 @@ endif ()
# Configure the process library, the last of our third-party libraries.
#######################################################################
-include(StoutConfigure)
include(ProcessConfigure)
http://git-wip-us.apache.org/repos/asf/mesos/blob/cd7ec918/3rdparty/libprocess/cmake/ProcessConfigure.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/cmake/ProcessConfigure.cmake b/3rdparty/libprocess/cmake/ProcessConfigure.cmake
index 75af774..b9281b1 100755
--- a/3rdparty/libprocess/cmake/ProcessConfigure.cmake
+++ b/3rdparty/libprocess/cmake/ProcessConfigure.cmake
@@ -65,12 +65,11 @@ macro(GROUP_PROCESS_HEADERS)
"*.h*")
endmacro()
-# Define process library dependencies. Tells the process library build targets
+# DEFINE PROCESS LIBRARY DEPENDENCIES. Tells the process library build targets
# download/configure/build all third-party libraries before attempting to build.
################################################################################
set(PROCESS_DEPENDENCIES
${PROCESS_DEPENDENCIES}
- ${STOUT_DEPENDENCIES}
${HTTP_PARSER_TARGET}
${CONCURRENTQUEUE_TARGET}
)
@@ -88,7 +87,7 @@ if (WIN32)
)
endif ()
-# Define third-party include directories. Tells compiler toolchain where to get
+# DEFINE THIRD-PARTY INCLUDE DIRECTORIES. Tells compiler toolchain where to get
# headers for our third party libs (e.g., -I/path/to/glog on Linux).
###############################################################################
set(PROCESS_INCLUDE_DIRS
@@ -98,8 +97,6 @@ set(PROCESS_INCLUDE_DIRS
set(PROCESS_3RDPARTY_INCLUDE_DIRS
${PROCESS_3RDPARTY_INCLUDE_DIRS}
- ${STOUT_3RDPARTY_INCLUDE_DIRS}
- ${STOUT_INCLUDE_DIRS}
${HTTP_PARSER_INCLUDE_DIR}
${CONCURRENTQUEUE_INCLUDE_DIR}
)
@@ -134,13 +131,12 @@ if (WIN32)
)
endif ()
-# Define third-party lib install directories. Used to tell the compiler
+# DEFINE THIRD-PARTY LIB INSTALL DIRECTORIES. Used to tell the compiler
# toolchain where to find our third party libs (e.g., -L/path/to/glog on
# Linux).
########################################################################
set(PROCESS_LIB_DIRS
${PROCESS_LIB_DIRS}
- ${STOUT_LIB_DIRS}
${HTTP_PARSER_LIB_DIR}
)
@@ -157,14 +153,14 @@ if (WIN32)
)
endif ()
-# Define third-party libs. Used to generate flags that the linker uses to
+# DEFINE THIRD-PARTY LIBS. Used to generate flags that the linker uses to
# include our third-party libs (e.g., -lglog on Linux).
#########################################################################
find_package(Threads REQUIRED)
set(PROCESS_LIBS
${PROCESS_LIBS}
- ${STOUT_LIBS}
+ stout
${HTTP_PARSER_LFLAG}
)
http://git-wip-us.apache.org/repos/asf/mesos/blob/cd7ec918/3rdparty/libprocess/cmake/ProcessTestsConfigure.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/cmake/ProcessTestsConfigure.cmake b/3rdparty/libprocess/cmake/ProcessTestsConfigure.cmake
index 5a23990..b5454d4 100644
--- a/3rdparty/libprocess/cmake/ProcessTestsConfigure.cmake
+++ b/3rdparty/libprocess/cmake/ProcessTestsConfigure.cmake
@@ -14,6 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+# TODO(andschwa): Remove this when gmock and gtest can be included.
include(StoutTestsConfigure)
set(
[34/42] mesos git commit: CMake: Updated Cotire module to version
1.7.10.
Posted by jo...@apache.org.
CMake: Updated Cotire module to version 1.7.10.
This adds compatibility with CMake 3.8 and fixes a couple
other build issues on specific platforms.
See: https://github.com/sakra/cotire/blob/master/HISTORY.md
Review: https://reviews.apache.org/r/61751/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/dd454cfd
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/dd454cfd
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/dd454cfd
Branch: refs/heads/master
Commit: dd454cfd5986e83e77f376a2e16aeb5bd983e6a8
Parents: 79acae2
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Sat Sep 2 23:55:00 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:09 2017 -0700
----------------------------------------------------------------------
3rdparty/cmake/cotire.cmake | 118 +++++++++++++++++++++++++++------------
1 file changed, 82 insertions(+), 36 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/dd454cfd/3rdparty/cmake/cotire.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/cmake/cotire.cmake b/3rdparty/cmake/cotire.cmake
index ab61100..62cd23d 100644
--- a/3rdparty/cmake/cotire.cmake
+++ b/3rdparty/cmake/cotire.cmake
@@ -3,7 +3,7 @@
# See the cotire manual for usage hints.
#
#=============================================================================
-# Copyright 2012-2016 Sascha Kratky
+# Copyright 2012-2017 Sascha Kratky
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
@@ -43,7 +43,7 @@ if (NOT CMAKE_SCRIPT_MODE_FILE)
endif()
set (COTIRE_CMAKE_MODULE_FILE "${CMAKE_CURRENT_LIST_FILE}")
-set (COTIRE_CMAKE_MODULE_VERSION "1.7.9")
+set (COTIRE_CMAKE_MODULE_VERSION "1.7.10")
# activate select policies
if (POLICY CMP0025)
@@ -106,6 +106,11 @@ if (POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif()
+if (POLICY CMP0055)
+ # strict checking for break() command
+ cmake_policy(SET CMP0055 NEW)
+endif()
+
include(CMakeParseArguments)
include(ProcessorCount)
@@ -293,7 +298,7 @@ function (cotire_get_source_file_property_values _valuesVar _property)
set (${_valuesVar} ${_values} PARENT_SCOPE)
endfunction()
-function (cotire_resolve_config_properites _configurations _propertiesVar)
+function (cotire_resolve_config_properties _configurations _propertiesVar)
set (_properties "")
foreach (_property ${ARGN})
if ("${_property}" MATCHES "<CONFIG>")
@@ -309,8 +314,8 @@ function (cotire_resolve_config_properites _configurations _propertiesVar)
set (${_propertiesVar} ${_properties} PARENT_SCOPE)
endfunction()
-function (cotire_copy_set_properites _configurations _type _source _target)
- cotire_resolve_config_properites("${_configurations}" _properties ${ARGN})
+function (cotire_copy_set_properties _configurations _type _source _target)
+ cotire_resolve_config_properties("${_configurations}" _properties ${ARGN})
foreach (_property ${_properties})
get_property(_isSet ${_type} ${_source} PROPERTY ${_property} SET)
if (_isSet)
@@ -320,13 +325,18 @@ function (cotire_copy_set_properites _configurations _type _source _target)
endforeach()
endfunction()
-function (cotire_get_target_usage_requirements _target _targetRequirementsVar)
+function (cotire_get_target_usage_requirements _target _config _targetRequirementsVar)
set (_targetRequirements "")
get_target_property(_librariesToProcess ${_target} LINK_LIBRARIES)
while (_librariesToProcess)
# remove from head
list (GET _librariesToProcess 0 _library)
list (REMOVE_AT _librariesToProcess 0)
+ if (_library MATCHES "^\\$<\\$<CONFIG:${_config}>:([A-Za-z0-9_:-]+)>$")
+ set (_library "${CMAKE_MATCH_1}")
+ elseif (_config STREQUAL "None" AND _library MATCHES "^\\$<\\$<CONFIG:>:([A-Za-z0-9_:-]+)>$")
+ set (_library "${CMAKE_MATCH_1}")
+ endif()
if (TARGET ${_library})
list (FIND _targetRequirements ${_library} _index)
if (_index LESS 0)
@@ -441,7 +451,7 @@ function (cotire_get_target_compile_flags _config _language _target _flagsVar)
# interface compile options from linked library targets
if (_target)
set (_linkedTargets "")
- cotire_get_target_usage_requirements(${_target} _linkedTargets)
+ cotire_get_target_usage_requirements(${_target} ${_config} _linkedTargets)
foreach (_linkedTarget ${_linkedTargets})
get_target_property(_targetOptions ${_linkedTarget} INTERFACE_COMPILE_OPTIONS)
if (_targetOptions)
@@ -573,7 +583,7 @@ function (cotire_get_target_include_directories _config _language _target _inclu
# interface include directories from linked library targets
if (_target)
set (_linkedTargets "")
- cotire_get_target_usage_requirements(${_target} _linkedTargets)
+ cotire_get_target_usage_requirements(${_target} ${_config} _linkedTargets)
foreach (_linkedTarget ${_linkedTargets})
get_target_property(_linkedTargetType ${_linkedTarget} TYPE)
if (CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE AND NOT CMAKE_VERSION VERSION_LESS "3.4.0" AND
@@ -627,7 +637,7 @@ function (cotire_get_target_include_directories _config _language _target _inclu
if (CMAKE_${_language}_IMPLICIT_INCLUDE_DIRECTORIES)
list (REMOVE_ITEM _includeDirs ${CMAKE_${_language}_IMPLICIT_INCLUDE_DIRECTORIES})
endif()
- if (WIN32)
+ if (WIN32 AND NOT MINGW)
# convert Windows paths in include directories to CMake paths
if (_includeDirs)
set (_paths "")
@@ -703,7 +713,7 @@ function (cotire_get_target_compile_definitions _config _language _target _defin
endif()
# interface compile definitions from linked library targets
set (_linkedTargets "")
- cotire_get_target_usage_requirements(${_target} _linkedTargets)
+ cotire_get_target_usage_requirements(${_target} ${_config} _linkedTargets)
foreach (_linkedTarget ${_linkedTargets})
get_target_property(_definitions ${_linkedTarget} INTERFACE_COMPILE_DEFINITIONS)
if (_definitions)
@@ -859,6 +869,9 @@ macro (cotire_set_cmd_to_prologue _cmdVar)
list (APPEND ${_cmdVar} "--warn-uninitialized")
endif()
list (APPEND ${_cmdVar} "-DCOTIRE_BUILD_TYPE:STRING=$<CONFIGURATION>")
+ if (XCODE)
+ list (APPEND ${_cmdVar} "-DXCODE:BOOL=TRUE")
+ endif()
if (COTIRE_VERBOSE)
list (APPEND ${_cmdVar} "-DCOTIRE_VERBOSE:BOOL=ON")
elseif("${CMAKE_GENERATOR}" MATCHES "Makefiles")
@@ -902,16 +915,16 @@ function (cotire_add_includes_to_cmd _cmdVar _language _includesVar _systemInclu
foreach (_include ${_includeDirs})
if (WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
file (TO_NATIVE_PATH "${_include}" _include)
- list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_${_language}_SEP}${_include}")
+ list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_SEP_${_language}}${_include}")
else()
set (_index -1)
if ("${CMAKE_INCLUDE_SYSTEM_FLAG_${_language}}" MATCHES ".+")
list (FIND ${_systemIncludesVar} "${_include}" _index)
endif()
if (_index GREATER -1)
- list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_SYSTEM_FLAG_${_language}}${_include}")
+ list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_SYSTEM_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_SEP_${_language}}${_include}")
else()
- list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_${_language}_SEP}${_include}")
+ list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_SEP_${_language}}${_include}")
endif()
endif()
endforeach()
@@ -1657,6 +1670,10 @@ function (cotire_add_pch_compilation_flags _language _compilerID _compilerVersio
get_filename_component(_pchName "${_pchFile}" NAME)
set (_xLanguage_C "c-header")
set (_xLanguage_CXX "c++-header")
+ set (_pchSuppressMessages FALSE)
+ if ("${CMAKE_${_language}_FLAGS}" MATCHES ".*-Wno-pch-messages.*")
+ set(_pchSuppressMessages TRUE)
+ endif()
if (_flags)
# append to list
if ("${_language}" STREQUAL "CXX")
@@ -1664,13 +1681,17 @@ function (cotire_add_pch_compilation_flags _language _compilerID _compilerVersio
endif()
list (APPEND _flags "-include" "${_prefixFile}" "-pch-dir" "${_pchDir}" "-pch-create" "${_pchName}" "-fsyntax-only" "${_hostFile}")
if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
- list (APPEND _flags "-Wpch-messages")
+ if (NOT _pchSuppressMessages)
+ list (APPEND _flags "-Wpch-messages")
+ endif()
endif()
else()
# return as a flag string
set (_flags "-include \"${_prefixFile}\" -pch-dir \"${_pchDir}\" -pch-create \"${_pchName}\"")
if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
- set (_flags "${_flags} -Wpch-messages")
+ if (NOT _pchSuppressMessages)
+ set (_flags "${_flags} -Wpch-messages")
+ endif()
endif()
endif()
endif()
@@ -1781,17 +1802,25 @@ function (cotire_add_prefix_pch_inclusion_flags _language _compilerID _compilerV
if (_pchFile)
get_filename_component(_pchDir "${_pchFile}" DIRECTORY)
get_filename_component(_pchName "${_pchFile}" NAME)
+ set (_pchSuppressMessages FALSE)
+ if ("${CMAKE_${_language}_FLAGS}" MATCHES ".*-Wno-pch-messages.*")
+ set(_pchSuppressMessages TRUE)
+ endif()
if (_flags)
# append to list
list (APPEND _flags "-include" "${_prefixFile}" "-pch-dir" "${_pchDir}" "-pch-use" "${_pchName}")
if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
- list (APPEND _flags "-Wpch-messages")
+ if (NOT _pchSuppressMessages)
+ list (APPEND _flags "-Wpch-messages")
+ endif()
endif()
else()
# return as a flag string
set (_flags "-include \"${_prefixFile}\" -pch-dir \"${_pchDir}\" -pch-use \"${_pchName}\"")
if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
- set (_flags "${_flags} -Wpch-messages")
+ if (NOT _pchSuppressMessages)
+ set (_flags "${_flags} -Wpch-messages")
+ endif()
endif()
endif()
else()
@@ -1839,6 +1868,14 @@ function (cotire_precompile_prefix_header _prefixFile _pchFile _hostFile)
if (_option_COMPILER_ID MATCHES "MSVC")
# cl.exe messes with the output streams unless the environment variable VS_UNICODE_OUTPUT is cleared
unset (ENV{VS_UNICODE_OUTPUT})
+ elseif (_option_COMPILER_ID MATCHES "GNU|Clang")
+ if (_option_COMPILER_LAUNCHER MATCHES "ccache" OR
+ _option_COMPILER_EXECUTABLE MATCHES "ccache")
+ # Newer versions of Clang and GCC seem to embed a compilation timestamp into the precompiled header binary,
+ # which results in "file has been modified since the precompiled header was built" errors if ccache is used.
+ # We work around the problem by disabling ccache upon pre-compiling the prefix header.
+ set (ENV{CCACHE_DISABLE} "true")
+ endif()
endif()
execute_process(
COMMAND ${_cmd}
@@ -2191,7 +2228,7 @@ function (cotire_generate_target_script _language _configurations _target _targe
XCODE MSVC CMAKE_GENERATOR CMAKE_BUILD_TYPE CMAKE_CONFIGURATION_TYPES
CMAKE_${_language}_COMPILER_ID CMAKE_${_language}_COMPILER_VERSION
CMAKE_${_language}_COMPILER_LAUNCHER CMAKE_${_language}_COMPILER CMAKE_${_language}_COMPILER_ARG1
- CMAKE_INCLUDE_FLAG_${_language} CMAKE_INCLUDE_FLAG_${_language}_SEP
+ CMAKE_INCLUDE_FLAG_${_language} CMAKE_INCLUDE_FLAG_SEP_${_language}
CMAKE_INCLUDE_SYSTEM_FLAG_${_language}
CMAKE_${_language}_FRAMEWORK_SEARCH_FLAG
CMAKE_${_language}_SYSTEM_FRAMEWORK_SEARCH_FLAG
@@ -2989,8 +3026,13 @@ function (cotire_setup_unity_build_target _languages _configurations _target)
if (_targetAutoMoc OR _targetAutoUic OR _targetAutoRcc)
# if the original target sources are subject to CMake's automatic Qt processing,
# also include implicitly generated <targetname>_automoc.cpp file
- list (APPEND _unityTargetSources "${_target}_automoc.cpp")
- set_property (SOURCE "${_target}_automoc.cpp" PROPERTY GENERATED TRUE)
+ if (CMAKE_VERSION VERSION_LESS "3.8.0")
+ list (APPEND _unityTargetSources "${_target}_automoc.cpp")
+ set_property (SOURCE "${_target}_automoc.cpp" PROPERTY GENERATED TRUE)
+ else()
+ list (APPEND _unityTargetSources "${_target}_autogen/moc_compilation.cpp")
+ set_property (SOURCE "${_target}_autogen/moc_compilation.cpp" PROPERTY GENERATED TRUE)
+ endif()
endif()
# prevent AUTOMOC, AUTOUIC and AUTORCC properties from being set when the unity target is created
set (CMAKE_AUTOMOC OFF)
@@ -3013,7 +3055,11 @@ function (cotire_setup_unity_build_target _languages _configurations _target)
else()
if (_targetAutoMoc OR _targetAutoUic OR _targetAutoRcc)
# depend on the original target's implicity generated <targetname>_automoc target
- add_dependencies(${_unityTargetName} ${_target}_automoc)
+ if (CMAKE_VERSION VERSION_LESS "3.8.0")
+ add_dependencies(${_unityTargetName} ${_target}_automoc)
+ else()
+ add_dependencies(${_unityTargetName} ${_target}_autogen)
+ endif()
endif()
endif()
# copy output location properties
@@ -3027,8 +3073,8 @@ function (cotire_setup_unity_build_target _languages _configurations _target)
set (_outputDir "${COTIRE_UNITY_OUTPUT_DIRECTORY}")
else()
# append relative COTIRE_UNITY_OUTPUT_DIRECTORY to target's actual output directory
- cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName} ${_outputDirProperties})
- cotire_resolve_config_properites("${_configurations}" _properties ${_outputDirProperties})
+ cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName} ${_outputDirProperties})
+ cotire_resolve_config_properties("${_configurations}" _properties ${_outputDirProperties})
foreach (_property ${_properties})
get_property(_outputDir TARGET ${_target} PROPERTY ${_property})
if (_outputDir)
@@ -3048,11 +3094,11 @@ function (cotire_setup_unity_build_target _languages _configurations _target)
RUNTIME_OUTPUT_DIRECTORY "${_outputDir}")
endif()
else()
- cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+ cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
${_outputDirProperties})
endif()
# copy output name
- cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+ cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
ARCHIVE_OUTPUT_NAME ARCHIVE_OUTPUT_NAME_<CONFIG>
LIBRARY_OUTPUT_NAME LIBRARY_OUTPUT_NAME_<CONFIG>
OUTPUT_NAME OUTPUT_NAME_<CONFIG>
@@ -3060,7 +3106,7 @@ function (cotire_setup_unity_build_target _languages _configurations _target)
PREFIX <CONFIG>_POSTFIX SUFFIX
IMPORT_PREFIX IMPORT_SUFFIX)
# copy compile stuff
- cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+ cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
COMPILE_DEFINITIONS COMPILE_DEFINITIONS_<CONFIG>
COMPILE_FLAGS COMPILE_OPTIONS
Fortran_FORMAT Fortran_MODULE_DIRECTORY
@@ -3072,12 +3118,12 @@ function (cotire_setup_unity_build_target _languages _configurations _target)
C_VISIBILITY_PRESET CXX_VISIBILITY_PRESET VISIBILITY_INLINES_HIDDEN
C_CLANG_TIDY CXX_CLANG_TIDY)
# copy compile features
- cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+ cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
C_EXTENSIONS C_STANDARD C_STANDARD_REQUIRED
CXX_EXTENSIONS CXX_STANDARD CXX_STANDARD_REQUIRED
COMPILE_FEATURES)
# copy interface stuff
- cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+ cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
COMPATIBLE_INTERFACE_BOOL COMPATIBLE_INTERFACE_NUMBER_MAX COMPATIBLE_INTERFACE_NUMBER_MIN
COMPATIBLE_INTERFACE_STRING
INTERFACE_COMPILE_DEFINITIONS INTERFACE_COMPILE_FEATURES INTERFACE_COMPILE_OPTIONS
@@ -3085,7 +3131,7 @@ function (cotire_setup_unity_build_target _languages _configurations _target)
INTERFACE_POSITION_INDEPENDENT_CODE INTERFACE_SYSTEM_INCLUDE_DIRECTORIES
INTERFACE_AUTOUIC_OPTIONS NO_SYSTEM_FROM_IMPORTED)
# copy link stuff
- cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+ cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
BUILD_WITH_INSTALL_RPATH INSTALL_RPATH INSTALL_RPATH_USE_LINK_PATH SKIP_BUILD_RPATH
LINKER_LANGUAGE LINK_DEPENDS LINK_DEPENDS_NO_SHARED
LINK_FLAGS LINK_FLAGS_<CONFIG>
@@ -3094,18 +3140,18 @@ function (cotire_setup_unity_build_target _languages _configurations _target)
LINK_SEARCH_START_STATIC LINK_SEARCH_END_STATIC
STATIC_LIBRARY_FLAGS STATIC_LIBRARY_FLAGS_<CONFIG>
NO_SONAME SOVERSION VERSION
- LINK_WHAT_YOU_USE)
+ LINK_WHAT_YOU_USE BUILD_RPATH)
# copy cmake stuff
- cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+ cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
IMPLICIT_DEPENDS_INCLUDE_TRANSFORM RULE_LAUNCH_COMPILE RULE_LAUNCH_CUSTOM RULE_LAUNCH_LINK)
# copy Apple platform specific stuff
- cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+ cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
BUNDLE BUNDLE_EXTENSION FRAMEWORK FRAMEWORK_VERSION INSTALL_NAME_DIR
MACOSX_BUNDLE MACOSX_BUNDLE_INFO_PLIST MACOSX_FRAMEWORK_INFO_PLIST MACOSX_RPATH
OSX_ARCHITECTURES OSX_ARCHITECTURES_<CONFIG> PRIVATE_HEADER PUBLIC_HEADER RESOURCE XCTEST
- IOS_INSTALL_COMBINED)
+ IOS_INSTALL_COMBINED XCODE_EXPLICIT_FILE_TYPE XCODE_PRODUCT_TYPE)
# copy Windows platform specific stuff
- cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+ cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
GNUtoMS
COMPILE_PDB_NAME COMPILE_PDB_NAME_<CONFIG>
COMPILE_PDB_OUTPUT_DIRECTORY COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG>
@@ -3119,9 +3165,9 @@ function (cotire_setup_unity_build_target _languages _configurations _target)
VS_WINRT_COMPONENT VS_WINRT_EXTENSIONS VS_WINRT_REFERENCES
WIN32_EXECUTABLE WINDOWS_EXPORT_ALL_SYMBOLS
DEPLOYMENT_REMOTE_DIRECTORY VS_CONFIGURATION_TYPE
- VS_SDK_REFERENCES)
+ VS_SDK_REFERENCES VS_USER_PROPS VS_DEBUGGER_WORKING_DIRECTORY)
# copy Android platform specific stuff
- cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+ cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
ANDROID_API ANDROID_API_MIN ANDROID_GUI
ANDROID_ANT_ADDITIONAL_OPTIONS ANDROID_ARCH ANDROID_ASSETS_DIRECTORIES
ANDROID_JAR_DEPENDENCIES ANDROID_JAR_DIRECTORIES ANDROID_JAVA_SOURCE_DIR
[28/42] mesos git commit: CMake: Removed some CMake helper modules.
Posted by jo...@apache.org.
CMake: Removed some CMake helper modules.
`External` and `PatchCommand` were consolidated to `3rdparty`, and
`VsBuildCommand` has already been deprecated and is unused.
Review: https://reviews.apache.org/r/61514/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/b4933f15
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/b4933f15
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/b4933f15
Branch: refs/heads/master
Commit: b4933f15c6dbb3f9ad458a56d64ef2c3ea7705f9
Parents: bf6ad1f
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Sat Sep 2 20:03:28 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:08 2017 -0700
----------------------------------------------------------------------
3rdparty/libprocess/cmake/macros/External.cmake | 80 -----------------
.../libprocess/cmake/macros/PatchCommand.cmake | 29 ------
.../libprocess/cmake/macros/VsBuildCommand.bat | 94 --------------------
3 files changed, 203 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/b4933f15/3rdparty/libprocess/cmake/macros/External.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/cmake/macros/External.cmake b/3rdparty/libprocess/cmake/macros/External.cmake
deleted file mode 100644
index 5bc51bd..0000000
--- a/3rdparty/libprocess/cmake/macros/External.cmake
+++ /dev/null
@@ -1,80 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-###############################################################
-# EXTERNAL defines a few variables that make it easy for us to track the
-# directory structure of a dependency. In particular, if our library's name is
-# boost, we will define the following variables:
-#
-# BOOST_VERSION (e.g., 1.53.0)
-# BOOST_TARGET (a target folder name to put dep in e.g., boost-1.53.0)
-# BOOST_CMAKE_ROOT (where to have CMake put the uncompressed source, e.g.,
-# build/3rdparty/boost-1.53.0)
-# BOOST_ROOT (where the code goes in various stages of build, e.g.,
-# build/.../boost-1.53.0/src, which might contain folders
-# build-1.53.0-build, -lib, and so on, for each build step
-# that dependency has)
-function(EXTERNAL
- LIB_NAME
- LIB_VERSION
- BIN_ROOT)
-
- string(TOUPPER ${LIB_NAME} LIB_NAME_UPPER)
-
- # Names of variables we will set in this function.
- set(VERSION_VAR ${LIB_NAME_UPPER}_VERSION) # e.g., BOOST_VERSION
- set(TARGET_VAR ${LIB_NAME_UPPER}_TARGET) # e.g., BOOST_TARGET
- set(CMAKE_ROOT_VAR ${LIB_NAME_UPPER}_CMAKE_ROOT) # e.g., BOOST_CMAKE_ROOT
- set(ROOT_VAR ${LIB_NAME_UPPER}_ROOT) # e.g., BOOST_ROOT
-
- # Generate data that we will put in the above variables.
- # NOTE: bundled packages are untar'd into the BIN_ROOT, which is why we're
- # pointing the source root into BIN_ROOT rather than SRC_ROOT.
- # TODO(hausdorff): SRC_DATA doesn't work for HTTP, LIBEV, GMOCK, or GTEST.
- set(VERSION_DATA ${LIB_VERSION})
- set(TARGET_DATA ${LIB_NAME}-${VERSION_DATA})
- set(CMAKE_ROOT_DATA ${BIN_ROOT}/${TARGET_DATA})
- set(ROOT_DATA ${CMAKE_ROOT_DATA}/src/${TARGET_DATA})
-
- # Finally, EXPORT THE ABOVE VARIABLES. We take the data variables we just
- # defined, and export them to variables in the parent scope.
- #
- # NOTE: The "export" step is different from the "define the data vars" step
- # because an expression like ${VERSION_VAR} will evaluate to
- # something like "BOOST_VERSION", not something like "1.53.0". That
- # is: to get the version in the parent scope we would do something
- # like ${BOOST_VERSION}, which might evaluate to something like
- # "1.53.0". So in this function, if you wanted to generate (e.g.) the
- # target variable, it is not sufficient to write
- # "${LIB_NAME}-${VERSION_VAR}", because this would result in
- # something like "boost-BOOST_VERSION" when what we really wanted was
- # "boost-1.53.0". Hence, these two steps are different.
- set(${VERSION_VAR} # e.g., 1.53.0
- ${VERSION_DATA}
- PARENT_SCOPE)
-
- set(${TARGET_VAR} # e.g., boost-1.53.0
- ${TARGET_DATA}
- PARENT_SCOPE)
-
- set(${CMAKE_ROOT_VAR} # e.g., build/3rdparty/boost-1.53.0
- ${CMAKE_ROOT_DATA}
- PARENT_SCOPE)
-
- set(${ROOT_VAR} # e.g., build/.../boost-1.53.0/src
- ${ROOT_DATA}
- PARENT_SCOPE)
-endfunction()
http://git-wip-us.apache.org/repos/asf/mesos/blob/b4933f15/3rdparty/libprocess/cmake/macros/PatchCommand.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/cmake/macros/PatchCommand.cmake b/3rdparty/libprocess/cmake/macros/PatchCommand.cmake
deleted file mode 100644
index 12ee3f1..0000000
--- a/3rdparty/libprocess/cmake/macros/PatchCommand.cmake
+++ /dev/null
@@ -1,29 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-##############################################################
-# PATCH_CMD generates a patch command for those dependencies that need it. For
-# example, when the rebundled version of GLOG needs to be patched, we would run
-# this command.
-function(PATCH_CMD patch_filename patch_cmd_varname)
- # CMake does not appear to have a good way for macro functions to return
- # values, so here we assign the patch command to a variable in the
- # PARENT_SCOPE. (The name of the variable to assign to in the parent scope
- # is passed in as a parameter to the macro function.)
- set (${patch_cmd_varname}
- test ! -e ${patch_filename} || patch -p1 < ${patch_filename}
- PARENT_SCOPE)
-endfunction()
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/mesos/blob/b4933f15/3rdparty/libprocess/cmake/macros/VsBuildCommand.bat
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/cmake/macros/VsBuildCommand.bat b/3rdparty/libprocess/cmake/macros/VsBuildCommand.bat
deleted file mode 100644
index 8d8f7c6..0000000
--- a/3rdparty/libprocess/cmake/macros/VsBuildCommand.bat
+++ /dev/null
@@ -1,94 +0,0 @@
-REM Licensed to the Apache Software Foundation (ASF) under one
-REM or more contributor license agreements. See the NOTICE file
-REM distributed with this work for additional information
-REM regarding copyright ownership. The ASF licenses this file
-REM to you under the Apache License, Version 2.0 (the
-REM "License"); you may not use this file except in compliance
-REM with the License. You may obtain a copy of the License at
-REM
-REM http://www.apache.org/licenses/LICENSE-2.0
-REM
-REM Unless required by applicable law or agreed to in writing, software
-REM distributed under the License is distributed on an "AS IS" BASIS,
-REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-REM See the License for the specific language governing permissions and
-REM limitations under the License.
-
-
-REM Usage: `VsBuildCommand.bat solution_file configuration project_root projects`
-REM The arguments follow:
-REM * solution_file: The `.sln` file we want to build.
-REM * configuration: Type of build, usually `Debug` or `Release`.
-REM * project_root: Path to the `.vcxproj` files for the `.sln` in the first
-REM argument.
-REM * projects: List of projects to compile. For example, the ZK list is just
-REM "zookeeper", even though there is also a `Cli` project; the reason is
-REM that we don't need the `Cli` project to build Mesos.
-REM
-REM NOTE: This script is fairly limited in 2 ways: it assumes that (1) all the
-REM VS project files for a solution are in `project_root`, and (2) all the
-REM project files are `.vcxproj` files (rather than, say, `.vcproj` files). This
-REM limitation can be overcome with more complicated command line parsing
-REM machinery, since our use case is fairly limited, we did not think the
-REM complexity was worth it.
-
-@echo off
-
-REM Parse command line params.
-for /f "tokens=1-3*" %%A in ("%*") do (
- set SOLUTION_FILE=%%A
- set CONFIGURATION=%%B
- set PROJECTS_ROOT=%%C
- set PROJECTS=%%D
-)
-
-set PLATFORM=x64
-setlocal EnableDelayedExpansion
-setlocal EnableExtensions
-
-REM Get Visual Studio 2015 install directory.
-set VS2015_KEY=HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0
-set VS2015_INSTALLDIR_VALUE=InstallDir
-
-for /F "skip=2 tokens=1,2*" %%A ^
-in ('REG QUERY %VS2015_KEY% /v %VS2015_INSTALLDIR_VALUE% 2^>nul') do (
- set VS2015_DIR=%%C..\..
-)
-
-REM Check if Visual Studio 2015 is installed.
-if defined VS2015_DIR (
- set SOLUTION_VER=12.00
- set PROJECT_VER=14.00
- REM Prepare Visual Studio 2015 command line environment.
- call "%VS2015_DIR%\VC\vcvarsall.bat" x86
-) else (
- echo "No compiler : Microsoft Visual Studio (2015) is not installed."
- exit /b 1
-)
-
-REM For each project in the list of projects...
-for %%P in (%PROJECTS%) do (
- devenv /upgrade %PROJECTS_ROOT%\%%P.vcxproj
-)
-
-FINDSTR ^
- /C:"Microsoft Visual Studio Solution File, Format Version %SOLUTION_VER%" ^
- %SOLUTION_FILE:/=\%
-if %errorlevel% neq 0 (
- REM Upgrade solution file if its version does not match current %SOLUTION_VER%.
- echo "Upgrading Visual Studio Solution File: %SOLUTION_FILE% ."
- devenv /upgrade %SOLUTION_FILE%
-)
-
-if not "%PROJECTS%" == "" (
- set PROJECTS_TARGET=/t:%PROJECTS: =;%
-)
-
-msbuild ^
- %SOLUTION_FILE% %PROJECTS_TARGET% ^
- /p:Configuration=%CONFIGURATION%;Platform=%PLATFORM% ^
- /p:PlatformTarget=%PLATFORM% ^
- /p:RuntimeLibrary=MT_StaticDebug
-
-:end
-exit /b
\ No newline at end of file
[40/42] mesos git commit: CMake: Audited linkage of 3rdparty
dependencies.
Posted by jo...@apache.org.
CMake: Audited linkage of 3rdparty dependencies.
This patch forward the `CMAKE_POSITION_INDEPENDENT_CODE` property to
3rdparty projects built with CMake.
It marks as `GLOBAL` imported (non-interface) libraries to enable Cotire
to find the targets. Note that while "global" is usually frowned upon,
it makes sense for these targets as they would be top-level targets if
they were not also 3rdparty targets, causing us to keep them separate.
It adds `IMPORTED_IMPLIB` locations for dependencies which can be built
as shared libraries (`BUILD_SHARED_LIBS=ON`) so that CMake can link to
them correctly. For the libraries that cannot be built in this way, the
linkage was set explicitly and appropriately (e.g. Googletest must
always be built statically).
Review: https://reviews.apache.org/r/61752/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/4a430e3b
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/4a430e3b
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/4a430e3b
Branch: refs/heads/master
Commit: 4a430e3b52d8ce1268163a3856e6b3ead8fb60c9
Parents: dd454cf
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Thu Aug 17 15:10:33 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:09 2017 -0700
----------------------------------------------------------------------
3rdparty/CMakeLists.txt | 85 +++++++++++++++++++++++++++++---------------
1 file changed, 56 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/4a430e3b/3rdparty/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
index 431260a..2a183a4 100755
--- a/3rdparty/CMakeLists.txt
+++ b/3rdparty/CMakeLists.txt
@@ -100,6 +100,7 @@ list(APPEND CMAKE_FORWARD_ARGS
# TODO(andschwa): Set the CMAKE_GENERATOR explicitly as an argmuent to
# `ExternalProject_Add`.
-G${CMAKE_GENERATOR}
+ -DCMAKE_POSITION_INDEPENDENT_CODE=${CMAKE_POSITION_INDEPENDENT_CODE}
-DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS})
# This only matters for single-configuration generators.
@@ -207,7 +208,7 @@ ExternalProject_Add(
# https://github.com/google/glog
################################
EXTERNAL(glog ${GLOG_VERSION} ${CMAKE_CURRENT_BINARY_DIR})
-add_library(glog ${LIBRARY_LINKAGE} IMPORTED)
+add_library(glog ${LIBRARY_LINKAGE} IMPORTED GLOBAL)
add_dependencies(glog ${GLOG_TARGET})
# Patch glog to deal with a problem that appears when compiling on clang
@@ -227,27 +228,30 @@ if (WIN32)
#
# [1] https://htmlpreview.github.io/?https://github.com/google/glog/blob/master/doc/glog.html#windows
# [2] https://github.com/google/glog/blob/f012836db187d5897d4adaaf621b4d53ae4865da/src/windows/glog/logging.h#L965
- set(GLOG_COMPILE_DEFINITIONS GOOGLE_GLOG_DLL_DECL= NOGDI NOMINMAX)
+ set(GLOG_COMPILE_DEFINITIONS NOGDI NOMINMAX)
+ if (NOT BUILD_SHARED_LIBS)
+ list(APPEND GLOG_COMPILE_DEFINITIONS GOOGLE_GLOG_DLL_DECL=)
+ endif ()
set_target_properties(
glog PROPERTIES
IMPORTED_LOCATION_DEBUG ${GLOG_ROOT}-build/Debug/glog${LIBRARY_SUFFIX}
IMPORTED_LOCATION_RELEASE ${GLOG_ROOT}-build/Release/glog${LIBRARY_SUFFIX}
+ IMPORTED_IMPLIB_DEBUG ${GLOG_ROOT}-build/Debug/glog${CMAKE_IMPORT_LIBRARY_SUFFIX}
+ IMPORTED_IMPLIB_RELEASE ${GLOG_ROOT}-build/Release/glog${CMAKE_IMPORT_LIBRARY_SUFFIX}
INTERFACE_INCLUDE_DIRECTORIES ${GLOG_ROOT}/src/windows
# TODO(andschwa): Remove this when glog is updated.
IMPORTED_LINK_INTERFACE_LIBRARIES DbgHelp
INTERFACE_COMPILE_DEFINITIONS "${GLOG_COMPILE_DEFINITIONS}")
else ()
# TODO(andschwa): Build with CMake instead when glog is updated.
- # NOTE: We only link to the shared library of glog because the static build
- # doesn't have PIC.
- set(GLOG_CONFIG_CMD ${GLOG_ROOT}/src/../configure GTEST_CONFIG=no --prefix=${GLOG_ROOT}-build)
+ set(GLOG_CONFIG_CMD ${GLOG_ROOT}/src/../configure --with-pic GTEST_CONFIG=no --prefix=${GLOG_ROOT}-build)
set(GLOG_BUILD_CMD make)
set(GLOG_INSTALL_CMD make install)
set_target_properties(
glog PROPERTIES
- IMPORTED_LOCATION ${GLOG_ROOT}-build/lib/libglog${CMAKE_SHARED_LIBRARY_SUFFIX}
+ IMPORTED_LOCATION ${GLOG_ROOT}-build/lib/libglog${LIBRARY_SUFFIX}
INTERFACE_INCLUDE_DIRECTORIES ${GLOG_ROOT}-build/include)
endif ()
@@ -318,11 +322,15 @@ ExternalProject_Add(
##################################################
# TODO: Remove `GLOBAL` when `Process3rdpartyConfigure` is removed.
EXTERNAL(http_parser ${HTTP_PARSER_VERSION} ${CMAKE_CURRENT_BINARY_DIR})
-add_library(http_parser ${LIBRARY_LINKAGE} IMPORTED GLOBAL)
+
+# NOTE: http-parser is built as a static library unconditionally.
+add_library(http_parser STATIC IMPORTED GLOBAL)
add_dependencies(http_parser ${HTTP_PARSER_TARGET})
-set_target_properties(http_parser PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${HTTP_PARSER_ROOT})
-# NOTE: http-parser is always built as a static library.
+set_target_properties(
+ http_parser PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES ${HTTP_PARSER_ROOT})
+
if (WIN32)
set_target_properties(
http_parser PROPERTIES
@@ -442,10 +450,11 @@ endif ()
###########################################
if (WIN32)
EXTERNAL(libapr ${LIBAPR_VERSION} ${CMAKE_CURRENT_BINARY_DIR})
- add_library(apr ${LIBRARY_LINKAGE} IMPORTED)
- add_dependencies(apr ${LIBAPR_TARGET})
# NOTE: libapr-1 is always a static library on Windows.
+ add_library(apr STATIC IMPORTED)
+ add_dependencies(apr ${LIBAPR_TARGET})
+
set_target_properties(
apr PROPERTIES
IMPORTED_LOCATION_DEBUG ${LIBAPR_ROOT}-build/Debug/libapr-1${CMAKE_STATIC_LIBRARY_SUFFIX}
@@ -499,24 +508,28 @@ endif ()
######################################################################
if (WIN32)
EXTERNAL(curl ${CURL_VERSION} ${CMAKE_CURRENT_BINARY_DIR})
- add_library(curl ${LIBRARY_LINKAGE} IMPORTED)
+ add_library(curl ${LIBRARY_LINKAGE} IMPORTED GLOBAL)
add_dependencies(curl ${CURL_TARGET})
+ # NOTE: curl does not respect BUILD_SHARED_LIBS.
+ set(CURL_CMAKE_ARGS ${CMAKE_FORWARD_ARGS} -DBUILD_CURL_TESTS=OFF)
+ if (NOT BUILD_SHARED_LIBS)
+ # This is both a CMake argument and a pre-processor definition.
+ list(APPEND CURL_CMAKE_ARGS -DCURL_STATICLIB=ON)
+
+ set_target_properties(
+ curl PROPERTIES
+ INTERFACE_COMPILE_DEFINITIONS CURL_STATICLIB)
+ endif ()
+
set_target_properties(
curl PROPERTIES
IMPORTED_LOCATION_DEBUG ${CURL_ROOT}-build/lib/Debug/libcurl${LIBRARY_SUFFIX}
IMPORTED_LOCATION_RELEASE ${CURL_ROOT}-build/lib/Release/libcurl${LIBRARY_SUFFIX}
- INTERFACE_COMPILE_DEFINITIONS CURL_STATICLIB
+ IMPORTED_IMPLIB_DEBUG ${CURL_ROOT}-build/lib/Debug/libcurl_imp${CMAKE_IMPORT_LIBRARY_SUFFIX}
+ IMPORTED_IMPLIB_RELEASE ${CURL_ROOT}-build/lib/Release/libcurl_imp${CMAKE_IMPORT_LIBRARY_SUFFIX}
INTERFACE_INCLUDE_DIRECTORIES ${CURL_ROOT}/include)
- set(CURL_CMAKE_ARGS ${CMAKE_FORWARD_ARGS} -DBUILD_CURL_TESTS=OFF)
-
- # NOTE: curl does not respect BUILD_SHARED_LIBS.
- if (NOT BUILD_SHARED_LIBS)
- # This is both a CMake argument, and a pre-processor definition.
- list(APPEND CURL_CMAKE_ARGS -DCURL_STATICLIB=ON)
- endif ()
-
MAKE_INCLUDE_DIR(curl)
GET_BYPRODUCTS(curl)
@@ -551,15 +564,19 @@ if (WIN32)
# Zlib generates different libraries depending on the linkage
# and configuration. i.e.:
# * For a static Debug build: `zlibstaticd.lib`.
- # * For a shared Release build: `zlib.lib`.
+ # * For a shared Release build: `zlib1.lib`.
if (NOT BUILD_SHARED_LIBS)
set(ZLIB_STATIC static)
+ else ()
+ set(ZLIB_SHARED 1)
endif ()
set_target_properties(
zlib PROPERTIES
- IMPORTED_LOCATION_DEBUG ${ZLIB_ROOT}-build/Debug/zlib${ZLIB_STATIC}d${LIBRARY_SUFFIX}
- IMPORTED_LOCATION_RELEASE ${ZLIB_ROOT}-build/Release/zlib${ZLIB_STATIC}${LIBRARY_SUFFIX}
+ IMPORTED_LOCATION_DEBUG ${ZLIB_ROOT}-build/Debug/zlib${ZLIB_STATIC}d${ZLIB_SHARED}${LIBRARY_SUFFIX}
+ IMPORTED_LOCATION_RELEASE ${ZLIB_ROOT}-build/Release/zlib${ZLIB_STATIC}${ZLIB_SHARED}${LIBRARY_SUFFIX}
+ IMPORTED_IMPLIB_DEBUG ${ZLIB_ROOT}-build/Debug/zlib${ZLIB_STATIC}d${CMAKE_IMPORT_LIBRARY_SUFFIX}
+ IMPORTED_IMPLIB_RELEASE ${ZLIB_ROOT}-build/Release/zlib${ZLIB_STATIC}${CMAKE_IMPORT_LIBRARY_SUFFIX}
INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_ROOT};${ZLIB_ROOT}-build")
MAKE_INCLUDE_DIR(zlib)
@@ -596,8 +613,11 @@ add_library(googletest INTERFACE)
add_dependencies(googletest ${GOOGLETEST_TARGET})
target_link_libraries(googletest INTERFACE gmock gtest)
-add_library(gmock IMPORTED STATIC)
-add_library(gtest IMPORTED STATIC)
+# Note that Google Test is always built with static libraries because of the
+# following open issue when using shared libraries, on both Windows and Linux:
+# https://github.com/google/googletest/issues/930
+add_library(gmock STATIC IMPORTED GLOBAL)
+add_library(gtest STATIC IMPORTED GLOBAL)
set_target_properties(
gmock PROPERTIES
@@ -632,13 +652,20 @@ MAKE_INCLUDE_DIR(gtest)
GET_BYPRODUCTS(gmock)
GET_BYPRODUCTS(gtest)
+set(GOOGLETEST_CMAKE_FORWARD_ARGS ${CMAKE_FORWARD_ARGS})
+
+# Unconditionally build static libraries.
+list(APPEND GOOGLETEST_CMAKE_FORWARD_ARGS -DBUILD_SHARED_LIBS=OFF)
+
+# Link to the correct CRT based on other libraries' linkage.
+list(APPEND GOOGLETEST_CMAKE_FORWARD_ARGS
+ -Dgtest_force_shared_crt=${BUILD_SHARED_LIBS})
+
ExternalProject_Add(
${GOOGLETEST_TARGET}
PREFIX ${GOOGLETEST_CMAKE_ROOT}
BUILD_BYPRODUCTS ${GMOCK_BYPRODUCTS};${GTEST_BYPRODUCTS}
- # NOTE: googletest cannot be built as a shared library, or the test runner
- # will crash with a double-free.
- CMAKE_ARGS ${CMAKE_FORWARD_ARGS};-DBUILD_SHARED_LIBS=OFF
+ CMAKE_ARGS ${GOOGLETEST_CMAKE_FORWARD_ARGS}
INSTALL_COMMAND ${CMAKE_NOOP}
URL ${GOOGLETEST_URL}
URL_HASH ${GOOGLETEST_HASH})
[38/42] mesos git commit: CMake: Normalized trailing parentheses
style (libprocess).
Posted by jo...@apache.org.
CMake: Normalized trailing parentheses style (libprocess).
This removes dangling parentheses from CMake files setting variables
or calling functions.
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/21f7837d
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/21f7837d
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/21f7837d
Branch: refs/heads/master
Commit: 21f7837d1084520ff9b66de7f5203482376203cb
Parents: 8ef80cf
Author: Joseph Wu <jo...@apache.org>
Authored: Sun Sep 3 00:43:51 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:09 2017 -0700
----------------------------------------------------------------------
3rdparty/libprocess/src/CMakeLists.txt | 39 +++++++++--------------
3rdparty/libprocess/src/tests/CMakeLists.txt | 10 ++----
2 files changed, 18 insertions(+), 31 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/21f7837d/3rdparty/libprocess/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/CMakeLists.txt b/3rdparty/libprocess/src/CMakeLists.txt
index 348398a..dae057b 100644
--- a/3rdparty/libprocess/src/CMakeLists.txt
+++ b/3rdparty/libprocess/src/CMakeLists.txt
@@ -24,21 +24,7 @@ endif ()
# SOURCE FILES FOR THE PROCESS LIBRARY.
#######################################
-
-if (WIN32)
- set(PROCESS_SRC
- ${PROCESS_SRC}
- subprocess_windows.cpp
- )
-else ()
- set(PROCESS_SRC
- ${PROCESS_SRC}
- subprocess_posix.cpp
- )
-endif ()
-
set(PROCESS_SRC
- ${PROCESS_SRC}
authenticator_manager.cpp
authenticator_manager.hpp
authenticator.cpp
@@ -69,23 +55,30 @@ set(PROCESS_SRC
socket.cpp
subprocess.cpp
time.cpp
- timeseries.cpp
- )
+ timeseries.cpp)
+
+if (WIN32)
+ set(PROCESS_SRC
+ ${PROCESS_SRC}
+ subprocess_windows.cpp)
+else ()
+ set(PROCESS_SRC
+ ${PROCESS_SRC}
+ subprocess_posix.cpp)
+endif ()
if (ENABLE_LIBEVENT)
set(PROCESS_SRC
${PROCESS_SRC}
libevent.hpp
libevent.cpp
- libevent_poll.cpp
- )
+ libevent_poll.cpp)
else ()
set(PROCESS_SRC
${PROCESS_SRC}
libev.hpp
libev.cpp
- libev_poll.cpp
- )
+ libev_poll.cpp)
endif ()
if (ENABLE_SSL)
@@ -94,14 +87,12 @@ if (ENABLE_SSL)
jwt.cpp
jwt_authenticator.cpp
openssl.cpp
- ssl/utilities.cpp
- )
+ ssl/utilities.cpp)
if (ENABLE_LIBEVENT)
set(PROCESS_SRC
${PROCESS_SRC}
- libevent_ssl_socket.cpp
- )
+ libevent_ssl_socket.cpp)
endif ()
endif ()
http://git-wip-us.apache.org/repos/asf/mesos/blob/21f7837d/3rdparty/libprocess/src/tests/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/tests/CMakeLists.txt b/3rdparty/libprocess/src/tests/CMakeLists.txt
index c96db50..28396bd 100644
--- a/3rdparty/libprocess/src/tests/CMakeLists.txt
+++ b/3rdparty/libprocess/src/tests/CMakeLists.txt
@@ -17,7 +17,6 @@
# PROCESS TESTS.
################
set(PROCESS_TESTS_SRC
- ${PROCESS_TESTS_SRC}
main.cpp
after_tests.cpp
collect_tests.cpp
@@ -40,23 +39,20 @@ set(PROCESS_TESTS_SRC
subprocess_tests.cpp
system_tests.cpp
time_tests.cpp
- timeseries_tests.cpp
- )
+ timeseries_tests.cpp)
if (NOT WIN32)
set(PROCESS_TESTS_SRC
${PROCESS_TESTS_SRC}
io_tests.cpp
- reap_tests.cpp
- )
+ reap_tests.cpp)
endif ()
if (ENABLE_SSL)
set(PROCESS_TESTS_SRC
${PROCESS_TESTS_SRC}
jwt_tests.cpp
- ssl_tests.cpp
- )
+ ssl_tests.cpp)
endif ()
add_library(process-interface INTERFACE)
[13/42] mesos git commit: CMake: Prioritized provided paths in
`FindPackageHelper`.
Posted by jo...@apache.org.
CMake: Prioritized provided paths in `FindPackageHelper`.
This ensure that the given paths are searched before the default paths,
required for finding the correct macOS packages.
Also normalized some whitespace in the file.
Review: https://reviews.apache.org/r/61336/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/ea39e120
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/ea39e120
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/ea39e120
Branch: refs/heads/master
Commit: ea39e12050e2ae20d16d0affd9bb77bc56b129ad
Parents: 5c52e46
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Sat Sep 2 07:51:29 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:06 2017 -0700
----------------------------------------------------------------------
3rdparty/stout/cmake/FindPackageHelper.cmake | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/ea39e120/3rdparty/stout/cmake/FindPackageHelper.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/stout/cmake/FindPackageHelper.cmake b/3rdparty/stout/cmake/FindPackageHelper.cmake
index 089edb0..2e6acdf 100644
--- a/3rdparty/stout/cmake/FindPackageHelper.cmake
+++ b/3rdparty/stout/cmake/FindPackageHelper.cmake
@@ -46,16 +46,16 @@ function(FIND_PACKAGE_HELPER PACKAGE_NAME HEADER_FILE)
find_path(
${PACKAGE_NAME}_INCLUDE_DIR
${HEADER_FILE}
- HINTS ${POSSIBLE_${PACKAGE_NAME}_INCLUDE_DIRS}
- )
+ HINTS ${POSSIBLE_${PACKAGE_NAME}_INCLUDE_DIRS})
# Check if the header file was found.
string(
COMPARE NOTEQUAL
"${PACKAGE_NAME}_INCLUDE_DIR-NOTFOUND"
${${PACKAGE_NAME}_INCLUDE_DIR}
- ${PACKAGE_NAME}_INCLUDE_DIR_FOUND # Output variable.
- )
+
+ # Output variable.
+ ${PACKAGE_NAME}_INCLUDE_DIR_FOUND)
# Error out if the header is not found.
if (NOT ${${PACKAGE_NAME}_INCLUDE_DIR_FOUND})
@@ -74,15 +74,23 @@ function(FIND_PACKAGE_HELPER PACKAGE_NAME HEADER_FILE)
${PACKAGE_NAME}_LIB_PATH
NAMES ${LIBRARY_NAME}
PATHS ${POSSIBLE_${PACKAGE_NAME}_LIB_DIRS}
- )
+ NO_DEFAULT_PATH)
+
+ # NOTE: We call this again to search the default paths,
+ # but it will only do so if it wasn't found above.
+ # This is recommended by the CMake documentation.
+ find_library(
+ ${PACKAGE_NAME}_LIB_PATH
+ NAMES ${LIBRARY_NAME})
# Check if the library was found.
string(
COMPARE NOTEQUAL
"${PACKAGE_NAME}_LIB_PATH-NOTFOUND"
${${PACKAGE_NAME}_LIB_PATH}
- ${PACKAGE_NAME}_LIB_PATH_FOUND # Output variable.
- )
+
+ # Output variable.
+ ${PACKAGE_NAME}_LIB_PATH_FOUND)
# Error out if any of the libraries are not found.
if (NOT ${${PACKAGE_NAME}_LIB_PATH_FOUND})
[18/42] mesos git commit: CMake: Cleaned up 3rdparty/CMakelists.txt.
Posted by jo...@apache.org.
CMake: Cleaned up 3rdparty/CMakelists.txt.
This move some macros away from the global scope, as they are only used
in one file; and cleans up some comments and whitespace.
Review: https://reviews.apache.org/r/61360/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/b44557f1
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/b44557f1
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/b44557f1
Branch: refs/heads/master
Commit: b44557f110f01721cf7ccf0b4af903db70474551
Parents: c23cc03
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Sat Sep 2 17:37:33 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:07 2017 -0700
----------------------------------------------------------------------
3rdparty/CMakeLists.txt | 127 ++++++++++++++++++++-----------------------
CMakeLists.txt | 6 --
cmake/Common.cmake | 25 ---------
3 files changed, 59 insertions(+), 99 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/b44557f1/3rdparty/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
index eb258b3..8655f3d 100755
--- a/3rdparty/CMakeLists.txt
+++ b/3rdparty/CMakeLists.txt
@@ -14,39 +14,27 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-include(ExternalProject)
-
-if (BUILD_SHARED_LIBS)
- set(LIBRARY_LINKAGE SHARED)
- set(LIBRARY_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
-else ()
- set(LIBRARY_LINKAGE STATIC)
- set(LIBRARY_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX})
-endif ()
-
-
-# Define sources of third-party dependencies.
-#############################################
+# URLs for each downloaded or bundled third-party dependency.
+#############################################################
if (REBUNDLED)
set(FETCH_URL ${CMAKE_CURRENT_SOURCE_DIR})
else ()
set(FETCH_URL ${3RDPARTY_DEPENDENCIES})
endif ()
-
-# DEPENDENCIES FOR THE PROCESS LIBRARY AND STOUT.
-#
-# Downloads, configures, and compiles the third-party libraries for the process
-# library (located in `3rdparty/`, i.e. not the `mesos-3rdparty` repository).
-###############################################################################
+# TODO(andschwa): Move each URL to the dependency itself.
set(BOOST_URL ${FETCH_URL}/boost-${BOOST_VERSION}.tar.gz)
set(CONCURRENTQUEUE_URL ${FETCH_URL}/concurrentqueue-${CONCURRENTQUEUE_VERSION}.tar.gz)
set(ELFIO_URL ${FETCH_URL}/elfio-${ELFIO_VERSION}.tar.gz)
set(GLOG_URL ${FETCH_URL}/glog-${GLOG_VERSION}.tar.gz)
+set(GOOGLETEST_URL ${FETCH_URL}/googletest-release-${GOOGLETEST_VERSION}.tar.gz)
set(HTTP_PARSER_URL ${FETCH_URL}/http-parser-${HTTP_PARSER_VERSION}.tar.gz)
set(PICOJSON_URL ${FETCH_URL}/picojson-${PICOJSON_VERSION}.tar.gz)
-set(NVML_URL ${FETCH_URL}/nvml-${NVML_VERSION}.tar.gz)
+set(PROTOBUF_URL ${FETCH_URL}/protobuf-${PROTOBUF_VERSION}.tar.gz)
+set(LEVELDB_URL ${FETCH_URL}/leveldb-${LEVELDB_VERSION}.tar.gz)
set(LIBEV_URL ${FETCH_URL}/libev-${LIBEV_VERSION}.tar.gz)
+set(NVML_URL ${FETCH_URL}/nvml-${NVML_VERSION}.tar.gz)
+set(ZOOKEEPER_URL ${FETCH_URL}/zookeeper-${ZOOKEEPER_VERSION}.tar.gz)
# NOTE: libevent doesn't come rebundled, so this URL is always the same. But,
# it's only downloaded if `ENABLE_LIBEVENT` is set.
@@ -65,6 +53,42 @@ if (WIN32)
set(GLOG_URL ${3RDPARTY_DEPENDENCIES}/glog-${GLOG_VERSION}.tar.gz)
endif ()
+
+# Helper utilities for dealing with third-party dependencies.
+#############################################################
+# ExternalProject: Create custom targets to build projects in external trees.
+# https://cmake.org/cmake/help/latest/module/ExternalProject.html
+include(ExternalProject)
+
+# This adds our FindApr and FindSvn packages.
+list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/stout/cmake)
+
+# This adds our `external()` and `patch_command()` functions.
+list(APPEND CMAKE_MODULE_PATH
+ ${CMAKE_CURRENT_SOURCE_DIR}/libprocess/cmake/macros)
+
+include(External)
+include(PatchCommand)
+
+# Variables for current specified linkage.
+# NOTE: Not all third-party dependencies will respect this.
+if (BUILD_SHARED_LIBS)
+ set(LIBRARY_LINKAGE SHARED)
+ set(LIBRARY_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
+else ()
+ set(LIBRARY_LINKAGE STATIC)
+ set(LIBRARY_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX})
+endif ()
+
+# Sets a variable CMAKE_NOOP as noop operation.
+#
+# NOTE: This is especially important when building third-party libraries on
+# Windows; the default behavior of `ExternalProject` is to try to assume that
+# third-party libraries can be configured/built/installed with CMake, so in
+# cases where this isn't true, we have to "trick" CMake into skipping those
+# steps by giving it a noop command to run instead.
+set(CMAKE_NOOP ${CMAKE_COMMAND} -E echo)
+
# This `CMAKE_FORWARD_ARGS` variable is sent as the `CMAKE_ARGS` argument to
# the `ExternalProject_Add` macro (along with any per-project arguments), and
# is used when the external project is configured as a CMake project.
@@ -78,9 +102,7 @@ list(APPEND CMAKE_FORWARD_ARGS
# TODO(andschwa): Set the CMAKE_GENERATOR explicitly as an argmuent to
# `ExternalProject_Add`.
-G${CMAKE_GENERATOR}
-
- -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
- )
+ -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS})
# This only matters for single-configuration generators.
# E.g. Makefile, but not Visual Studio.
@@ -90,21 +112,14 @@ endif ()
foreach (lang C CXX)
list(APPEND CMAKE_FORWARD_ARGS
- -DCMAKE_${lang}_FLAGS=${CMAKE_${lang}_FLAGS}
- )
+ -DCMAKE_${lang}_FLAGS=${CMAKE_${lang}_FLAGS})
foreach (config DEBUG RELEASE RELWITHDEBINFO MINSIZEREL)
list(APPEND CMAKE_FORWARD_ARGS
- -DCMAKE_${lang}_FLAGS_${config}=${CMAKE_${lang}_FLAGS_${config}}
- )
+ -DCMAKE_${lang}_FLAGS_${config}=${CMAKE_${lang}_FLAGS_${config}})
endforeach ()
endforeach ()
-
-# Third-party libraries. Tell the build system how to pull in and build third-
-# party libraries at compile time, using the ExternalProject_Add macro.
-##############################################################################
-
# This function works around a CMake issue with setting include directories of
# imported libraries built with `ExternalProject_Add`.
# https://gitlab.kitware.com/cmake/cmake/issues/15052
@@ -113,6 +128,12 @@ function(MAKE_INCLUDE_DIR TARGET)
file(MAKE_DIRECTORY ${DIR})
endfunction()
+
+# Third-party libraries. Adds CMake imported or interface targets for each
+# dependency. Bundled dependencies are built with `ExternalProject_Add`,
+# otherwise `find_package()` is used.
+##########################################################################
+
# Boost: C++ Libraries.
# http://www.boost.org
#######################
@@ -537,16 +558,6 @@ set_target_properties(
INTERFACE_COMPILE_DEFINITIONS HAVE_LIBZ)
-# DEPENDENCIES FOR THE PROCESS LIBRARY TESTS AND STOUT TESTS.
-#
-# Downloads, configures, and compiles the third-party libraries for the process
-# library tests (located in `3rdparty/`).
-###############################################################################
-list(
- APPEND CMAKE_MODULE_PATH
- ${CMAKE_SOURCE_DIR}/3rdparty/stout/cmake)
-
-
# Google Test: Google's C++ test framework (GoogleTest and GoogleMock).
# https://github.com/google/googletest
#######################################################################
@@ -589,8 +600,6 @@ endif ()
MAKE_INCLUDE_DIR(gmock)
MAKE_INCLUDE_DIR(gtest)
-set(GOOGLETEST_URL ${FETCH_URL}/googletest-release-${GOOGLETEST_VERSION}.tar.gz)
-
ExternalProject_Add(
${GOOGLETEST_TARGET}
PREFIX ${GOOGLETEST_CMAKE_ROOT}
@@ -645,8 +654,6 @@ endif ()
MAKE_INCLUDE_DIR(protobuf)
-set(PROTOBUF_URL ${FETCH_URL}/protobuf-${PROTOBUF_VERSION}.tar.gz)
-
ExternalProject_Add(
${PROTOBUF_TARGET}
PREFIX ${PROTOBUF_CMAKE_ROOT}
@@ -657,28 +664,6 @@ ExternalProject_Add(
URL_HASH ${PROTOBUF_HASH})
-# BUILDING THE STOUT LIBRARY AND ITS TESTS.
-#
-# Builds, configures, and compiles the stout library and assorted tests.
-########################################################################
-add_subdirectory(stout)
-
-
-# BUILDING THE PROCESS LIBRARY AND ITS TESTS.
-#
-# Builds, configures, and compiles the process library and assorted tests.
-##########################################################################
-add_subdirectory(libprocess)
-
-
-# BUILDING THE MESOS DEPENDENCIES.
-#
-# Downloads, configures, and compiles the third-party libraries for the mesos.
-###################################################
-set(LEVELDB_URL ${FETCH_URL}/leveldb-${LEVELDB_VERSION}.tar.gz)
-set(ZOOKEEPER_URL ${FETCH_URL}/zookeeper-${ZOOKEEPER_VERSION}.tar.gz)
-
-
# Apache ZooKeeper: C Client Library to ZooKeeper.
# https://zookeeper.apache.org/
##################################################
@@ -765,3 +750,9 @@ if (NOT WIN32)
URL ${LEVELDB_URL}
URL_HASH ${LEVELDB_HASH})
endif ()
+
+
+# In-tree dependencies.
+#######################
+add_subdirectory(stout)
+add_subdirectory(libprocess)
http://git-wip-us.apache.org/repos/asf/mesos/blob/b44557f1/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c1126a7..8e18c2c 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -40,9 +40,6 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/3rdparty/cmake)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/3rdparty/libprocess/cmake)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/3rdparty/stout/cmake)
-list(
- APPEND
- CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/3rdparty/libprocess/cmake/macros)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/src/cmake)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/src/examples/cmake)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/src/master/cmake)
@@ -50,9 +47,6 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/src/slave/cmake)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/src/tests/cmake)
# Macros.
-include(Common)
-include(External)
-include(PatchCommand)
include(Versions)
include(cotire)
http://git-wip-us.apache.org/repos/asf/mesos/blob/b44557f1/cmake/Common.cmake
----------------------------------------------------------------------
diff --git a/cmake/Common.cmake b/cmake/Common.cmake
deleted file mode 100644
index 76b2a67..0000000
--- a/cmake/Common.cmake
+++ /dev/null
@@ -1,25 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-###############################################################
-# Exports a variable CMAKE_NOOP as noop operation.
-#
-# NOTE: This is especially important when building third-party libraries on
-# Windows; the default behavior of `ExternalProject` is to try to assume that
-# third-party libraries can be configured/built/installed with CMake, so in
-# cases where this isn't true, we have to "trick" CMake into skipping those
-# steps by giving it a noop command to run instead.
-set(CMAKE_NOOP ${CMAKE_COMMAND} -E echo)
[23/42] mesos git commit: CMake: Refactored `MesosProtobuf` helper.
Posted by jo...@apache.org.
CMake: Refactored `MesosProtobuf` helper.
This adds some CMake-style option parsing to eliminate some duplicate
code in the MesosProtobuf helper (and associated usage).
And adds Java protobuf generation.
Review: https://reviews.apache.org/r/61301/
Review: https://reviews.apache.org/r/61307/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/44b64487
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/44b64487
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/44b64487
Branch: refs/heads/master
Commit: 44b64487cdf0ccae2e5eaa28bf12320788e64431
Parents: 7c6837c
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Sat Sep 2 15:59:21 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:07 2017 -0700
----------------------------------------------------------------------
src/CMakeLists.txt | 140 +++++++++++++-----------------------
src/cmake/MesosProtobuf.cmake | 143 ++++++++++++++++++++-----------------
2 files changed, 128 insertions(+), 155 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/44b64487/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 58b24a7..10acb12 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -19,95 +19,57 @@
include(MesosProtobuf)
# Build the protobuf structs.
-PROTOC_TO_INCLUDE_DIR(ACLS mesos/authorizer/acls)
-PROTOC_TO_INCLUDE_DIR(AGENT mesos/agent/agent)
-PROTOC_TO_INCLUDE_DIR(ALLOCATOR mesos/allocator/allocator)
-PROTOC_TO_INCLUDE_DIR(APPC_SPEC mesos/appc/spec)
-PROTOC_TO_INCLUDE_DIR(AUTHENTICATION mesos/authentication/authentication)
-PROTOC_TO_INCLUDE_DIR(AUTHORIZATION mesos/authorizer/authorizer)
-PROTOC_TO_INCLUDE_DIR(CONTAINERIZER mesos/slave/containerizer)
-PROTOC_TO_INCLUDE_DIR(DOCKER_SPEC mesos/docker/spec)
-PROTOC_TO_INCLUDE_DIR(DOCKER_V1 mesos/docker/v1)
-PROTOC_TO_INCLUDE_DIR(DOCKER_V2 mesos/docker/v2)
-PROTOC_TO_INCLUDE_DIR(EXECUTOR mesos/executor/executor)
-PROTOC_TO_INCLUDE_DIR(FETCHER mesos/fetcher/fetcher)
-PROTOC_TO_INCLUDE_DIR(HOOK mesos/module/hook)
-PROTOC_TO_INCLUDE_DIR(MAINTENANCE mesos/maintenance/maintenance)
-PROTOC_TO_INCLUDE_DIR(MASTER mesos/master/master)
-PROTOC_TO_INCLUDE_DIR(MESOS mesos/mesos)
-PROTOC_TO_INCLUDE_DIR(MODULE mesos/module/module)
-PROTOC_TO_INCLUDE_DIR(OVERSUBSCRIPTION mesos/slave/oversubscription)
-PROTOC_TO_INCLUDE_DIR(OCI_SPEC mesos/oci/spec)
-PROTOC_TO_INCLUDE_DIR(QUOTA mesos/quota/quota)
-PROTOC_TO_INCLUDE_DIR(RESOURCE_PROVIDER mesos/resource_provider/resource_provider)
-PROTOC_TO_INCLUDE_DIR(SCHEDULER mesos/scheduler/scheduler)
-PROTOC_TO_INCLUDE_DIR(STATE mesos/state/state)
-PROTOC_TO_INCLUDE_DIR(URI mesos/uri/uri)
-PROTOC_TO_INCLUDE_DIR(V1_AGENT mesos/v1/agent/agent)
-PROTOC_TO_INCLUDE_DIR(V1_ALLOCATOR mesos/v1/allocator/allocator)
-PROTOC_TO_INCLUDE_DIR(V1_EXECUTOR mesos/v1/executor/executor)
-PROTOC_TO_INCLUDE_DIR(V1_MAINTENANCE mesos/v1/maintenance/maintenance)
-PROTOC_TO_INCLUDE_DIR(V1_MASTER mesos/v1/master/master)
-PROTOC_TO_INCLUDE_DIR(V1_MESOS mesos/v1/mesos)
-PROTOC_TO_INCLUDE_DIR(V1_QUOTA mesos/v1/quota/quota)
-PROTOC_TO_INCLUDE_DIR(V1_RESOURCE_PROVIDER mesos/v1/resource_provider/resource_provider)
-PROTOC_TO_INCLUDE_DIR(V1_SCHEDULER mesos/v1/scheduler/scheduler)
-
-PROTOC_TO_SRC_DIR(INTERNAL_FLAGS messages/flags)
-PROTOC_TO_SRC_DIR(INTERNAL_LOG messages/log)
-PROTOC_TO_SRC_DIR(INTERNAL_MESSAGES messages/messages)
-PROTOC_TO_SRC_DIR(INTERNAL_STATE messages/state)
-PROTOC_TO_SRC_DIR(ISOLATOR_CNI_SPEC slave/containerizer/mesos/isolators/network/cni/spec)
-PROTOC_TO_SRC_DIR(ISOLATOR_DOCKER_VOLUME_STATE slave/containerizer/mesos/isolators/docker/volume/state)
-PROTOC_TO_SRC_DIR(PROVISIONER_DOCKER slave/containerizer/mesos/provisioner/docker/message)
-PROTOC_TO_SRC_DIR(REGISTRY master/registry)
-
-set(PUBLIC_PROTOBUF_SRC
- ${ACLS_PROTO_CC}
- ${AGENT_PROTO_CC}
- ${ALLOCATOR_PROTO_CC}
- ${APPC_SPEC_PROTO_CC}
- ${AUTHENTICATION_PROTO_CC}
- ${AUTHORIZATION_PROTO_CC}
- ${CONTAINERIZER_PROTO_CC}
- ${DOCKER_SPEC_PROTO_CC}
- ${DOCKER_V1_PROTO_CC}
- ${DOCKER_V2_PROTO_CC}
- ${EXECUTOR_PROTO_CC}
- ${FETCHER_PROTO_CC}
- ${HOOK_PROTO_CC}
- ${MAINTENANCE_PROTO_CC}
- ${MASTER_PROTO_CC}
- ${MESOS_PROTO_CC}
- ${MODULE_PROTO_CC}
- ${OCI_SPEC_PROTO_CC}
- ${OVERSUBSCRIPTION_PROTO_CC}
- ${QUOTA_PROTO_CC}
- ${RESOURCE_PROVIDER_PROTO_CC}
- ${SCHEDULER_PROTO_CC}
- ${STATE_PROTO_CC}
- ${URI_PROTO_CC}
- ${V1_AGENT_PROTO_CC}
- ${V1_ALLOCATOR_PROTO_CC}
- ${V1_EXECUTOR_PROTO_CC}
- ${V1_MAINTENANCE_PROTO_CC}
- ${V1_MASTER_PROTO_CC}
- ${V1_MESOS_PROTO_CC}
- ${V1_QUOTA_PROTO_CC}
- ${V1_RESOURCE_PROVIDER_PROTO_CC}
- ${V1_SCHEDULER_PROTO_CC}
- )
-
-set(INTERNAL_PROTOBUF_SRC
- ${INTERNAL_FLAGS_PROTO_CC}
- ${INTERNAL_LOG_PROTO_CC}
- ${INTERNAL_MESSAGES_PROTO_CC}
- ${INTERNAL_STATE_PROTO_CC}
- ${ISOLATOR_CNI_SPEC_PROTO_CC}
- ${ISOLATOR_DOCKER_VOLUME_STATE_PROTO_CC}
- ${PROVISIONER_DOCKER_PROTO_CC}
- ${REGISTRY_PROTO_CC}
- )
+#
+# NOTE: `PROTOC_GENERATE` will list append to `PUBLIC_PROTOBUF_SRC`,
+# `INTERNAL_PROTOBUF_SRC`, and/or `JAVA_PROTOBUF_SRC` depending on the
+# `INTERNAL` and `JAVA` options.
+set(PUBLIC_PROTOBUF_SRC "")
+PROTOC_GENERATE(TARGET mesos/agent/agent)
+PROTOC_GENERATE(TARGET mesos/allocator/allocator)
+PROTOC_GENERATE(TARGET mesos/appc/spec)
+PROTOC_GENERATE(TARGET mesos/authentication/authentication)
+PROTOC_GENERATE(TARGET mesos/authorizer/acls)
+PROTOC_GENERATE(TARGET mesos/authorizer/authorizer)
+PROTOC_GENERATE(TARGET mesos/docker/spec)
+PROTOC_GENERATE(TARGET mesos/docker/v1)
+PROTOC_GENERATE(TARGET mesos/docker/v2)
+PROTOC_GENERATE(TARGET mesos/maintenance/maintenance)
+PROTOC_GENERATE(TARGET mesos/master/master)
+PROTOC_GENERATE(TARGET mesos/module/hook)
+PROTOC_GENERATE(TARGET mesos/module/module)
+PROTOC_GENERATE(TARGET mesos/oci/spec)
+PROTOC_GENERATE(TARGET mesos/quota/quota)
+PROTOC_GENERATE(TARGET mesos/resource_provider/resource_provider)
+PROTOC_GENERATE(TARGET mesos/slave/containerizer)
+PROTOC_GENERATE(TARGET mesos/slave/oversubscription)
+PROTOC_GENERATE(TARGET mesos/state/state)
+PROTOC_GENERATE(TARGET mesos/uri/uri)
+
+# NOTE: The JAVA option is a noop if Java is disabled.
+set(JAVA_PROTOBUF_SRC "")
+PROTOC_GENERATE(JAVA TARGET mesos/executor/executor)
+PROTOC_GENERATE(JAVA TARGET mesos/fetcher/fetcher)
+PROTOC_GENERATE(JAVA TARGET mesos/mesos)
+PROTOC_GENERATE(JAVA TARGET mesos/scheduler/scheduler)
+PROTOC_GENERATE(JAVA TARGET mesos/v1/agent/agent)
+PROTOC_GENERATE(JAVA TARGET mesos/v1/allocator/allocator)
+PROTOC_GENERATE(JAVA TARGET mesos/v1/executor/executor)
+PROTOC_GENERATE(JAVA TARGET mesos/v1/maintenance/maintenance)
+PROTOC_GENERATE(JAVA TARGET mesos/v1/master/master)
+PROTOC_GENERATE(JAVA TARGET mesos/v1/mesos)
+PROTOC_GENERATE(JAVA TARGET mesos/v1/quota/quota)
+PROTOC_GENERATE(JAVA TARGET mesos/v1/resource_provider/resource_provider)
+PROTOC_GENERATE(JAVA TARGET mesos/v1/scheduler/scheduler)
+
+set(INTERNAL_PROTOBUF_SRC "")
+PROTOC_GENERATE(INTERNAL TARGET messages/flags)
+PROTOC_GENERATE(INTERNAL TARGET messages/log)
+PROTOC_GENERATE(INTERNAL TARGET messages/messages)
+PROTOC_GENERATE(INTERNAL TARGET messages/state)
+PROTOC_GENERATE(INTERNAL TARGET slave/containerizer/mesos/isolators/network/cni/spec)
+PROTOC_GENERATE(INTERNAL TARGET slave/containerizer/mesos/isolators/docker/volume/state)
+PROTOC_GENERATE(INTERNAL TARGET slave/containerizer/mesos/provisioner/docker/message)
+PROTOC_GENERATE(INTERNAL TARGET master/registry)
# BUILD PROTOBUFS.
http://git-wip-us.apache.org/repos/asf/mesos/blob/44b64487/src/cmake/MesosProtobuf.cmake
----------------------------------------------------------------------
diff --git a/src/cmake/MesosProtobuf.cmake b/src/cmake/MesosProtobuf.cmake
index e30ad84..533455e 100644
--- a/src/cmake/MesosProtobuf.cmake
+++ b/src/cmake/MesosProtobuf.cmake
@@ -14,89 +14,100 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# PROTO_TO_INCLUDE_DIR is a convenience function that will: (1) compile .proto
-# files found in the Mesos public-facing `include/` directory, (2) place the
-# generated files in the build folder, but with an identical directory
-# structure, and (3) export variables holding the fully qualified path to the
-# generated files, based on a name structure the user specifies with the
-# `BASE_NAME` and `BASE_DIR_STRUCTURE` parameters.
+# PROTOC_GENERATE is a convenience function that will:
+# (1) Compile .proto files found in the Mesos public-facing `include/`
+# directory, or with the option `INTERNAL` the Mesos `src/` directory.
+# The `JAVA` option flag will generate the Java Protobuf files to
+# `src/java/generated`.
+# (2) Place the generated files in the build folder, but with an identical
+# directory structure.
+# (3) Append to list variables `PUBLIC_PROTOBUF_SRC`, `INTERNAL_PROTOBUF_SRC`,
+# and `JAVA_PROTOBUF_SRC` (depending on options passed in) the fully
+# qualified path to the generated files. This export is a *side effect*
+# and modifies the variables in the parent scope.
#
-# For example, if suppose wish to compile `include/mesos/mesos.proto`. We might
-# pass in the following values for the parameters:
+# For example, if suppose wish to compile `include/mesos/mesos.proto`,
+# we might pass in the following values for the parameters:
#
-# BASE_NAME: MESOS (i.e., basis for the exported var names)
-# BASE_DIR_STRUCTURE: mesos/mesos (i.e., where `mesos/mesos.proto` would be
-# the relative path to the .proto file, we'd
-# use this "root name" to generate files
-# like `mesos/mesos.pb.cc`
+# PROTOC_GENERATE(TARGET mesos/mesos)
+#
+# Where `mesos/mesos.proto` would be the relative path to the .proto file,
+# we'd use this "root name" to generate files like `mesos/mesos.pb.cc`
#
# In this case, this function would:
#
-# (1) compile the `include/mesos/mesos.proto`, which would generate the files
-# `build/include/mesos/mesos.pb.h` and `build/include/mesos/mesos.pb.cc`
-# (2) export the following variables, based on the `BASE_NAME` parameter
-# (a) MESOS_PROTO: ${MESOS_ROOT}/include/mesos/mesos.proto
-# (b) MESOS_PROTO_CC: ${MESOS_ROOT}/build/include/mesos/mesos.pb.cc
-# (a) MESOS_PROTO_H: ${MESOS_ROOT}/build/include/mesos/mesos.pb.h
-function(PROTOC_TO_INCLUDE_DIR BASE_NAME BASE_DIR_STRUCTURE)
+# (1) Compile the `include/mesos/mesos.proto`, which would generate the files
+# `build/include/mesos/mesos.pb.h` and `build/include/mesos/mesos.pb.cc`.
+# (2) Append the path `${MESOS_ROOT}/build/include/mesos/mesos.pb.cc` to
+# the parent scope variable `PUBLIC_PROTOBUF_SRC`.
+#
+# NOTE: The `protoc` binary used here is an imported executable target from
+# `3rdparty/CMakeLists.txt`. However, this is not strictly necessary, and
+# `protoc` could be supplied in `PATH`.
+function(PROTOC_GENERATE)
+ set(options OPTIONAL INTERNAL JAVA)
+ set(oneValueArgs TARGET)
+ cmake_parse_arguments(PROTOC "${options}" "${oneValueArgs}" "" ${ARGN})
+
+ if (PROTOC_INTERNAL)
+ set(CPP_OUT ${MESOS_BIN_SRC_DIR})
+ else ()
+ set(CPP_OUT ${MESOS_BIN_INCLUDE_DIR})
+ endif ()
- set(TO_INCLUDE_DIR
+ set(PROTOC_OPTIONS
-I${MESOS_PUBLIC_INCLUDE_DIR}
-I${MESOS_SRC_DIR}
- --cpp_out=${MESOS_BIN_INCLUDE_DIR})
+ --cpp_out=${CPP_OUT})
- # Names of variables we will be publicly exporting.
- set(PROTO_VAR ${BASE_NAME}_PROTO) # e.g., MESOS_PROTO
- set(CC_VAR ${BASE_NAME}_PROTO_CC) # e.g., MESOS_PROTO_CC
- set(H_VAR ${BASE_NAME}_PROTO_H) # e.g., MESOS_PROTO_H
+ if (PROTOC_JAVA AND HAS_JAVA)
+ list(APPEND PROTOC_OPTIONS
+ --java_out=${MESOS_BIN_SRC_DIR}/java/generated)
+ endif ()
- # Fully qualified paths for the input .proto files and the output C files.
- set(PROTO ${MESOS_PUBLIC_INCLUDE_DIR}/${BASE_DIR_STRUCTURE}.proto)
- set(CC ${MESOS_BIN_INCLUDE_DIR}/${BASE_DIR_STRUCTURE}.pb.cc)
- set(H ${MESOS_BIN_INCLUDE_DIR}/${BASE_DIR_STRUCTURE}.pb.h)
+ # Fully qualified paths for the input .proto files and the output C file.
+ if (PROTOC_INTERNAL) # to src dir
+ set(PROTO ${MESOS_SRC_DIR}/${PROTOC_TARGET}.proto)
+ else () # to public include dir
+ set(PROTO ${MESOS_PUBLIC_INCLUDE_DIR}/${PROTOC_TARGET}.proto)
+ endif ()
- # Export variables holding the target filenames.
- set(${PROTO_VAR} ${PROTO} PARENT_SCOPE) # e.g., mesos/mesos.proto
- set(${CC_VAR} ${CC} PARENT_SCOPE) # e.g., mesos/mesos.pb.cc
- set(${H_VAR} ${H} PARENT_SCOPE) # e.g., mesos/mesos.pb.h
-
- # Compile the .proto file.
- ADD_CUSTOM_COMMAND(
- OUTPUT ${CC} ${H}
- COMMAND ${PROTOC} ${TO_INCLUDE_DIR} ${PROTO}
- DEPENDS make_bin_include_dir ${PROTO}
- WORKING_DIRECTORY ${MESOS_BIN})
-endfunction()
+ set(CC ${CPP_OUT}/${PROTOC_TARGET}.pb.cc)
-# PROTO_TO_SRC_DIR is similar to `PROTO_TO_INCLUDE_DIR`, except it acts on the
-# Mesos `src/` directory instead of the public-facing `include/` directory (see
-# documentation for `PROTO_TO_INCLUDE_DIR` for details).
-function(PROTOC_TO_SRC_DIR BASE_NAME BASE_DIR_STRUCTURE)
+ # Fully qualified path for the Java file.
+ if (PROTOC_JAVA AND HAS_JAVA)
+ get_filename_component(PROTOC_JAVA_DIR ${PROTOC_TARGET} DIRECTORY)
+ set(JAVA ${MESOS_BIN_SRC_DIR}/java/generated/org/apache/${PROTOC_JAVA_DIR}/Protos.java)
+ endif ()
- set(TO_SRC_DIR
- -I${MESOS_PUBLIC_INCLUDE_DIR}
- -I${MESOS_SRC_DIR}
- --cpp_out=${MESOS_BIN_SRC_DIR})
+ # Export variables holding the target filenames.
+ if (PROTOC_INTERNAL)
+ list(APPEND INTERNAL_PROTOBUF_SRC ${CC})
+ set(INTERNAL_PROTOBUF_SRC ${INTERNAL_PROTOBUF_SRC} PARENT_SCOPE)
+ else ()
+ list(APPEND PUBLIC_PROTOBUF_SRC ${CC})
+ set(PUBLIC_PROTOBUF_SRC ${PUBLIC_PROTOBUF_SRC} PARENT_SCOPE)
+ endif ()
- # Names of variables we will be publicly exporting.
- set(PROTO_VAR ${BASE_NAME}_PROTO) # e.g., MESOS_PROTO
- set(CC_VAR ${BASE_NAME}_PROTO_CC) # e.g., MESOS_PROTO_CC
- set(H_VAR ${BASE_NAME}_PROTO_H) # e.g., MESOS_PROTO_H
+ if (PROTOC_JAVA AND HAS_JAVA)
+ list(APPEND JAVA_PROTOBUF_SRC ${JAVA})
+ set(JAVA_PROTOBUF_SRC ${JAVA_PROTOBUF_SRC} PARENT_SCOPE)
+ endif ()
- # Fully qualified paths for the input .proto files and the output C files.
- set(PROTO ${MESOS_SRC_DIR}/${BASE_DIR_STRUCTURE}.proto)
- set(CC ${MESOS_BIN_SRC_DIR}/${BASE_DIR_STRUCTURE}.pb.cc)
- set(H ${MESOS_BIN_SRC_DIR}/${BASE_DIR_STRUCTURE}.pb.h)
+ if (PROTOC_INTERNAL)
+ set(PROTOC_DEPENDS make_bin_src_dir)
+ else ()
+ set(PROTOC_DEPENDS make_bin_include_dir)
+ endif ()
- # Export variables holding the target filenames.
- set(${PROTO_VAR} ${PROTO} PARENT_SCOPE) # e.g., mesos/mesos.proto
- set(${CC_VAR} ${CC} PARENT_SCOPE) # e.g., mesos/mesos.pb.cc
- set(${H_VAR} ${H} PARENT_SCOPE) # e.g., mesos/mesos.pb.h
+ if (PROTOC_JAVA AND HAS_JAVA)
+ list(APPEND PROTOC_DEPENDS make_bin_java_dir)
+ endif ()
# Compile the .proto file.
- ADD_CUSTOM_COMMAND(
- OUTPUT ${CC} ${H}
- COMMAND ${PROTOC} ${TO_SRC_DIR} ${PROTO}
- DEPENDS make_bin_src_dir ${PROTO}
+ add_custom_command(
+ OUTPUT ${CC} ${H} ${JAVA}
+ COMMAND protoc ${PROTOC_OPTIONS} ${PROTO}
+ DEPENDS ${PROTOC_DEPENDS} ${PROTO}
WORKING_DIRECTORY ${MESOS_BIN})
endfunction()
[11/42] mesos git commit: CMake: Changed zookeeper into an imported
library.
Posted by jo...@apache.org.
CMake: Changed zookeeper into an imported library.
This commit imports the ZooKeeper C Client as a library, and removes the
discrepancy between Linux and Windows. Both configurations now use
ZooKeeper 3.4.8, with an updated patch to both build with CMake.
Review: https://reviews.apache.org/r/61309/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/26b2c281
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/26b2c281
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/26b2c281
Branch: refs/heads/master
Commit: 26b2c2816e02cd172634a3e6ad01c805369dedc8
Parents: c16e4fb
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Thu Aug 17 13:03:11 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:06 2017 -0700
----------------------------------------------------------------------
3rdparty/CMakeLists.txt | 104 ++++++++++++-----------
3rdparty/cmake/Mesos3rdpartyConfigure.cmake | 23 -----
3rdparty/cmake/Versions.cmake | 18 ++--
3 files changed, 59 insertions(+), 86 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/26b2c281/3rdparty/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
index 26ccb70..551cdd3 100755
--- a/3rdparty/CMakeLists.txt
+++ b/3rdparty/CMakeLists.txt
@@ -413,64 +413,66 @@ add_subdirectory(libprocess)
# Downloads, configures, and compiles the third-party libraries for the mesos.
###################################################
set(LEVELDB_URL ${FETCH_URL}/leveldb-${LEVELDB_VERSION}.tar.gz)
-# NOTE: The Windows version of ZooKeeper is patched and only available in the
-# 3rdparty repo, not the local repo.
-if (NOT WIN32)
- set(ZOOKEEPER_URL ${FETCH_URL}/zookeeper-${ZOOKEEPER_VERSION}.tar.gz)
-else ()
- set(ZOOKEEPER_URL ${3RDPARTY_DEPENDENCIES}/zookeeper-${ZOOKEEPER_VERSION}.tar.gz)
-endif ()
+set(ZOOKEEPER_URL ${FETCH_URL}/zookeeper-${ZOOKEEPER_VERSION}.tar.gz)
-# Third-party libraries. Tell the build system how to pull in and build third-
-# party libraries at compile time, using the ExternalProject_Add macro.
-##############################################################################
-if (NOT WIN32)
- # NOTE: `ExternalProject_Add` is used separately because older versions
- # of CMake used on Linux do not understand the `SOURCE_SUBDIR` command.
- PATCH_CMD(
- ${MESOS_3RDPARTY_SRC}/zookeeper-${ZOOKEEPER_VERSION}.patch
- ZOOKEEPER_PATCH_CMD)
-
- # NOTE: ZooKeeper's `configure` script must be run with within the
- # correct directory or it will fail to find necessary files, hence the `cd`.
- set(ZOOKEEPER_CONFIG_CMD cd ${ZOOKEEPER_C_ROOT} && ./configure)
- if (BUILD_SHARED_LIBS)
- set(ZOOKEEPER_CONFIG_CMD ${ZOOKEEPER_CONFIG_CMD} --enable-shared=yes --enable-static=no)
- else ()
- set(ZOOKEEPER_CONFIG_CMD ${ZOOKEEPER_CONFIG_CMD} --enable-shared=no --enable-static=yes)
- endif ()
+# Apache ZooKeeper: C Client Library to ZooKeeper.
+# https://zookeeper.apache.org/
+##################################################
+# TODO(andschwa): Move zookeeper so these don't have to be GLOBAL.
+EXTERNAL(zookeeper ${ZOOKEEPER_VERSION} "${MESOS_3RDPARTY_BIN}")
+add_library(zookeeper STATIC IMPORTED GLOBAL)
+add_library(zk-hashtable STATIC IMPORTED GLOBAL)
+add_dependencies(zookeeper ${ZOOKEEPER_TARGET})
- # NOTE: The `--with-pic` does not mean compile with `-fPIC`.
- set(ZOOKEEPER_CONFIG_CMD ${ZOOKEEPER_CONFIG_CMD} --with-pic --srcdir=${ZOOKEEPER_C_ROOT} --prefix=${ZOOKEEPER_LIB})
+set(ZOOKEEPER_COMPILE_DEFINITIONS ZOOKEEPER_VERSION="${ZOOKEEPER_VERSION}" USE_STATIC_LIB)
+set_target_properties(
+ zookeeper PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${ZOOKEEPER_ROOT}/src/c/include;${ZOOKEEPER_ROOT}/src/c/generated"
+ INTERFACE_LINK_LIBRARIES zk-hashtable
+ INTERFACE_COMPILE_DEFINITIONS "${ZOOKEEPER_COMPILE_DEFINITIONS}")
- ExternalProject_Add(
- ${ZOOKEEPER_TARGET}
- PREFIX ${ZOOKEEPER_CMAKE_ROOT}
- PATCH_COMMAND ${ZOOKEEPER_PATCH_CMD}
- CONFIGURE_COMMAND ${ZOOKEEPER_CONFIG_CMD}
- BUILD_COMMAND cd ${ZOOKEEPER_C_ROOT} && make
- INSTALL_COMMAND cd ${ZOOKEEPER_C_ROOT} && make install
- URL ${ZOOKEEPER_URL}
- URL_HASH ${ZOOKEEPER_HASH}
- )
+if (WIN32)
+ set_target_properties(
+ zookeeper PROPERTIES
+ IMPORTED_LOCATION_DEBUG ${ZOOKEEPER_ROOT}-build/Debug/zookeeper${CMAKE_STATIC_LIBRARY_SUFFIX}
+ IMPORTED_LOCATION_RELEASE ${ZOOKEEPER_ROOT}-build/Release/zookeeper${CMAKE_STATIC_LIBRARY_SUFFIX})
+
+ set_target_properties(
+ zk-hashtable PROPERTIES
+ IMPORTED_LOCATION_DEBUG ${ZOOKEEPER_ROOT}-build/Debug/hashtable${CMAKE_STATIC_LIBRARY_SUFFIX}
+ IMPORTED_LOCATION_RELEASE ${ZOOKEEPER_ROOT}-build/Release/hashtable${CMAKE_STATIC_LIBRARY_SUFFIX})
+
+ # Set the patch command which will utilize patch.exe in temp location for no elevation prompt
+ # NOTE: We do not specify the `--binary` patch option here because the
+ # files being modified are extracted with CRLF (Windows) line endings
+ # already. The `--binary` option will instead fail to apply the patch.
+ set(ZOOKEEPER_PATCH_CMD ${PATCHEXE_LOCATION} -p1 < ${MESOS_3RDPARTY_SRC}/zookeeper-${ZOOKEEPER_VERSION}.patch)
else ()
- ExternalProject_Add(
- ${ZOOKEEPER_TARGET}
- PREFIX ${ZOOKEEPER_CMAKE_ROOT}
- # Set the patch command which will utilize patch.exe in temp location for no elevation prompt
- # NOTE: We do not specify the `--binary` patch option here because the
- # files being modified are extracted with CRLF (Windows) line endings
- # already. The `--binary` option will instead fail to apply the patch.
- PATCH_COMMAND ${PATCHEXE_LOCATION} -p1 < ${MESOS_3RDPARTY_SRC}/zookeeper-${ZOOKEEPER_VERSION}.patch
- SOURCE_SUBDIR src/c
- CMAKE_ARGS ${CMAKE_FORWARD_ARGS};-DWANT_CPPUNIT=OFF
- INSTALL_COMMAND ${CMAKE_NOOP}
- URL ${ZOOKEEPER_URL}
- URL_HASH ${ZOOKEEPER_HASH}
- )
+ set_target_properties(
+ zookeeper PROPERTIES
+ IMPORTED_LOCATION ${ZOOKEEPER_ROOT}-build/libzookeeper${CMAKE_STATIC_LIBRARY_SUFFIX})
+
+ set_target_properties(
+ zk-hashtable PROPERTIES
+ IMPORTED_LOCATION ${ZOOKEEPER_ROOT}-build/libhashtable${CMAKE_STATIC_LIBRARY_SUFFIX})
+
+ patch_cmd(${MESOS_3RDPARTY_SRC}/zookeeper-${ZOOKEEPER_VERSION}.patch ZOOKEEPER_PATCH_CMD)
endif ()
+MAKE_INCLUDE_DIR(zookeeper)
+
+ExternalProject_Add(
+ ${ZOOKEEPER_TARGET}
+ PREFIX ${ZOOKEEPER_CMAKE_ROOT}
+ PATCH_COMMAND ${ZOOKEEPER_PATCH_CMD}
+ SOURCE_SUBDIR src/c
+ CMAKE_ARGS ${CMAKE_FORWARD_ARGS};-DWANT_CPPUNIT=OFF
+ INSTALL_COMMAND ${CMAKE_NOOP}
+ URL ${ZOOKEEPER_URL}
+ URL_HASH ${ZOOKEEPER_HASH})
+
+
if (NOT WIN32)
PATCH_CMD(
${MESOS_3RDPARTY_SRC}/leveldb-${LEVELDB_VERSION}.patch
http://git-wip-us.apache.org/repos/asf/mesos/blob/26b2c281/3rdparty/cmake/Mesos3rdpartyConfigure.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/cmake/Mesos3rdpartyConfigure.cmake b/3rdparty/cmake/Mesos3rdpartyConfigure.cmake
index fa1202a..9a3a477 100755
--- a/3rdparty/cmake/Mesos3rdpartyConfigure.cmake
+++ b/3rdparty/cmake/Mesos3rdpartyConfigure.cmake
@@ -24,36 +24,13 @@ if (NOT WIN32)
EXTERNAL("leveldb" ${LEVELDB_VERSION} "${MESOS_3RDPARTY_BIN}")
endif ()
-EXTERNAL("zookeeper" ${ZOOKEEPER_VERSION} "${MESOS_3RDPARTY_BIN}")
-
-# Intermediate convenience variables for oddly-structured directories.
-set(ZOOKEEPER_C_ROOT ${ZOOKEEPER_ROOT}/src/c)
-set(ZOOKEEPER_LIB ${ZOOKEEPER_ROOT}/src/c)
-
# Convenience variables for include directories of third-party dependencies.
set(LEVELDB_INCLUDE_DIR ${LEVELDB_ROOT}/include)
-set(ZOOKEEPER_INCLUDE_GENDIR ${ZOOKEEPER_C_ROOT}/generated)
-set(ZOOKEEPER_INCLUDE_DIR ${ZOOKEEPER_C_ROOT}/include)
-
-# Convenience variables for `lib` directories of built third-party dependencies.
-if (NOT WIN32)
- set(ZOOKEEPER_LIB_DIR ${ZOOKEEPER_LIB})
-else ()
- set(ZOOKEEPER_LIB_DIR ${ZOOKEEPER_ROOT}-build)
-endif ()
# Convenience variables for "lflags", the symbols we pass to CMake to generate
# things like `-L/path/to/glog` or `-lglog`.
if (NOT WIN32)
set(LEVELDB_LFLAG ${LEVELDB_ROOT}/out-static/libleveldb.a)
-
- if (BUILD_SHARED_LIBS)
- set(ZOOKEEPER_LFLAG ${ZOOKEEPER_LIB}/lib/libzookeeper_mt${CMAKE_SHARED_LIBRARY_SUFFIX})
- else ()
- set(ZOOKEEPER_LFLAG ${ZOOKEEPER_LIB}/lib/libzookeeper_mt.a)
- endif ()
-else ()
- set(ZOOKEEPER_LFLAG zookeeper hashtable)
endif ()
# Configure Windows use of the GNU patch utility;
http://git-wip-us.apache.org/repos/asf/mesos/blob/26b2c281/3rdparty/cmake/Versions.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/cmake/Versions.cmake b/3rdparty/cmake/Versions.cmake
index 9586296..0b62ae9 100644
--- a/3rdparty/cmake/Versions.cmake
+++ b/3rdparty/cmake/Versions.cmake
@@ -27,24 +27,18 @@ set(PROTOBUF_VERSION "3.3.0")
set(PROTOBUF_HASH "SHA256=E43F47C51C4A838F737EE2DA2F183F129EE388272622C403179D5AD28C555F39")
set(ZLIB_VERSION "1.2.8")
set(ZLIB_HASH "SHA256=36658CB768A54C1D4DEC43C3116C27ED893E88B02ECFCB44F2166F9C0B7F2A0D")
+set(ZOOKEEPER_VERSION "3.4.8")
+set(ZOOKEEPER_HASH "SHA256=F10A0B51F45C4F64C1FE69EF713ABF9EB9571BC7385A82DA892E83BB6C965E90")
# Platform-dependent versions.
if (NOT WIN32)
set(GLOG_VERSION "0.3.3")
set(GLOG_HASH "SHA256=FBF90C2285BA0561DB7A40F8A4EEFB9AA963E7D399BD450363E959929FE849D0")
- set(ZOOKEEPER_VERSION "3.4.8")
- set(ZOOKEEPER_HASH "SHA256=F10A0B51F45C4F64C1FE69EF713ABF9EB9571BC7385A82DA892E83BB6C965E90")
else ()
- # TODO(hausdorff): (MESOS-3394) Upgrade Windows to use glog v0.3.5 when they
- # release it, as that will contain fixes that will allow us to build glog on
- # Windows, as well as build using CMake directly. For now, we simply point
- # Windows builds at a commit hash in the glog history that has all the
- # functionality we want.
+ # TODO(andschwa): (MESOS-3394) Update Windows to use glog v0.3.6 when it is
+ # released, as it contains our patches. For now, we simply point Windows
+ # builds at a commit hash in the glog history that has all the functionality
+ # we want.
set(GLOG_VERSION "da816ea70")
set(GLOG_HASH "SHA256=15338EDBE643F3F9A769FBCA34C3AFDF48D8779D800E7F0878A9649A53339F96")
-
- # The latest release of ZK, 3.4.7, does not compile on Windows. Therefore, we
- # pick a recent commit that does until the next release stabilizes.
- set(ZOOKEEPER_VERSION "3.5.2-alpha")
- set(ZOOKEEPER_HASH "SHA256=E4997EE78AAB27628876BCB7BA7FCE8369BA162B1F50D9270A0ED865D11B8310")
endif ()
[08/42] mesos git commit: CMake: Updated 3rdparty's usage of stout.
Posted by jo...@apache.org.
CMake: Updated 3rdparty's usage of stout.
Because stout now has a proper CMakeLists file (which defines the
stout target), 3rdparty should include the stout subdirectory
instead of stout's tests.
Review: https://reviews.apache.org/r/61290/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/da357f4f
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/da357f4f
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/da357f4f
Branch: refs/heads/master
Commit: da357f4f618b1e551f5a7c3eae93f68aa2ede38d
Parents: ca24018
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Mon Aug 7 18:33:06 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:05 2017 -0700
----------------------------------------------------------------------
3rdparty/CMakeLists.txt | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/da357f4f/3rdparty/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
index a36bc24..a503194 100755
--- a/3rdparty/CMakeLists.txt
+++ b/3rdparty/CMakeLists.txt
@@ -376,12 +376,11 @@ else ()
)
endif ()
-
-# BUILDING THE STOUT TESTS.
+# BUILDING THE STOUT LIBRARY AND ITS TESTS.
#
-# Builds, configures, and compiles the Stout tests.
-###################################################
-add_subdirectory(stout/tests)
+# Builds, configures, and compiles the stout library and assorted tests.
+########################################################################
+add_subdirectory(stout)
# BUILDING THE PROCESS LIBRARY AND ITS TESTS.
[07/42] mesos git commit: CMake: Removed `GroupSource` from `stout`.
Posted by jo...@apache.org.
CMake: Removed `GroupSource` from `stout`.
Source grouping is a cosmetic change that only has an effect if
you load this project into an IDE (such as XCode or Visual Studio).
The existing source grouping is brittle and is not vital for the
CMake build system MVP, so we are removing it to reduce code churn.
Review: https://reviews.apache.org/r/61287/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/ae778e46
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/ae778e46
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/ae778e46
Branch: refs/heads/master
Commit: ae778e46ecdb8096ae8d69e584a69114d2226fd0
Parents: da357f4
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Mon Aug 7 18:09:48 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:05 2017 -0700
----------------------------------------------------------------------
3rdparty/stout/cmake/StoutConfigure.cmake | 20 --------------------
3rdparty/stout/tests/CMakeLists.txt | 8 --------
2 files changed, 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/ae778e46/3rdparty/stout/cmake/StoutConfigure.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/stout/cmake/StoutConfigure.cmake b/3rdparty/stout/cmake/StoutConfigure.cmake
index 48b153a..a20fb95 100644
--- a/3rdparty/stout/cmake/StoutConfigure.cmake
+++ b/3rdparty/stout/cmake/StoutConfigure.cmake
@@ -27,26 +27,6 @@ if (NOT WIN32)
find_package(Svn REQUIRED)
endif ()
-include(GroupSource)
-
-# SOURCE GROUPS. Allows IDEs to group header files for projects taking a
-# dependency on this package.
-########################################################################
-file(
- GLOB_RECURSE
- STOUT_HEADERS
- "${STOUT_INCLUDE_DIR}/stout/*.hpp"
- "${STOUT_INCLUDE_DIR}/stout/*.h"
- )
-
-macro(GROUP_STOUT_HEADERS)
- GROUP_SOURCE(
- "Stout Public Headers"
- "${STOUT_INCLUDE_DIR}/stout"
- "${STOUT_INCLUDE_DIR}/stout"
- "*.h*")
-endmacro()
-
# DEFINE STOUT LIBRARY DEPENDENCIES. Tells the stout library build targets
# download/configure/build all third-party libraries before attempting to build.
################################################################################
http://git-wip-us.apache.org/repos/asf/mesos/blob/ae778e46/3rdparty/stout/tests/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/stout/tests/CMakeLists.txt b/3rdparty/stout/tests/CMakeLists.txt
index 74b8758..f18dabd 100644
--- a/3rdparty/stout/tests/CMakeLists.txt
+++ b/3rdparty/stout/tests/CMakeLists.txt
@@ -108,14 +108,6 @@ add_custom_command(
${CMAKE_SOURCE_DIR}/3rdparty/stout/tests/protobuf_tests.proto
DEPENDS ${CMAKE_SOURCE_DIR}/3rdparty/stout/tests/protobuf_tests.proto)
-GROUP_STOUT_HEADERS()
-
-GROUP_SOURCE(
- "tests"
- "${CMAKE_CURRENT_SOURCE_DIR}"
- "${CMAKE_CURRENT_SOURCE_DIR}"
- "*.[ch]*")
-
# TODO(andschwa): Remove when gmock and gtest are top-level targets.
link_directories(${STOUT_TEST_LIB_DIRS})
[25/42] mesos git commit: CMake: Added and ported the ZooKeeper tests
to Windows.
Posted by jo...@apache.org.
CMake: Added and ported the ZooKeeper tests to Windows.
This adds the ZooKeeper test sources to the CMake build system when Java
is enabled and makes the tests compatible with the CMake build
structure and Windows.
Review: https://reviews.apache.org/r/61311/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/c23cc036
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/c23cc036
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/c23cc036
Branch: refs/heads/master
Commit: c23cc036452d9e24b4123b1d86cfc09d04b0a3ab
Parents: 44b6448
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Sat Sep 2 16:48:33 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:07 2017 -0700
----------------------------------------------------------------------
src/CMakeLists.txt | 2 +-
src/tests/CMakeLists.txt | 10 ++++++++++
src/tests/zookeeper.cpp | 15 +++++++++++++--
src/zookeeper/group.cpp | 2 +-
4 files changed, 25 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/c23cc036/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 10acb12..5edfb6f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -521,7 +521,7 @@ if (NOT WIN32)
${STATE_SRC}
state/leveldb.cpp
state/log.cpp
- )
+ state/zookeeper.cpp)
endif ()
set(URI_SRC
http://git-wip-us.apache.org/repos/asf/mesos/blob/c23cc036/src/tests/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
index be49b73..2d4eed2 100644
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -133,6 +133,16 @@ set(MESOS_TESTS_SRC
zookeeper_url_tests.cpp
)
+if (HAS_JAVA)
+ set(MESOS_TESTS_SRC
+ ${MESOS_TESTS_SRC}
+ group_tests.cpp
+ registrar_zookeeper_tests.cpp
+ zookeeper.cpp
+ zookeeper_test_server.cpp
+ zookeeper_tests.cpp)
+endif ()
+
if (ENABLE_SSL)
set(MESOS_TESTS_SRC
${MESOS_TESTS_SRC}
http://git-wip-us.apache.org/repos/asf/mesos/blob/c23cc036/src/tests/zookeeper.cpp
----------------------------------------------------------------------
diff --git a/src/tests/zookeeper.cpp b/src/tests/zookeeper.cpp
index b34ed3a..54cf9c6 100644
--- a/src/tests/zookeeper.cpp
+++ b/src/tests/zookeeper.cpp
@@ -54,11 +54,16 @@ const Duration ZooKeeperTest::NO_TIMEOUT = Seconds(10);
void ZooKeeperTest::SetUpTestCase()
{
if (!Jvm::created()) {
+ const string zookeeper = "zookeeper-" ZOOKEEPER_VERSION;
string zkHome =
- path::join(flags.build_dir, "/3rdparty/zookeeper-" ZOOKEEPER_VERSION);
+ path::join(flags.build_dir, "3rdparty", zookeeper);
+#ifdef USE_CMAKE_BUILD_CONFIG
+ // CMake build directory is further nested.
+ zkHome = path::join(zkHome, "src", zookeeper);
+#endif // USE_CMAKE_BUILD_CONFIG
string classpath = "-Djava.class.path=" +
- path::join(zkHome, "zookeeper-" ZOOKEEPER_VERSION ".jar");
+ path::join(zkHome, zookeeper + ".jar");
// Now add all the libraries in 'lib' too.
Try<list<string>> jars = fs::list(path::join(zkHome, "lib", "*.jar"));
@@ -66,7 +71,13 @@ void ZooKeeperTest::SetUpTestCase()
CHECK_SOME(jars);
foreach (const string& jar, jars.get()) {
+#ifdef __WINDOWS__
+ // TODO(andschwa): `fs::list` on Windows only returns the file names, not
+ // the full paths. Remove this work-around when MESOS-7803 is resolved.
+ classpath += ";" + path::join(zkHome, "lib", jar);
+#else
classpath += ":" + jar;
+#endif
}
LOG(INFO) << "Using Java classpath: " << classpath;
http://git-wip-us.apache.org/repos/asf/mesos/blob/c23cc036/src/zookeeper/group.cpp
----------------------------------------------------------------------
diff --git a/src/zookeeper/group.cpp b/src/zookeeper/group.cpp
index 0b823ec..6ba08d8 100644
--- a/src/zookeeper/group.cpp
+++ b/src/zookeeper/group.cpp
@@ -628,7 +628,7 @@ Result<Group::Membership> GroupProcess::doJoin(
// Save the sequence number but only grab the basename. Example:
// "/path/to/znode/label_0000000131" => "0000000131".
- const string basename = Path(result).basename();
+ const string basename = strings::tokenize(result, "/").back();
// Strip the label before grabbing the sequence number.
const string node = label.isSome()
[41/42] mesos git commit: CMake: Used `list(APPEND x ...)` where
appropriate (libprocess).
Posted by jo...@apache.org.
CMake: Used `list(APPEND x ...)` where appropriate (libprocess).
Now that the minimum version of CMake has been bumped above 3.0,
we can use `list(APPEND x ...)` instead of `set(x ${x} ...)`.
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/2572edd9
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/2572edd9
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/2572edd9
Branch: refs/heads/master
Commit: 2572edd97a9fd5b205b4b8c9062d19be21329487
Parents: fc6c0dc
Author: Joseph Wu <jo...@apache.org>
Authored: Sun Sep 3 00:58:26 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:10 2017 -0700
----------------------------------------------------------------------
3rdparty/libprocess/src/CMakeLists.txt | 18 ++++++------------
3rdparty/libprocess/src/tests/CMakeLists.txt | 6 ++----
2 files changed, 8 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/2572edd9/3rdparty/libprocess/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/CMakeLists.txt b/3rdparty/libprocess/src/CMakeLists.txt
index dae057b..107e197 100644
--- a/3rdparty/libprocess/src/CMakeLists.txt
+++ b/3rdparty/libprocess/src/CMakeLists.txt
@@ -58,40 +58,34 @@ set(PROCESS_SRC
timeseries.cpp)
if (WIN32)
- set(PROCESS_SRC
- ${PROCESS_SRC}
+ list(APPEND PROCESS_SRC
subprocess_windows.cpp)
else ()
- set(PROCESS_SRC
- ${PROCESS_SRC}
+ list(APPEND PROCESS_SRC
subprocess_posix.cpp)
endif ()
if (ENABLE_LIBEVENT)
- set(PROCESS_SRC
- ${PROCESS_SRC}
+ list(APPEND PROCESS_SRC
libevent.hpp
libevent.cpp
libevent_poll.cpp)
else ()
- set(PROCESS_SRC
- ${PROCESS_SRC}
+ list(APPEND PROCESS_SRC
libev.hpp
libev.cpp
libev_poll.cpp)
endif ()
if (ENABLE_SSL)
- set(PROCESS_SRC
- ${PROCESS_SRC}
+ list(APPEND PROCESS_SRC
jwt.cpp
jwt_authenticator.cpp
openssl.cpp
ssl/utilities.cpp)
if (ENABLE_LIBEVENT)
- set(PROCESS_SRC
- ${PROCESS_SRC}
+ list(APPEND PROCESS_SRC
libevent_ssl_socket.cpp)
endif ()
endif ()
http://git-wip-us.apache.org/repos/asf/mesos/blob/2572edd9/3rdparty/libprocess/src/tests/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/tests/CMakeLists.txt b/3rdparty/libprocess/src/tests/CMakeLists.txt
index 28396bd..d9ca23d 100644
--- a/3rdparty/libprocess/src/tests/CMakeLists.txt
+++ b/3rdparty/libprocess/src/tests/CMakeLists.txt
@@ -42,15 +42,13 @@ set(PROCESS_TESTS_SRC
timeseries_tests.cpp)
if (NOT WIN32)
- set(PROCESS_TESTS_SRC
- ${PROCESS_TESTS_SRC}
+ list(APPEND PROCESS_TESTS_SRC
io_tests.cpp
reap_tests.cpp)
endif ()
if (ENABLE_SSL)
- set(PROCESS_TESTS_SRC
- ${PROCESS_TESTS_SRC}
+ list(APPEND PROCESS_TESTS_SRC
jwt_tests.cpp
ssl_tests.cpp)
endif ()
[20/42] mesos git commit: CMake: Updated stout interface library
linking rules.
Posted by jo...@apache.org.
CMake: Updated stout interface library linking rules.
Now that all the dependencies of stout are import or interface libraries
with their properties properly defined within their respective targets,
we can update the linking rules of stout to point to those dependent
targets. CMake will do the rest for us.
Review: https://reviews.apache.org/r/61292/
Review: https://reviews.apache.org/r/61295/
Review: https://reviews.apache.org/r/61304/
Review: https://reviews.apache.org/r/61315/
Review: https://reviews.apache.org/r/61322/
Review: https://reviews.apache.org/r/61324/
Review: https://reviews.apache.org/r/61328/
Review: https://reviews.apache.org/r/61331/
Review: https://reviews.apache.org/r/61339/
Review: https://reviews.apache.org/r/61345/
Review: https://reviews.apache.org/r/61352/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/4c62721d
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/4c62721d
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/4c62721d
Branch: refs/heads/master
Commit: 4c62721d7e916c88e4cbaefe211258249969ae30
Parents: d431bbc
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Sat Sep 2 10:50:09 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:07 2017 -0700
----------------------------------------------------------------------
3rdparty/stout/CMakeLists.txt | 31 +++---
3rdparty/stout/cmake/StoutConfigure.cmake | 128 -------------------------
2 files changed, 16 insertions(+), 143 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/4c62721d/3rdparty/stout/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/stout/CMakeLists.txt b/3rdparty/stout/CMakeLists.txt
index 9fcde58..7f43b95 100644
--- a/3rdparty/stout/CMakeLists.txt
+++ b/3rdparty/stout/CMakeLists.txt
@@ -14,23 +14,24 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-include(StoutConfigure)
+find_package(Threads REQUIRED)
-# TODO(andschwa): Remove this when all libraries are fully qualified.
-link_directories(${STOUT_LIB_DIRS})
-
-# THE STOUT LIBRARY INTERFACE
-#############################
add_library(stout INTERFACE)
+target_include_directories(stout INTERFACE include)
-# TODO(andschwa): Remove this when all dependencies have top-level targets.
-add_dependencies(stout ${STOUT_DEPENDENCIES})
-
-target_include_directories(stout INTERFACE
- include/
- ${STOUT_3RDPARTY_INCLUDE_DIRS})
-
-target_link_libraries(stout INTERFACE
- ${STOUT_LIBS})
+target_link_libraries(
+ stout INTERFACE
+ apr
+ boost
+ curl
+ elfio
+ glog
+ picojson
+ protobuf
+ Threads::Threads
+ zlib
+ $<$<PLATFORM_ID:Linux>:rt dl svn>
+ $<$<PLATFORM_ID:Darwin>:svn>
+ $<$<PLATFORM_ID:Windows>:ws2_32 Mswsock Secur32 Userenv>)
add_subdirectory(tests)
http://git-wip-us.apache.org/repos/asf/mesos/blob/4c62721d/3rdparty/stout/cmake/StoutConfigure.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/stout/cmake/StoutConfigure.cmake b/3rdparty/stout/cmake/StoutConfigure.cmake
deleted file mode 100644
index a20fb95..0000000
--- a/3rdparty/stout/cmake/StoutConfigure.cmake
+++ /dev/null
@@ -1,128 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-if (NOT WIN32)
- # TODO(hausdorff): (cf. MESOS-3181) Add support for attempting to find these
- # packages on Windows, and then if that fails, use CMake macros/functions to
- # download, configure, and build them.
- #
- # WHY: Windows does not have a good package manager, so getting some of our
- # dependencies can be really annoying in some circumstances. For this reason,
- # we should support a CMake-based "distribution channel", even though this
- # way is sure to be more hackish.
- find_package(Apr REQUIRED)
- find_package(Svn REQUIRED)
-endif ()
-
-# DEFINE STOUT LIBRARY DEPENDENCIES. Tells the stout library build targets
-# download/configure/build all third-party libraries before attempting to build.
-################################################################################
-set(STOUT_DEPENDENCIES
- ${STOUT_DEPENDENCIES}
- ${BOOST_TARGET}
- ${ELFIO_TARGET}
- ${GLOG_TARGET}
- ${NVML_TARGET}
- ${PROTOBUF_TARGET}
- ${PICOJSON_TARGET}
- )
-
-if (WIN32)
- set(STOUT_DEPENDENCIES
- ${STOUT_DEPENDENCIES}
- ${CURL_TARGET}
- ${ZLIB_TARGET}
- )
-endif ()
-
-# DEFINE THIRD-PARTY INCLUDE DIRECTORIES. Tells compiler toolchain where to get
-# headers for our third party libs (e.g., -I/path/to/glog on Linux).
-###############################################################################
-set(STOUT_3RDPARTY_INCLUDE_DIRS
- ${STOUT_3RDPARTY_INCLUDE_DIRS}
- ${APR_INCLUDE_DIR}
- ${BOOST_INCLUDE_DIR}
- ${ELFIO_INCLUDE_DIR}
- ${GLOG_INCLUDE_DIR}
- ${NVML_INCLUDE_DIR}
- ${PICOJSON_INCLUDE_DIR}
- ${PROTOBUF_INCLUDE_DIR}
- ${SVN_INCLUDE_DIR}
- )
-
-if (WIN32)
- set(STOUT_3RDPARTY_INCLUDE_DIRS
- ${STOUT_3RDPARTY_INCLUDE_DIRS}
- ${CURL_INCLUDE_DIR}
- ${ZLIB_INCLUDE_DIR}
- )
-endif ()
-
-# DEFINE THIRD-PARTY LIB INSTALL DIRECTORIES. Used to tell the compiler
-# toolchain where to find our third party libs (e.g., -L/path/to/glog on
-# Linux).
-########################################################################
-set(STOUT_LIB_DIRS
- ${STOUT_LIB_DIRS}
- ${GLOG_LIB_DIR}
- ${PROTOBUF_LIB_DIR}
- )
-
-if (WIN32)
- set(STOUT_LIB_DIRS
- ${STOUT_LIB_DIRS}
- ${CURL_LIB_DIR}
- ${ZLIB_LIB_DIR}
- )
-endif ()
-
-# DEFINE THIRD-PARTY LIBS. Used to generate flags that the linker uses to
-# include our third-party libs (e.g., -lglog on Linux).
-#########################################################################
-set(STOUT_LIBS
- ${STOUT_LIBS}
- ${CMAKE_THREAD_LIBS_INIT}
- ${APR_LIBS}
- ${CURL_LFLAG}
- ${GLOG_LFLAG}
- ${SVN_LIBS}
- ${PROTOBUF_LFLAG}
- )
-
-if (WIN32)
- set(STOUT_LIBS
- ${STOUT_LIBS}
- ${ZLIB_LFLAG}
- ws2_32
- Mswsock
- Secur32
- Userenv
- )
-else ()
- set(STOUT_LIBS
- ${STOUT_LIBS}
- ${DL_LFLAG}
- apr-1
- )
-endif ()
-
-# TODO(hausdorff): The `LINUX` flag comes from MesosConfigure; when we
-# port the bootstrap script to CMake, we should also copy this logic
-# into .cmake files in the Stout and Process libraries' folders
-# individually.
-if (LINUX)
- set(STOUT_LIBS ${STOUT_LIBS} rt)
-endif ()
[27/42] mesos git commit: CMake: Replaced `MESOS_3RDPARTY_*` with
`CMAKE_CURRENT_*_DIR`.
Posted by jo...@apache.org.
CMake: Replaced `MESOS_3RDPARTY_*` with `CMAKE_CURRENT_*_DIR`.
This variable was superfluous and set as a side effect of
`Mesos3rdpartyConfigure.cmake`.
Review: https://reviews.apache.org/r/61361
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/7034aed8
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/7034aed8
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/7034aed8
Branch: refs/heads/master
Commit: 7034aed8bbfb3bf04777bae53d83a53aaa2e62aa
Parents: b44557f
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Thu Jul 27 15:03:01 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:08 2017 -0700
----------------------------------------------------------------------
3rdparty/CMakeLists.txt | 46 ++++++++++++------------
3rdparty/cmake/Mesos3rdpartyConfigure.cmake | 12 +++----
2 files changed, 27 insertions(+), 31 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/7034aed8/3rdparty/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
index 8655f3d..09f4061 100755
--- a/3rdparty/CMakeLists.txt
+++ b/3rdparty/CMakeLists.txt
@@ -137,7 +137,7 @@ endfunction()
# Boost: C++ Libraries.
# http://www.boost.org
#######################
-EXTERNAL(boost ${BOOST_VERSION} "${MESOS_3RDPARTY_BIN}")
+EXTERNAL(boost ${BOOST_VERSION} ${CMAKE_CURRENT_BINARY_DIR})
add_library(boost INTERFACE)
add_dependencies(boost ${BOOST_TARGET})
target_include_directories(boost SYSTEM INTERFACE ${BOOST_ROOT})
@@ -155,7 +155,7 @@ ExternalProject_Add(
# moodycamel::ConcurrentQueue: An industrial-strength lock-free queue.
# https://github.com/cameron314/concurrentqueue
######################################################################
-EXTERNAL(concurrentqueue ${CONCURRENTQUEUE_VERSION} "${MESOS_3RDPARTY_BIN}")
+EXTERNAL(concurrentqueue ${CONCURRENTQUEUE_VERSION} ${CMAKE_CURRENT_BINARY_DIR})
add_library(concurrentqueue INTERFACE)
add_dependencies(concurrentqueue ${CONCURRENTQUEUE_TARGET})
target_include_directories(concurrentqueue SYSTEM INTERFACE ${CONCURRENTQUEUE_ROOT})
@@ -173,7 +173,7 @@ ExternalProject_Add(
# ELFIO: library for reading and generating ELF files.
# http://elfio.sourceforge.net
######################################################
-EXTERNAL(elfio ${ELFIO_VERSION} "${MESOS_3RDPARTY_BIN}")
+EXTERNAL(elfio ${ELFIO_VERSION} ${CMAKE_CURRENT_BINARY_DIR})
add_library(elfio INTERFACE)
add_dependencies(elfio ${ELFIO_TARGET})
target_include_directories(elfio SYSTEM INTERFACE ${ELFIO_ROOT})
@@ -191,12 +191,12 @@ ExternalProject_Add(
# glog: Google Logging Library.
# https://github.com/google/glog
################################
-EXTERNAL(glog ${GLOG_VERSION} "${MESOS_3RDPARTY_BIN}")
+EXTERNAL(glog ${GLOG_VERSION} ${CMAKE_CURRENT_BINARY_DIR})
add_library(glog ${LIBRARY_LINKAGE} IMPORTED)
add_dependencies(glog ${GLOG_TARGET})
if (WIN32)
- set(GLOG_PATCH_CMD ${PATCHEXE_LOCATION} -p1 < ${MESOS_3RDPARTY_SRC}/glog-${GLOG_VERSION}.patch)
+ set(GLOG_PATCH_CMD ${PATCHEXE_LOCATION} -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/glog-${GLOG_VERSION}.patch)
set(GLOG_INSTALL_CMD ${CMAKE_NOOP})
# NOTE: Windows-specific workaround for a glog issue documented here[1].
@@ -221,7 +221,7 @@ if (WIN32)
else ()
# Patch glog to deal with a problem that appears when compiling on clang
# under the C++11 standard. cf. MESOS-860, MESOS-966.
- patch_cmd(${MESOS_3RDPARTY_SRC}/glog-${GLOG_VERSION}.patch GLOG_PATCH_CMD)
+ patch_cmd(${CMAKE_CURRENT_SOURCE_DIR}/glog-${GLOG_VERSION}.patch GLOG_PATCH_CMD)
# TODO(andschwa): Build with CMake instead when glog is updated.
# NOTE: We only link to the shared library of glog because the static build
@@ -252,7 +252,7 @@ ExternalProject_Add(
# PicoJSON: JSON parser / serializer.
# https://github.com/kazuho/picojson
#####################################
-EXTERNAL(picojson ${PICOJSON_VERSION} "${MESOS_3RDPARTY_BIN}")
+EXTERNAL(picojson ${PICOJSON_VERSION} ${CMAKE_CURRENT_BINARY_DIR})
add_library(picojson INTERFACE)
add_dependencies(picojson ${PICOJSON_TARGET})
target_include_directories(picojson SYSTEM INTERFACE ${PICOJSON_ROOT})
@@ -280,7 +280,7 @@ ExternalProject_Add(
# NVML: NVIDIA Management Library.
# https://developer.nvidia.com/nvidia-management-library-nvml
#############################################################
-EXTERNAL(nvml ${NVML_VERSION} "${MESOS_3RDPARTY_BIN}")
+EXTERNAL(nvml ${NVML_VERSION} ${CMAKE_CURRENT_BINARY_DIR})
add_library(nvml INTERFACE)
add_dependencies(nvml ${NVML_TARGET})
target_include_directories(nvml SYSTEM INTERFACE ${NVML_ROOT})
@@ -299,7 +299,7 @@ ExternalProject_Add(
# https://github.com/nodejs/http-parser
##################################################
# TODO: Remove `GLOBAL` when `Process3rdpartyConfigure` is removed.
-EXTERNAL(http_parser ${HTTP_PARSER_VERSION} "${MESOS_3RDPARTY_BIN}")
+EXTERNAL(http_parser ${HTTP_PARSER_VERSION} ${CMAKE_CURRENT_BINARY_DIR})
add_library(http_parser ${LIBRARY_LINKAGE} IMPORTED GLOBAL)
add_dependencies(http_parser ${HTTP_PARSER_TARGET})
set_target_properties(http_parser PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${HTTP_PARSER_ROOT})
@@ -321,7 +321,7 @@ endif ()
# tarball at build time, and `add_library` is a configuration time step.
set(HTTP_PARSER_PATCH_CMD
${CMAKE_COMMAND} -E copy
- ${MESOS_3RDPARTY_SRC}/http-parser/CMakeLists.txt.template
+ ${CMAKE_CURRENT_SOURCE_DIR}/http-parser/CMakeLists.txt.template
${HTTP_PARSER_ROOT}/CMakeLists.txt)
MAKE_INCLUDE_DIR(http_parser)
@@ -340,7 +340,7 @@ if (ENABLE_LIBEVENT)
# libevent: An event notification library.
# http://libevent.org/
##########################################
- EXTERNAL(libevent ${LIBEVENT_VERSION} "${MESOS_3RDPARTY_BIN}")
+ EXTERNAL(libevent ${LIBEVENT_VERSION} ${CMAKE_CURRENT_BINARY_DIR})
add_library(libevent ${LIBRARY_LINKAGE} IMPORTED)
add_dependencies(libevent ${LIBEVENT_TARGET})
@@ -387,7 +387,7 @@ else ()
# libev: Full-featured high-performance event loop.
# https://github.com/enki/libev
###################################################
- EXTERNAL(libev ${LIBEV_VERSION} "${MESOS_3RDPARTY_BIN}")
+ EXTERNAL(libev ${LIBEV_VERSION} ${CMAKE_CURRENT_BINARY_DIR})
add_library(libev SHARED IMPORTED)
add_dependencies(libev ${LIBEV_TARGET})
@@ -397,7 +397,7 @@ else ()
INTERFACE_INCLUDE_DIRECTORIES ${LIBEV_ROOT}-build/include)
# Patch libev to keep it from reaping child processes.
- patch_cmd(${MESOS_3RDPARTY_SRC}/libev-4.22.patch LIBEV_PATCH_CMD)
+ patch_cmd(${CMAKE_CURRENT_SOURCE_DIR}/libev-4.22.patch LIBEV_PATCH_CMD)
MAKE_INCLUDE_DIR(libev)
@@ -417,7 +417,7 @@ endif ()
# https://apr.apache.org
###########################################
if (WIN32)
- EXTERNAL(libapr ${LIBAPR_VERSION} "${MESOS_3RDPARTY_BIN}")
+ EXTERNAL(libapr ${LIBAPR_VERSION} ${CMAKE_CURRENT_BINARY_DIR})
add_library(apr ${LIBRARY_LINKAGE} IMPORTED)
add_dependencies(apr ${LIBAPR_TARGET})
@@ -472,7 +472,7 @@ endif ()
# https://curl.haxx.se
######################################################################
if (WIN32)
- EXTERNAL(curl ${CURL_VERSION} "${MESOS_3RDPARTY_BIN}")
+ EXTERNAL(curl ${CURL_VERSION} ${CMAKE_CURRENT_BINARY_DIR})
add_library(curl ${LIBRARY_LINKAGE} IMPORTED)
add_dependencies(curl ${CURL_TARGET})
@@ -516,7 +516,7 @@ endif ()
# https://zlib.net
##########################################################################
if (WIN32)
- EXTERNAL(zlib ${ZLIB_VERSION} "${MESOS_3RDPARTY_BIN}")
+ EXTERNAL(zlib ${ZLIB_VERSION} ${CMAKE_CURRENT_BINARY_DIR})
add_library(zlib ${LIBRARY_LINKAGE} IMPORTED)
add_dependencies(zlib ${ZLIB_TARGET})
@@ -561,7 +561,7 @@ set_target_properties(
# Google Test: Google's C++ test framework (GoogleTest and GoogleMock).
# https://github.com/google/googletest
#######################################################################
-EXTERNAL(googletest ${GOOGLETEST_VERSION} "${MESOS_3RDPARTY_BIN}")
+EXTERNAL(googletest ${GOOGLETEST_VERSION} ${CMAKE_CURRENT_BINARY_DIR})
add_library(googletest INTERFACE)
add_dependencies(googletest ${GOOGLETEST_TARGET})
target_link_libraries(googletest INTERFACE gmock gtest)
@@ -614,7 +614,7 @@ ExternalProject_Add(
# Protocol Buffers: Google's data interchange format.
# https://developers.google.com/protocol-buffers/
#####################################################
-EXTERNAL("protobuf" ${PROTOBUF_VERSION} "${MESOS_3RDPARTY_BIN}")
+EXTERNAL(protobuf ${PROTOBUF_VERSION} ${CMAKE_CURRENT_BINARY_DIR})
# TODO(andschwa): Move protobufs so these don't have to be GLOBAL.
add_library(protobuf ${LIBRARY_LINKAGE} IMPORTED GLOBAL)
@@ -668,7 +668,7 @@ ExternalProject_Add(
# https://zookeeper.apache.org/
##################################################
# TODO(andschwa): Move zookeeper so these don't have to be GLOBAL.
-EXTERNAL(zookeeper ${ZOOKEEPER_VERSION} "${MESOS_3RDPARTY_BIN}")
+EXTERNAL(zookeeper ${ZOOKEEPER_VERSION} ${CMAKE_CURRENT_BINARY_DIR})
add_library(zookeeper STATIC IMPORTED GLOBAL)
add_library(zk-hashtable STATIC IMPORTED GLOBAL)
add_dependencies(zookeeper ${ZOOKEEPER_TARGET})
@@ -695,7 +695,7 @@ if (WIN32)
# NOTE: We do not specify the `--binary` patch option here because the
# files being modified are extracted with CRLF (Windows) line endings
# already. The `--binary` option will instead fail to apply the patch.
- set(ZOOKEEPER_PATCH_CMD ${PATCHEXE_LOCATION} -p1 < ${MESOS_3RDPARTY_SRC}/zookeeper-${ZOOKEEPER_VERSION}.patch)
+ set(ZOOKEEPER_PATCH_CMD ${PATCHEXE_LOCATION} -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/zookeeper-${ZOOKEEPER_VERSION}.patch)
else ()
set_target_properties(
zookeeper PROPERTIES
@@ -705,7 +705,7 @@ else ()
zk-hashtable PROPERTIES
IMPORTED_LOCATION ${ZOOKEEPER_ROOT}-build/libhashtable${CMAKE_STATIC_LIBRARY_SUFFIX})
- patch_cmd(${MESOS_3RDPARTY_SRC}/zookeeper-${ZOOKEEPER_VERSION}.patch ZOOKEEPER_PATCH_CMD)
+ patch_cmd(${CMAKE_CURRENT_SOURCE_DIR}/zookeeper-${ZOOKEEPER_VERSION}.patch ZOOKEEPER_PATCH_CMD)
endif ()
MAKE_INCLUDE_DIR(zookeeper)
@@ -726,7 +726,7 @@ ExternalProject_Add(
############################################
if (NOT WIN32)
# TODO(andschwa): Move leveldb so these don't have to be GLOBAL.
- EXTERNAL(leveldb ${LEVELDB_VERSION} "${MESOS_3RDPARTY_BIN}")
+ EXTERNAL(leveldb ${LEVELDB_VERSION} ${CMAKE_CURRENT_BINARY_DIR})
add_library(leveldb STATIC IMPORTED GLOBAL)
add_dependencies(leveldb ${LEVELDB_TARGET})
@@ -735,7 +735,7 @@ if (NOT WIN32)
IMPORTED_LOCATION ${LEVELDB_ROOT}/out-static/libleveldb${CMAKE_STATIC_LIBRARY_SUFFIX}
INTERFACE_INCLUDE_DIRECTORIES ${LEVELDB_ROOT}/include)
- patch_cmd(${MESOS_3RDPARTY_SRC}/leveldb-${LEVELDB_VERSION}.patch LEVELDB_PATCH_CMD)
+ patch_cmd(${CMAKE_CURRENT_SOURCE_DIR}/leveldb-${LEVELDB_VERSION}.patch LEVELDB_PATCH_CMD)
MAKE_INCLUDE_DIR(leveldb)
http://git-wip-us.apache.org/repos/asf/mesos/blob/7034aed8/3rdparty/cmake/Mesos3rdpartyConfigure.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/cmake/Mesos3rdpartyConfigure.cmake b/3rdparty/cmake/Mesos3rdpartyConfigure.cmake
index 8cec807..e53ef2b 100755
--- a/3rdparty/cmake/Mesos3rdpartyConfigure.cmake
+++ b/3rdparty/cmake/Mesos3rdpartyConfigure.cmake
@@ -14,11 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# DEFINE DIRECTORY STRUCTURE FOR THIRD-PARTY LIBS.
-##################################################
-set(MESOS_3RDPARTY_SRC ${CMAKE_SOURCE_DIR}/3rdparty)
-set(MESOS_3RDPARTY_BIN ${CMAKE_BINARY_DIR}/3rdparty)
-
# Configure Windows use of the GNU patch utility;
# we attempt to find it in its default location,
# but this path may be customized.
@@ -41,6 +36,7 @@ if (WIN32)
FATAL_ERROR
"GnuWin32 patch.exe was not found. Use -DPATCHEXE_PATH to "
"provide the local path of GnuWin32 patch.exe. "
+ "Also delete CMakeCache.txt to clear the cache. "
"Mesos for Windows requires GnuWin32 patch.exe "
"to apply updates. You may get it from "
"http://gnuwin32.sourceforge.net/packages/patch.htm"
@@ -52,7 +48,7 @@ if (WIN32)
${GNUWIN32_PATCH_EXECUTABLE})
# Since Windows Vista patch.exe has been reqesting elevation to work
- # eventhough it is not required to apply patches. So to avoid a prompt
+ # even though it is not required to apply patches. So to avoid a prompt
# for elevation a manifest will be applied to patch.exe in the current
# user temp directory.
@@ -63,8 +59,8 @@ if (WIN32)
# Set full path for temp location of patch.exe.
set(PATCHEXE_LOCATION $ENV{${USER_TMP_DIR}}/patch.exe)
- #set full path for patch.exe.manifest.
- set(PATCHMANIFEST_LOCATION ${MESOS_3RDPARTY_SRC}/patch.exe.manifest)
+ # Set full path for patch.exe.manifest.
+ set(PATCHMANIFEST_LOCATION ${CMAKE_SOURCE_DIR}/3rdparty/patch.exe.manifest)
# Set full path for temp location of patch.exe.manifest.
set(PATCHMANIFEST_TMP_LOCATION $ENV{${USER_TMP_DIR}}/patch.exe.manifest)
[35/42] mesos git commit: CMake: Normalized trailing parentheses
style (stout).
Posted by jo...@apache.org.
CMake: Normalized trailing parentheses style (stout).
This removes dangling parentheses from CMake files setting variables
or calling functions.
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/8ef80cf6
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/8ef80cf6
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/8ef80cf6
Branch: refs/heads/master
Commit: 8ef80cf629af1541c0b845bf5163deb88e79257e
Parents: d10fd9b
Author: Joseph Wu <jo...@apache.org>
Authored: Sun Sep 3 00:48:23 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:09 2017 -0700
----------------------------------------------------------------------
3rdparty/stout/cmake/FindApr.cmake | 6 ++----
3rdparty/stout/cmake/FindSvn.cmake | 9 +++------
3rdparty/stout/tests/CMakeLists.txt | 18 +++++-------------
3 files changed, 10 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/8ef80cf6/3rdparty/stout/cmake/FindApr.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/stout/cmake/FindApr.cmake b/3rdparty/stout/cmake/FindApr.cmake
index 10e6d14..b6cc740 100644
--- a/3rdparty/stout/cmake/FindApr.cmake
+++ b/3rdparty/stout/cmake/FindApr.cmake
@@ -29,15 +29,13 @@ set(POSSIBLE_APR_INCLUDE_DIRS
/usr/local/include/apr-1.0
/usr/local/apr/include/apr-1
/usr/include/apr-1
- /usr/include/apr-1.0
- )
+ /usr/include/apr-1.0)
set(POSSIBLE_APR_LIB_DIRS
${APR_PREFIX}/libexec/lib
/usr/local/apr/lib
/usr/local/lib
- /usr/lib
- )
+ /usr/lib)
set(APR_LIBRARY_NAMES apr-1)
http://git-wip-us.apache.org/repos/asf/mesos/blob/8ef80cf6/3rdparty/stout/cmake/FindSvn.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/stout/cmake/FindSvn.cmake b/3rdparty/stout/cmake/FindSvn.cmake
index 15ec6ed..eed7590 100644
--- a/3rdparty/stout/cmake/FindSvn.cmake
+++ b/3rdparty/stout/cmake/FindSvn.cmake
@@ -26,19 +26,16 @@ execute_process(
set(POSSIBLE_SVN_INCLUDE_DIRS
${SVN_PREFIX}/include/subversion-1
/usr/include/subversion-1
- /usr/local/include/subversion-1
- )
+ /usr/local/include/subversion-1)
set(POSSIBLE_SVN_LIB_DIRS
${SVN_PREFIX}/lib
/usr/lib
- /usr/local/lib
- )
+ /usr/local/lib)
set(SVN_LIBRARY_NAMES
svn_delta-1
svn_diff-1
- svn_subr-1
- )
+ svn_subr-1)
FIND_PACKAGE_HELPER(SVN svn_client.h)
http://git-wip-us.apache.org/repos/asf/mesos/blob/8ef80cf6/3rdparty/stout/tests/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/stout/tests/CMakeLists.txt b/3rdparty/stout/tests/CMakeLists.txt
index eb1c97e..8a87672 100644
--- a/3rdparty/stout/tests/CMakeLists.txt
+++ b/3rdparty/stout/tests/CMakeLists.txt
@@ -17,7 +17,6 @@
# STOUT TESTS.
##############
set(STOUT_ROOT_TESTS_SRC
- ${STOUT_ROOT_TESTS_SRC}
base64_tests.cpp
bits_tests.cpp
bytes_tests.cpp
@@ -53,35 +52,30 @@ set(STOUT_ROOT_TESTS_SRC
try_tests.cpp
uuid_tests.cpp
variant_tests.cpp
- version_tests.cpp
- )
+ version_tests.cpp)
if (NOT WIN32)
set(STOUT_ROOT_TESTS_SRC
${STOUT_ROOT_TESTS_SRC}
protobuf_tests.cpp
protobuf_tests.pb.cc
- svn_tests.cpp
- )
+ svn_tests.cpp)
endif ()
set(STOUT_OS_TESTS_SRC
- ${STOUT_OS_TESTS_SRC}
os/env_tests.cpp
os/filesystem_tests.cpp
os/process_tests.cpp
os/rmdir_tests.cpp
os/socket_tests.cpp
os/strerror_tests.cpp
- os/systems_tests.cpp
- )
+ os/systems_tests.cpp)
if (NOT WIN32)
set(STOUT_OS_TESTS_SRC
${STOUT_OS_TESTS_SRC}
os/sendfile_tests.cpp
- os/signals_tests.cpp
- )
+ os/signals_tests.cpp)
endif ()
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
@@ -89,11 +83,9 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
endif ()
set(STOUT_TESTS_SRC
- ${STOUT_TESTS_SRC}
${STOUT_HEADERS}
${STOUT_ROOT_TESTS_SRC}
- ${STOUT_OS_TESTS_SRC}
- )
+ ${STOUT_OS_TESTS_SRC})
# THE C++ PROTOCOL BUFFER CODE (protobuf_tests.pb.h and protobuf_tests.pb.cc).
##############################################################################
[09/42] mesos git commit: CMake: Removed unnecessary includes of
`StoutConfigure`.
Posted by jo...@apache.org.
CMake: Removed unnecessary includes of `StoutConfigure`.
Because stout is now an "interface" library, the necessary metadata
is carried along with the stout target and does not need to be
spelled out by the downstream targets that use stout. This means
that these downstream files do not need to include stout's CMake file.
Review: https://reviews.apache.org/r/61289/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/ca240181
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/ca240181
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/ca240181
Branch: refs/heads/master
Commit: ca240181d2380a8f4da97f30100fb576676f5760
Parents: cd7ec91
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Mon Aug 7 18:24:57 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:05 2017 -0700
----------------------------------------------------------------------
3rdparty/CMakeLists.txt | 2 +-
src/master/cmake/MasterConfigure.cmake | 2 --
src/slave/cmake/AgentConfigure.cmake | 2 --
3 files changed, 1 insertion(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/ca240181/3rdparty/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
index f4feaf9..a36bc24 100755
--- a/3rdparty/CMakeLists.txt
+++ b/3rdparty/CMakeLists.txt
@@ -327,7 +327,7 @@ list(
APPEND CMAKE_MODULE_PATH
${CMAKE_SOURCE_DIR}/3rdparty/stout/cmake
)
-include(StoutConfigure)
+# TODO(andschwa): Remove this when gmock and gtest can be included.
include(StoutTestsConfigure)
set(GOOGLETEST_URL ${FETCH_URL}/googletest-release-${GOOGLETEST_VERSION}.tar.gz)
http://git-wip-us.apache.org/repos/asf/mesos/blob/ca240181/src/master/cmake/MasterConfigure.cmake
----------------------------------------------------------------------
diff --git a/src/master/cmake/MasterConfigure.cmake b/src/master/cmake/MasterConfigure.cmake
index 173dc36..96f0d5b 100644
--- a/src/master/cmake/MasterConfigure.cmake
+++ b/src/master/cmake/MasterConfigure.cmake
@@ -14,8 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-include(StoutConfigure)
-
# Define process library dependencies. Tells the process library build targets
# download/configure/build all third-party libraries before attempting to build.
################################################################################
http://git-wip-us.apache.org/repos/asf/mesos/blob/ca240181/src/slave/cmake/AgentConfigure.cmake
----------------------------------------------------------------------
diff --git a/src/slave/cmake/AgentConfigure.cmake b/src/slave/cmake/AgentConfigure.cmake
index af2f74f..0d70f91 100644
--- a/src/slave/cmake/AgentConfigure.cmake
+++ b/src/slave/cmake/AgentConfigure.cmake
@@ -14,8 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-include(StoutConfigure)
-
set(LOGROTATE_CONTAINER_LOGGER_TARGET logrotate_container_logger
CACHE STRING "Library containing the logrotate container logger."
)
[02/42] mesos git commit: CMake: Made `libprocess` use default
linking.
Posted by jo...@apache.org.
CMake: Made `libprocess` use default linking.
The static/shared specifier defaults to `BUILD_SHARED_LIBS`,
which is defined as a CMake option (defaults to ON for Posix
and OFF for Windows).
The PIC property is redundant as it will be set via the global
`CMAKE_POSITION_INDEPENDENT_CODE` variable. A separate CMake
file will define this appropriately when building shared libraries.
Review: https://reviews.apache.org/r/61284/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/db716d7d
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/db716d7d
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/db716d7d
Branch: refs/heads/master
Commit: db716d7df6de01cb8e988e572c372aa56bb170cd
Parents: b8d187f
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Mon Aug 7 16:44:15 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:05 2017 -0700
----------------------------------------------------------------------
3rdparty/libprocess/src/CMakeLists.txt | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/db716d7d/3rdparty/libprocess/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/CMakeLists.txt b/3rdparty/libprocess/src/CMakeLists.txt
index 1ffa2c9..ac2846f 100644
--- a/3rdparty/libprocess/src/CMakeLists.txt
+++ b/3rdparty/libprocess/src/CMakeLists.txt
@@ -110,16 +110,7 @@ link_directories(${PROCESS_LIB_DIRS})
# THE PROCESS LIBRARY (generates, e.g., libprocess.so, etc., on Linux).
#######################################################################
-if (WIN32)
- add_library(${PROCESS_TARGET} STATIC ${PROCESS_SRC})
-else ()
- add_library(${PROCESS_TARGET} SHARED ${PROCESS_SRC})
-
- set_target_properties(
- ${PROCESS_TARGET} PROPERTIES
- POSITION_INDEPENDENT_CODE TRUE
- )
-endif ()
+add_library(${PROCESS_TARGET} ${PROCESS_SRC})
set_target_properties(
${PROCESS_TARGET} PROPERTIES