[users] Refactor users functionality to a static lib
- this makes it less fragile to share all the functionality with usersq, since it ends up in the library which is shared between the modules.
This commit is contained in:
parent
6560ef00a1
commit
3d289f345a
@ -23,25 +23,35 @@ endif()
|
|||||||
|
|
||||||
include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui )
|
include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui )
|
||||||
|
|
||||||
set( JOB_SRC
|
set( _users_src
|
||||||
|
# Jobs
|
||||||
CreateUserJob.cpp
|
CreateUserJob.cpp
|
||||||
MiscJobs.cpp
|
MiscJobs.cpp
|
||||||
SetPasswordJob.cpp
|
SetPasswordJob.cpp
|
||||||
SetHostNameJob.cpp
|
SetHostNameJob.cpp
|
||||||
)
|
# Configuration
|
||||||
set( CONFIG_SRC
|
|
||||||
CheckPWQuality.cpp
|
CheckPWQuality.cpp
|
||||||
Config.cpp
|
Config.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
calamares_add_library(
|
||||||
|
users_internal
|
||||||
|
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
||||||
|
TARGET_TYPE STATIC
|
||||||
|
NO_INSTALL
|
||||||
|
NO_VERSION
|
||||||
|
SOURCES
|
||||||
|
${_users_src}
|
||||||
|
LINK_LIBRARIES
|
||||||
|
Qt5::DBus
|
||||||
|
)
|
||||||
|
|
||||||
calamares_add_plugin( users
|
calamares_add_plugin( users
|
||||||
TYPE viewmodule
|
TYPE viewmodule
|
||||||
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
||||||
SOURCES
|
SOURCES
|
||||||
UsersViewStep.cpp
|
UsersViewStep.cpp
|
||||||
UsersPage.cpp
|
UsersPage.cpp
|
||||||
${JOB_SRC}
|
|
||||||
${CONFIG_SRC}
|
|
||||||
UI
|
UI
|
||||||
page_usersetup.ui
|
page_usersetup.ui
|
||||||
RESOURCES
|
RESOURCES
|
||||||
@ -50,7 +60,7 @@ calamares_add_plugin( users
|
|||||||
calamaresui
|
calamaresui
|
||||||
${CRYPT_LIBRARIES}
|
${CRYPT_LIBRARIES}
|
||||||
${USER_EXTRA_LIB}
|
${USER_EXTRA_LIB}
|
||||||
Qt5::DBus
|
users_internal
|
||||||
SHARED_LIB
|
SHARED_LIB
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -83,10 +93,9 @@ calamares_add_test(
|
|||||||
userstest
|
userstest
|
||||||
SOURCES
|
SOURCES
|
||||||
Tests.cpp
|
Tests.cpp
|
||||||
${JOB_SRC}
|
${_users_src} # Build again with test-visibility
|
||||||
${CONFIG_SRC}
|
|
||||||
LIBRARIES
|
LIBRARIES
|
||||||
${USER_EXTRA_LIB}
|
${USER_EXTRA_LIB}
|
||||||
Qt5::DBus # HostName job can use DBus to systemd
|
|
||||||
${CRYPT_LIBRARIES} # SetPassword job uses crypt()
|
${CRYPT_LIBRARIES} # SetPassword job uses crypt()
|
||||||
|
Qt5::DBus # HostName job can use DBus to systemd
|
||||||
)
|
)
|
||||||
|
@ -84,7 +84,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class Config : public QObject
|
class PLUGINDLLEXPORT Config : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
@ -13,9 +13,8 @@ find_package( Crypt REQUIRED )
|
|||||||
|
|
||||||
# Add optional libraries here
|
# Add optional libraries here
|
||||||
set( USER_EXTRA_LIB )
|
set( USER_EXTRA_LIB )
|
||||||
set( _users ${CMAKE_CURRENT_SOURCE_DIR}/../users )
|
|
||||||
|
|
||||||
include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui ${CMAKE_CURRENT_SOURCE_DIR}/../../libcalamares ${_users} )
|
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../users )
|
||||||
|
|
||||||
find_package( LibPWQuality )
|
find_package( LibPWQuality )
|
||||||
set_package_properties(
|
set_package_properties(
|
||||||
@ -33,12 +32,6 @@ calamares_add_plugin( usersq
|
|||||||
TYPE viewmodule
|
TYPE viewmodule
|
||||||
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
||||||
SOURCES
|
SOURCES
|
||||||
${_users}/CheckPWQuality.cpp
|
|
||||||
${_users}/Config.cpp
|
|
||||||
${_users}/CreateUserJob.cpp
|
|
||||||
${_users}/MiscJobs.cpp
|
|
||||||
${_users}/SetHostNameJob.cpp
|
|
||||||
${_users}/SetPasswordJob.cpp
|
|
||||||
UsersQmlViewStep.cpp
|
UsersQmlViewStep.cpp
|
||||||
RESOURCES
|
RESOURCES
|
||||||
usersq.qrc
|
usersq.qrc
|
||||||
@ -47,5 +40,6 @@ calamares_add_plugin( usersq
|
|||||||
${CRYPT_LIBRARIES}
|
${CRYPT_LIBRARIES}
|
||||||
${USER_EXTRA_LIB}
|
${USER_EXTRA_LIB}
|
||||||
Qt5::DBus
|
Qt5::DBus
|
||||||
|
users_internal
|
||||||
SHARED_LIB
|
SHARED_LIB
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user