You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by as...@apache.org on 2020/05/28 14:34:35 UTC

[mesos] branch master updated (b7c3da5 -> 40efbc8)

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

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


    from b7c3da5  Added a test `ROOT_CommandTaskNoRootfsWithUnmountVolumeFailure`.
     new 8400df8  Introduced install target into cmake build.
     new 6330a75  Added documentation for the cmake install target.
     new 4d4fdea  Added install target into libprocess cmake build.
     new bc8556b  Added tests to cmake install target.
     new ba18d78  Added documentation for installing mesos-tests.
     new 40efbc8  Added Web UI install target.

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


Summary of changes:
 3rdparty/CMakeLists.txt                            |  58 ++++++++++-
 3rdparty/libprocess/src/CMakeLists.txt             |   6 ++
 cmake/CompilationConfigure.cmake                   | 108 +++++++++++++++++----
 docs/cmake.md                                      |  33 +++++++
 docs/configuration/cmake.md                        |  22 +++++
 src/CMakeLists.txt                                 |  13 +++
 src/checks/CMakeLists.txt                          |   3 +
 src/cli/CMakeLists.txt                             |   4 +
 src/examples/CMakeLists.txt                        |  82 ++++++++++------
 src/java/CMakeLists.txt                            |  14 +++
 src/launcher/CMakeLists.txt                        |   8 ++
 src/local/CMakeLists.txt                           |   4 +
 src/log/CMakeLists.txt                             |   3 +
 src/master/CMakeLists.txt                          |   4 +
 src/resource_provider/storage/CMakeLists.txt       |   5 +
 src/slave/CMakeLists.txt                           |   1 +
 src/slave/container_loggers/CMakeLists.txt         |  10 ++
 src/slave/containerizer/mesos/CMakeLists.txt       |  10 ++
 src/slave/qos_controllers/CMakeLists.txt           |   5 +
 src/slave/resource_estimators/CMakeLists.txt       |   5 +
 src/tests/CMakeLists.txt                           |  21 +++-
 .../agent_resource_provider_config_api_tests.cpp   |   2 +-
 src/tests/default_executor_tests.cpp               |   4 +-
 .../storage_local_resource_provider_tests.cpp      |   2 +-
 src/usage/CMakeLists.txt                           |   3 +
 25 files changed, 370 insertions(+), 60 deletions(-)


[mesos] 01/06: Introduced install target into cmake build.

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 8400df8d2ae1bcae632ae6729f6f0f6fc7d58904
Author: Andrei Sekretenko <as...@apache.org>
AuthorDate: Sun Apr 19 00:35:54 2020 +0200

    Introduced install target into cmake build.
    
    Review: https://reviews.apache.org/r/72492
---
 3rdparty/CMakeLists.txt                      |  58 ++++++++++++++-
 cmake/CompilationConfigure.cmake             | 101 ++++++++++++++++++++++-----
 src/CMakeLists.txt                           |   9 +++
 src/checks/CMakeLists.txt                    |   3 +
 src/cli/CMakeLists.txt                       |   4 ++
 src/java/CMakeLists.txt                      |  14 ++++
 src/launcher/CMakeLists.txt                  |   8 +++
 src/local/CMakeLists.txt                     |   4 ++
 src/log/CMakeLists.txt                       |   3 +
 src/master/CMakeLists.txt                    |   4 ++
 src/resource_provider/storage/CMakeLists.txt |   5 ++
 src/slave/CMakeLists.txt                     |   1 +
 src/slave/container_loggers/CMakeLists.txt   |  10 +++
 src/slave/containerizer/mesos/CMakeLists.txt |  10 +++
 src/slave/qos_controllers/CMakeLists.txt     |   5 ++
 src/slave/resource_estimators/CMakeLists.txt |   5 ++
 src/usage/CMakeLists.txt                     |   3 +
 17 files changed, 226 insertions(+), 21 deletions(-)

diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
index 7b84f12..a2e6549 100644
--- a/3rdparty/CMakeLists.txt
+++ b/3rdparty/CMakeLists.txt
@@ -99,6 +99,15 @@ else ()
   set(LIBRARY_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX})
 endif ()
 
+if (WIN32 AND BUILD_SHARED_LIBS)
+  set(3RDPARTY_LIBS_INSTALL_DIR ${MESOS_INSTALL_RUNTIME})
+else()
+  set(3RDPARTY_LIBS_INSTALL_DIR ${MESOS_INSTALL_LIBRARIES})
+endif()
+
+set(LIBPROCESS_INSTALL_RUNTIME ${MESOS_INSTALL_RUNTIME})
+set(LIBPROCESS_INSTALL_LIBRARIES ${MESOS_INSTALL_LIBRARIES})
+
 # Sets a variable CMAKE_NOOP as noop operation.
 #
 # NOTE: This is especially important when building third-party libraries on
@@ -281,6 +290,8 @@ if (WIN32)
     INSTALL_COMMAND   ${CMAKE_NOOP}
     URL               ${SASL2_URL}
     URL_HASH          ${SASL2_HASH})
+
+  install(FILES $<TARGET_FILE:sasl2> DESTINATION ${3RDPARTY_LIBS_INSTALL_DIR})
 else ()
   find_library(SASL2_LIB sasl2)
 
@@ -443,6 +454,17 @@ ExternalProject_Add(
   URL               ${GLOG_URL}
   URL_HASH          ${GLOG_HASH})
 
+if (WIN32 AND BUILD_SHARED_LIBS)
+  # NOTE: glog's install step places DLLs into ${GLOG_INSTALL_DIR}/bin .
+  install(
+    DIRECTORY ${GLOG_INSTALL_DIR}/bin/
+    DESTINATION ${MESOS_INSTALL_RUNTIME})
+endif()
+
+install(
+  DIRECTORY ${GLOG_INSTALL_DIR}/lib/
+  DESTINATION ${MESOS_INSTALL_LIBRARIES})
+
 
 # PicoJSON: JSON parser / serializer.
 # https://github.com/kazuho/picojson
@@ -626,6 +648,11 @@ if (ENABLE_LIBEVENT)
       INSTALL_COMMAND   ${CMAKE_NOOP}
       URL               ${LIBEVENT_URL}
       URL_HASH          ${LIBEVENT_HASH})
