2020-08-25 16:05:56 +02:00
|
|
|
# === This file is part of Calamares - <https://calamares.io> ===
|
2020-08-26 00:24:52 +02:00
|
|
|
#
|
|
|
|
# SPDX-FileCopyrightText: 2020 Adriaan de Groot <groot@kde.org>
|
|
|
|
# SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
#
|
2022-02-08 16:18:47 +01:00
|
|
|
find_package(Qt5 ${QT_VERSION} CONFIG REQUIRED Core DBus Network)
|
|
|
|
find_package(Crypt REQUIRED)
|
2014-07-31 19:06:31 +02:00
|
|
|
|
2018-01-23 13:02:49 +01:00
|
|
|
# Add optional libraries here
|
2022-02-08 16:18:47 +01:00
|
|
|
set(USER_EXTRA_LIB)
|
2018-01-23 13:02:49 +01:00
|
|
|
|
2022-02-08 16:18:47 +01:00
|
|
|
find_package(LibPWQuality)
|
|
|
|
set_package_properties(LibPWQuality PROPERTIES PURPOSE "Extra checks of password quality")
|
2018-01-23 13:02:49 +01:00
|
|
|
|
2022-02-08 16:18:47 +01:00
|
|
|
if(LibPWQuality_FOUND)
|
|
|
|
list(APPEND USER_EXTRA_LIB ${LibPWQuality_LIBRARIES})
|
|
|
|
include_directories(${LibPWQuality_INCLUDE_DIRS})
|
|
|
|
add_definitions(-DCHECK_PWQUALITY -DHAVE_LIBPWQUALITY)
|
2018-01-23 13:02:49 +01:00
|
|
|
endif()
|
|
|
|
|
2022-02-08 16:18:47 +01:00
|
|
|
find_package(ICU COMPONENTS uc i18n)
|
|
|
|
set_package_properties(ICU PROPERTIES PURPOSE "Transliteration support for full name to username conversion")
|
2020-11-02 01:24:42 +01:00
|
|
|
|
2022-02-08 16:18:47 +01:00
|
|
|
if(ICU_FOUND)
|
|
|
|
list(APPEND USER_EXTRA_LIB ICU::uc ICU::i18n)
|
|
|
|
include_directories(${ICU_INCLUDE_DIRS})
|
|
|
|
add_definitions(-DHAVE_ICU)
|
2020-11-02 01:24:42 +01:00
|
|
|
endif()
|
|
|
|
|
2022-02-08 16:18:47 +01:00
|
|
|
include_directories(${PROJECT_BINARY_DIR}/src/libcalamaresui)
|
2017-06-20 23:43:50 +02:00
|
|
|
|
2022-02-08 16:18:47 +01:00
|
|
|
set(_users_src
|
2020-10-21 15:02:33 +02:00
|
|
|
# Jobs
|
2020-08-18 11:41:43 +02:00
|
|
|
CreateUserJob.cpp
|
2020-10-21 14:43:45 +02:00
|
|
|
MiscJobs.cpp
|
2020-08-18 11:41:43 +02:00
|
|
|
SetPasswordJob.cpp
|
|
|
|
SetHostNameJob.cpp
|
2020-10-21 15:02:33 +02:00
|
|
|
# Configuration
|
2020-08-18 11:41:43 +02:00
|
|
|
CheckPWQuality.cpp
|
|
|
|
Config.cpp
|
|
|
|
)
|
|
|
|
|
2022-04-12 14:10:12 +02:00
|
|
|
# This part of the code is shared with the usersq module
|
2020-10-21 15:02:33 +02:00
|
|
|
calamares_add_library(
|
|
|
|
users_internal
|
|
|
|
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
|
|
|
TARGET_TYPE STATIC
|
|
|
|
NO_INSTALL
|
|
|
|
NO_VERSION
|
|
|
|
SOURCES
|
|
|
|
${_users_src}
|
|
|
|
LINK_LIBRARIES
|
2022-04-12 14:10:12 +02:00
|
|
|
KF5::CoreAddons
|
2020-10-21 15:02:33 +02:00
|
|
|
Qt5::DBus
|
2020-11-02 14:10:35 +01:00
|
|
|
${CRYPT_LIBRARIES}
|
2020-10-21 15:02:33 +02:00
|
|
|
)
|
|
|
|
|
2022-02-08 16:18:47 +01:00
|
|
|
calamares_add_plugin(users
|
2014-07-31 14:52:05 +02:00
|
|
|
TYPE viewmodule
|
|
|
|
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
|
|
|
SOURCES
|
|
|
|
UsersViewStep.cpp
|
|
|
|
UsersPage.cpp
|
|
|
|
UI
|
|
|
|
page_usersetup.ui
|
2014-08-26 15:18:30 +02:00
|
|
|
RESOURCES
|
|
|
|
users.qrc
|
2016-12-07 16:37:29 +01:00
|
|
|
LINK_PRIVATE_LIBRARIES
|
2020-11-02 14:10:35 +01:00
|
|
|
users_internal
|
2014-07-31 19:06:31 +02:00
|
|
|
${CRYPT_LIBRARIES}
|
2018-01-23 13:02:49 +01:00
|
|
|
${USER_EXTRA_LIB}
|
2014-07-31 14:52:05 +02:00
|
|
|
SHARED_LIB
|
|
|
|
)
|
2017-06-20 23:43:50 +02:00
|
|
|
|
2022-02-08 16:18:47 +01:00
|
|
|
calamares_add_test(userspasswordtest SOURCES TestPasswordJob.cpp SetPasswordJob.cpp LIBRARIES ${CRYPT_LIBRARIES})
|
2020-02-17 18:10:46 +01:00
|
|
|
|
2020-07-27 15:00:14 +02:00
|
|
|
calamares_add_test(
|
2020-10-22 14:21:14 +02:00
|
|
|
usersgroupstest
|
2020-07-27 15:00:14 +02:00
|
|
|
SOURCES
|
2020-10-22 14:22:11 +02:00
|
|
|
TestGroupInformation.cpp
|
2022-02-08 16:18:47 +01:00
|
|
|
${_users_src} # Build again with test-visibility
|
2020-11-02 12:11:13 +01:00
|
|
|
LIBRARIES
|
2022-04-12 14:10:12 +02:00
|
|
|
KF5::CoreAddons
|
2022-02-08 16:18:47 +01:00
|
|
|
Qt5::DBus # HostName job can use DBus to systemd
|
|
|
|
${CRYPT_LIBRARIES} # SetPassword job uses crypt()
|
2020-11-02 12:11:13 +01:00
|
|
|
${USER_EXTRA_LIB}
|
2020-07-27 15:00:14 +02:00
|
|
|
)
|
|
|
|
|
2020-02-17 18:10:46 +01:00
|
|
|
calamares_add_test(
|
2020-07-29 13:23:41 +02:00
|
|
|
usershostnametest
|
2022-02-08 16:18:47 +01:00
|
|
|
SOURCES TestSetHostNameJob.cpp SetHostNameJob.cpp
|
2020-02-17 18:10:46 +01:00
|
|
|
LIBRARIES
|
2022-02-08 16:18:47 +01:00
|
|
|
Qt5::DBus # HostName job can use DBus to systemd
|
2020-02-17 18:10:46 +01:00
|
|
|
)
|
2020-07-29 13:31:39 +02:00
|
|
|
|
|
|
|
calamares_add_test(
|
|
|
|
userstest
|
|
|
|
SOURCES
|
|
|
|
Tests.cpp
|
2022-02-08 16:18:47 +01:00
|
|
|
${_users_src} # Build again with test-visibility
|
2020-08-05 13:03:56 +02:00
|
|
|
LIBRARIES
|
2022-04-12 14:10:12 +02:00
|
|
|
KF5::CoreAddons
|
2022-02-08 16:18:47 +01:00
|
|
|
Qt5::DBus # HostName job can use DBus to systemd
|
|
|
|
${CRYPT_LIBRARIES} # SetPassword job uses crypt()
|
2020-10-23 12:01:29 +02:00
|
|
|
${USER_EXTRA_LIB}
|
2020-07-29 13:31:39 +02:00
|
|
|
)
|