mirror of
https://github.com/znc/znc.git
synced 2026-08-08 09:52:55 +02:00
Fix CMake build:
* VERSION_EXTRA is now supported * znc-buildmod uses the correct ZNC library instead of one in /usr/share
This commit is contained in:
+3
-1
@@ -19,6 +19,8 @@ project(ZNC VERSION 1.7.0)
|
||||
set(ZNC_VERSION 1.7.x)
|
||||
set(append_git_version true)
|
||||
set(alpha_version "") # e.g. "-rc1"
|
||||
set(VERSION_EXTRA "" CACHE STRING
|
||||
"Additional string appended to version, e.g. to mark distribution")
|
||||
|
||||
set(PROJECT_VERSION "${ZNC_VERSION}")
|
||||
|
||||
@@ -336,7 +338,7 @@ macro(summary_line text var)
|
||||
endif()
|
||||
endmacro()
|
||||
set(summary_lines
|
||||
"ZNC ${ZNC_VERSION}${alpha_version} configured"
|
||||
"ZNC ${ZNC_VERSION}${VERSION_EXTRA}${alpha_version} configured"
|
||||
" "
|
||||
"Prefix : ${CMAKE_INSTALL_PREFIX}")
|
||||
summary_line("SSL " "${OPENSSL_FOUND}")
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
// Don't use this one
|
||||
#define VERSION (VERSION_MAJOR + VERSION_MINOR / 10.0)
|
||||
|
||||
// You can add -DVERSION_EXTRA="stuff" to your CXXFLAGS!
|
||||
// autoconf: You can add -DVERSION_EXTRA="stuff" to your CXXFLAGS!
|
||||
// CMake: You can add -DVERSION_EXTRA=stuff to cmake!
|
||||
#ifndef VERSION_EXTRA
|
||||
#define VERSION_EXTRA ""
|
||||
#endif
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#define VERSION_MINOR @PROJECT_VERSION_MINOR@
|
||||
#define VERSION_PATCH @PROJECT_VERSION_PATCH@
|
||||
#define VERSION_STR "@PROJECT_VERSION@"
|
||||
#define VERSION_EXTRA "@VERSION_EXTRA@"
|
||||
|
||||
#cmakedefine _GLIBCXX_DEBUG 1
|
||||
#cmakedefine _GLIBCXX_DEBUG_PEDANTIC 1
|
||||
|
||||
@@ -318,7 +318,8 @@ class ZNCTest : public testing::Test {
|
||||
out << content;
|
||||
file.close();
|
||||
Process p(
|
||||
ZNC_BIN_DIR "/znc-buildmod", QStringList() << file.fileName(),
|
||||
ZNC_BIN_DIR "/znc-buildmod",
|
||||
QStringList() << "--verbose" << file.fileName(),
|
||||
[&](QProcess* proc) {
|
||||
proc->setWorkingDirectory(dir.absolutePath());
|
||||
proc->setProcessChannelMode(QProcess::ForwardedChannels);
|
||||
@@ -1874,7 +1875,8 @@ TEST_F(ZNCTest, BuildMod) {
|
||||
EXPECT_TRUE(dir.cd("modules"));
|
||||
{
|
||||
Process p(ZNC_BIN_DIR "/znc-buildmod",
|
||||
QStringList() << srcdir.filePath("file-not-found.cpp"),
|
||||
QStringList() << "--verbose"
|
||||
<< srcdir.filePath("file-not-found.cpp"),
|
||||
[&](QProcess* proc) {
|
||||
proc->setWorkingDirectory(dir.absolutePath());
|
||||
proc->setProcessChannelMode(QProcess::ForwardedChannels);
|
||||
@@ -1883,7 +1885,8 @@ TEST_F(ZNCTest, BuildMod) {
|
||||
}
|
||||
{
|
||||
Process p(ZNC_BIN_DIR "/znc-buildmod",
|
||||
QStringList() << srcdir.filePath("testmod.cpp"),
|
||||
QStringList() << "--verbose"
|
||||
<< srcdir.filePath("testmod.cpp"),
|
||||
[&](QProcess* proc) {
|
||||
proc->setWorkingDirectory(dir.absolutePath());
|
||||
proc->setProcessChannelMode(QProcess::ForwardedChannels);
|
||||
|
||||
@@ -58,8 +58,8 @@ with tempfile.TemporaryDirectory() as cmdir:
|
||||
with open(os.path.join(cmdir, 'CMakeLists.txt'), 'w') as cm:
|
||||
print('cmake_minimum_required(VERSION 3.1)', file=cm)
|
||||
print('project(ExternalModules)', file=cm)
|
||||
print('find_package(ZNC @ZNC_VERSION_MAJOR@.@ZNC_VERSION_MINOR@ PATHS '
|
||||
'@CMAKE_INSTALL_FULL_DATADIR@/znc)', file=cm)
|
||||
print('find_package(ZNC @ZNC_VERSION_MAJOR@.@ZNC_VERSION_MINOR@ HINTS '
|
||||
'@CMAKE_INSTALL_FULL_DATADIR@/znc REQUIRED)', file=cm)
|
||||
if args.verbose > 0:
|
||||
print('set(CMAKE_VERBOSE_MAKEFILE true)', file=cm)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user