mirror of
https://github.com/arcan1s/queued.git
synced 2025-04-24 23:47:19 +00:00
add cmake adds
This commit is contained in:
parent
9094e6f450
commit
3ed3973f4d
@ -1,5 +1,5 @@
|
|||||||
# main qt libraries
|
# main qt libraries
|
||||||
find_package(Qt5 5.6.0 REQUIRED COMPONENTS Core DBus Sql Test)
|
find_package(Qt5 5.8.0 REQUIRED COMPONENTS Core DBus Sql Test)
|
||||||
add_definitions(
|
add_definitions(
|
||||||
${Qt5Core_DEFINITIONS} ${Qt5DBus_DEFINITIONS} ${Qt5Sql_DEFINITIONS}
|
${Qt5Core_DEFINITIONS} ${Qt5DBus_DEFINITIONS} ${Qt5Sql_DEFINITIONS}
|
||||||
)
|
)
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
set (SUBPROJECT "queued-daemon")
|
set (SUBPROJECT "queued-daemon")
|
||||||
message (STATUS "Subproject ${SUBPROJECT}")
|
message (STATUS "Subproject ${SUBPROJECT}")
|
||||||
|
|
||||||
|
include("adds.cmake")
|
||||||
add_subdirectory ("src")
|
add_subdirectory ("src")
|
||||||
# build man
|
# build man
|
||||||
file (GLOB SUBPROJECT_MAN_IN "*.1")
|
file (GLOB SUBPROJECT_MAN_IN "*.1")
|
||||||
|
58
sources/queued-daemon/QueuedConfig.cmake
Normal file
58
sources/queued-daemon/QueuedConfig.cmake
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) 2017 Evgeniy Alekseev
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
# of this software and associated documentation files (the "Software"), to deal
|
||||||
|
#
|
||||||
|
# in the Software without restriction, including without limitation the rights
|
||||||
|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
# copies of the Software, and to permit persons to whom the Software is
|
||||||
|
# furnished to do so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be included in
|
||||||
|
# all copies or substantial portions of the Software.
|
||||||
|
##
|
||||||
|
# @file QueuedConfig.cmake
|
||||||
|
# Additional file of queued library
|
||||||
|
# @author Evgeniy Alekseev
|
||||||
|
# @copyright MIT
|
||||||
|
# @bug https://github.com/arcan1s/queued/issues
|
||||||
|
##
|
||||||
|
|
||||||
|
|
||||||
|
##
|
||||||
|
# @brief try to find queued libraries
|
||||||
|
##
|
||||||
|
|
||||||
|
##
|
||||||
|
# @def QUEUED_DEFINITIONS
|
||||||
|
# optional cmake definitions
|
||||||
|
##
|
||||||
|
set(QUEUED_DEFINITIONS "")
|
||||||
|
##
|
||||||
|
# @def QUEUED_INCLUDE_DIRS
|
||||||
|
# path to root include directory
|
||||||
|
##
|
||||||
|
find_path(QUEUEDCORE_INCLUDE_DIR "queued/Queued.h" PATH_SUFFIXES "queued")
|
||||||
|
set(QUEUED_INCLUDE_DIRS "${QUEUEDCORE_INCLUDE_DIR}")
|
||||||
|
##
|
||||||
|
# @def QUEUED_LIBRARIES
|
||||||
|
# queued library name
|
||||||
|
##
|
||||||
|
find_library(QUEUEDCORE_LIBRARY NAMES "queued" "libqueued"
|
||||||
|
PATH_SUFFIXES "queued")
|
||||||
|
set(QUEUED_LIBRARIES "${QUEUEDCORE_LIBRARY}")
|
||||||
|
##
|
||||||
|
# @def QUEUED_FOUND
|
||||||
|
# boolean, true if library has been found
|
||||||
|
##
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(Queued DEFAULT_MSG
|
||||||
|
QUEUED_LIBRARIES QUEUED_INCLUDE_DIRS)
|
||||||
|
|
||||||
|
##
|
||||||
|
# @brief additional defined macros
|
||||||
|
##
|
||||||
|
include("${CMAKE_CURRENT_LIST_DIR}/QueuedPaths.cmake")
|
||||||
|
include("${CMAKE_CURRENT_LIST_DIR}/QueuedLibraries.cmake")
|
||||||
|
include("${CMAKE_CURRENT_LIST_DIR}/QueuedMacros.cmake")
|
47
sources/queued-daemon/QueuedLibraries.cmake
Normal file
47
sources/queued-daemon/QueuedLibraries.cmake
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) 2017 Evgeniy Alekseev
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
# of this software and associated documentation files (the "Software"), to deal
|
||||||
|
#
|
||||||
|
# in the Software without restriction, including without limitation the rights
|
||||||
|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
# copies of the Software, and to permit persons to whom the Software is
|
||||||
|
# furnished to do so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be included in
|
||||||
|
# all copies or substantial portions of the Software.
|
||||||
|
##
|
||||||
|
# @file QueuedLibraries.cmake
|
||||||
|
# Additional file of queued library
|
||||||
|
# @author Evgeniy Alekseev
|
||||||
|
# @copyright MIT
|
||||||
|
# @bug https://github.com/arcan1s/queued/issues
|
||||||
|
##
|
||||||
|
|
||||||
|
|
||||||
|
##
|
||||||
|
# @brief Queued common libraries
|
||||||
|
##
|
||||||
|
|
||||||
|
find_package(Qt5 5.8.0 REQUIRED COMPONENTS Core DBus Sql)
|
||||||
|
##
|
||||||
|
# @brief add Qt definitions
|
||||||
|
##
|
||||||
|
add_definitions(
|
||||||
|
${Qt5Core_DEFINITIONS} ${Qt5DBus_DEFINITIONS} ${Qt5Sql_DEFINITIONS}
|
||||||
|
)
|
||||||
|
##
|
||||||
|
# @def Qt_INCLUDE
|
||||||
|
# Qt include paths
|
||||||
|
##
|
||||||
|
set(Qt_INCLUDE
|
||||||
|
${Qt5Core_INCLUDE_DIRS} ${Qt5DBus_INCLUDE_DIRS} ${Qt5Sql_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
##
|
||||||
|
# @def Qt_LIBRARIES
|
||||||
|
# Qt libraries
|
||||||
|
##
|
||||||
|
set(Qt_LIBRARIES
|
||||||
|
${Qt5Core_LIBRARIES} ${Qt5DBus_LIBRARIES} ${Qt5Sql_LIBRARIES}
|
||||||
|
)
|
60
sources/queued-daemon/QueuedMacros.cmake
Normal file
60
sources/queued-daemon/QueuedMacros.cmake
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) 2017 Evgeniy Alekseev
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
# of this software and associated documentation files (the "Software"), to deal
|
||||||
|
#
|
||||||
|
# in the Software without restriction, including without limitation the rights
|
||||||
|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
# copies of the Software, and to permit persons to whom the Software is
|
||||||
|
# furnished to do so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be included in
|
||||||
|
# all copies or substantial portions of the Software.
|
||||||
|
##
|
||||||
|
# @file QueuedMacros.cmake
|
||||||
|
# Additional file of queued library
|
||||||
|
# @author Evgeniy Alekseev
|
||||||
|
# @copyright MIT
|
||||||
|
# @bug https://github.com/arcan1s/queued/issues
|
||||||
|
##
|
||||||
|
|
||||||
|
|
||||||
|
##
|
||||||
|
# @brief additional macros for queued
|
||||||
|
##
|
||||||
|
|
||||||
|
##
|
||||||
|
# @fn queued_install_plugin root [name] [libraries]
|
||||||
|
# @brief build and install plugin
|
||||||
|
# @param PLUGIN_ROOT plugin root directory
|
||||||
|
# @param PLUGIN plugin name (optional). Will be assigned from path
|
||||||
|
# if empty
|
||||||
|
# @param ADDS_LIBRARIES additional libraries (optional)
|
||||||
|
#
|
||||||
|
##
|
||||||
|
macro(queued_install_plugin PLUGIN_ROOT)
|
||||||
|
set(PLUGIN "${ARGV1}")
|
||||||
|
if (NOT PLUGIN)
|
||||||
|
set(PLUGIN "${PLUGIN_ROOT}")
|
||||||
|
endif()
|
||||||
|
set(ADDS_LIBRARIES "${ARGV2}")
|
||||||
|
message (STATUS "Plugin ${PLUGIN}")
|
||||||
|
# get sources
|
||||||
|
file (GLOB_RECURSE ${PLUGIN}_SOURCES "${PLUGIN_ROOT}/*.cpp")
|
||||||
|
file (GLOB_RECURSE ${PLUGIN}_HEADERS "${PLUGIN_ROOT}/*.h")
|
||||||
|
qt5_wrap_cpp (${PLUGIN}_MOC_SOURCES "${${PLUGIN}_HEADERS}")
|
||||||
|
|
||||||
|
# include directories
|
||||||
|
include_directories ("${CMAKE_CURRENT_BINARY_DIR}"
|
||||||
|
"${Qt_INCLUDE}"
|
||||||
|
"${QUEUED_INCLUDE_DIRS}")
|
||||||
|
|
||||||
|
# build
|
||||||
|
add_library ("${PLUGIN}" MODULE "${${PLUGIN}_SOURCES}" "${${PLUGIN}_HEADERS}"
|
||||||
|
"${${PLUGIN}_MOC_SOURCES}")
|
||||||
|
target_link_libraries ("${PLUGIN}" "${QUEUED_LIBRARIES}" "${Qt_LIBRARIES}" "${ADDS_LIBRARIES}")
|
||||||
|
|
||||||
|
# install
|
||||||
|
install (TARGETS "${PLUGIN}" DESTINATION "${QUEUED_PLUGIN_ROOT}")
|
||||||
|
endmacro()
|
56
sources/queued-daemon/QueuedPaths.cmake.in
Normal file
56
sources/queued-daemon/QueuedPaths.cmake.in
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) 2017 Evgeniy Alekseev
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
# of this software and associated documentation files (the "Software"), to deal
|
||||||
|
#
|
||||||
|
# in the Software without restriction, including without limitation the rights
|
||||||
|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
# copies of the Software, and to permit persons to whom the Software is
|
||||||
|
# furnished to do so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be included in
|
||||||
|
# all copies or substantial portions of the Software.
|
||||||
|
##
|
||||||
|
# @file QueuedPaths.cmake
|
||||||
|
# Additional file of queued library
|
||||||
|
# @author Evgeniy Alekseev
|
||||||
|
# @copyright MIT
|
||||||
|
# @bug https://github.com/arcan1s/queued/issues
|
||||||
|
##
|
||||||
|
|
||||||
|
|
||||||
|
##
|
||||||
|
# @brief Queued common paths
|
||||||
|
##
|
||||||
|
|
||||||
|
##
|
||||||
|
# @def BIN_INSTALL_DIR
|
||||||
|
# installation directory for executables
|
||||||
|
##
|
||||||
|
set(BIN_INSTALL_DIR "@BIN_INSTALL_DIR@")
|
||||||
|
##
|
||||||
|
# @def DATA_INSTALL_DIR
|
||||||
|
# installation directory for data
|
||||||
|
##
|
||||||
|
set(DATA_INSTALL_DIR "@DATA_INSTALL_DIR@")
|
||||||
|
##
|
||||||
|
# @def INCLUDE_INSTALL_DIR
|
||||||
|
# installation directory for headers
|
||||||
|
##
|
||||||
|
set(INCLUDE_INSTALL_DIR "@INCLUDE_INSTALL_DIR@")
|
||||||
|
##
|
||||||
|
# @def LIB_INSTALL_DIR
|
||||||
|
# installation directory for libraries
|
||||||
|
##
|
||||||
|
set(LIB_INSTALL_DIR "@LIB_INSTALL_DIR@")
|
||||||
|
##
|
||||||
|
# @def QUEUED_ROOT
|
||||||
|
# queued root directory
|
||||||
|
##
|
||||||
|
set(QUEUED_ROOT "${DATA_INSTALL_DIR}/queued")
|
||||||
|
##
|
||||||
|
# @def QUEUED_PLUGIN_ROOT
|
||||||
|
# queued plugins root directory
|
||||||
|
##
|
||||||
|
set(QUEUED_PLUGIN_ROOT "${QUEUED_ROOT}/plugins")
|
7
sources/queued-daemon/adds.cmake
Normal file
7
sources/queued-daemon/adds.cmake
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# configure paths
|
||||||
|
configure_file ("QueuedPaths.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/QueuedPaths.cmake" @ONLY)
|
||||||
|
# additional files
|
||||||
|
install (FILES "QueuedConfig.cmake" DESTINATION "${LIB_INSTALL_DIR}/cmake/Queued")
|
||||||
|
install (FILES "QueuedLibraries.cmake" DESTINATION "${LIB_INSTALL_DIR}/cmake/Queued")
|
||||||
|
install (FILES "QueuedMacros.cmake" DESTINATION "${LIB_INSTALL_DIR}/cmake/Queued")
|
||||||
|
install (FILES "${CMAKE_CURRENT_BINARY_DIR}/QueuedPaths.cmake" DESTINATION "${LIB_INSTALL_DIR}/cmake/Queued")
|
@ -193,8 +193,6 @@ public:
|
|||||||
* start report date
|
* start report date
|
||||||
* @param _to
|
* @param _to
|
||||||
* stop report date
|
* stop report date
|
||||||
* @param _core
|
|
||||||
* pointer to core object
|
|
||||||
* @param _token
|
* @param _token
|
||||||
* user auth token
|
* user auth token
|
||||||
* @return performance table
|
* @return performance table
|
||||||
|
@ -44,8 +44,6 @@ namespace QueuedEnums
|
|||||||
* administrative permissions
|
* administrative permissions
|
||||||
* @var Permission::Job
|
* @var Permission::Job
|
||||||
* job related permissions
|
* job related permissions
|
||||||
* @var Permission::Web
|
|
||||||
* web server access
|
|
||||||
* @var Permission::Reports
|
* @var Permission::Reports
|
||||||
* access to reports
|
* access to reports
|
||||||
*/
|
*/
|
||||||
@ -54,8 +52,7 @@ enum class Permission {
|
|||||||
SuperAdmin = 1 << 1,
|
SuperAdmin = 1 << 1,
|
||||||
Admin = 1 << 2,
|
Admin = 1 << 2,
|
||||||
Job = 1 << 3,
|
Job = 1 << 3,
|
||||||
Web = 1 << 4,
|
Reports = 1 << 4
|
||||||
Reports = 1 << 5
|
|
||||||
};
|
};
|
||||||
Q_DECLARE_FLAGS(Permissions, Permission)
|
Q_DECLARE_FLAGS(Permissions, Permission)
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS(Permissions)
|
Q_DECLARE_OPERATORS_FOR_FLAGS(Permissions)
|
||||||
@ -63,7 +60,6 @@ const QHash<QString, Permission> PermissionMap = {
|
|||||||
{"superadmin", Permission::SuperAdmin},
|
{"superadmin", Permission::SuperAdmin},
|
||||||
{"admin", Permission::Admin},
|
{"admin", Permission::Admin},
|
||||||
{"job", Permission::Job},
|
{"job", Permission::Job},
|
||||||
{"web", Permission::Web},
|
|
||||||
{"reports", Permission::Reports},
|
{"reports", Permission::Reports},
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user