Skip to content

Commit 7ecdcca

Browse files
Merge pull request flameshot-org#3946 from flameshot-org/external_deps
External deps to Cmake FetchContent
2 parents 09f2d95 + 4ef7e3a commit 7ecdcca

File tree

170 files changed

+48
-20842
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+48
-20842
lines changed

CMakeLists.txt

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ set(FLAMESHOT_VERSION 12.1.0)
55

66
# Flameshot-org
77
set(GIT_API_URL "https://api.github.com/repos/flameshot-org/flameshot/releases/latest")
8-
# Namecheap
9-
# set(GIT_API_URL "https://api.github.com/repos/namecheap/flameshot/releases/latest")
108

119
# TODO - fix it for all linux distros
1210
#find_package (Git)
@@ -36,6 +34,26 @@ project(
3634
LANGUAGES CXX)
3735
set(PROJECT_NAME_CAPITALIZED "Flameshot")
3836

37+
include(FetchContent)
38+
39+
FetchContent_Declare(
40+
qtColorWidgets
41+
GIT_REPOSITORY https://gitlab.com/mattbas/Qt-Color-Widgets.git
42+
GIT_TAG 352bc8f99bf2174d5724ee70623427aa31ddc26a
43+
)
44+
45+
#Workaround for duplicate GUID in windows WIX installer
46+
if (WIN32)
47+
FetchContent_GetProperties(qtColorWidgets)
48+
if(NOT qtcolorwidgets_POPULATED)
49+
FetchContent_Populate(qtColorWidgets)
50+
add_subdirectory(${qtcolorwidgets_SOURCE_DIR} ${qtcolorwidgets_BINARY_DIR} EXCLUDE_FROM_ALL)
51+
endif()
52+
else()
53+
FetchContent_MakeAvailable(qtColorWidgets)
54+
endif()
55+
56+
3957
# This can be read from ${PROJECT_NAME} after project() is called
4058
if (APPLE)
4159
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version")
@@ -104,19 +122,28 @@ if(USE_EXTERNAL_SINGLEAPPLICATION)
104122
find_library(QTSINGLEAPPLICATION_LIBRARY NAMES ${qtsingleapplication_libs})
105123
message(STATUS "Using external SingleApplication library")
106124
else()
107-
add_subdirectory(external/singleapplication)
125+
FetchContent_Declare(
126+
singleApplication
127+
GIT_REPOSITORY https://github.com/itay-grudev/SingleApplication.git
128+
GIT_TAG v3.5.2
129+
)
130+
FetchContent_MakeAvailable(SingleApplication)
108131
set(QTSINGLEAPPLICATION_LIBRARY SingleApplication::SingleApplication)
109132
endif()
110133

111134

112135
option(BUILD_STATIC_LIBS ON)
113136
option(BUILD_SHARED_LIBS OFF)
114-
add_subdirectory(external/Qt-Color-Widgets EXCLUDE_FROM_ALL)
115-
116137

117138
if (APPLE)
118-
add_subdirectory(external/QHotkey)
139+
FetchContent_Declare(
140+
qHotKey
141+
GIT_REPOSITORY https://github.com/flameshot-org/QHotkey
142+
GIT_TAG master
143+
)
144+
FetchContent_MakeAvailable(QHotKey)
119145
endif()
146+
120147
add_subdirectory(src)
121148

122149
# CPack

external/.clang-format

Lines changed: 0 additions & 2 deletions
This file was deleted.

external/QHotkey/CMakeLists.txt

Lines changed: 0 additions & 43 deletions
This file was deleted.

external/QHotkey/LICENSE

Lines changed: 0 additions & 27 deletions
This file was deleted.

external/QHotkey/QHotkey

Lines changed: 0 additions & 1 deletion
This file was deleted.

external/QHotkey/README.md

Lines changed: 0 additions & 104 deletions
This file was deleted.

0 commit comments

Comments
 (0)