-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
44 lines (36 loc) · 1.72 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
cmake_minimum_required(VERSION 2.8.4)
cmake_policy(SET CMP0042 NEW)
project(mesos-modules)
# Override output folder for conveniency.
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules)
# Check that one of the officially supported compilers is used.
if(MSVC)
message(STATUS "Supported compiler used: MSVC")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
message(STATUS "Supported compiler used: GCC")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
message(STATUS "Supported compiler used: Clang")
else()
message("Unsupported compiler used: ${CMAKE_CXX_COMPILER_ID}")
endif(MSVC)
# Locate and enable Mesos, stout, and libprocess.
# NOTE(rukletsov): We do not regenerate protobufs, but reuse those from
# Mesos build folder. We also re-use boost bundled with Mesos to avoid
# funky issues.
# TODO(rukletsov): Improve FindMesos.cmake so that it supports both installed
# Mesos and dev build.
find_package(Mesos REQUIRED)
include_directories(${Mesos_INCLUDE_DIR} ${Stout_INCLUDE_DIR} ${Libprocess_INCLUDE_DIR})
include_directories(${Mesos_Boost_INCLUDE_DIR})
include_directories(${Mesos_BUILD_DIR}/include)
message(STATUS "Mesos library used: \"${Mesos_LIBRARIES}\"")
# Enable C++11 for Clang on MacOS X.
if(APPLE AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"))
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++")
endif(APPLE AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"))
# Test hook.
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/test-hook)
# External HierarchicalDRF allocator.
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/external-allocator)