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 2015/10/18 02:11:44 UTC

[09/12] mesos git commit: CMake: Moved libevent, gmock, http-parser to CMake on Windows.

CMake: Moved libevent, gmock, http-parser to CMake on Windows.

Review: https://reviews.apache.org/r/39202


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/51fc7733
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/51fc7733
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/51fc7733

Branch: refs/heads/master
Commit: 51fc7733ada42a9d06528e6efc5bc9b0fb7031d4
Parents: bc27f7f
Author: Alex Clemmer <cl...@gmail.com>
Authored: Sat Oct 17 17:32:43 2015 -0400
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Sat Oct 17 20:11:13 2015 -0400

----------------------------------------------------------------------
 3rdparty/libprocess/3rdparty/CMakeLists.txt     | 19 +++--------
 .../http-parser/CMakeLists.txt.template         | 34 ++++++++++++++++++++
 .../cmake/Process3rdpartyConfigure.cmake        |  3 +-
 .../libprocess/cmake/ProcessConfigure.cmake     | 18 +++++++++--
 .../cmake/ProcessTestsConfigure.cmake           |  8 ++---
 5 files changed, 60 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/51fc7733/3rdparty/libprocess/3rdparty/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/CMakeLists.txt b/3rdparty/libprocess/3rdparty/CMakeLists.txt
index f0de224..9b61376 100644
--- a/3rdparty/libprocess/3rdparty/CMakeLists.txt
+++ b/3rdparty/libprocess/3rdparty/CMakeLists.txt
@@ -97,9 +97,6 @@ if (NOT WIN32)
   # under the C++11 standard. cf. MESOS-860, MESOS-966.
   PATCH_CMD(${PROCESS_3RD_SRC}/glog-0.3.3.patch GLOG_PATCH_CMD)
 
-  set(RY_BUILD_CMD   make -C ${HTTP_PARSER_ROOT})
-  set(RY_INSTALL_CMD ar -rv libhttp_parser.a ${HTTP_PARSER_ROOT}/http_parser_g.o)
-
   # 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)
@@ -119,14 +116,13 @@ elseif (WIN32)
       ${CMAKE_BUILD_TYPE}
       "libglog")
 
-  set(RY_BUILD_CMD   ${CMAKE_NOOP})
-  set(RY_INSTALL_CMD ${CMAKE_NOOP})
-
   set(LIBEVENT_INSTALL_CMD ${CMAKE_NOOP})
 
   set(LIBAPR_INSTALL_CMD ${CMAKE_NOOP})
 endif (NOT WIN32)
 
+set(RY_UPDATE_CMD ${CMAKE_COMMAND} -E copy ${PROCESS_3RD_SRC}/http-parser/CMakeLists.txt.template ${HTTP_PARSER_ROOT}/CMakeLists.txt)
+
 # Third-party libraries. Tell the build system how to pull in and build third-
 # party libraries at compile time, using the ExternalProject_Add macro.
 ##############################################################################