+
+    install(
+      FILES $<TARGET_FILE:libevent>
+      DESTINATION ${3RDPARTY_LIBS_INSTALL_DIR})
+
   else ()
     find_package(LIBEVENT REQUIRED)
     add_library(libevent INTERFACE)
@@ -668,6 +695,10 @@ elseif (NOT WIN32) # Windows defaults to `libwinio`, a native implementation.
     INSTALL_COMMAND   ${MAKE_PROGRAM} install
     URL               ${LIBEV_URL}
     URL_HASH          ${LIBEV_HASH})
+
+  install(
+    DIRECTORY ${LIBEV_ROOT}-build/lib/
+    DESTINATION ${3RDPARTY_LIBS_INSTALL_DIR})
 endif ()
 
 
@@ -700,6 +731,11 @@ if (ENABLE_SECCOMP_ISOLATOR)
       INSTALL_COMMAND   ${CMAKE_NOOP}
       URL               ${LIBSECCOMP_URL}
       URL_HASH          ${LIBSECCOMP_HASH})
+
+    install(
+      FILES $<TARGET_FILE:libseccomp>
+      DESTINATION ${3RDPARTY_LIBS_INSTALL_DIR})
+
   else ()
     find_package(LIBSECCOMP REQUIRED)
     add_library(libseccomp SHARED IMPORTED GLOBAL)
@@ -746,6 +782,8 @@ if (WIN32)
     INSTALL_COMMAND   ${CMAKE_NOOP}
     URL               ${LIBAPR_URL}
     URL_HASH          ${LIBAPR_HASH})
+
+  install(FILES $<TARGET_FILE:apr> DESTINATION ${3RDPARTY_LIBS_INSTALL_DIR})
 else ()
   find_package(APR REQUIRED)
   add_library(apr SHARED IMPORTED)
@@ -859,12 +897,14 @@ if (WIN32)
 
   # This copies the file `curl.exe` from the `3rdparty` build folder to
   # `build/src`, next to the other produced executables. This is necessary for
-  # code that shells out to cURL on Windows.
-  #
-  # TODO(andschwa): Change this to an `INSTALL` step.
+  # code that shells out to cURL on Windows (in particular, for running Mesos
+  # tests without running cmake install).
   ExternalProject_Add_Step(${CURL_TARGET} copy
     COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:curl> ${CMAKE_BINARY_DIR}/src/curl.exe
     DEPENDEES build)
+
+  install(FILES $<TARGET_FILE:libcurl> DESTINATION ${3RDPARTY_LIBS_INSTALL_DIR})
+  install(FILES $<TARGET_FILE:curl> DESTINATION ${MESOS_INSTALL_RUNTIME})
 else ()
   if ("${CURL_ROOT_DIR}" STREQUAL "")
     find_package(CURL REQUIRED)
@@ -917,6 +957,8 @@ if (WIN32)
     INSTALL_COMMAND     ${WCLAYER_INSTALL_CMD}
     DOWNLOAD_NO_EXTRACT FALSE
     URL                 ${WCLAYER_URL})
+
+  install(FILES $<TARGET_FILE:wclayer> DESTINATION ${MESOS_INSTALL_RUNTIME})
 endif ()
 
 # bzip2: A high-quality data compressor.
@@ -963,6 +1005,8 @@ if (WIN32)
     INSTALL_DIR       ${BZIP2_ROOT}-lib
     URL               ${BZIP2_URL}
     URL_HASH          ${BZIP2_HASH})
+
+  install(FILES $<TARGET_FILE:bzip2> DESTINATION ${3RDPARTY_LIBS_INSTALL_DIR})
 endif ()
 
 # xz: A Massively Spiffy Yet Delicately Unobtrusive Compression Library.
@@ -1070,6 +1114,8 @@ if (WIN32)
     INSTALL_DIR       ${ZLIB_ROOT}-lib
     URL               ${ZLIB_URL}
     URL_HASH          ${ZLIB_HASH})
+
+  install(FILES $<TARGET_FILE:zlib> DESTINATION ${3RDPARTY_LIBS_INSTALL_DIR})
 else ()
   find_package(ZLIB REQUIRED)
   add_library(zlib SHARED IMPORTED)
@@ -1342,6 +1388,7 @@ ExternalProject_Add(
   URL               ${PROTOBUF_URL}
   URL_HASH          ${PROTOBUF_HASH})
 
+install(FILES $<TARGET_FILE:protobuf> DESTINATION ${3RDPARTY_LIBS_INSTALL_DIR})
 
 # gRPC: Google's high performance, open-source universal RPC framework.
 # https://grpc.io/
@@ -1475,6 +1522,11 @@ ExternalProject_Add(
   URL              ${GRPC_URL}
   URL_HASH         ${GRPC_HASH})
 
+install(
+  FILES $<TARGET_FILE:libgpr> $<TARGET_FILE:libgrpc> $<TARGET_FILE:libgrpc++>
+  DESTINATION ${3RDPARTY_LIBS_INSTALL_DIR})
+
+
 
 # Jemalloc: General-purpose malloc implementation.
 # http://jemalloc.net
diff --git a/cmake/CompilationConfigure.cmake b/cmake/CompilationConfigure.cmake
index af1a8b5..d29c427 100644
--- a/cmake/CompilationConfigure.cmake
+++ b/cmake/CompilationConfigure.cmake
@@ -66,6 +66,14 @@ if (CMAKE_GENERATOR MATCHES "Visual Studio")
   endif ()
 endif ()
 
+set(
+  MESOS_FINAL_PREFIX
+  ${CMAKE_INSTALL_PREFIX}
+  CACHE STRING
+  "Adjust built-in paths (rpath in shared objects, default paths in Mesos flags
+   and so on) so that cmake install output works after being copied into this prefix.
+   This is typically used by package managers that use different prefixes on a build
+   system and on a target system.")
 
 # 3RDPARTY OPTIONS.
 ###################
@@ -390,15 +398,46 @@ if (NOT WIN32)
     add_compile_options(-fno-omit-frame-pointer)
   endif ()
 
