sapling/CMakeLists.txt
Wez Furlong d0c7e1ccb9 eden: cmake: initial support for running unit tests
Summary:
beholdunittests

This enables some plumbing for running some of the
tests using the gtest/gmock machinery in cmake.

Part of this diff is removing the FindGMock.cmake file from the
eden repo; we now pull this in from the shared cmake library
that is populated by shipit.

Reviewed By: simpkins

Differential Revision: D14993344

fbshipit-source-id: 51caf9518c7f3a083a3b90cda10324c3a8170359
2019-05-03 15:59:45 -07:00

63 lines
1.7 KiB
CMake

cmake_minimum_required(VERSION 3.1.3 FATAL_ERROR)
# We use the GoogleTest module if it is available (only in CMake 3.9+)
# It requires CMP0054 and CMP0057 to be enabled.
if (POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif()
if (POLICY CMP0057)
cmake_policy(SET CMP0057 NEW)
endif()
# Project information
project("eden" LANGUAGES CXX C)
# Tell CMake to also look in the directories where getdeps.py installs
# our third-party dependencies.
list(APPEND CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/external/install")
# CMake include directories
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake"
# For in-fbsource builds on mac
"${CMAKE_CURRENT_SOURCE_DIR}/../opensource/fbcode_builder/CMake"
# For shipit-transformed builds
"${CMAKE_CURRENT_SOURCE_DIR}/build/fbcode_builder/CMake"
${CMAKE_MODULE_PATH})
include_directories(
${CMAKE_SOURCE_DIR}
${CMAKE_BINARY_DIR}
)
if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/external/osxfuse")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/external/osxfuse/common")
else()
find_path(OSXFUSE_INCLUDE_DIR NAMES "fuse_ioctl.h")
if (OSXFUSE_INCLUDE_DIR)
include_directories(${OSXFUSE_INCLUDE_DIR})
endif()
endif()
set(CMAKE_CXX_STANDARD 17)
include(CompilerSettingsUnix)
include(EdenConfigChecks)
include(ThriftCppLibrary)
include(FBMercurialFeatures)
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
set_property(
DIRECTORY
${CMAKE_CURRENT_SOURCE_DIR}
APPEND
PROPERTY
COMPILE_DEFINITIONS
"FOLLY_XLOG_STRIP_PREFIXES=\"${CMAKE_SOURCE_DIR}:${CMAKE_BINARY_DIR}\""
)
add_subdirectory(common)
add_subdirectory(eden/fs)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/CMake/eden-config.h.in
${CMAKE_CURRENT_BINARY_DIR}/eden/fs/eden-config.h
)