File tree Expand file tree Collapse file tree 3 files changed +61
-8
lines changed
Expand file tree Collapse file tree 3 files changed +61
-8
lines changed Original file line number Diff line number Diff line change 1+ # CMake build script for the git2 project
2+ #
3+ # Building (out of source build):
4+ # > mkdir build && cd build
5+ # > cmake .. [-DSETTINGS=VALUE]
6+ # > cmake --build .
7+ #
8+ # Install:
9+ # > cmake --build . --target install
10+
11+ PROJECT (git2app C)
12+ CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
13+
14+ SET (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR} " )
15+
16+ # Collect sourcefiles
17+ FILE (GLOB SRC *.c builtin/*.c)
18+ FILE (GLOB SRC_H *.h)
19+
20+ IF (WIN32 AND NOT CYGWIN )
21+ ADD_DEFINITIONS (-DWIN32 -D_DEBUG -D_LIB)
22+ IF (MINGW)
23+ SET (PTHREAD_LIBRARY pthread)
24+ ENDIF ()
25+ ENDIF ()
26+
27+ # Find required dependencies
28+ FIND_PACKAGE (Libgit2 REQUIRED)
29+
30+ # Specify target
31+ ADD_EXECUTABLE (git2app ${SRC} )
32+
33+ INCLUDE_DIRECTORIES (${Libgit2_INCLUDE_DIR} ${Libgit2_INCLUDE_DIR} /../deps/zlib)
34+ TARGET_LINK_LIBRARIES (git2app ${Libgit2_LIBRARY} )
35+
Original file line number Diff line number Diff line change 1+
2+ if (Libgit2_INCLUDE_DIR AND Libgit2_LIBRARY)
3+ # Already in cache, be silent
4+ set (Libgit2_FIND_QUIETLY TRUE )
5+ endif ()
6+
7+
8+ FIND_PATH (Libgit2_INCLUDE_DIR git2.h libgit2/include )
9+
10+ FIND_LIBRARY (Libgit2_LIBRARY NAMES git2 PATHS libgit2)
11+
12+ if (Libgit2_INCLUDE_DIR AND Libgit2_LIBRARY)
13+ set (Libgit2_FOUND TRUE )
14+ endif ()
15+
16+ if (Libgit2_FOUND)
17+ if (NOT Libgit2_FIND_QUIETLY)
18+ message (STATUS "Found libgit2: ${Libgit2_LIBRARY} " )
19+ endif ()
20+ else ()
21+ if (Libgit2_FIND_REQUIRED AND NOT Libgit2_FIND_QUIETLY)
22+ message (FATAL_ERROR "Could NOT find libgit2 library" )
23+ endif ()
24+ endif ()
25+
26+ mark_as_advanced (Libgit2_LIBRARY Libgit2_INCLUDE_DIR)
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments