calamares/src/modules/users/CMakeLists.txt

102 lines
2.1 KiB
CMake
Raw Normal View History

# === This file is part of Calamares - <https://calamares.io> ===
#
# SPDX-FileCopyrightText: 2020 Adriaan de Groot <groot@kde.org>
# SPDX-License-Identifier: BSD-2-Clause
#
find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED Core DBus Network )
2017-09-13 22:24:30 +02:00
find_package( Crypt REQUIRED )
# 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()
2017-06-20 23:43:50 +02:00
include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui )
set( _users_src
# Jobs
CreateUserJob.cpp
MiscJobs.cpp
SetPasswordJob.cpp
SetHostNameJob.cpp
# Configuration
CheckPWQuality.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
)
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
RESOURCES
users.qrc
2016-12-07 16:37:29 +01:00
LINK_PRIVATE_LIBRARIES
2014-07-31 14:52:05 +02:00
calamaresui
${CRYPT_LIBRARIES}
${USER_EXTRA_LIB}
users_internal
2014-07-31 14:52:05 +02:00
SHARED_LIB
)
2017-06-20 23:43:50 +02:00
calamares_add_test(
userspasswordtest
SOURCES
TestPasswordJob.cpp
SetPasswordJob.cpp
LIBRARIES
${CRYPT_LIBRARIES}
)
calamares_add_test(
userscreatetest
SOURCES
TestCreateUserJob.cpp
CreateUserJob.cpp
)
calamares_add_test(
usershostnametest
SOURCES
TestSetHostNameJob.cpp
SetHostNameJob.cpp
LIBRARIES
Qt5::DBus # HostName job can use DBus to systemd
)
calamares_add_test(
userstest
SOURCES
Tests.cpp
${_users_src} # Build again with test-visibility
LIBRARIES
${USER_EXTRA_LIB}
${CRYPT_LIBRARIES} # SetPassword job uses crypt()
Qt5::DBus # HostName job can use DBus to systemd
)