-  # Directory structure for some build artifacts.
-  # This is defined for use in tests.
-  set(EXEC_INSTALL_PREFIX  ${CMAKE_INSTALL_PREFIX})
-  set(SHARE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/share)
-  set(DATA_INSTALL_PREFIX  ${SHARE_INSTALL_PREFIX}/mesos)
+  # Install layout definitions used in cmake install targets.
+  # These are relative to ${CMAKE_INSTALL_PREFIX}.
+  #
+  # NOTE: Windows and POSIX configurations have to define the same variables,
+  # but the layout is different!
+  set(MESOS_INSTALL_LAUNCHER  libexec/mesos) # launcher executables
+  set(MESOS_INSTALL_RUNTIME   bin)           # all other executables
+  set(MESOS_INSTALL_LIBRARIES lib)           # static and shared libraries
+  set(MESOS_INSTALL_HEADERS   include)       # headers
+  set(MESOS_INSTALL_DATA      share/mesos)   # data (webui, etc.)
+
+  # File layout definitions that are used in the sources
+  # (for setting up installed tests and default values of flags).
+  #
+  # NOTE: If ${MESOS_FINAL_PREFIX} is set to a non-default value
+  # (i.e. differs from ${CMAKE_INSTALL_PREFIX}), cmake install output
+  # will only work after copying to ${MESOS_FINAL_PREFIX}.
+
+  # - Path for data (webui, etc.).
+  set(DATA_INSTALL_PREFIX  ${MESOS_FINAL_PREFIX}/${MESOS_INSTALL_DATA})
+
+  # - Path to launcher binaries.
+  set(PKG_LIBEXEC_INSTALL_DIR ${MESOS_FINAL_PREFIX}/${MESOS_INSTALL_LAUNCHER})
+
+  # - Path to libmesos shared object.
+  set(LIB_INSTALL_DIR ${MESOS_FINAL_PREFIX}/${MESOS_INSTALL_LIBRARIES})
+
+  # - Path to modules, including test modules.
+  set(PKG_MODULE_DIR ${MESOS_FINAL_PREFIX}/${MESOS_INSTALL_LIBRARIES})
+
+  # - Path to test-helper and (in the future) test scripts.
+  #   TODO(asekretenko): Either port script tests to cmake or drop them.
+  set(TEST_LIB_EXEC_DIR ${MESOS_FINAL_PREFIX}/${MESOS_INSTALL_RUNTIME})
 
-  set(LIBEXEC_INSTALL_DIR     ${EXEC_INSTALL_PREFIX}/libexec)
-  set(PKG_LIBEXEC_INSTALL_DIR ${LIBEXEC_INSTALL_DIR}/mesos)
-  set(LIB_INSTALL_DIR         ${EXEC_INSTALL_PREFIX}/libmesos)
+  # - Path to Mesos binaries, used in tests.
+  set(S_BIN_DIR ${MESOS_FINAL_PREFIX}/${MESOS_INSTALL_RUNTIME})
+
+  # We add an RPATH pointing to the planned shared libraries location.
+  set(CMAKE_INSTALL_RPATH
+    "${CMAKE_INSTALL_RPATH};${MESOS_FINAL_PREFIX}/${MESOS_INSTALL_LIBRARIES}")
 endif ()
 
 option(ENABLE_GC_UNUSED
@@ -565,16 +604,42 @@ if (WIN32)
     -D_CRT_SECURE_NO_WARNINGS
     -D_CRT_NONSTDC_NO_WARNINGS)
 
-  # Directory structure definitions.
-  # TODO(hausdorff): (MESOS-5455) These are placeholder values.
-  # Transition away from them.
-  set(EXEC_INSTALL_PREFIX     "WARNINGDONOTUSEME")
-  set(LIBEXEC_INSTALL_DIR     "WARNINGDONOTUSEME")
-  set(PKG_LIBEXEC_INSTALL_DIR "WARNINGDONOTUSEME")
-  set(LIB_INSTALL_DIR         "WARNINGDONOTUSEME")
-  set(TEST_LIB_EXEC_DIR       "WARNINGDONOTUSEME")
-  set(PKG_MODULE_DIR          "WARNINGDONOTUSEME")
-  set(S_BIN_DIR               "WARNINGDONOTUSEME")
+  # Install layout definitions used in cmake install targets.
+  # These are relative to ${CMAKE_INSTALL_PREFIX}.
+  #
+  # NOTE: Windows and POSIX configurations have to define the same variables,
+  # but the layout is different!
+  set(MESOS_INSTALL_RUNTIME   bin)           # all executables and DLLs
+  set(MESOS_INSTALL_LAUNCHER  ${MESOS_INSTALL_RUNTIME})
+  set(MESOS_INSTALL_LIBRARIES lib)           # static libraries
+  set(MESOS_INSTALL_HEADERS   include)       # headers
+  set(MESOS_INSTALL_DATA      share/mesos)   # data (webui, etc.)
+
+  # File layout definitions that are used in the sources
+  # (for setting up installed tests and default values of flags).
+  #
+  # NOTE: If ${MESOS_FINAL_PREFIX} is set to a non-default value
+  # (i.e. differs from ${CMAKE_INSTALL_PREFIX}), cmake install output
+  # will only work after copying to ${MESOS_FINAL_PREFIX}.
+
+  #  - Path for data (webui, etc.)
+  set(DATA_INSTALL_PREFIX  ${MESOS_FINAL_PREFIX}/${MESOS_INSTALL_DATA})
+
+  # - Path to launcher binaries
+  set(PKG_LIBEXEC_INSTALL_DIR ${MESOS_FINAL_PREFIX}/${MESOS_INSTALL_RUNTIME})
+
+  # - Path to libmesos shared object
+  set(LIB_INSTALL_DIR ${MESOS_FINAL_PREFIX}/${MESOS_INSTALL_RUNTIME})
+
+  # - Path to modules, including test modules
+  set(PKG_MODULE_DIR ${MESOS_FINAL_PREFIX}/${MESOS_INSTALL_RUNTIME})
+
+  # - Path to test-helper and (in the future) test scripts.
+  #   TODO(asekretenko): Either port script tests to Windows or drop them.
+  set(TEST_LIB_EXEC_DIR ${MESOS_FINAL_PREFIX}/${MESOS_INSTALL_RUNTIME})
+
+  # - Path to Mesos binaries, used in tests
+  set(S_BIN_DIR ${MESOS_FINAL_PREFIX}/${MESOS_INSTALL_RUNTIME})
 endif ()
 
 
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 810acbf..a43142f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -668,6 +668,15 @@ if (NOT WIN32)
 endif()
 
 
