@@ -6,28 +6,6 @@ set(FLAMESHOT_VERSION 13.0.0)
66# Flameshot-org
77set (GIT_API_URL "https://api.github.com/repos/flameshot-org/flameshot/releases/latest" )
88
9- # TODO - fix it for all linux distros
10- #find_package (Git)
11- #if (GIT_FOUND)
12- # message("git found: ${GIT_EXECUTABLE} in version ${GIT_VERSION_STRING}")
13- #
14- # # set flameshot updates url
15- # execute_process(COMMAND ${GIT_EXECUTABLE} ls-remote --get-url OUTPUT_VARIABLE GIT_ORIGIN_REMOTE)
16- # message("GIT_ORIGIN_REMOTE: ${GIT_ORIGIN_REMOTE}")
17- # string(REGEX REPLACE ".git\r*\n*$" "/releases/latest" GIT_API_URL ${GIT_ORIGIN_REMOTE})
18- # string(REGEX REPLACE "^.*:" "https://api.github.com/repos/" GIT_API_URL ${GIT_API_URL})
19- # message("GIT_API_URL: '${GIT_API_URL}'")
20- #
21- # # get application version
22- # execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --abbrev=0 --match v[0-9]* OUTPUT_VARIABLE FLAMESHOT_VERSION)
23- # string(REGEX REPLACE "\r" "" FLAMESHOT_VERSION ${FLAMESHOT_VERSION})
24- # string(REGEX REPLACE "\n" "" FLAMESHOT_VERSION ${FLAMESHOT_VERSION})
25- # string(REGEX REPLACE "^v" "" FLAMESHOT_VERSION ${FLAMESHOT_VERSION})
26- # message("FLAMESHOT_VERSION: '${FLAMESHOT_VERSION}'")
27- #else()
28- # message("git command is not found")
29- #endif ()
30-
319project (
3210 flameshot
3311 VERSION ${FLAMESHOT_VERSION}
@@ -46,24 +24,28 @@ option(BUILD_SHARED_LIBS OFF)
4624#Needed due to linker error with QtColorWidget
4725set (CMAKE_POSITION_INDEPENDENT_CODE ON )
4826
49- FetchContent_Declare(
50- qtColorWidgets
51- GIT_REPOSITORY https://gitlab.com/mattbas/Qt-Color-Widgets.git
52- GIT_TAG 352bc8f99bf2174d5724ee70623427aa31ddc26a
53- )
54-
55- #Workaround for duplicate GUID in windows WIX installer
56- if (WIN32 )
57- FetchContent_GetProperties(qtColorWidgets)
58- if (NOT qtcolorwidgets_POPULATED)
59- FetchContent_Populate(qtColorWidgets)
60- add_subdirectory (${qtcolorwidgets_SOURCE_DIR} ${qtcolorwidgets_BINARY_DIR} EXCLUDE_FROM_ALL )
61- endif ()
27+
28+ # Dependency can be fetched via flatpak builder
29+ if (EXISTS "${CMAKE_SOURCE_DIR} /external/Qt-Color-Widgets/CMakeLists.txt" )
30+ add_subdirectory ("${CMAKE_SOURCE_DIR} /external/Qt-Color-Widgets" EXCLUDE_FROM_ALL )
6231else ()
63- FetchContent_MakeAvailable(qtColorWidgets)
32+ FetchContent_Declare(
33+ qtColorWidgets
34+ GIT_REPOSITORY https://gitlab.com/mattbas/Qt-Color-Widgets.git
35+ GIT_TAG 352bc8f99bf2174d5724ee70623427aa31ddc26a
36+ )
37+ #Workaround for duplicate GUID in windows WIX installer
38+ if (WIN32 )
39+ FetchContent_GetProperties(qtColorWidgets)
40+ if (NOT qtcolorwidgets_POPULATED)
41+ FetchContent_Populate(qtColorWidgets)
42+ add_subdirectory (${qtcolorwidgets_SOURCE_DIR} ${qtcolorwidgets_BINARY_DIR} EXCLUDE_FROM_ALL )
43+ endif ()
44+ else ()
45+ FetchContent_MakeAvailable(qtColorWidgets)
46+ endif ()
6447endif ()
6548
66-
6749# This can be read from ${PROJECT_NAME} after project() is called
6850if (APPLE )
6951 set (CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version" )
@@ -129,12 +111,17 @@ if (USE_KDSINGLEAPPLICATION)
129111 set (KDSingleApplication_EXAMPLES OFF CACHE BOOL "Don't build the examples" )
130112 set (KDSingleApplication_STATIC ON CACHE BOOL "Build static versions of the libraries" )
131113
132- FetchContent_Declare(
133- kdsingleApplication
134- GIT_REPOSITORY https://github.com/KDAB/KDSingleApplication.git
135- GIT_TAG v1.2.0
136- )
137- FetchContent_MakeAvailable(KDSingleApplication)
114+ # Check if KDSingleApplication is available locally
115+ if (EXISTS "${CMAKE_SOURCE_DIR} /external/KDSingleApplication/CMakeLists.txt" )
116+ add_subdirectory ("${CMAKE_SOURCE_DIR} /external/KDSingleApplication" )
117+ else ()
118+ FetchContent_Declare(
119+ kdsingleApplication
120+ GIT_REPOSITORY https://github.com/KDAB/KDSingleApplication.git
121+ GIT_TAG v1.2.0
122+ )
123+ FetchContent_MakeAvailable(KDSingleApplication)
124+ endif ()
138125endif ()
139126
140127# ToDo: Check if this is used anywhere
0 commit comments