Get updates url from the current git remote
This commit is contained in:
@@ -1,16 +1,46 @@
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
# cmake_policy(SET CMP0076 OLD)
|
||||
|
||||
set(FLAMESHOT_VERSION 0.8.5.5)
|
||||
|
||||
# Flameshot-org
|
||||
#set(GIT_API_URL "https://api.github.com/repos/flameshot-org/flameshot/releases/latest")
|
||||
# Namecheap
|
||||
set(GIT_API_URL "https://api.github.com/repos/namecheap/flameshot/releases/latest")
|
||||
|
||||
# TODO - fix it for all linux distros
|
||||
# find_package (Git)
|
||||
#if (GIT_FOUND)
|
||||
# message("git found: ${GIT_EXECUTABLE} in version ${GIT_VERSION_STRING}")
|
||||
#
|
||||
# # set flameshot updates url
|
||||
# execute_process(COMMAND ${GIT_EXECUTABLE} ls-remote --get-url OUTPUT_VARIABLE GIT_ORIGIN_REMOTE)
|
||||
# message("GIT_ORIGIN_REMOTE: ${GIT_ORIGIN_REMOTE}")
|
||||
# string(REGEX REPLACE ".git\r*\n*$" "/releases/latest" GIT_API_URL ${GIT_ORIGIN_REMOTE})
|
||||
# string(REGEX REPLACE "^.*:" "https://api.github.com/repos/" GIT_API_URL ${GIT_API_URL})
|
||||
# message("GIT_API_URL: '${GIT_API_URL}'")
|
||||
#
|
||||
# # get application version
|
||||
# execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --abbrev=0 --match v[0-9]* OUTPUT_VARIABLE FLAMESHOT_VERSION)
|
||||
# string(REGEX REPLACE "\r" "" FLAMESHOT_VERSION ${FLAMESHOT_VERSION})
|
||||
# string(REGEX REPLACE "\n" "" FLAMESHOT_VERSION ${FLAMESHOT_VERSION})
|
||||
# string(REGEX REPLACE "^v" "" FLAMESHOT_VERSION ${FLAMESHOT_VERSION})
|
||||
# message("FLAMESHOT_VERSION: '${FLAMESHOT_VERSION}'")
|
||||
#else()
|
||||
# message("git command is not found")
|
||||
#endif ()
|
||||
|
||||
project(
|
||||
flameshot
|
||||
VERSION ${FLAMESHOT_VERSION}
|
||||
LANGUAGES CXX)
|
||||
set(PROJECT_NAME_CAPITALIZED "Flameshot")
|
||||
|
||||
# This can be read from ${PROJECT_NAME} after project() is called
|
||||
if(APPLE)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version")
|
||||
endif()
|
||||
|
||||
project(
|
||||
flameshot
|
||||
VERSION 0.8.5.5
|
||||
LANGUAGES CXX)
|
||||
set(PROJECT_NAME_CAPITALIZED "Flameshot")
|
||||
|
||||
# Configuration options
|
||||
set(DEFAULT_RUN_IN_PLACE FALSE)
|
||||
|
||||
@@ -174,6 +174,7 @@ target_compile_definitions(flameshot PRIVATE APP_PREFIX="${CMAKE_INSTALL_PREFIX}
|
||||
target_compile_definitions(flameshot PRIVATE APP_VERSION="v${PROJECT_VERSION}")
|
||||
target_compile_definitions(flameshot PRIVATE IMGUR_CLIENT_ID="313baf0c7b4d3ff")
|
||||
target_compile_definitions(flameshot PRIVATE QAPPLICATION_CLASS=QApplication)
|
||||
target_compile_definitions(flameshot PRIVATE FLAMESHOT_APP_VERSION_URL="${GIT_API_URL}")
|
||||
|
||||
foreach(FILE ${QM_FILES})
|
||||
get_filename_component(F_NAME ${FILE} NAME)
|
||||
|
||||
@@ -17,9 +17,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#define FLAMESHOT_APP_VERSION_URL \
|
||||
"https://api.github.com/repos/namecheap/flameshot/releases/latest"
|
||||
|
||||
#include "src/core/capturerequest.h"
|
||||
#include <QMap>
|
||||
#include <QMenu>
|
||||
|
||||
Reference in New Issue
Block a user