Warning, /utilities/keysmith/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 #
0002 # SPDX-License-Identifier: BSD-2-Clause
0003 # SPDX-FileCopyrightText: 2019 Bhushan Shah <bshah@kde.org>
0004 # SPDX-FileCopyrightText: 2019 Friedrich W. H. Kossebau <kossebau@kde.org>
0005 # SPDX-FileCopyrightText: 2019-2020 Johan Ouwerkerk <jm.ouwerkerk@gmail.com>
0006 # SPDX-FileCopyrightText: 2021 Devin Lin <espidev@gmail.com>
0007 #
0008 
0009 # Need 3.10.X for C++17 support enabled via CMake: https://cmake.org/cmake/help/v3.10/prop_tgt/CXX_STANDARD.html#prop_tgt:CXX_STANDARD
0010 cmake_minimum_required(VERSION 3.10)
0011 
0012 project(keysmith)
0013 set(PROJECT_VERSION "22.06")
0014 
0015 set(KF5_MIN_VERSION "5.91.0")
0016 set(QT_MIN_VERSION "5.15.0")
0017 set(SODIUM_MIN_VERSION "1.0.16")
0018 set(KDE_COMPILERSETTINGS_LEVEL "5.82.0")
0019 
0020 ################# Disallow in-source build #################
0021 
0022 if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
0023    message(FATAL_ERROR "This application requires an out of source build. Please create a separate build directory.")
0024 endif()
0025 
0026 include(FeatureSummary)
0027 
0028 ################# set KDE specific information #################
0029 
0030 find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
0031 
0032 # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
0033 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
0034 
0035 include(KDEInstallDirs)
0036 include(KDECMakeSettings)
0037 include(KDECompilerSettings NO_POLICY_SCOPE)
0038 
0039 include(ECMAddTests)
0040 include(ECMPoQmTools)
0041 
0042 set(CMAKE_CXX_STANDARD 17)
0043 set(CMAKE_CXX_STANDARD_REQUIRED ON)
0044 
0045 ################# Find dependencies #################
0046 
0047 find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Gui Svg QuickControls2 Concurrent)
0048 find_package(KF5Kirigami2 ${KF5_MIN_VERSION} REQUIRED)
0049 find_package(KF5I18n ${KF5_MIN_VERSION} REQUIRED)
0050 
0051 if (QT_MAJOR_VERSION EQUAL "6")
0052     find_package(Qt6Core5Compat REQUIRED)
0053 endif()
0054 
0055 if(NOT BUILD_EXTERNAL AND (NOT ANDROID OR DEFINED BUILD_EXTERNAL))
0056     set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
0057 
0058     message(STATUS "Will build against system version of: libsodium")
0059     find_package(sodium ${SODIUM_MIN_VERSION} REQUIRED)
0060 endif()
0061 
0062 if (BUILD_DBUS_INTERFACE OR (NOT ANDROID AND NOT DEFINED BUILD_DBUS_INTERFACE))
0063     find_package(KF5DBusAddons ${KF5_MIN_VERSION} REQUIRED)
0064     find_package(KF5WindowSystem ${KF5_MIN_VERSION} REQUIRED)
0065     set(ENABLE_DBUS_INTERFACE ON)
0066 endif()
0067 
0068 ################ Find testing dependencies ##########
0069 
0070 if (BUILD_TESTING)
0071     find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED Test)
0072 endif()
0073 
0074 ################# build and install #################
0075 add_subdirectory(src)
0076 
0077 if (ANDROID)
0078     add_subdirectory(android)
0079 endif()
0080 
0081 if (BUILD_TESTING)
0082     add_subdirectory(autotests)
0083 endif()
0084 
0085 install(PROGRAMS org.kde.keysmith.desktop DESTINATION ${KDE_INSTALL_APPDIR})
0086 install(FILES keysmith.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps/)
0087 install(FILES org.kde.keysmith.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
0088 
0089 feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
0090 
0091 ################# install translations #################
0092 ki18n_install(po)