-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
58 lines (47 loc) · 1.52 KB
/
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
47
48
49
50
51
52
53
54
55
56
57
58
cmake_minimum_required(VERSION 3.10)
# Set the project name and version
project(Safron VERSION 0.0.2)
# Specify the C++ standard
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# Include the directories
include_directories(include)
# Add the executable
add_executable(safron
src/main.cpp
src/config_manager.cpp
src/package_manager.cpp
src/build_manager.cpp
src/admin_access.cpp
)
# Find and link the CURL library
find_package(CURL REQUIRED)
if(CURL_FOUND)
include_directories(${CURL_INCLUDE_DIRS})
target_link_libraries(safron PRIVATE ${CURL_LIBRARIES})
else()
message(FATAL_ERROR "Could not find CURL library")
endif()
# Set the output directory
set_target_properties(safron PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
)
# Installation paths
install(TARGETS safron DESTINATION bin)
install(DIRECTORY include/ DESTINATION include)
install(DIRECTORY src/ DESTINATION src)
install(DIRECTORY resources/ DESTINATION resources)
install(FILES CMakeLists.txt DESTINATION .)
# Include CPack for packaging
include(CPack)
# Set package properties
set(CPACK_PACKAGE_NAME "SafronCLI")
set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
set(CPACK_PACKAGE_CONTACT "MrAshCreates [email protected]")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Safron CLI Tool - A versatile package manager")
# Specify the package generators
set(CPACK_GENERATOR "TGZ;ZIP")
# Exclude build and VCS directories from the package
set(CPACK_SOURCE_IGNORE_FILES
"/build/;/\\.git/;~$;${CPACK_SOURCE_IGNORE_FILES}"
)