-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
46 lines (39 loc) · 1008 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
cmake_minimum_required(VERSION 3.10)
# Set the project name
project(git_c)
# Set the C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# Add source files
set(SOURCES
src/CPP/main.cpp
src/CPP/git_init.cpp
src/CPP/hash_object.cpp
src/CPP/ls_tree.cpp
src/CPP/cat_file.cpp
src/CPP/write_tree.cpp
src/CPP/utils.cpp
src/CPP/git_add.cpp
src/CPP/commit_tree.cpp
src/CPP/git_checkout.cpp
)
# Add header files
set(HEADERS
src/Headers/git_init.h
src/Headers/hash_object.h
src/Headers/ls_tree.h
src/Headers/cat_file.h
src/Headers/write_tree.h
src/Headers/utils.h
src/Headers/git_add.h
src/Headers/commit_tree.h
src/Headers/git_checkout.h
)
# Include directories
include_directories(src/Headers)
# Add the executable
add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS})
# Link libraries
find_package(OpenSSL REQUIRED)
find_package(ZLIB REQUIRED)
target_link_libraries(${PROJECT_NAME} OpenSSL::SSL ZLIB::ZLIB)