diff --git a/CMakeLists.txt b/CMakeLists.txt index 271cd840..03901731 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}") diff --git a/include/znc/version.h b/include/znc/version.h index f7d40e47..bb866459 100644 --- a/include/znc/version.h +++ b/include/znc/version.h @@ -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 diff --git a/include/znc/zncconfig.h.cmake.in b/include/znc/zncconfig.h.cmake.in index de955d90..2fef4db1 100644 --- a/include/znc/zncconfig.h.cmake.in +++ b/include/znc/zncconfig.h.cmake.in @@ -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 diff --git a/test/integration/main.cpp b/test/integration/main.cpp index daaa7a25..613f25df 100644 --- a/test/integration/main.cpp +++ b/test/integration/main.cpp @@ -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); diff --git a/znc-buildmod.cmake.in b/znc-buildmod.cmake.in index f3dbe8d5..7fb5a03c 100755 --- a/znc-buildmod.cmake.in +++ b/znc-buildmod.cmake.in @@ -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)