-
Notifications
You must be signed in to change notification settings - Fork 10
/
CMakeLists.txt
71 lines (66 loc) · 2.34 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
59
60
61
62
63
64
65
66
67
68
69
70
71
cmake_minimum_required(VERSION 3.18)
project(ashirt VERSION 1.2.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(NOTARIZE_AS "" CACHE STRING "Attempt to Sign Package With Provided User")
if(EXISTS ${CMAKE_SOURCE_DIR}/.git)
find_package(Git)
if(GIT_FOUND)
EXECUTE_PROCESS(
COMMAND ${GIT_EXECUTABLE} describe --long --match v*
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
OUTPUT_VARIABLE GITREV
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REGEX MATCH [0-9]+ MAJOR ${GITREV})
string(REGEX MATCH \\.[0-9]+ MINOR ${GITREV})
string(REPLACE "." "" MINOR ${MINOR})
string(REGEX MATCH [0-9]+\- PATCH ${GITREV})
string(REPLACE "-" "" PATCH ${PATCH})
string(REGEX MATCH \-[0-9]+\- TWEAK ${GITREV})
string(REPLACE "-" "" TWEAK ${TWEAK})
set(CMAKE_PROJECT_VERSION_MAJOR ${MAJOR})
set(CMAKE_PROJECT_VERSION_MINOR ${MINOR})
set(CMAKE_PROJECT_VERSION_PATCH ${PATCH})
set(CMAKE_PROJECT_VERSION_TWEAK ${TWEAK})
set(CMAKE_PROJECT_VERSION "${MAJOR}.${MINOR}.${PATCH}.${TWEAK}")
set(VERSION_TAG "v${MAJOR}.${MINOR}.${PATCH}")
EXECUTE_PROCESS(
COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
OUTPUT_VARIABLE COMMIT_HASH
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
EXECUTE_PROCESS(
COMMAND ${GIT_EXECUTABLE} remote get-url origin
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
OUTPUT_VARIABLE GITORIGIN
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REPLACE "https://github.com/" ":" GITORIGIN ${GITORIGIN})
string(REPLACE "[email protected]" "" GITORIGIN ${GITORIGIN})
string(REGEX MATCH [[:[A-Za-z0-9]+]] REPO_OWNER ${GITORIGIN})
string(REPLACE ":" "" REPO_OWNER ${REPO_OWNER})
string(REGEX MATCH [[/[A-Za-z0-9]+]] REPO_NAME ${GITORIGIN})
string(REPLACE "/" "" REPO_NAME ${REPO_NAME})
endif()
else()
set(COMMIT_HASH "")
set(REPO_NAME "ashirt")
set(REPO_OWNER "theparanoids")
set(VERSION_TAG "v0.0.0")
endif()
message(STATUS "VERSION: ${CMAKE_PROJECT_VERSION}")
find_package(Qt6 6.5.0 REQUIRED COMPONENTS
Widgets
Gui
Network
Sql
Core
Svg
)
add_subdirectory(deploy)
add_subdirectory(src)