+install(
+  TARGETS
+    mesos-protobufs
+    mesos
+  RUNTIME DESTINATION ${MESOS_INSTALL_RUNTIME}
+  ARCHIVE DESTINATION ${MESOS_INSTALL_LIBRARIES}
+  LIBRARY DESTINATION ${MESOS_INSTALL_LIBRARIES})
+
+
 # BUILD THE MESOS TESTS.
 ########################
 add_subdirectory(tests)
diff --git a/src/checks/CMakeLists.txt b/src/checks/CMakeLists.txt
index a3a6aed..518b45a 100644
--- a/src/checks/CMakeLists.txt
+++ b/src/checks/CMakeLists.txt
@@ -18,3 +18,6 @@
 ###################################
 add_executable(mesos-tcp-connect tcp_connect.cpp)
 target_link_libraries(mesos-tcp-connect PRIVATE mesos)
+install(
+  TARGETS mesos-tcp-connect
+  RUNTIME DESTINATION ${MESOS_INSTALL_LAUNCHER})
diff --git a/src/cli/CMakeLists.txt b/src/cli/CMakeLists.txt
index e99b055..2c7310a 100644
--- a/src/cli/CMakeLists.txt
+++ b/src/cli/CMakeLists.txt
@@ -26,6 +26,10 @@ target_link_libraries(mesos-execute PRIVATE mesos)
 add_executable(mesos-resolve resolve.cpp)
 target_link_libraries(mesos-resolve PRIVATE mesos)
 
+install(
+  TARGETS mesos-execute mesos-resolve
+  RUNTIME DESTINATION ${MESOS_INSTALL_RUNTIME})
+
 # MESOS CLI.
 # Soon to be deprecated old version of the Mesos CLI.
 #####################################################
diff --git a/src/java/CMakeLists.txt b/src/java/CMakeLists.txt
index 81eb9b5..0777035 100644
--- a/src/java/CMakeLists.txt
+++ b/src/java/CMakeLists.txt
@@ -11,6 +11,7 @@
 #       impossible to use.
 set(MESOS_JAR ${CMAKE_CURRENT_BINARY_DIR}/target/mesos-${MESOS_PACKAGE_VERSION}.jar)
 set(PROTOBUF_JAR ${CMAKE_CURRENT_BINARY_DIR}/target/dependency/protobuf-java-${PROTOBUF_VERSION}.jar)
+set(MESOS_SHADED_PROTOBUF_JAR  ${CMAKE_CURRENT_BINARY_DIR}/target/mesos-${PACKAGE_VERSION}-shaded-protobuf.jar)
 
 # This file is generated into the build tree.
 set(MESOS_JAVA_LIBRARY generated/org/apache/mesos/MesosNativeLibrary.java)
@@ -128,3 +129,16 @@ target_include_directories(
   ${JNI_INCLUDE_DIRS}
   ${CMAKE_CURRENT_BINARY_DIR}/jni
   ${MESOS_PUBLIC_INCLUDE_DIR})
+
+install(
+  TARGETS mesos-java
+  RUNTIME DESTINATION ${MESOS_INSTALL_RUNTIME}
+  LIBRARY DESTINATION ${MESOS_INSTALL_LIBRARIES}
+  ARCHIVE DESTINATION ${MESOS_INSTALL_LIBRARIES})
+
+# NOTE: Currently, the automake build installs Java packages differently.
+# Namely, `make install` doesn't install Java packages at all, and
+# `make maven-install` calls `mvn install` for package installation.
+install(
+  FILES ${MESOS_JAR} ${MESOS_SHADED_PROTOBUF_JAR}
+  DESTINATION ${MESOS_INSTALL_LIBRARIES})
diff --git a/src/launcher/CMakeLists.txt b/src/launcher/CMakeLists.txt
index 73587f4..9e6bb16 100644
--- a/src/launcher/CMakeLists.txt
+++ b/src/launcher/CMakeLists.txt
@@ -29,3 +29,11 @@ target_link_libraries(mesos-fetcher PRIVATE mesos)
 #################################
 add_executable(mesos-docker-executor docker_executor.cpp)
 target_link_libraries(mesos-docker-executor PRIVATE mesos)
+
+install(
+  TARGETS
+    mesos-default-executor
+    mesos-executor
+    mesos-fetcher
+    mesos-docker-executor
+  RUNTIME DESTINATION ${MESOS_INSTALL_LAUNCHER})
diff --git a/src/local/CMakeLists.txt b/src/local/CMakeLists.txt
index 7be3ede..fce43b4 100644
--- a/src/local/CMakeLists.txt
+++ b/src/local/CMakeLists.txt
@@ -22,4 +22,8 @@ if (NOT WIN32)
   add_executable(mesos-local main.cpp)
   target_link_libraries(mesos-local PRIVATE mesos)
   add_dependencies(mesos-local mesos-agent mesos-master)
+
+  install(
+    TARGETS mesos-local
+    RUNTIME DESTINATION ${MESOS_INSTALL_RUNTIME})
 endif ()
diff --git a/src/log/CMakeLists.txt b/src/log/CMakeLists.txt
index 1c94470..994d24f 100644
--- a/src/log/CMakeLists.txt
+++ b/src/log/CMakeLists.txt
@@ -21,4 +21,7 @@ if (NOT WIN32)
   ###################################################
   add_executable(mesos-log main.cpp)
   target_link_libraries(mesos-log PRIVATE mesos)
+  install(
+    TARGETS mesos-log
+    RUNTIME DESTINATION ${MESOS_INSTALL_RUNTIME})
 endif ()
