Skip to content

Commit

Permalink
CMake enable install module dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
akornatskyy committed May 29, 2020
1 parent d4634f4 commit 0aee89a
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 1 deletion.
42 changes: 42 additions & 0 deletions 3rdparty/CMakeLists.txt
Expand Up @@ -465,6 +465,11 @@ install(
DIRECTORY ${GLOG_INSTALL_DIR}/lib/
DESTINATION ${MESOS_INSTALL_LIBRARIES})

if (ENABLE_INSTALL_MODULE_DEPENDENCIES)
install(
DIRECTORY ${GLOG_INSTALL_DIR}/include/glog
DESTINATION ${MESOS_INSTALL_HEADERS})
endif ()

# PicoJSON: JSON parser / serializer.
# https://github.com/kazuho/picojson
Expand Down Expand Up @@ -494,6 +499,11 @@ ExternalProject_Add(
URL ${PICOJSON_URL}
URL_HASH ${PICOJSON_HASH})

if (ENABLE_INSTALL_MODULE_DEPENDENCIES)
install(
FILES ${PICOJSON_CMAKE_ROOT}/src/picojson-${PICOJSON_VERSION}/picojson.h
DESTINATION ${MESOS_INSTALL_HEADERS})
endif ()

# RapidJSON: JSON parser / serializer.
# https://github.com/Tencent/rapidjson
Expand All @@ -518,6 +528,11 @@ ExternalProject_Add(
URL ${RAPIDJSON_URL}
URL_HASH ${RAPIDJSON_HASH})

if (ENABLE_INSTALL_MODULE_DEPENDENCIES)
install(
DIRECTORY ${RAPIDJSON_CMAKE_ROOT}/src/rapidjson-${RAPIDJSON_VERSION}/include/rapidjson
DESTINATION ${MESOS_INSTALL_HEADERS})
endif ()

if (ENABLE_NVML)
# NVML: NVIDIA Management Library.
Expand Down Expand Up @@ -1316,6 +1331,7 @@ 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)
add_library(libprotoc ${LIBRARY_LINKAGE} IMPORTED GLOBAL)

add_dependencies(protobuf ${PROTOBUF_TARGET})
add_executable(protoc IMPORTED GLOBAL)
Expand Down Expand Up @@ -1369,6 +1385,10 @@ else ()
protobuf PROPERTIES
IMPORTED_LOCATION ${PROTOBUF_ROOT}-build/libprotobuf${PROTOBUF_SUFFIX}${LIBRARY_SUFFIX})

set_target_properties(
libprotoc PROPERTIES
IMPORTED_LOCATION ${PROTOBUF_ROOT}-build/libprotoc${PROTOBUF_SUFFIX}${LIBRARY_SUFFIX})

set_target_properties(
protoc PROPERTIES
IMPORTED_LOCATION ${PROTOBUF_ROOT}-build/protoc)
Expand All @@ -1389,6 +1409,15 @@ ExternalProject_Add(
URL_HASH ${PROTOBUF_HASH})

install(FILES $<TARGET_FILE:protobuf> DESTINATION ${3RDPARTY_LIBS_INSTALL_DIR})
install(FILES $<TARGET_FILE:libprotoc> DESTINATION ${3RDPARTY_LIBS_INSTALL_DIR})
install(PROGRAMS $<TARGET_FILE:protoc> DESTINATION ${MESOS_INSTALL_RUNTIME})

if (ENABLE_INSTALL_MODULE_DEPENDENCIES)
install(
DIRECTORY ${PROTOBUF_ROOT}/src/google
DESTINATION ${MESOS_INSTALL_HEADERS}
FILES_MATCHING PATTERN "*.h")
endif ()

# gRPC: Google's high performance, open-source universal RPC framework.
# https://grpc.io/
Expand Down Expand Up @@ -1622,6 +1651,19 @@ ExternalProject_Add(
URL ${ZOOKEEPER_URL}
URL_HASH ${ZOOKEEPER_HASH})

if (ENABLE_INSTALL_MODULE_DEPENDENCIES)
install(
FILES
${ZOOKEEPER_CMAKE_ROOT}/src/zookeeper-${ZOOKEEPER_VERSION}/src/c/generated/zookeeper.jute.h
${ZOOKEEPER_CMAKE_ROOT}/src/zookeeper-${ZOOKEEPER_VERSION}/src/c/include/config.h
${ZOOKEEPER_CMAKE_ROOT}/src/zookeeper-${ZOOKEEPER_VERSION}/src/c/include/proto.h
${ZOOKEEPER_CMAKE_ROOT}/src/zookeeper-${ZOOKEEPER_VERSION}/src/c/include/recordio.h
${ZOOKEEPER_CMAKE_ROOT}/src/zookeeper-${ZOOKEEPER_VERSION}/src/c/include/winconfig.h
${ZOOKEEPER_CMAKE_ROOT}/src/zookeeper-${ZOOKEEPER_VERSION}/src/c/include/zookeeper_log.h
${ZOOKEEPER_CMAKE_ROOT}/src/zookeeper-${ZOOKEEPER_VERSION}/src/c/include/zookeeper_version.h
${ZOOKEEPER_CMAKE_ROOT}/src/zookeeper-${ZOOKEEPER_VERSION}/src/c/include/zookeeper.h
DESTINATION ${MESOS_INSTALL_HEADERS}/zookeeper)
endif ()

# LevelDB: A fast key-value storage library.
# https://github.com/google/leveldb
Expand Down
6 changes: 6 additions & 0 deletions 3rdparty/libprocess/CMakeLists.txt
Expand Up @@ -17,3 +17,9 @@
add_subdirectory(src)
add_subdirectory(src/tests)
add_subdirectory(examples)

if (ENABLE_INSTALL_MODULE_DEPENDENCIES)
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include
DESTINATION .)
endif ()
6 changes: 6 additions & 0 deletions 3rdparty/stout/CMakeLists.txt
Expand Up @@ -37,4 +37,10 @@ target_link_libraries(
$<$<PLATFORM_ID:Windows>:Ws2_32 IPHlpAPI Mswsock Secur32 Userenv>
$<$<PLATFORM_ID:FreeBSD>:svn>)

if (ENABLE_INSTALL_MODULE_DEPENDENCIES)
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include
DESTINATION .)
endif ()

add_subdirectory(tests)
4 changes: 4 additions & 0 deletions cmake/CompilationConfigure.cmake
Expand Up @@ -33,6 +33,10 @@ option(BUILD_SHARED_LIBS
"Build shared libraries."
${DEFAULT_BUILD_SHARED_LIBS})

option(ENABLE_INSTALL_MODULE_DEPENDENCIES
"Install third-party bundled dependencies required for module development"
FALSE)

option(ENABLE_PRECOMPILED_HEADERS
"Enable auto-generated precompiled headers using cotire"
${WIN32})
Expand Down
9 changes: 8 additions & 1 deletion src/CMakeLists.txt
Expand Up @@ -676,11 +676,18 @@ install(
ARCHIVE DESTINATION ${MESOS_INSTALL_LIBRARIES}
LIBRARY DESTINATION ${MESOS_INSTALL_LIBRARIES})


install(
DIRECTORY webui
DESTINATION ${MESOS_INSTALL_DATA})

if (ENABLE_INSTALL_MODULE_DEPENDENCIES)
install(
DIRECTORY
${MESOS_PUBLIC_INCLUDE_DIR}
${MESOS_BIN_INCLUDE_DIR}
DESTINATION .)
endif ()

# BUILD THE MESOS TESTS.
########################
add_subdirectory(tests)
Expand Down

0 comments on commit 0aee89a

Please sign in to comment.