From b025013706483daaa073ff3dc7a137f5f04258d5 Mon Sep 17 00:00:00 2001 From: Axel Kittenberger Date: Fri, 24 Apr 2020 03:48:08 +0200 Subject: [PATCH] version defines (#333) * version defines * version defines * version defines --- CMakeLists.txt | 8 +++++++- lib/qtermwidget.h | 1 + lib/qtermwidget_version.h.in | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 lib/qtermwidget_version.h.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 9126db3..dd4c3df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -240,7 +240,7 @@ install(EXPORT ) install(FILES - ${HDRS_DISTRIB} "${CMAKE_CURRENT_BINARY_DIR}/lib/qtermwidget_export.h" + ${HDRS_DISTRIB} "${CMAKE_CURRENT_BINARY_DIR}/lib/qtermwidget_export.h" "${CMAKE_CURRENT_BINARY_DIR}/lib/qtermwidget_version.h" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${QTERMWIDGET_LIBRARY_NAME}" COMPONENT Devel ) @@ -277,6 +277,12 @@ configure_file( @ONLY ) +configure_file( + "${PROJECT_SOURCE_DIR}/lib/qtermwidget_version.h.in" + "${CMAKE_BINARY_DIR}/lib/qtermwidget_version.h" + @ONLY +) + install(FILES "${CMAKE_BINARY_DIR}/${QTERMWIDGET_LIBRARY_NAME}-config.cmake" DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${QTERMWIDGET_LIBRARY_NAME}" diff --git a/lib/qtermwidget.h b/lib/qtermwidget.h index 80e5609..b014a71 100644 --- a/lib/qtermwidget.h +++ b/lib/qtermwidget.h @@ -25,6 +25,7 @@ #include "Emulation.h" #include "Filter.h" #include "qtermwidget_export.h" +#include "qtermwidget_version.h" class QVBoxLayout; class TermWidgetImpl; diff --git a/lib/qtermwidget_version.h.in b/lib/qtermwidget_version.h.in new file mode 100644 index 0000000..00e2a74 --- /dev/null +++ b/lib/qtermwidget_version.h.in @@ -0,0 +1,33 @@ +/* Copyright (C) 2020 Axel Kittenberger (axel.kittenberger@univie.ac.at) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + + +#ifndef _Q_TERM_WIDGET_VERSION +#define _Q_TERM_WIDGET_VERSION + +#include +#define QTERMWIDGET_VERSION_MAJOR @QTERMWIDGET_VERSION_MAJOR@ +#define QTERMWIDGET_VERSION_MINOR @QTERMWIDGET_VERSION_MINOR@ +#define QTERMWIDGET_VERSION_PATCH @QTERMWIDGET_VERSION_PATCH@ +#define QTERMWIDGET_VERSION QT_VERSION_CHECK(\ + QTERMWIDGET_VERSION_MAJOR,\ + QTERMWIDGET_VERSION_MINOR,\ + QTERMWIDGET_VERSION_PATCH) + +#endif +