@@ -162,9 +158,8 @@ ExternalProject_Add(
 ExternalProject_Add(
   ${HTTP_PARSER_TARGET}
   PREFIX            ${HTTP_PARSER_CMAKE_ROOT}
-  CONFIGURE_COMMAND ${CMAKE_NOOP}
-  BUILD_COMMAND     ${RY_BUILD_CMD}
-  INSTALL_COMMAND   ${RY_INSTALL_CMD}
+  UPDATE_COMMAND    ${RY_UPDATE_CMD}
+  INSTALL_COMMAND   ${CMAKE_NOOP}
   URL               ${HTTP_PARSER_URL}
   )
 
@@ -236,12 +231,6 @@ endif (WIN32)
 if (NOT WIN32)
   set(GMOCK_INSTALL_CMD mkdir -p ${GMOCK_ROOT}-lib/lib && cp -r ${GMOCK_ROOT}-build/. ${GMOCK_ROOT}-lib/lib && cp -r ${GMOCK_ROOT}-build/gtest/. ${GMOCK_ROOT}-lib/lib)
 elseif (WIN32)
-  set(GMOCK_CONFIG_CMD ${CMAKE_NOOP})
-  VS_BUILD_CMD(
-      GMOCK
-      ${GMOCK_ROOT}/msvc/2010/gmock.sln
-      ${CMAKE_BUILD_TYPE}
-      "gmock gmock_main")
   set(GMOCK_INSTALL_CMD ${CMAKE_NOOP})
 endif (NOT WIN32)
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/51fc7733/3rdparty/libprocess/3rdparty/http-parser/CMakeLists.txt.template
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/http-parser/CMakeLists.txt.template b/3rdparty/libprocess/3rdparty/http-parser/CMakeLists.txt.template
new file mode 100644
index 0000000..bf2aa38
--- /dev/null
+++ b/3rdparty/libprocess/3rdparty/http-parser/CMakeLists.txt.template
@@ -0,0 +1,34 @@
+# 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.
+
+# Builds Ryan Dahl's http-parser project.
+#########################################
+# NOTE: at build time, this file will be copied into the directory of the
+# http-parser project. This will allow any CMake-based build system consuming
+# the process library to trivially build this dependency and link to it.
+cmake_minimum_required(VERSION 2.8)
+
+project(http-parser)
+
+include_directories(.)
+
+set(HTTP_PARSER_SRC
+  ${HTTP_PARSER_SRC}
+  http_parser.c
+  http_parser.h
+  )
+
+add_library(http_parser ${HTTP_PARSER_SRC})

http://git-wip-us.apache.org/repos/asf/mesos/blob/51fc7733/3rdparty/libprocess/cmake/Process3rdpartyConfigure.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/cmake/Process3rdpartyConfigure.cmake b/3rdparty/libprocess/cmake/Process3rdpartyConfigure.cmake
index 577aac8..a9cd990 100644
--- a/3rdparty/libprocess/cmake/Process3rdpartyConfigure.cmake
+++ b/3rdparty/libprocess/cmake/Process3rdpartyConfigure.cmake
@@ -70,14 +70,15 @@ endif (WIN32)
 # Convenience variables for `lib` directories of built third-party dependencies.
 set(HTTP_PARSER_LIB_DIR ${HTTP_PARSER_ROOT}-build)
 set(LIBEV_LIB_DIR       ${LIBEV_ROOT}-build/.libs)
-set(LIBEVENT_LIB_DIR    ${LIBEVENT_LIB_ROOT}/lib)
 
 if (WIN32)
   set(CURL_LIB_DIR     ${CURL_ROOT}/lib)
   set(GLOG_LIB_DIR     ${GLOG_ROOT}/${CMAKE_BUILD_TYPE})
+  set(LIBEVENT_LIB_DIR ${LIBEVENT_ROOT}-build/lib)
   set(PROTOBUF_LIB_DIR ${PROTOBUF_ROOT}/vsprojects/${CMAKE_BUILD_TYPE})
 else (WIN32)
   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 (WIN32)
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/51fc7733/3rdparty/libprocess/cmake/ProcessConfigure.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/cmake/ProcessConfigure.cmake b/3rdparty/libprocess/cmake/ProcessConfigure.cmake
index 60108ff..2a37fdb 100755
--- a/3rdparty/libprocess/cmake/ProcessConfigure.cmake
+++ b/3rdparty/libprocess/cmake/ProcessConfigure.cmake
@@ -62,6 +62,10 @@ elseif (ENABLE_LIBEVENT)
   set(PROCESS_DEPENDENCIES ${PROCESS_DEPENDENCIES} ${LIBEVENT_TARGET})
 endif (NOT ENABLE_LIBEVENT)
 
+if (WIN32)
+  set(PROCESS_DEPENDENCIES ${PROCESS_DEPENDENCIES} ${CURL_TARGET})
+endif (WIN32)
+
 # 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).
 ###############################################################################
@@ -85,6 +89,10 @@ if (HAS_GPERFTOOLS)
   set(PROCESS_INCLUDE_DIRS ${PROCESS_INCLUDE_DIRS} ${GPERFTOOLS_INCLUDE_DIR})
 endif (HAS_GPERFTOOLS)
 
+if (WIN32)
+  set(PROCESS_INCLUDE_DIRS ${PROCESS_INCLUDE_DIRS} ${CURL_INCLUDE_DIR})
+endif (WIN32)
+
 # 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).
@@ -101,6 +109,10 @@ elseif (ENABLE_LIBEVENT)
   set(PROCESS_LIB_DIRS ${PROCESS_LIB_DIRS} ${LIBEVENT_LIB_DIR})
 endif (NOT ENABLE_LIBEVENT)
 
+if (WIN32)
+  set(PROCESS_LIB_DIRS ${PROCESS_LIB_DIRS} ${CURL_LIB_DIR})
+endif (WIN32)
+
 
 # Define third-party libs. Used to generate flags that the linker uses to
 # include our third-party libs (e.g., -lglog on Linux).
@@ -121,7 +133,9 @@ elseif (ENABLE_LIBEVENT)
   set(PROCESS_LIBS ${PROCESS_LIBS} ${LIBEVENT_LFLAG})
 endif (NOT ENABLE_LIBEVENT)
 
-if (NOT WIN32)
+if (WIN32)
+  set(PROCESS_LIBS ${PROCESS_LIBS} ${CURL_LFLAG})
+elseif (NOT WIN32)
   find_package(ZLIB REQUIRED)
 
   # TODO(hausdorff): (MESOS-3396) The `LINUX` flag comes from MesosConfigure;
@@ -136,4 +150,4 @@ if (NOT WIN32)
     ${PROCESS_LIBS}
     ${ZLIB_LIBRARIES}
     )
-endif (NOT WIN32)
+endif (WIN32)

http://git-wip-us.apache.org/repos/asf/mesos/blob/51fc7733/3rdparty/libprocess/cmake/ProcessTestsConfigure.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/cmake/ProcessTestsConfigure.cmake b/3rdparty/libprocess/cmake/ProcessTestsConfigure.cmake
index d60bce2..6eda46b 100644
--- a/3rdparty/libprocess/cmake/ProcessTestsConfigure.cmake
+++ b/3rdparty/libprocess/cmake/ProcessTestsConfigure.cmake
@@ -48,12 +48,12 @@ set(GMOCK_INCLUDE_DIR ${GMOCK_ROOT}/include)
 set(GTEST_INCLUDE_DIR ${GTEST_SRC}/include)
 
 # Convenience variables for `lib` directories of built third-party dependencies.
-set(GTEST_LIB_DIR ${GMOCK_ROOT}-build/gtest/lib/.libs)
-
 if (WIN32)
-  set(GMOCK_LIB_DIR    ${GMOCK_ROOT}/msvc/2010/Debug)
+  set(GMOCK_LIB_DIR ${GMOCK_ROOT}/msvc/2010/Debug)
+  set(GTEST_LIB_DIR ${GMOCK_ROOT}-build/gtest/Debug)
 else (WIN32)
-  set(GMOCK_LIB_DIR    ${GMOCK_ROOT}-lib/lib/)
+  set(GMOCK_LIB_DIR ${GMOCK_ROOT}-lib/lib/)
+  set(GTEST_LIB_DIR ${GMOCK_ROOT}-build/gtest/lib/.libs)
 endif (WIN32)
 
 # Convenience variables for "lflags", the symbols we pass to CMake to generate