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:42 UTC

[20/42] mesos git commit: CMake: Updated stout interface library linking rules.

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 ()