File: CMakeLists.txt

package info (click to toggle)
libgit2 0.27.7%2Bdfsg.1-0.2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 31,400 kB
  • sloc: ansic: 157,824; sh: 406; python: 182; php: 65; makefile: 61
file content (30 lines) | stat: -rw-r--r-- 895 bytes parent folder | download | duplicates (5)
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
CMAKE_MINIMUM_REQUIRED (VERSION 2.8)
PROJECT (libgit2_test)
 
ADD_EXECUTABLE (libgit2_test libgit2_test.c)

FIND_PACKAGE(PkgConfig)

PKG_CHECK_MODULES(PC_LIBGIT2 libgit2)

SET(LIBGIT2_DEFINITIONS ${PC_LIBGIT_CFLAGS_OTHER})

FIND_PATH(LIBGIT2_INCLUDE_DIR git2.h
          HINTS ${PC_LIBGIT_INCLUDEDIR} ${PC_LIBGIT_INCLUDE_DIRS}
          PATH_SUFFIXES libgit2 )

FIND_LIBRARY(LIBGIT2_LIBRARY NAMES git2 libgit2
             HINTS ${PC_LIBGIT_LIBDIR} ${PC_LIBGIT_LIBRARY_DIRS} )

SET(LIBGIT2_LIBRARIES ${LIBGIT2_LIBRARY} )
SET(LIBGIT2_INCLUDE_DIRS ${LIBGIT2_INCLUDE_DIR} )

INCLUDE(FindPackageHandleStandardArgs)

FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibGit2  DEFAULT_MSG
                                  LIBGIT2_LIBRARY LIBGIT2_INCLUDE_DIR)


mark_as_advanced(LIBGIT2_INCLUDE_DIR LIBGIT2_LIBRARY )
include_directories(${LIBGIT2_INCLUDE_DIR})
target_link_libraries (libgit2_test ${LIBGIT2_LIBRARY})