From 56e1e98493831414cffd14a111289dc229d51758 Mon Sep 17 00:00:00 2001 From: Martchus Date: Sun, 16 Jun 2019 16:58:52 +0200 Subject: [PATCH] Apply cmake-format --- connector/CMakeLists.txt | 5 ++- fileitemactionplugin/CMakeLists.txt | 6 +++- libsyncthing/CMakeLists.txt | 51 ++++++++++++++++++++--------- widgets/CMakeLists.txt | 5 ++- 4 files changed, 48 insertions(+), 19 deletions(-) diff --git a/connector/CMakeLists.txt b/connector/CMakeLists.txt index 4dfb3e4..af3bdd4 100644 --- a/connector/CMakeLists.txt +++ b/connector/CMakeLists.txt @@ -63,7 +63,10 @@ if (SYSTEMD_SUPPORT) org.freedesktop.systemd1.Manager.xml org.freedesktop.systemd1.Service.xml org.freedesktop.systemd1.Unit.xml) - set_source_files_properties(org.freedesktop.systemd1.Manager.xml PROPERTIES INCLUDE syncthingservice.h) + set_source_files_properties(org.freedesktop.systemd1.Manager.xml + PROPERTIES + INCLUDE + syncthingservice.h) list(APPEND META_PUBLIC_COMPILE_DEFINITIONS ${META_PROJECT_VARNAME_UPPER}_SUPPORT_SYSTEMD) message(STATUS "systemd support enabled") else () diff --git a/fileitemactionplugin/CMakeLists.txt b/fileitemactionplugin/CMakeLists.txt index 987dd0a..3dced36 100644 --- a/fileitemactionplugin/CMakeLists.txt +++ b/fileitemactionplugin/CMakeLists.txt @@ -38,7 +38,11 @@ use_syncthingmodel() # link also explicitely against the following Qt and KF modules list(APPEND ADDITIONAL_QT_MODULES Network) list(APPEND ADDITIONAL_KF_MODULES KIO) -set(KIO_MODULE_TARGETS KF5::KIOCore KF5::KIOFileWidgets KF5::KIOWidgets KF5::KIONTLM) +set(KIO_MODULE_TARGETS + KF5::KIOCore + KF5::KIOFileWidgets + KF5::KIOWidgets + KF5::KIONTLM) # include modules to apply configuration include(BasicConfig) diff --git a/libsyncthing/CMakeLists.txt b/libsyncthing/CMakeLists.txt index 7b28960..e5d156b 100644 --- a/libsyncthing/CMakeLists.txt +++ b/libsyncthing/CMakeLists.txt @@ -58,12 +58,15 @@ message(STATUS "Using GOOS=${GO_TARGET_OS} and GOARCH=${GO_TARGET_ARCH}") # locate the Syncthing checkout set(GO_DEVELOPMENT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/go" CACHE PATH "the 'GOPATH'") -set(SYNCTHING_PATH "${CMAKE_CURRENT_SOURCE_DIR}/go/src/github.com/syncthing/syncthing" +set(SYNCTHING_PATH + "${CMAKE_CURRENT_SOURCE_DIR}/go/src/github.com/syncthing/syncthing" CACHE PATH "path of Syncthing checkout") # find Syncthing's assets caveat: newly added assets will not cause CMake to automatically regenerate -file(GLOB_RECURSE SRC_FILES_SYNCTHING_ASSETS LIST_DIRECTORIES false - RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${SYNCTHING_PATH}/gui/*") +file(GLOB_RECURSE SRC_FILES_SYNCTHING_ASSETS + LIST_DIRECTORIES false + RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" + "${SYNCTHING_PATH}/gui/*") if (NOT SRC_FILES_SYNCTHING_ASSETS) message( FATAL_ERROR @@ -72,11 +75,10 @@ if (NOT SRC_FILES_SYNCTHING_ASSETS) endif () # find Syncthing's source code caveat: newly added files will not cause CMake to automatically regenerate -file(GLOB_RECURSE SRC_FILES_SYNCTHING LIST_DIRECTORIES false +file(GLOB_RECURSE SRC_FILES_SYNCTHING + LIST_DIRECTORIES false RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" - "${SYNCTHING_PATH}/cmd/*.go" - "${SYNCTHING_PATH}/cmd/*.h" - "${SYNCTHING_PATH}/cmd/*.c") + "${SYNCTHING_PATH}/cmd/*.go" "${SYNCTHING_PATH}/cmd/*.h" "${SYNCTHING_PATH}/cmd/*.c") if (NOT SRC_FILES_SYNCTHING) message( FATAL_ERROR @@ -88,7 +90,13 @@ message(STATUS "Syncthing's go files: ${SRC_FILES_SYNCTHING}") # generate Syncthing's assets: don't set GOARCH/GOOS here, this is supposed to run on the host add_custom_command(OUTPUT "${SYNCTHING_PATH}/lib/auto/gui.files.go" - COMMAND "GOPATH=${GO_DEVELOPMENT_PATH}" "${GO_BIN}" run ./script/genassets.go gui > lib/auto/gui.files.go + COMMAND "GOPATH=${GO_DEVELOPMENT_PATH}" + "${GO_BIN}" + run + ./script/genassets.go + gui + > + lib/auto/gui.files.go DEPENDS ${SRC_FILES_SYNCTHING_ASSETS} WORKING_DIRECTORY "${SYNCTHING_PATH}" COMMENT "Building Syncthing's assets") @@ -96,10 +104,23 @@ add_custom_command(OUTPUT "${SYNCTHING_PATH}/lib/auto/gui.files.go" # compile Syncthing as static library add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libsyncthinginternal.a" "${CMAKE_CURRENT_BINARY_DIR}/libsyncthinginternal.h" - COMMAND "CC=${CMAKE_C_COMPILER}" "CXX=${CMAKE_CXX_COMPILER}" "AR=${CMAKE_C_COMPILER_AR}" - "GOOS=${GO_TARGET_OS}" "GOARCH=${GO_TARGET_ARCH}" "CGO_ENABLED=1" "GOPATH=${GO_DEVELOPMENT_PATH}" - "${GO_BIN}" build -v -buildmode c-archive -o "${CMAKE_CURRENT_BINARY_DIR}/libsyncthinginternal.a" - ./cmd/syncthing && "${CMAKE_RANLIB}" "${CMAKE_CURRENT_BINARY_DIR}/libsyncthinginternal.a" + COMMAND "CC=${CMAKE_C_COMPILER}" + "CXX=${CMAKE_CXX_COMPILER}" + "AR=${CMAKE_C_COMPILER_AR}" + "GOOS=${GO_TARGET_OS}" + "GOARCH=${GO_TARGET_ARCH}" + "CGO_ENABLED=1" + "GOPATH=${GO_DEVELOPMENT_PATH}" + "${GO_BIN}" + build + -v -buildmode + c-archive + -o + "${CMAKE_CURRENT_BINARY_DIR}/libsyncthinginternal.a" + ./cmd/syncthing + && + "${CMAKE_RANLIB}" + "${CMAKE_CURRENT_BINARY_DIR}/libsyncthinginternal.a" DEPENDS ${SRC_FILES_SYNCTHING} WORKING_DIRECTORY "${SYNCTHING_PATH}" COMMENT "Building Syncthing itself") @@ -120,10 +141,8 @@ list(APPEND PRIVATE_INCLUDE_DIRS "${SYNCTHING_PATH}/cmd/syncthing") find_package(c++utilities${CONFIGURATION_PACKAGE_SUFFIX} 5.0.0 REQUIRED) list(APPEND CMAKE_MODULE_PATH ${CPP_UTILITIES_MODULE_DIRS}) if (CPP_UTILITIES_SOURCE_DIR) - list(APPEND PRIVATE_INCLUDE_DIRS - $ - $ - ) + list(APPEND PRIVATE_INCLUDE_DIRS $ + $) else () list(APPEND PRIVATE_INCLUDE_DIRS ${CPP_UTILITIES_INCLUDE_DIRS}) endif () diff --git a/widgets/CMakeLists.txt b/widgets/CMakeLists.txt index 2c19015..5b67246 100644 --- a/widgets/CMakeLists.txt +++ b/widgets/CMakeLists.txt @@ -87,7 +87,10 @@ option(USE_LIBSYNCTHING "whether libsyncthing should be included for the launche if (USE_LIBSYNCTHING) find_package(syncthing ${META_APP_VERSION} REQUIRED) use_syncthing() - set_source_files_properties(misc/syncthinglauncher.cpp PROPERTIES COMPILE_DEFINITIONS SYNCTHINGWIDGETS_USE_LIBSYNCTHING) + set_source_files_properties(misc/syncthinglauncher.cpp + PROPERTIES + COMPILE_DEFINITIONS + SYNCTHINGWIDGETS_USE_LIBSYNCTHING) endif () # configure logging JavaScript events to stderr