The complete source code of IdealIRC
http://www.idealirc.org/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
2.1 KiB
61 lines
2.1 KiB
/*
|
|
* IdealIRC - Internet Relay Chat client
|
|
* Copyright (C) 2021 Tom-Andre Barstad.
|
|
* This software is licensed under the Software Attribution License.
|
|
* See LICENSE for more information.
|
|
*/
|
|
|
|
@config_h_warning@
|
|
|
|
#ifndef IDEALIRC_CONFIG_H
|
|
#define IDEALIRC_CONFIG_H
|
|
|
|
#include <QApplication>
|
|
#include <QStandardPaths>
|
|
|
|
|
|
/*
|
|
* Define known directory paths for the application.
|
|
* - GLOBAL_PATH: Common files across the system, such as skeleton for each user. Consider this directory to be read-only.
|
|
* - LOCAL_PATH: Configuration storage for the user running the application. Consider this directory to be read-write.
|
|
*/
|
|
#define IIRCBT_packaged 1
|
|
#define IIRCBT_standalone 2
|
|
#define IIRCBT IIRCBT_@BUILD_TYPE@
|
|
#if IIRCBT == IIRCBT_packaged
|
|
#if defined(Q_OS_LINUX)
|
|
#define GLOBAL_PATH QStringLiteral("/usr/share/idealirc")
|
|
#define LOCAL_PATH QStringLiteral("%1/idealirc").arg(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation))
|
|
#elif defined(Q_OS_WIN32) | defined(Q_OS_WIN64)
|
|
#define GLOBAL_PATH QApplication::applicationDirPath()
|
|
#define LOCAL_PATH QStandardPaths::writableLocation(QStandardPaths::ConfigLocation)
|
|
#else
|
|
#error Unsupported platform! Update config.h.in accordingly.
|
|
#endif
|
|
#elif IIRCBT == IIRCBT_standalone
|
|
#define GLOBAL_PATH QApplication::applicationDirPath()
|
|
#define LOCAL_PATH QApplication::applicationDirPath()
|
|
#else
|
|
#error 'Invalid BUILD_TYPE setting: @BUILD_TYPE@. Valid choises are: "packaged" and "standalone".'
|
|
#endif
|
|
#undef IIRCBT
|
|
#undef IIRCBT_packaged
|
|
#undef IIRCBT_standalone
|
|
|
|
enum class BuildType
|
|
{
|
|
packaged,
|
|
standalone
|
|
};
|
|
|
|
constexpr BuildType BUILD_TYPE = BuildType::@BUILD_TYPE@;
|
|
|
|
constexpr int VERSION_MAJOR = @VERSION_MAJOR@;
|
|
constexpr int VERSION_MINOR = @VERSION_MINOR@;
|
|
constexpr int VERSION_PATCH = @VERSION_PATCH@;
|
|
constexpr auto* VERSION_APPEND = "@VERSION_APPEND@";
|
|
constexpr auto* VERSION_STRING = "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@@VERSION_APPEND@";
|
|
constexpr auto* VERSION_STRING_NO_APPEND = "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@";
|
|
|
|
|
|
#endif
|
|
|