Apply cmake-format
This commit is contained in:
parent
65eb59fe26
commit
56e1e98493
|
@ -63,7 +63,10 @@ if (SYSTEMD_SUPPORT)
|
||||||
org.freedesktop.systemd1.Manager.xml
|
org.freedesktop.systemd1.Manager.xml
|
||||||
org.freedesktop.systemd1.Service.xml
|
org.freedesktop.systemd1.Service.xml
|
||||||
org.freedesktop.systemd1.Unit.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)
|
list(APPEND META_PUBLIC_COMPILE_DEFINITIONS ${META_PROJECT_VARNAME_UPPER}_SUPPORT_SYSTEMD)
|
||||||
message(STATUS "systemd support enabled")
|
message(STATUS "systemd support enabled")
|
||||||
else ()
|
else ()
|
||||||
|
|
|
@ -38,7 +38,11 @@ use_syncthingmodel()
|
||||||
# link also explicitely against the following Qt and KF modules
|
# link also explicitely against the following Qt and KF modules
|
||||||
list(APPEND ADDITIONAL_QT_MODULES Network)
|
list(APPEND ADDITIONAL_QT_MODULES Network)
|
||||||
list(APPEND ADDITIONAL_KF_MODULES KIO)
|
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 modules to apply configuration
|
||||||
include(BasicConfig)
|
include(BasicConfig)
|
||||||
|
|
|
@ -58,12 +58,15 @@ message(STATUS "Using GOOS=${GO_TARGET_OS} and GOARCH=${GO_TARGET_ARCH}")
|
||||||
|
|
||||||
# locate the Syncthing checkout
|
# locate the Syncthing checkout
|
||||||
set(GO_DEVELOPMENT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/go" CACHE PATH "the 'GOPATH'")
|
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")
|
CACHE PATH "path of Syncthing checkout")
|
||||||
|
|
||||||
# find Syncthing's assets caveat: newly added assets will not cause CMake to automatically regenerate
|
# 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
|
file(GLOB_RECURSE SRC_FILES_SYNCTHING_ASSETS
|
||||||
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${SYNCTHING_PATH}/gui/*")
|
LIST_DIRECTORIES false
|
||||||
|
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
|
"${SYNCTHING_PATH}/gui/*")
|
||||||
if (NOT SRC_FILES_SYNCTHING_ASSETS)
|
if (NOT SRC_FILES_SYNCTHING_ASSETS)
|
||||||
message(
|
message(
|
||||||
FATAL_ERROR
|
FATAL_ERROR
|
||||||
|
@ -72,11 +75,10 @@ if (NOT SRC_FILES_SYNCTHING_ASSETS)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# find Syncthing's source code caveat: newly added files will not cause CMake to automatically regenerate
|
# 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}"
|
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
"${SYNCTHING_PATH}/cmd/*.go"
|
"${SYNCTHING_PATH}/cmd/*.go" "${SYNCTHING_PATH}/cmd/*.h" "${SYNCTHING_PATH}/cmd/*.c")
|
||||||
"${SYNCTHING_PATH}/cmd/*.h"
|
|
||||||
"${SYNCTHING_PATH}/cmd/*.c")
|
|
||||||
if (NOT SRC_FILES_SYNCTHING)
|
if (NOT SRC_FILES_SYNCTHING)
|
||||||
message(
|
message(
|
||||||
FATAL_ERROR
|
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
|
# 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"
|
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}
|
DEPENDS ${SRC_FILES_SYNCTHING_ASSETS}
|
||||||
WORKING_DIRECTORY "${SYNCTHING_PATH}"
|
WORKING_DIRECTORY "${SYNCTHING_PATH}"
|
||||||
COMMENT "Building Syncthing's assets")
|
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
|
# compile Syncthing as static library
|
||||||
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libsyncthinginternal.a"
|
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libsyncthinginternal.a"
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/libsyncthinginternal.h"
|
"${CMAKE_CURRENT_BINARY_DIR}/libsyncthinginternal.h"
|
||||||
COMMAND "CC=${CMAKE_C_COMPILER}" "CXX=${CMAKE_CXX_COMPILER}" "AR=${CMAKE_C_COMPILER_AR}"
|
COMMAND "CC=${CMAKE_C_COMPILER}"
|
||||||
"GOOS=${GO_TARGET_OS}" "GOARCH=${GO_TARGET_ARCH}" "CGO_ENABLED=1" "GOPATH=${GO_DEVELOPMENT_PATH}"
|
"CXX=${CMAKE_CXX_COMPILER}"
|
||||||
"${GO_BIN}" build -v -buildmode c-archive -o "${CMAKE_CURRENT_BINARY_DIR}/libsyncthinginternal.a"
|
"AR=${CMAKE_C_COMPILER_AR}"
|
||||||
./cmd/syncthing && "${CMAKE_RANLIB}" "${CMAKE_CURRENT_BINARY_DIR}/libsyncthinginternal.a"
|
"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}
|
DEPENDS ${SRC_FILES_SYNCTHING}
|
||||||
WORKING_DIRECTORY "${SYNCTHING_PATH}"
|
WORKING_DIRECTORY "${SYNCTHING_PATH}"
|
||||||
COMMENT "Building Syncthing itself")
|
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)
|
find_package(c++utilities${CONFIGURATION_PACKAGE_SUFFIX} 5.0.0 REQUIRED)
|
||||||
list(APPEND CMAKE_MODULE_PATH ${CPP_UTILITIES_MODULE_DIRS})
|
list(APPEND CMAKE_MODULE_PATH ${CPP_UTILITIES_MODULE_DIRS})
|
||||||
if (CPP_UTILITIES_SOURCE_DIR)
|
if (CPP_UTILITIES_SOURCE_DIR)
|
||||||
list(APPEND PRIVATE_INCLUDE_DIRS
|
list(APPEND PRIVATE_INCLUDE_DIRS $<BUILD_INTERFACE:${CPP_UTILITIES_SOURCE_DIR}/..>
|
||||||
$<BUILD_INTERFACE:${CPP_UTILITIES_SOURCE_DIR}/..>
|
$<INSTALL_INTERFACE:${CPP_UTILITIES_INCLUDE_DIRS}>)
|
||||||
$<INSTALL_INTERFACE:${CPP_UTILITIES_INCLUDE_DIRS}>
|
|
||||||
)
|
|
||||||
else ()
|
else ()
|
||||||
list(APPEND PRIVATE_INCLUDE_DIRS ${CPP_UTILITIES_INCLUDE_DIRS})
|
list(APPEND PRIVATE_INCLUDE_DIRS ${CPP_UTILITIES_INCLUDE_DIRS})
|
||||||
endif ()
|
endif ()
|
||||||
|
|
|
@ -87,7 +87,10 @@ option(USE_LIBSYNCTHING "whether libsyncthing should be included for the launche
|
||||||
if (USE_LIBSYNCTHING)
|
if (USE_LIBSYNCTHING)
|
||||||
find_package(syncthing ${META_APP_VERSION} REQUIRED)
|
find_package(syncthing ${META_APP_VERSION} REQUIRED)
|
||||||
use_syncthing()
|
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 ()
|
endif ()
|
||||||
|
|
||||||
# configure logging JavaScript events to stderr
|
# configure logging JavaScript events to stderr
|
||||||
|
|
Loading…
Reference in New Issue