-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
31 lines (23 loc) · 904 Bytes
/
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
cmake_minimum_required(VERSION 3.12.1)
project (gitbash-powerline)
set(CMAKE_VERBOSE_MAKEFILE ON)
include_directories("include")
file(GLOB SOURCES "src/*.cpp")
include(ExternalProject)
set(EXTERNAL_INSTALL_LOCATION ${CMAKE_BINARY_DIR}/external)
ExternalProject_Add(libgit2
GIT_REPOSITORY https://github.com/libgit2/libgit2
GIT_TAG v0.28.1
GIT_SHALLOW TRUE
CMAKE_ARGS -DBUILD_CLAR=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION}
)
include_directories(${EXTERNAL_INSTALL_LOCATION}/include)
link_directories(${EXTERNAL_INSTALL_LOCATION}/lib)
link_directories(${CMAKE_BINARY_DIR})
add_executable(gitbash-powerline ${SOURCES})
add_dependencies(gitbash-powerline libgit2)
if(WIN32)
target_link_libraries(gitbash-powerline git2 winhttp rpcrt4 crypt32)
else()
target_link_libraries(gitbash-powerline git2 pthread z ssl crypto)
endif()