Skip to content
Open
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
5 changes: 5 additions & 0 deletions .conan/config/global.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
core.net.http:timeout = 300

tools.system.package_manager:mode = install
tools.system.package_manager:sudo = True

9 changes: 9 additions & 0 deletions .conan/profiles/macos-latest-armv8.conanprofile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[settings]
arch=armv8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need another mac config with x86_64

build_type=Release
compiler=apple-clang
compiler.cppstd=17
compiler.libcxx=libc++
compiler.version=15
os=Macos
os.version=13.0
8 changes: 8 additions & 0 deletions .conan/profiles/ubuntu-latest-x86_64.conanprofile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=13
os=Linux
9 changes: 9 additions & 0 deletions .conan/profiles/windows-latest-x86_64.conanprofile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=17
compiler.runtime=dynamic
compiler.runtime_type=Debug
compiler.version=194
os=Windows
49 changes: 49 additions & 0 deletions .github/workflows/conan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build with conan

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
name: Building ${{ matrix.build_type }} ${{ matrix.profile }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# Release build type
- os: ubuntu-latest
profile: ubuntu-latest-x86_64
build_type: Release
- os: macos-latest
profile: macos-latest-armv8
build_type: Release
- os: windows-latest
profile: windows-latest-x86_64
build_type: Release

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install Conan
uses: conan-io/setup-conan@v1
with:
version: '2.19'

- name: Add artifactory & set conan config
run: |
conan config install ./.conan/config/global.conf
conan remote remove conancenter
conan remote add oc https://artifactory.owncloud-demo.com/artifactory/api/conan/conan-local
conan remote login oc ${{ secrets.CONAN_USER }} -p ${{ secrets.CONAN_PASSWORD }}
conan remote list
conan profile show

- name: Build the client with conan and run tests
run: |
conan build . --profile=.conan/profiles/${{ matrix.profile }}.conanprofile -s build_type=${{ matrix.build_type }}
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
CMakeUserPresets.json
/branding/
.gitmodules
*build*/
Expand Down Expand Up @@ -180,3 +181,11 @@ test/gui/config.ini
test/gui/reports
*/**/__pycache__/
test/gui/users.json

# conan generated files
#*-config.cmake
#*-data.cmake
#*-version.cmake
#*-release.cmake
#*Targets.cmake
#*conan*.sh
11 changes: 7 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@ set(APPLE_SUPPRESS_X11_WARNING ON)

set(CMAKE_POSITION_INDEPENDENT_CODE ON)

find_package(QT 6.7 NAMES Qt6 COMPONENTS Core REQUIRED)
find_package(QT 6.8 NAMES Qt6 COMPONENTS Core REQUIRED)

find_package(Qt6 COMPONENTS Core Concurrent Network Widgets Xml Quick QuickWidgets QuickControls2 REQUIRED)
find_package(Qt6LinguistTools REQUIRED)
get_target_property (QT_QMAKE_EXECUTABLE Qt::qmake IMPORTED_LOCATION)
find_package(Qt6 COMPONENTS Core Concurrent Network Widgets Xml Quick Qml QuickWidgets QuickControls2 REQUIRED)
find_package(Qt6 CONFIG REQUIRED COMPONENTS LinguistTools)

get_target_property (QT_QMAKE_EXECUTABLE Qt6::qmake IMPORTED_LOCATION)
message(STATUS "Using Qt ${QT_VERSION} (${QT_QMAKE_EXECUTABLE})")

qt6_standard_project_setup()

if (UNIX AND NOT APPLE)
find_package(Qt6 REQUIRED COMPONENTS DBus)
endif()
Expand Down
54 changes: 54 additions & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
from conan import ConanFile
from conan.tools.build import can_run
from conan.tools.cmake import cmake_layout, CMake

class ClientRecipe(ConanFile):
settings = "os", "compiler", "arch", "build_type"
generators = "CMakeToolchain", "CMakeDeps"
options = {"shared": [True, False]}
default_options = {
"shared": True,
"*:fPIC": True,
'qt/*:shared': True,
'qt/*:qtdeclarative': True,
'qt/*:qtquickcontrols2': True,
'qt/*:qtshadertools': True,
'qt/*:qtsvg': True,
'qt/*:qtimageformats': True,
'qt/*:qttools': True,
'qt/*:qttranslations': True,
'qt/*:gui': True,
'qt/*:widgets': True,
}

def configure(self):
self.options['qt/*'].with_pq = False
self.options['qt/*'].with_odbc = False
if self.settings.os == "Linux":
self.options['qt/*'].with_dbus = True

def requirements(self):
self.requires("extra-cmake-modules/6.8.0")
self.requires("zlib/1.3.1")
self.requires("sqlite3/3.49.1")
self.requires("openssl/3.4.2")
self.requires("nlohmann_json/3.11.3")
self.requires("qt/6.8.3")
self.requires("kdsingleapplication/1.2.0")
self.requires("qtkeychain/0.15.0")
self.requires("libregraphapi/1.0.4")
if self.settings.os == "Macos":
self.requires("sparkle/2.7.0")

def build_requirements(self):
self.tool_requires("cmake/3.30.0")

def layout(self):
cmake_layout(self)

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
if can_run(self):
cmake.ctest(["--output-on-failure"])
4 changes: 2 additions & 2 deletions src/csync/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ generate_export_header(csync

target_link_libraries(csync
PUBLIC
Qt::Core
Qt6::Core
PRIVATE
Qt::Concurrent
Qt6::Concurrent
SQLite::SQLite3
ZLIB::ZLIB
)
Expand Down
6 changes: 3 additions & 3 deletions src/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ set_target_properties(owncloudGui PROPERTIES AUTOUIC ON AUTORCC ON)
target_include_directories(owncloudGui PRIVATE models spaces creds)
target_link_libraries(owncloudGui
PUBLIC
Qt::Widgets Qt::Network Qt::Xml Qt::Quick Qt::QuickWidgets Qt::QuickControls2
Qt6::Widgets Qt6::Network Qt6::Xml Qt6::Quick Qt6::QuickWidgets Qt6::QuickControls2
folderwizard
libsync
Qt6Keychain::Qt6Keychain
Expand Down Expand Up @@ -160,8 +160,8 @@ elseif( WIN32 )
folderwatcher_win.cpp)
elseif(UNIX AND NOT APPLE)
## handle DBUS for Fdo notifications
if (TARGET Qt::DBus)
target_link_libraries(owncloudGui PUBLIC Qt::DBus)
if (TARGET Qt6::DBus)
target_link_libraries(owncloudGui PUBLIC Qt6::DBus)
target_compile_definitions(owncloudGui PUBLIC "USE_FDO_NOTIFICATIONS")
endif()
target_sources(owncloudGui PRIVATE
Expand Down
2 changes: 1 addition & 1 deletion src/gui/accountstate.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <QElapsedTimer>
#include <QPointer>
#include <memory>
#include <qqmlintegration.h>
#include <QtQmlIntegration/QtQmlIntegration>


class QDialog;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/folderwizard/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ add_library(folderwizard STATIC
spacespage.ui
)

target_link_libraries(folderwizard PUBLIC Qt::Widgets libsync owncloudResources)
target_link_libraries(folderwizard PUBLIC Qt6::Widgets libsync owncloudResources)
set_target_properties(folderwizard PROPERTIES AUTOUIC ON AUTORCC ON)
apply_common_target_settings(folderwizard)
2 changes: 1 addition & 1 deletion src/gui/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "libsync/logger.h"
#include "socketapi/socketapi.h"

#include <kdsingleapplication.h>
#include <kdsingleapplication-qt6/kdsingleapplication.h>

#ifdef WITH_AUTO_UPDATER
#include "updater/updater.h"
Expand Down
13 changes: 7 additions & 6 deletions src/libsync/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ target_link_libraries(libsync
PUBLIC
csync
owncloudResources
Qt::Core
Qt::Network
Qt::Widgets
Qt::QuickControls2
Qt6::Core
Qt6::Network
Qt6::Widgets
Qt6::QuickControls2

PRIVATE
Qt::Concurrent
Qt6::Concurrent
ZLIB::ZLIB
Qt6Keychain::Qt6Keychain
)
Expand All @@ -108,7 +108,8 @@ set_source_files_properties(configfile.cpp
COMPILE_DEFINITIONS EXCLUDE_FILE_NAME="${EXCLUDE_FILE_NAME}"
)

target_link_libraries(libsync PUBLIC $<BUILD_INTERFACE:OpenAPI::LibreGraphAPI>)
#target_link_libraries(libsync PUBLIC $<BUILD_INTERFACE:OpenAPI::LibreGraphAPI>)
target_link_libraries(libsync PUBLIC OpenAPI::LibreGraphAPI)
add_subdirectory(graphapi)

if ( APPLE )
Expand Down
4 changes: 2 additions & 2 deletions src/libsync/graphapi/jobs/drives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

#include "account.h"

#include <OAICollection_of_drives.h>
#include <OAIDrive.h>
#include "OpenAPI/LibreGraphAPI/OAICollection_of_drives.h"
#include "OpenAPI/LibreGraphAPI/OAIDrive.h"


using namespace OCC;
Expand Down
2 changes: 1 addition & 1 deletion src/libsync/graphapi/jobs/drives.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "networkjobs/jsonjob.h"

#include "owncloudlib.h"
#include <OAIDrive.h>
#include "OpenAPI/LibreGraphAPI/OAIDrive.h"

namespace OCC {
namespace GraphApi {
Expand Down
4 changes: 2 additions & 2 deletions src/libsync/graphapi/space.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

#include "libsync/accountfwd.h"

#include <OAIDrive.h>
#include "OpenAPI/LibreGraphAPI/OAIDrive.h"

#include <QIcon>
#include <QtQmlIntegration>
#include <QtQmlIntegration/QtQmlIntegration>

namespace OCC {
namespace GraphApi {
Expand Down
2 changes: 1 addition & 1 deletion src/libsync/graphapi/spacesmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "libsync/accountfwd.h"
#include "libsync/graphapi/space.h"

#include <OAIDrive.h>
#include "OpenAPI/LibreGraphAPI/OAIDrive.h"

#include <algorithm>

Expand Down
4 changes: 3 additions & 1 deletion src/resources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ generate_theme(owncloudResources OWNCLOUD_SIDEBAR_ICONS)
# make them available to the whole project
set(OWNCLOUD_SIDEBAR_ICONS ${OWNCLOUD_SIDEBAR_ICONS} CACHE INTERNAL "Sidebar icons" FORCE)

target_link_libraries(owncloudResources PUBLIC Qt::Core Qt::Gui Qt::Quick)
target_link_libraries(owncloudResources PUBLIC Qt6::Core Qt6::Gui Qt6::Quick)
apply_common_target_settings(owncloudResources)
target_include_directories(owncloudResources PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..> $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/..>)
target_compile_definitions(owncloudResources PRIVATE APPLICATION_SHORTNAME="${APPLICATION_SHORTNAME}")
Expand Down Expand Up @@ -47,6 +47,8 @@ ecm_add_qml_module(owncloudResources
NAMESPACE OCC
)

ecm_target_qml_sources(owncloudResources SOURCES qmlresources.cpp)

ecm_finalize_qml_module(owncloudResources DESTINATION ${KDE_INSTALL_QMLDIR})

install(TARGETS owncloudResources EXPORT ${APPLICATION_SHORTNAME}Config ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
6 changes: 3 additions & 3 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ owncloud_add_test(ConnectionValidator)


# TODO: we need keychain access for this test
if (NOT APPLE OR NOT DEFINED ENV{GITHUB_ACTION})
owncloud_add_test(CredentialManager)
endif()
#if (NOT APPLE OR NOT DEFINED ENV{GITHUB_ACTION})
# owncloud_add_test(CredentialManager)
#endif()

owncloud_add_test(ExcludedFiles)

Expand Down
9 changes: 7 additions & 2 deletions test/owncloud_add_test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,19 @@ function(owncloud_add_test test_class)
${ARGN}
TEST_NAME "${OWNCLOUD_TEST_CLASS}Test"
LINK_LIBRARIES
owncloudGui syncenginetestutils testutilsloader Qt::Test
owncloudGui syncenginetestutils testutilsloader Qt6::Test
)
apply_common_target_settings(${OWNCLOUD_TEST_CLASS}Test)
target_compile_definitions(${OWNCLOUD_TEST_CLASS}Test PRIVATE SOURCEDIR="${PROJECT_SOURCE_DIR}" QT_FORCE_ASSERTS)

target_include_directories(${OWNCLOUD_TEST_CLASS}Test PRIVATE "${CMAKE_SOURCE_DIR}/test/")
if (UNIX AND NOT APPLE)
set_property(TEST ${OWNCLOUD_TEST_CLASS}Test PROPERTY ENVIRONMENT "QT_QPA_PLATFORM=offscreen")
set_property(TEST ${OWNCLOUD_TEST_CLASS}Test PROPERTY ENVIRONMENT "QT_QPA_PLATFORM=offscreen;LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}:${qt_LIB_DIRS_RELEASE}")
endif()

if(WIN32)
set(dll_paths $<TARGET_RUNTIME_DLL_DIRS:${OWNCLOUD_TEST_CLASS}Test>)
set_property(TEST ${OWNCLOUD_TEST_CLASS}Test PROPERTY ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$<JOIN:${dll_paths},\\\;>")
endif()

foreach(arg IN LISTS ARGN)
Expand Down
4 changes: 2 additions & 2 deletions test/testutils/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
add_executable(test_helper test_helper.cpp)
target_link_libraries(test_helper PUBLIC Qt::Core libsync)
target_link_libraries(test_helper PUBLIC Qt6::Core libsync)

add_library(syncenginetestutils STATIC syncenginetestutils.cpp testutils.cpp)
target_link_libraries(syncenginetestutils PUBLIC owncloudGui Qt::Test)
target_link_libraries(syncenginetestutils PUBLIC owncloudGui Qt6::Test)
target_compile_definitions(syncenginetestutils PRIVATE TEST_HELPER_EXE="$<TARGET_FILE:test_helper>")

# testutilsloader.cpp uses Q_COREAPP_STARTUP_FUNCTION which can't used reliably in a static lib
Expand Down
Loading