sapling/CMake/FindLibGit2.cmake
Adam Simpkins 69e28322d3 make support for Git optional
Summary:
Add a CMake option to control whether or not we should build support for
Git.  If this is disabled we avoid building anything under eden/fs/store/git
and drop support for the "git" backing store.

Reviewed By: wez

Differential Revision: D15980321

fbshipit-source-id: 434364d81b44935ce86fdf4d66697ee21ff2992f
2019-09-20 18:22:04 -07:00

20 lines
548 B
CMake

# Copyright (c) Facebook, Inc. and its affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2.
include(FindPackageHandleStandardArgs)
find_package(PkgConfig)
pkg_check_modules(LibGit2 libgit2 QUIET IMPORTED_TARGET)
if(LibGit2_FOUND)
set_target_properties(PkgConfig::LibGit2 PROPERTIES IMPORTED_GLOBAL True)
add_library(libgit2 ALIAS PkgConfig::LibGit2)
endif()
find_package_handle_standard_args(
LibGit2
REQUIRED_VARS LibGit2_PREFIX
VERSION_VAR LibGit2_VERSION
)