Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ option(FLAMESHOT_DEBUG_CAPTURE "Enable mode to make debugging easier" OFF)
option(USE_MONOCHROME_ICON "Build using monochrome icon as default" OFF)
option(GENERATE_TS "Regenerate translation source files" OFF)
option(USE_KDSINGLEAPPLICATION "Use KDSingleApplication library" ON)
option(USE_BUNDLED_KDSINGLEAPPLICATION "Use a bundled version of the KDSingleApplication library" ${USE_KDSINGLEAPPLICATION})
option(USE_LAUNCHER_ABSOLUTE_PATH "Use absolute path for the desktop launcher" ON)
option(USE_WAYLAND_CLIPBOARD "USE KF Gui Wayland Clipboard" OFF)
option(DISABLE_UPDATE_CHECKER "Disable check for updates" OFF)
Expand Down Expand Up @@ -108,19 +109,23 @@ enable_sanitizers(project_options)
# allow for static analysis options include(cmake/StaticAnalyzers.cmake)

if (USE_KDSINGLEAPPLICATION)
set(KDSingleApplication_EXAMPLES OFF CACHE BOOL "Don't build the examples")
set(KDSingleApplication_STATIC ON CACHE BOOL "Build static versions of the libraries")
if (USE_BUNDLED_KDSINGLEAPPLICATION)
set(KDSingleApplication_EXAMPLES OFF CACHE BOOL "Don't build the examples")
set(KDSingleApplication_STATIC ON CACHE BOOL "Build static versions of the libraries")

# Check if KDSingleApplication is available locally
if(EXISTS "${CMAKE_SOURCE_DIR}/external/KDSingleApplication/CMakeLists.txt")
add_subdirectory("${CMAKE_SOURCE_DIR}/external/KDSingleApplication")
# Check if KDSingleApplication is available locally
if(EXISTS "${CMAKE_SOURCE_DIR}/external/KDSingleApplication/CMakeLists.txt")
add_subdirectory("${CMAKE_SOURCE_DIR}/external/KDSingleApplication")
else()
FetchContent_Declare(
kdsingleApplication
GIT_REPOSITORY https://github.com/KDAB/KDSingleApplication.git
GIT_TAG v1.2.0
)
FetchContent_MakeAvailable(kdsingleApplication)
endif()
else()
FetchContent_Declare(
kdsingleApplication
GIT_REPOSITORY https://github.com/KDAB/KDSingleApplication.git
GIT_TAG v1.2.0
)
FetchContent_MakeAvailable(KDSingleApplication)
find_package(KDSingleApplication-qt6 REQUIRED)
endif()
endif()

Expand Down
6 changes: 5 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,13 @@
message(STATUS "KDSingleApplication is used!")
add_compile_definitions(USE_KDSINGLEAPPLICATION=1)

if (USE_BUNDLED_KDSINGLEAPPLICATION)
target_include_directories(flameshot PRIVATE ${kdsingleapplication_SOURCE_DIR} ${kdsingleapplication_BINARY_DIR})
endif()

target_link_libraries(
flameshot
kdsingleapplication
KDAB::kdsingleapplication
)
endif()

Expand Down Expand Up @@ -269,7 +273,7 @@
endif ()

if (NOT USE_OPENSSL)
message(WARNING "OpenSSL is required to upload screenshots")

Check warning on line 276 in src/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / VS 2022 x64-portable

OpenSSL is required to upload screenshots

Check warning on line 276 in src/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / VS 2022 x64-installer

OpenSSL is required to upload screenshots

Check warning on line 276 in src/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / VS 2022 x64-portable

OpenSSL is required to upload screenshots

Check warning on line 276 in src/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / VS 2022 x64-installer

OpenSSL is required to upload screenshots
endif ()
endif ()

Expand Down Expand Up @@ -438,7 +442,7 @@
FILES_MATCHING
PATTERN "*.dll")
else ()
message(WARNING "Unable to find OpenSSL dlls.")

Check warning on line 445 in src/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / VS 2022 x64-portable

Unable to find OpenSSL dlls.

Check warning on line 445 in src/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / VS 2022 x64-installer

Unable to find OpenSSL dlls.

Check warning on line 445 in src/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / VS 2022 x64-portable

Unable to find OpenSSL dlls.

Check warning on line 445 in src/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / VS 2022 x64-installer

Unable to find OpenSSL dlls.
endif ()
endif ()

Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-FileCopyrightText: 2017-2019 Alejandro Sirgo Rica & Contributors

#ifdef USE_KDSINGLEAPPLICATION
#include "kdsingleapplication.h"
#include <kdsingleapplication.h>
#ifdef Q_OS_UNIX
#include "core/signaldaemon.h"
#include "csignal"
Expand Down
Loading