diff --git a/src/master/CMakeLists.txt b/src/master/CMakeLists.txt
index f4b15b5..bb595c3 100644
--- a/src/master/CMakeLists.txt
+++ b/src/master/CMakeLists.txt
@@ -21,3 +21,7 @@ target_link_libraries(mesos-master PRIVATE mesos)
 if (ENABLE_JEMALLOC_ALLOCATOR)
   target_link_libraries(mesos-master PRIVATE jemalloc)
 endif ()
+
+install(
+  TARGETS mesos-master
+  RUNTIME DESTINATION ${MESOS_INSTALL_RUNTIME})
diff --git a/src/resource_provider/storage/CMakeLists.txt b/src/resource_provider/storage/CMakeLists.txt
index 90fdd61..d1fb95d 100644
--- a/src/resource_provider/storage/CMakeLists.txt
+++ b/src/resource_provider/storage/CMakeLists.txt
@@ -19,3 +19,8 @@
 # NOTE: This library uses underscores to be consistent with other modules.
 add_library(uri_disk_profile_adaptor uri_disk_profile_adaptor.cpp)
 target_link_libraries(uri_disk_profile_adaptor PRIVATE mesos)
+install(
+  TARGETS uri_disk_profile_adaptor
+  RUNTIME DESTINATION ${MESOS_INSTALL_RUNTIME}
+  LIBRARY DESTINATION ${MESOS_INSTALL_LIBRARIES}
+  ARCHIVE DESTINATION ${MESOS_INSTALL_LIBRARIES})
diff --git a/src/slave/CMakeLists.txt b/src/slave/CMakeLists.txt
index f42a4a6..4264b90 100644
--- a/src/slave/CMakeLists.txt
+++ b/src/slave/CMakeLists.txt
@@ -23,6 +23,7 @@ add_subdirectory(resource_estimators)
 #######################
 add_executable(mesos-agent main.cpp)
 target_link_libraries(mesos-agent PRIVATE mesos)
+install(TARGETS mesos-agent RUNTIME DESTINATION ${MESOS_INSTALL_RUNTIME})
 
 if (ENABLE_JEMALLOC_ALLOCATOR)
   target_link_libraries(mesos-agent PRIVATE jemalloc)
diff --git a/src/slave/container_loggers/CMakeLists.txt b/src/slave/container_loggers/CMakeLists.txt
index b4f79a4..6e08c23 100644
--- a/src/slave/container_loggers/CMakeLists.txt
+++ b/src/slave/container_loggers/CMakeLists.txt
@@ -31,4 +31,14 @@ if (NOT WIN32)
   add_dependencies(
     logrotate_container_logger
     mesos-logrotate-logger)
+
+  install(
+    TARGETS mesos-logrotate-logger
+    RUNTIME DESTINATION ${MESOS_INSTALL_LAUNCHER})
+
+  install(
+    TARGETS logrotate_container_logger
+    RUNTIME DESTINATION ${MESOS_INSTALL_RUNTIME}
+    LIBRARY DESTINATION ${MESOS_INSTALL_LIBRARIES}
+    ARCHIVE DESTINATION ${MESOS_INSTALL_LIBRARIES})
 endif ()
diff --git a/src/slave/containerizer/mesos/CMakeLists.txt b/src/slave/containerizer/mesos/CMakeLists.txt
index 92f4a49..c6fae0f 100644
--- a/src/slave/containerizer/mesos/CMakeLists.txt
+++ b/src/slave/containerizer/mesos/CMakeLists.txt
@@ -18,6 +18,9 @@
 ###############################
 add_executable(mesos-containerizer main.cpp)
 target_link_libraries(mesos-containerizer PRIVATE mesos)
+install(
+  TARGETS mesos-containerizer
+  RUNTIME DESTINATION ${MESOS_INSTALL_LAUNCHER})
 
 if (NOT WIN32)
   add_executable(mesos-io-switchboard io/switchboard_main.cpp)
@@ -29,9 +32,16 @@ if (NOT WIN32)
     isolators/network/cni/plugins/port_mapper/port_mapper.cpp)
 
   target_link_libraries(mesos-cni-port-mapper PRIVATE mesos)
+
+  install(
+    TARGETS mesos-io-switchboard mesos-cni-port-mapper
+    RUNTIME DESTINATION ${MESOS_INSTALL_LAUNCHER})
 endif ()
 
 if (ENABLE_PORT_MAPPING_ISOLATOR)
   add_executable(mesos-network-helper isolators/network/helper.cpp)
   target_link_libraries(mesos-network-helper PRIVATE mesos)
+  install(
+    TARGETS mesos-network-helper
+    RUNTIME DESTINATION ${MESOS_INSTALL_LAUNCHER})
 endif ()
diff --git a/src/slave/qos_controllers/CMakeLists.txt b/src/slave/qos_controllers/CMakeLists.txt
index ff9cc15..da79eec 100644
--- a/src/slave/qos_controllers/CMakeLists.txt
+++ b/src/slave/qos_controllers/CMakeLists.txt
@@ -19,3 +19,8 @@
 # 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)
+install(
+  TARGETS load_qos_controller
+  RUNTIME DESTINATION ${MESOS_INSTALL_RUNTIME}
+  LIBRARY DESTINATION ${MESOS_INSTALL_LIBRARIES}
+  ARCHIVE DESTINATION ${MESOS_INSTALL_LIBRARIES})
diff --git a/src/slave/resource_estimators/CMakeLists.txt b/src/slave/resource_estimators/CMakeLists.txt
index 6f32421..ddbb094 100644
--- a/src/slave/resource_estimators/CMakeLists.txt
+++ b/src/slave/resource_estimators/CMakeLists.txt
@@ -20,3 +20,8 @@
 # `src/tests/oversubscription_tests.cpp`.
 add_library(fixed_resource_estimator fixed.cpp)
 target_link_libraries(fixed_resource_estimator PRIVATE mesos)
+install(
+  TARGETS fixed_resource_estimator
+  RUNTIME DESTINATION ${MESOS_INSTALL_RUNTIME}
+  LIBRARY DESTINATION ${MESOS_INSTALL_LIBRARIES}
+  ARCHIVE DESTINATION ${MESOS_INSTALL_LIBRARIES})
diff --git a/src/usage/CMakeLists.txt b/src/usage/CMakeLists.txt
index e51fe1e..60dc4a3 100644
--- a/src/usage/CMakeLists.txt
+++ b/src/usage/CMakeLists.txt
@@ -18,3 +18,6 @@
 #######################
 add_executable(mesos-usage main.cpp)
 target_link_libraries(mesos-usage PRIVATE mesos)
