mirror of
https://github.com/weechat/weechat.git
synced 2026-07-03 00:03:12 +02:00
5c8ac69f73821f6b9943ed29b1a2770b203aefd1
cmake documentation is absolutely atrocious, and I don't know why they mention all the wrong things to use, and the cargo cult of successfully writing a cmake build definition (copy-pasting what works from other projects) also uses all the wrong things. But it turns out it is possible to correctly link a PkgConfig target despite all that, at least, *iff* you use cmake >= 3.13. I've chosen option 2, which is to vendor in cmake >= 3.13's FindPkgConfig module in the previous commit. Using IMPORTED_TARGET GLOBAL in a pkg-config check will result in a proper linker target being created. For comparison, this is like using meson's dependency() target, except meson forces you to do this by default. The result is that the build system's internal representation of how to link something, is used instead of manually passing build flags defined in variables. This is an important distinction to make, because cmake does not have a list datatype, and instead turns lists into strings separated by ';' which are indistinguishable from, like, strings which contain ';' characters. When you pass the resulting list-which-isn't-really-a-list to link an executable/library, you either need to preprocess the variable to replace ';' with ' ' (just in case there are multiple elements) or use cmake functions which magically know to do this themselves -- or at least, I assume there are cmake functions that correctly handle so-called "lists", or there would be no need for "lists" to exist. The IMPORTED_TARGET will define a bunch of INTERFACE_* properties which do seem to do exactly this. The resulting build definition should actually, correctly, link python, thereby fixing #1398 in a better way.
:author: Sébastien Helleu :email: flashcode@flashtux.org :lang: en pass:[<p align="center">] image:https://weechat.org/media/images/weechat_logo_large.png[align="center"] pass:[</p>] image:https://img.shields.io/badge/diaspora*-follow-blue.svg["Diaspora*", link="https://diasp.eu/u/weechat"] image:https://img.shields.io/badge/mastodon-follow-blue.svg["Mastodon", link="https://hostux.social/@weechat"] image:https://img.shields.io/badge/twitter-follow-blue.svg["Twitter", link="https://twitter.com/WeeChatClient"] image:https://img.shields.io/badge/devel%20blog-follow-blue.svg["Devel blog", link="https://blog.weechat.org/"] image:https://img.shields.io/badge/slant-recommend-28acad.svg["Slant", link="https://www.slant.co/topics/1323/~best-irc-clients-for-linux"] image:https://img.shields.io/badge/help-donate%20%E2%9D%A4-ff69b4.svg["Donate", link="https://weechat.org/donate/"] image:https://travis-ci.org/weechat/weechat.svg?branch=master["Build Status", link="https://travis-ci.org/weechat/weechat"] image:https://codecov.io/gh/weechat/weechat/branch/master/graph/badge.svg["Code coverage", link="https://codecov.io/gh/weechat/weechat"] *WeeChat* (Wee Enhanced Environment for Chat) is a free chat client, fast and light, designed for many operating systems. It is highly customizable and extensible with scripts. Homepage: https://weechat.org/ == Features * *Modular chat client*: WeeChat has a lightweight core and optional https://weechat.org/files/doc/stable/weechat_user.en.html#plugins[plugins]. All plugins (including https://weechat.org/files/doc/stable/weechat_user.en.html#irc_plugin[IRC]) are independent and can be unloaded. * *Multi-platform*: WeeChat runs on GNU/Linux, *BSD, GNU/Hurd, Haiku, macOS and Windows (Bash/Ubuntu and Cygwin). * *Multi-protocols*: WeeChat is designed to support multiple protocols by plugins, like IRC. * *Standards-compliant*: the IRC plugin is compliant with RFCs https://tools.ietf.org/html/rfc1459[1459], https://tools.ietf.org/html/rfc2810[2810], https://tools.ietf.org/html/rfc2811[2811], https://tools.ietf.org/html/rfc2812[2812] and https://tools.ietf.org/html/rfc2813[2813]. * *Small, fast and very light*: the core is and should stay as light and fast as possible. * *Customizable and extensible*: there are a lot of options to customize WeeChat, and it is extensible with C plugins and https://weechat.org/scripts/[scripts] (https://weechat.org/scripts/stable/language/perl/[Perl], https://weechat.org/scripts/stable/language/python/[Python], https://weechat.org/scripts/stable/language/ruby[Ruby], https://weechat.org/scripts/stable/language/lua/[Lua], https://weechat.org/scripts/stable/language/tcl/[Tcl], https://weechat.org/scripts/stable/language/guile/[Scheme], https://weechat.org/scripts/stable/language/javascript/[JavaScript] and https://weechat.org/scripts/stable/language/php/[PHP]). * *Fully documented*: there is comprehensive https://weechat.org/doc/[documentation], which is https://weechat.org/files/doc/stable/weechat_dev.en.html#translations[translated] into several languages. * *Developed from scratch*: WeeChat was built from scratch and is not based on any other client. * *Free software*: WeeChat is released under https://www.gnu.org/licenses/gpl-3.0.html[GPLv3]. pass:[<p align="center">] image:https://weechat.org/media/images/screenshots/weechat/medium/weechat_2013-04-27_phlux_shadow.png[align="center"] pass:[</p>] On WeeChat's website you can find https://weechat.org/about/screenshots/[more screenshots]. == Install === Dependencies Following packages are *required*: * CMake * libncurses * libcurl * zlib * libgcrypt Following packages are optional: * for i18n: gettext * for SSL: gnutls, ca-certificates * for spell checking: aspell or enchant * for scripting: python, perl, ruby, lua, tcl, guile, libv8 (javascript), php * for building doc and man page: asciidoctor * for building tests: C++ compiler, CppUTest For a complete list of dependencies and versions recommended, please look at https://weechat.org/files/doc/devel/weechat_user.en.html#dependencies[user's guide]. === Compile WeeChat can be built with https://cmake.org/[CMake] (recommended) or autotools. [NOTE] Only CMake is officially supported to build WeeChat. You should only use autotools if you are not able to use CMake. + Building with autotools requires more dependencies and is slower than with CMake. * Installation in system directories (requires _root_ privileges): ---- $ mkdir build $ cd build $ cmake .. $ make $ sudo make install ---- * Installation in custom directory (for example your home): ---- $ mkdir build $ cd build $ cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/directory $ make $ make install ---- For more information or installation with autotools, please look at https://weechat.org/files/doc/devel/weechat_user.en.html#compile_with_autotools[user's guide]. === Run tests Following packages are *required* to compile tests: * libcpputest-dev * C++ compiler Tests must be enabled when compiling WeeChat: ---- $ cmake .. -DENABLE_TESTS=ON ---- They can be launched after compilation from the build directory: ---- $ ctest -V ---- == Copyright Copyright (C) 2003-2019 Sébastien Helleu <flashcode@flashtux.org> This file is part of WeeChat, the extensible chat client. WeeChat is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. WeeChat is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with WeeChat. If not, see <https://www.gnu.org/licenses/>.
Languages
C
79.4%
C++
17.8%
Python
1.7%
CMake
0.8%
Shell
0.2%
Other
0.1%