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
|
|
|
|
#
|
2020-02-17 10:57:41 +01:00
|
|
|
find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED Core DBus Network )
|
2017-09-13 22:24:30 +02:00
|
|
|
find_package( Crypt REQUIRED )
|
2014-07-31 19:06:31 +02:00
|
|
|
|
2018-01-23 13:02:49 +01:00
|
|
|
# Add optional libraries here
|
|
|
|
set( USER_EXTRA_LIB )
|
|
|
|
|
|
|
|
find_package( LibPWQuality )
|
|
|
|
set_package_properties(
|
|
|
|
LibPWQuality PROPERTIES
|
|
|
|
PURPOSE "Extra checks of password quality"
|
|
|
|
)
|
|
|
|
|
|
|
|
if( LibPWQuality_FOUND )
|
|
|
|
list( APPEND USER_EXTRA_LIB ${LibPWQuality_LIBRARIES} )
|
|
|
|
include_directories( ${LibPWQuality_INCLUDE_DIRS} )
|
|
|
|
add_definitions( -DCHECK_PWQUALITY -DHAVE_LIBPWQUALITY )
|
|
|
|
endif()
|
|
|
|
|
2020-11-02 01:24:42 +01:00
|
|
|
find_package( ICU COMPONENTS uc i18n )
|
|
|
|
set_package_properties(
|
|
|
|
ICU PROPERTIES
|
|
|
|
PURPOSE "Transliteration support for full name to username conversion"
|
|
|
|
)
|
|
|
|
|
|
|
|
if( ICU_FOUND )
|
|
|
|
list( APPEND USER_EXTRA_LIB ICU::uc ICU::i18n )
|
|
|
|
include_directories( ${ICU_INCLUDE_DIRS} )
|
|
|
|
add_definitions( -DHAVE_ICU )
|
|
|
|
endif()
|
|
|
|
|
2017-06-20 23:43:50 +02:00
|
|
|
include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui )
|
|
|
|
|
2020-10-21 15:02:33 +02:00
|
|
|
set( _users_src
|
|
|
|
# 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
|
|
|
|
)
|
|
|
|
|
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
|
|
|
|
Qt5::DBus
|
2020-11-02 14:10:35 +01:00
|
|
|
${CRYPT_LIBRARIES}
|
2020-10-21 15:02:33 +02:00
|
|
|
)
|
|
|
|
|
2014-07-31 14:52:05 +02:00
|
|
|
calamares_add_plugin( users
|
|
|
|
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
|
|
|
|
2020-02-17 14:36:52 +01:00
|
|
|
calamares_add_test(
|
2020-02-17 18:10:46 +01:00
|
|
|
userspasswordtest
|
2020-02-17 14:36:52 +01:00
|
|
|
SOURCES
|
2020-07-29 13:23:41 +02:00
|
|
|
TestPasswordJob.cpp
|
2020-02-17 14:36:52 +01:00
|
|
|
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
|
2020-11-02 12:11:13 +01:00
|
|
|
${_users_src} # Build again with test-visibility
|
|
|
|
LIBRARIES
|
|
|
|
Qt5::DBus # HostName job can use DBus to systemd
|
|
|
|
${CRYPT_LIBRARIES} # SetPassword job uses crypt()
|
|
|
|
${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
|
2020-02-17 18:10:46 +01:00
|
|
|
SOURCES
|
2020-07-29 13:23:41 +02:00
|
|
|
TestSetHostNameJob.cpp
|
2020-02-17 18:10:46 +01:00
|
|
|
SetHostNameJob.cpp
|
|
|
|
LIBRARIES
|
2020-08-18 11:41:43 +02: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
|
2020-10-21 15:02:33 +02:00
|
|
|
${_users_src} # Build again with test-visibility
|
2020-08-05 13:03:56 +02:00
|
|
|
LIBRARIES
|
2020-10-21 15:02:33 +02:00
|
|
|
Qt5::DBus # HostName job can use DBus to systemd
|
2020-08-18 11:41:43 +02:00
|
|
|
${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
|
|
|
)
|