+install(
+  TARGETS mesos-usage
+  RUNTIME DESTINATION ${MESOS_INSTALL_LAUNCHER})


[mesos] 03/06: Added install target into libprocess cmake build.

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 4d4fdead6ffafdfdeb16af3569f9ff879fc9f210
Author: Andrei Sekretenko <as...@apache.org>
AuthorDate: Sun Apr 19 00:35:54 2020 +0200

    Added install target into libprocess cmake build.
    
    Review: https://reviews.apache.org/r/72493
---
 3rdparty/libprocess/src/CMakeLists.txt | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/3rdparty/libprocess/src/CMakeLists.txt b/3rdparty/libprocess/src/CMakeLists.txt
index 6fa1f60..ab63606 100644
--- a/3rdparty/libprocess/src/CMakeLists.txt
+++ b/3rdparty/libprocess/src/CMakeLists.txt
@@ -129,3 +129,9 @@ target_compile_definitions(
 
 target_include_directories(process PUBLIC ../include)
 target_include_directories(process PRIVATE .)
+
+install(
+  TARGETS process
+  RUNTIME DESTINATION ${LIBPROCESS_INSTALL_RUNTIME}
+  LIBRARY DESTINATION ${LIBPROCESS_INSTALL_LIBRARIES}
+  ARCHIVE DESTINATION ${LIBPROCESS_INSTALL_LIBRARIES})


[mesos] 04/06: Added tests to cmake install target.

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit bc8556bf4f4bb3afc4f9f73b093c9fad1c639f70
Author: Andrei Sekretenko <as...@apache.org>
AuthorDate: Thu Apr 23 11:53:57 2020 +0200

    Added tests to cmake install target.
    
    Review: https://reviews.apache.org/r/72494
---
 cmake/CompilationConfigure.cmake                   |  7 ++
 src/examples/CMakeLists.txt                        | 82 +++++++++++++---------
 src/tests/CMakeLists.txt                           | 21 +++++-
 .../agent_resource_provider_config_api_tests.cpp   |  2 +-
 src/tests/default_executor_tests.cpp               |  4 +-
 .../storage_local_resource_provider_tests.cpp      |  2 +-
 6 files changed, 79 insertions(+), 39 deletions(-)

diff --git a/cmake/CompilationConfigure.cmake b/cmake/CompilationConfigure.cmake
index d29c427..f0e712e 100644
--- a/cmake/CompilationConfigure.cmake
+++ b/cmake/CompilationConfigure.cmake
@@ -75,6 +75,13 @@ set(
    This is typically used by package managers that use different prefixes on a build
    system and on a target system.")
 
+# TODO(asekretenko): Consider making Mesos tests a separate project
+# that would depend on Mesos installation.
+option(MESOS_INSTALL_TESTS
+  "Add test executables and their dependencies to the install step."
+  FALSE)
+
+
 # 3RDPARTY OPTIONS.
 ###################
 option(
diff --git a/src/examples/CMakeLists.txt b/src/examples/CMakeLists.txt
index a811a07..b25324b 100644
--- a/src/examples/CMakeLists.txt
+++ b/src/examples/CMakeLists.txt
@@ -14,49 +14,67 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+function(ADD_TEST_MODULE MODULE SOURCES)
+  if (MESOS_INSTALL_TESTS)
+    add_library(${MODULE} SHARED ${SOURCES})
+    install(
+      TARGETS ${MODULE}
+      RUNTIME DESTINATION ${MESOS_INSTALL_RUNTIME}
+      LIBRARY DESTINATION ${MESOS_INSTALL_LIBRARIES})
+  else()
+    add_library(${MODULE} SHARED EXCLUDE_FROM_ALL ${SOURCES})
+  endif()
+endfunction()
+
+function(ADD_TEST_EXECUTABLE EXECUTABLE SOURCES)
+  add_executable(${EXECUTABLE} ${SOURCES})
+  if (MESOS_INSTALL_TESTS)
+    install(TARGETS ${EXECUTABLE} RUNTIME DESTINATION ${MESOS_INSTALL_RUNTIME})
+  endif()
+endfunction()
+
 if (NOT WIN32)
   # 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_TEST_MODULE(testallocator          test_allocator_module.cpp)
+  ADD_TEST_MODULE(testanonymous          test_anonymous_module.cpp)
+  ADD_TEST_MODULE(testauthentication     test_authentication_modules.cpp)
+  ADD_TEST_MODULE(testauthorizer         test_authorizer_module.cpp)
+  ADD_TEST_MODULE(testcontainer_logger   test_container_logger_module.cpp)
+  ADD_TEST_MODULE(examplemodule          example_module_impl.cpp)
+  ADD_TEST_MODULE(testhook               test_hook_module.cpp)
+  ADD_TEST_MODULE(testhttpauthenticator  test_http_authenticator_module.cpp)
+  ADD_TEST_MODULE(testisolator           test_isolator_module.cpp)
+  ADD_TEST_MODULE(testmastercontender    test_master_contender_module.cpp)
+  ADD_TEST_MODULE(testmasterdetector     test_master_detector_module.cpp)
+  ADD_TEST_MODULE(testqos_controller     test_qos_controller_module.cpp)
+  ADD_TEST_MODULE(testresource_estimator test_resource_estimator_module.cpp)
 
   # 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(inverse-offer-framework       inverse_offer_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(operation-feedback-framework  operation_feedback_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)
-  add_executable(test-csi-user-framework       test_csi_user_framework.cpp)
+  ADD_TEST_EXECUTABLE(balloon-executor              balloon_executor.cpp)
+  ADD_TEST_EXECUTABLE(balloon-framework             balloon_framework.cpp)
+  ADD_TEST_EXECUTABLE(disk-full-framework           disk_full_framework.cpp)
+  ADD_TEST_EXECUTABLE(docker-no-executor-framework  docker_no_executor_framework.cpp)
+  ADD_TEST_EXECUTABLE(dynamic-reservation-framework dynamic_reservation_framework.cpp)
+  ADD_TEST_EXECUTABLE(inverse-offer-framework       inverse_offer_framework.cpp)
+  ADD_TEST_EXECUTABLE(load-generator-framework      load_generator_framework.cpp)
+  ADD_TEST_EXECUTABLE(long-lived-executor           long_lived_executor.cpp)
+  ADD_TEST_EXECUTABLE(long-lived-framework          long_lived_framework.cpp)
+  ADD_TEST_EXECUTABLE(operation-feedback-framework  operation_feedback_framework.cpp)
+  ADD_TEST_EXECUTABLE(no-executor-framework         no_executor_framework.cpp)
+  ADD_TEST_EXECUTABLE(persistent-volume-framework   persistent_volume_framework.cpp)
+  ADD_TEST_EXECUTABLE(test-executor                 test_executor.cpp)
+  ADD_TEST_EXECUTABLE(test-framework                test_framework.cpp)
+  ADD_TEST_EXECUTABLE(test-http-executor            test_http_executor.cpp)
+  ADD_TEST_EXECUTABLE(test-http-framework           test_http_framework.cpp)
+  ADD_TEST_EXECUTABLE(test-csi-user-framework       test_csi_user_framework.cpp)
 
   # TODO(chhsiao): The test CSI plugin is Linux only for now.
   if (LINUX)
-    add_executable(test-csi-plugin test_csi_plugin.cpp)
+    ADD_TEST_EXECUTABLE(test-csi-plugin test_csi_plugin.cpp)
   endif ()
 
   # NOTE: Do not replace this with `link_libraries()`. While it may result in
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
index 9d5ce02..cf579f8 100644
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -307,9 +307,15 @@ target_compile_definitions(
   PKGLIBEXECDIR="${PKG_LIBEXEC_INSTALL_DIR}"
   TESTLIBEXECDIR="${TEST_LIB_EXEC_DIR}"
   PKGMODULEDIR="${PKG_MODULE_DIR}"
-  SBINDIR="${S_BIN_DIR}")
+  SBINDIR="${S_BIN_DIR}"
+  MESOS_INSTALL_TESTS=${MESOS_INSTALL_TESTS})
+
+if(MESOS_INSTALL_TESTS)
+  add_executable(mesos-tests ${MESOS_TESTS_SRC})
+else()
+  add_executable(mesos-tests EXCLUDE_FROM_ALL ${MESOS_TESTS_SRC})
+endif()
 
-add_executable(mesos-tests EXCLUDE_FROM_ALL ${MESOS_TESTS_SRC})
 target_link_libraries(mesos-tests PRIVATE mesos-tests-interface)
 
 target_compile_definitions(
@@ -317,7 +323,13 @@ target_compile_definitions(
   $<$<BOOL:${HAS_JAVA}>:MESOS_HAS_JAVA>)
 
 # Helper to run tests that require a subprocess.
-add_executable(test-helper EXCLUDE_FROM_ALL ${TEST_HELPER_SRC})
+if (MESOS_INSTALL_TESTS)
+  add_executable(test-helper ${TEST_HELPER_SRC})
+  install(TARGETS test-helper RUNTIME DESTINATION ${MESOS_INSTALL_RUNTIME})
+else()
+  add_executable(test-helper EXCLUDE_FROM_ALL ${TEST_HELPER_SRC})
+endif()
+
 target_link_libraries(test-helper PRIVATE mesos-tests-interface)
 
 # The tests require these binaries.
@@ -392,6 +404,9 @@ if (NOT WIN32)
   endif ()
 endif ()
 
+if (MESOS_INSTALL_TESTS)
+  install(TARGETS mesos-tests RUNTIME DESTINATION ${MESOS_INSTALL_RUNTIME})
+endif()
 
 # ADD TEST TARGET (runs when you do, e.g., `make check`).
 #########################################################
diff --git a/src/tests/agent_resource_provider_config_api_tests.cpp b/src/tests/agent_resource_provider_config_api_tests.cpp
index aadebd3..ef4bc80 100644
--- a/src/tests/agent_resource_provider_config_api_tests.cpp
+++ b/src/tests/agent_resource_provider_config_api_tests.cpp
@@ -158,7 +158,7 @@ public:
         "local_" + strings::remove(id::UUID::random().toString(), "-");
 
       const string testCsiPluginPath =
-        path::join(tests::flags.build_dir, "src", "test-csi-plugin");
+        path::join(getTestHelperDir(), "test-csi-plugin");
 
       const string testCsiPluginWorkDir =
         path::join(sandbox.get(), testCsiPluginName);
diff --git a/src/tests/default_executor_tests.cpp b/src/tests/default_executor_tests.cpp
index 2353520..0196eb9 100644
--- a/src/tests/default_executor_tests.cpp
+++ b/src/tests/default_executor_tests.cpp
@@ -4457,11 +4457,11 @@ TEST_P(DefaultExecutorTest, DomainSockets)
     {"GLOG_v", os::getenv("GLOG_v").getOrElse("0") },
   };
 
-  Result<std::string> path = os::realpath(BUILD_DIR);
+  Result<std::string> path = os::realpath(getLauncherDir());
   ASSERT_SOME(path);
 
   Try<process::Subprocess> executor = process::subprocess(
-        path::join(path.get(), "src/mesos-default-executor"),
+        path::join(path.get(), "mesos-default-executor"),
         argv,
         process::Subprocess::FD(STDIN_FILENO),
         process::Subprocess::FD(STDOUT_FILENO),
diff --git a/src/tests/storage_local_resource_provider_tests.cpp b/src/tests/storage_local_resource_provider_tests.cpp
index 568683a..75959aa 100644
--- a/src/tests/storage_local_resource_provider_tests.cpp
+++ b/src/tests/storage_local_resource_provider_tests.cpp
@@ -252,7 +252,7 @@ public:
       const Option<Duration>& reconciliationInterval = None())
   {
     const string testCsiPluginPath =
-      path::join(tests::flags.build_dir, "src", "test-csi-plugin");
+      path::join(getTestHelperDir(), "test-csi-plugin");
 
     Try<string> resourceProviderConfig = strings::format(
         R"~(


[mesos] 06/06: Added Web UI install target.

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 40efbc8864c2c76147961910fa005468d70f5dfe
Author: Andrei Sekretenko <as...@apache.org>
AuthorDate: Mon May 11 20:28:02 2020 +0200

    Added Web UI install target.
    
    Review: https://reviews.apache.org/r/72495
---
 src/CMakeLists.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a43142f..e3a702c 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -677,6 +677,10 @@ install(
   LIBRARY DESTINATION ${MESOS_INSTALL_LIBRARIES})
 
 
+install(
+  DIRECTORY webui
+  DESTINATION ${MESOS_INSTALL_DATA})
+
 # BUILD THE MESOS TESTS.
 ########################
 add_subdirectory(tests)


[mesos] 05/06: Added documentation for installing mesos-tests.

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit ba18d7803923a3e8281ff97fbac338c21fa1ddf0
Author: Andrei Sekretenko <as...@apache.org>
AuthorDate: Wed May 20 23:24:30 2020 +0200

    Added documentation for installing mesos-tests.
    
    Review: https://reviews.apache.org/r/72536
---
 docs/cmake.md               | 11 ++++++++++-
 docs/configuration/cmake.md |  9 ++++++++-
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/docs/cmake.md b/docs/cmake.md
index ee5d6dc..60219e5 100644
--- a/docs/cmake.md
+++ b/docs/cmake.md
@@ -65,18 +65,27 @@ cmake -DCMAKE_INSTALL_PREFIX=/home/current_user/mesos
 cmake --build . --target install
 ```
 
+To additionally install `mesos-tests` executable and related test helpers
+(this can be used to run Mesos tests against the installed binaries),
+one can enable the `MESOS_INSTALL_TESTS` option.
+
 To produce a set of binaries and libraries that will work after being
 copied/moved to a different location, use `MESOS_FINAL_PREFIX`.
+
+The example below employs both `MESOS_FINAL_PREFIX` and `MESOS_INSTALL_TESTS`.
 On a build system:
 ```
 mkdir build && cd build
-cmake -DMESOS_FINAL_PREFIX=/opt/mesos -DCMAKE_INSTALL_PREFIX=/home/current_user/mesos
+cmake -DMESOS_FINAL_PREFIX=/opt/mesos -DCMAKE_INSTALL_PREFIX=/home/current_user/mesos -DMESOS_INSTALL_TESTS=ON
 cmake --build . --target install
 tar -czf mesos.tar.gz mesos -C /home/current_user
 ```
 On a target system:
 ```
 sudo tar -xf mesos.tar.gz -C /opt
+# Run tests against Mesos installation
+sudo /opt/mesos/bin/mesos-tests
+# Start Mesos agent
 sudo /opt/mesos/bin/mesos-agent --work-dir=/var/lib/mesos ...
 ```
 
diff --git a/docs/configuration/cmake.md b/docs/configuration/cmake.md
index 08d33dc..c3eb790 100644
--- a/docs/configuration/cmake.md
+++ b/docs/configuration/cmake.md
@@ -224,5 +224,12 @@ See more information in the [CMake documentation](../cmake.md).
       [default=`${CMAKE_INSTALL_PREFIX}`]
     </td>
   </tr>
-
+  <tr>
+    <td>
+      -DMESOS_INSTALL_TESTS=(TRUE|FALSE)
+    </td>
+    <td>
+      Add test executables and their dependencies to the install output.
+    </td>
+  </tr>
 </table>


[mesos] 02/06: Added documentation for the cmake install target.

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 6330a755ab40e2d771ba7f4fa5651281905c62b1
Author: Andrei Sekretenko <as...@apache.org>
AuthorDate: Wed May 20 22:17:54 2020 +0200

    Added documentation for the cmake install target.
    
    Review: https://reviews.apache.org/r/72535
---
 docs/cmake.md               | 24 ++++++++++++++++++++++++
 docs/configuration/cmake.md | 15 +++++++++++++++
 2 files changed, 39 insertions(+)

diff --git a/docs/cmake.md b/docs/cmake.md
index 0a4482b..ee5d6dc 100644
--- a/docs/cmake.md
+++ b/docs/cmake.md
@@ -56,6 +56,30 @@ like usual. Similarly, if you configure with `-G Ninja` to use the Ninja
 generator, you can then run `ninja tests` to build the `tests` target with
 Ninja.
 
+# Installable build
+
+This example will build Mesos and install it into a custom prefix:
+```
+mkdir build && cd build
+cmake -DCMAKE_INSTALL_PREFIX=/home/current_user/mesos
+cmake --build . --target install
+```
+
+To produce a set of binaries and libraries that will work after being
+copied/moved to a different location, use `MESOS_FINAL_PREFIX`.
+On a build system:
+```
+mkdir build && cd build
+cmake -DMESOS_FINAL_PREFIX=/opt/mesos -DCMAKE_INSTALL_PREFIX=/home/current_user/mesos
+cmake --build . --target install
+tar -czf mesos.tar.gz mesos -C /home/current_user
+```
+On a target system:
+```
+sudo tar -xf mesos.tar.gz -C /opt
+sudo /opt/mesos/bin/mesos-agent --work-dir=/var/lib/mesos ...
+```
+
 # Supported options
 
 See [configuration options](configuration/cmake.md).
diff --git a/docs/configuration/cmake.md b/docs/configuration/cmake.md
index 35a017c..08d33dc 100644
--- a/docs/configuration/cmake.md
+++ b/docs/configuration/cmake.md
@@ -210,4 +210,19 @@ See more information in the [CMake documentation](../cmake.md).
       Enable use of the NVML headers. [default=TRUE]
     </td>
   </tr>
+  <tr>
+    <td>
+      -DMESOS_FINAL_PREFIX=[path]
+    </td>
+    <td>
+      Adjust built-in paths (rpath in shared objects, default paths in Mesos
+      flags and so on) so that cmake install output works after being copied
+      into this prefix. This path does not have to exist on the build system
+      (the system where cmake install is invoked).
+      This option is typically used by package managers that use different
+      prefixes on a build system and on a target system.
+      [default=`${CMAKE_INSTALL_PREFIX}`]
+    </td>
+  </tr>
+
 </table>