mirror of
				https://github.com/f4exb/sdrangel.git
				synced 2025-11-03 13:11:20 -05:00 
			
		
		
		
	fix version project configuration
This commit is contained in:
		
							parent
							
								
									8c4de461a1
								
							
						
					
					
						commit
						b8bfdcae7e
					
				@ -9,16 +9,34 @@ project(sdrangel)
 | 
			
		||||
 | 
			
		||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
 | 
			
		||||
 | 
			
		||||
# set version
 | 
			
		||||
SET(sdrangel_VERSION_MAJOR "4")
 | 
			
		||||
SET(sdrangel_VERSION_MINOR "5")
 | 
			
		||||
SET(sdrangel_VERSION_PATCH "6")
 | 
			
		||||
SET(sdrangel_VERSION_SUFFIX "")
 | 
			
		||||
SET(sdrangel_VERSION "${sdrangel_VERSION_MAJOR}.${sdrangel_VERSION_MINOR}.${sdrangel_VERSION_PATCH}${sdrangel_VERSION_SUFFIX}")
 | 
			
		||||
SET(CPACK_PACKAGE_VERSION "${sdrangel_VERSION_MAJOR}.${sdrangel_VERSION_MINOR}.${sdrangel_VERSION_PATCH}")
 | 
			
		||||
SET(CPACK_PACKAGE_VERSION_MAJOR ${sdrangel_VERSION_MAJOR})
 | 
			
		||||
SET(CPACK_PACKAGE_VERSION_MINOR ${sdrangel_VERSION_MINOR})
 | 
			
		||||
SET(CPACK_PACKAGE_VERSION_PATCH ${sdrangel_VERSION_PATCH})
 | 
			
		||||
# configure version
 | 
			
		||||
set(SDRANGEL_VERSION_MAJOR "4")
 | 
			
		||||
set(SDRANGEL_VERSION_MINOR "5")
 | 
			
		||||
set(SDRANGEL_VERSION_PATCH "6")
 | 
			
		||||
set(SDRANGEL_VERSION_SUFFIX "")
 | 
			
		||||
 | 
			
		||||
find_package(Git)
 | 
			
		||||
if(GIT_FOUND)
 | 
			
		||||
    execute_process(COMMAND "${GIT_EXECUTABLE}" rev-parse --short HEAD
 | 
			
		||||
        WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
 | 
			
		||||
        RESULT_VARIABLE res
 | 
			
		||||
        OUTPUT_VARIABLE out
 | 
			
		||||
        ERROR_QUIET
 | 
			
		||||
        OUTPUT_STRIP_TRAILING_WHITESPACE)
 | 
			
		||||
    if(NOT res)
 | 
			
		||||
        set(SDRANGEL_VERSION_SUFFIX "-${out}")
 | 
			
		||||
    endif()
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
set(SDRANGEL_VERSION "${SDRANGEL_VERSION_MAJOR}.${SDRANGEL_VERSION_MINOR}.${SDRANGEL_VERSION_PATCH}${SDRANGEL_VERSION_SUFFIX}")
 | 
			
		||||
message(STATUS "SDRAngel Version: ${SDRANGEL_VERSION}")
 | 
			
		||||
add_definitions("-DSDRANGEL_LIB_VERSION=\"${SDRANGEL_VERSION_MAJOR}.${SDRANGEL_VERSION_MINOR}.${SDRANGEL_VERSION_PATCH}\"")
 | 
			
		||||
add_definitions("-DSDRANGEL_VERSION=\"${SDRANGEL_VERSION}\"")
 | 
			
		||||
 | 
			
		||||
set(CPACK_PACKAGE_VERSION "${SDRANGEL_VERSION}")
 | 
			
		||||
set(CPACK_PACKAGE_VERSION_MAJOR ${SDRANGEL_VERSION_MAJOR})
 | 
			
		||||
set(CPACK_PACKAGE_VERSION_MINOR ${SDRANGEL_VERSION_MINOR})
 | 
			
		||||
set(CPACK_PACKAGE_VERSION_PATCH ${SDRANGEL_VERSION_PATCH})
 | 
			
		||||
 | 
			
		||||
# disable only when needed
 | 
			
		||||
set(CMAKE_CXX_STANDARD 11)
 | 
			
		||||
@ -208,21 +226,6 @@ elseif (C_GCC)
 | 
			
		||||
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmax-errors=1")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
########## version configuration ############
 | 
			
		||||
## need more work
 | 
			
		||||
execute_process(
 | 
			
		||||
    COMMAND git describe --abbrev=8 --always --tags
 | 
			
		||||
    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
 | 
			
		||||
    OUTPUT_VARIABLE GIT_COMMIT_HASH
 | 
			
		||||
    OUTPUT_STRIP_TRAILING_WHITESPACE
 | 
			
		||||
)
 | 
			
		||||
add_definitions("-DGIT_COMMIT_HASH=${GIT_COMMIT_HASH}")
 | 
			
		||||
set(CPACK_PACKAGE_VERSION ${GIT_COMMIT_HASH})
 | 
			
		||||
 | 
			
		||||
configure_file(
 | 
			
		||||
    ${CMAKE_SOURCE_DIR}/custom/version.h.in
 | 
			
		||||
    ${CMAKE_BINARY_DIR}/generated/sdrangel_version.h
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
########### include sub-projects ############
 | 
			
		||||
if(BUILD_EXTERNAL_LIBRARIES)
 | 
			
		||||
@ -277,7 +280,6 @@ endif()
 | 
			
		||||
# includes needed by the following target
 | 
			
		||||
include_directories(
 | 
			
		||||
    ${CMAKE_CURRENT_BINARY_DIR}
 | 
			
		||||
    ${CMAKE_BINARY_DIR}/generated
 | 
			
		||||
    ${CMAKE_SOURCE_DIR}/sdrbase
 | 
			
		||||
    ${CMAKE_SOURCE_DIR}/exports
 | 
			
		||||
    ${CMAKE_SOURCE_DIR}/sdrgui
 | 
			
		||||
 | 
			
		||||
@ -26,11 +26,6 @@
 | 
			
		||||
#include "loggerwithfile.h"
 | 
			
		||||
#include "mainwindow.h"
 | 
			
		||||
#include "dsp/dsptypes.h"
 | 
			
		||||
#ifdef _MSC_VER
 | 
			
		||||
#define GIT_COMMIT_HASH_STR "v4.8.0"
 | 
			
		||||
#else
 | 
			
		||||
#include "sdrangel_version.h"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *logger)
 | 
			
		||||
{
 | 
			
		||||
@ -41,10 +36,10 @@ static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *lo
 | 
			
		||||
*/
 | 
			
		||||
	QCoreApplication::setOrganizationName("f4exb");
 | 
			
		||||
	QCoreApplication::setApplicationName("SDRangel");
 | 
			
		||||
    QCoreApplication::setApplicationVersion(GIT_COMMIT_HASH_STR);
 | 
			
		||||
        QCoreApplication::setApplicationVersion(SDRANGEL_VERSION);
 | 
			
		||||
#if QT_VERSION >= 0x050600
 | 
			
		||||
	QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support
 | 
			
		||||
    QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps
 | 
			
		||||
        QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if 1
 | 
			
		||||
 | 
			
		||||
@ -28,7 +28,6 @@
 | 
			
		||||
#include "loggerwithfile.h"
 | 
			
		||||
#include "mainbench.h"
 | 
			
		||||
#include "dsp/dsptypes.h"
 | 
			
		||||
#include "sdrangel_version.h"
 | 
			
		||||
 | 
			
		||||
void handler(int sig) {
 | 
			
		||||
    fprintf(stderr, "quit the application by signal(%d).\n", sig);
 | 
			
		||||
@ -59,7 +58,7 @@ static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *lo
 | 
			
		||||
 | 
			
		||||
    QCoreApplication::setOrganizationName("f4exb");
 | 
			
		||||
    QCoreApplication::setApplicationName("SDRangelBench");
 | 
			
		||||
    QCoreApplication::setApplicationVersion(GIT_COMMIT_HASH_STR);
 | 
			
		||||
    QCoreApplication::setApplicationVersion(SDRANGEL_VERSION);
 | 
			
		||||
 | 
			
		||||
    int catchSignals[] = {SIGQUIT, SIGINT, SIGTERM, SIGHUP};
 | 
			
		||||
    std::vector<int> vsig(catchSignals, catchSignals + sizeof(catchSignals) / sizeof(int));
 | 
			
		||||
@ -70,43 +69,41 @@ static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *lo
 | 
			
		||||
 | 
			
		||||
#if QT_VERSION >= 0x050400
 | 
			
		||||
    qInfo("%s %s Qt %s %db %s %s DSP Rx:%db Tx:%db PID %lld",
 | 
			
		||||
            qPrintable(QCoreApplication::applicationName()),
 | 
			
		||||
            qPrintable(QCoreApplication::applicationVersion()),
 | 
			
		||||
            qPrintable(QString(QT_VERSION_STR)),
 | 
			
		||||
            QT_POINTER_SIZE*8,
 | 
			
		||||
            qPrintable(QSysInfo::currentCpuArchitecture()),
 | 
			
		||||
            qPrintable(QSysInfo::prettyProductName()),
 | 
			
		||||
            SDR_RX_SAMP_SZ,
 | 
			
		||||
            SDR_TX_SAMP_SZ,
 | 
			
		||||
            QCoreApplication::applicationPid());
 | 
			
		||||
          qPrintable(QCoreApplication::applicationName()),
 | 
			
		||||
          qPrintable(QCoreApplication::applicationVersion()),
 | 
			
		||||
          qPrintable(QString(QT_VERSION_STR)),
 | 
			
		||||
          QT_POINTER_SIZE*8,
 | 
			
		||||
          qPrintable(QSysInfo::currentCpuArchitecture()),
 | 
			
		||||
          qPrintable(QSysInfo::prettyProductName()),
 | 
			
		||||
          SDR_RX_SAMP_SZ,
 | 
			
		||||
          SDR_TX_SAMP_SZ,
 | 
			
		||||
          QCoreApplication::applicationPid());
 | 
			
		||||
#else
 | 
			
		||||
    qInfo("%s %s Qt %s %db DSP Rx:%db Tx:%db PID %lld",
 | 
			
		||||
            qPrintable(QCoreApplication::applicationName()),
 | 
			
		||||
            qPrintable((QCoreApplication::>applicationVersion()),
 | 
			
		||||
            qPrintable(QString(QT_VERSION_STR)),
 | 
			
		||||
            QT_POINTER_SIZE*8,
 | 
			
		||||
            SDR_RX_SAMP_SZ,
 | 
			
		||||
            SDR_TX_SAMP_SZ,
 | 
			
		||||
            QCoreApplication::applicationPid());
 | 
			
		||||
          qPrintable(QCoreApplication::applicationName()),
 | 
			
		||||
          qPrintable((QCoreApplication::>applicationVersion()),
 | 
			
		||||
                     qPrintable(QString(QT_VERSION_STR)),
 | 
			
		||||
                     QT_POINTER_SIZE*8,
 | 
			
		||||
                     SDR_RX_SAMP_SZ,
 | 
			
		||||
                     SDR_TX_SAMP_SZ,
 | 
			
		||||
                     QCoreApplication::applicationPid());
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    MainBench m(logger, parser, &a);
 | 
			
		||||
          MainBench m(logger, parser, &a);
 | 
			
		||||
 | 
			
		||||
    // This will cause the application to exit when the main core is finished
 | 
			
		||||
    QObject::connect(&m, SIGNAL(finished()), &a, SLOT(quit()));
 | 
			
		||||
    // This will run the task from the application event loop
 | 
			
		||||
    QTimer::singleShot(0, &m, SLOT(run()));
 | 
			
		||||
 | 
			
		||||
    return a.exec();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int main(int argc, char* argv[])
 | 
			
		||||
{
 | 
			
		||||
    qtwebapp::LoggerWithFile *logger = new qtwebapp::LoggerWithFile(qApp);
 | 
			
		||||
    logger->installMsgHandler();
 | 
			
		||||
    int res = runQtApplication(argc, argv, logger);
 | 
			
		||||
    qWarning("SDRangel quit.");
 | 
			
		||||
    return res;
 | 
			
		||||
}
 | 
			
		||||
          // This will cause the application to exit when the main core is finished
 | 
			
		||||
          QObject::connect(&m, SIGNAL(finished()), &a, SLOT(quit()));
 | 
			
		||||
          // This will run the task from the application event loop
 | 
			
		||||
          QTimer::singleShot(0, &m, SLOT(run()));
 | 
			
		||||
 | 
			
		||||
          return a.exec();
 | 
			
		||||
          }
 | 
			
		||||
 | 
			
		||||
      int main(int argc, char* argv[])
 | 
			
		||||
      {
 | 
			
		||||
        qtwebapp::LoggerWithFile *logger = new qtwebapp::LoggerWithFile(qApp);
 | 
			
		||||
        logger->installMsgHandler();
 | 
			
		||||
        int res = runQtApplication(argc, argv, logger);
 | 
			
		||||
        qWarning("SDRangel quit.");
 | 
			
		||||
        return res;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
@ -27,7 +27,6 @@
 | 
			
		||||
#include "loggerwithfile.h"
 | 
			
		||||
#include "maincore.h"
 | 
			
		||||
#include "dsp/dsptypes.h"
 | 
			
		||||
#include "sdrangel_version.h"
 | 
			
		||||
 | 
			
		||||
void handler(int sig) {
 | 
			
		||||
    fprintf(stderr, "quit the application by signal(%d).\n", sig);
 | 
			
		||||
@ -58,7 +57,7 @@ static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *lo
 | 
			
		||||
 | 
			
		||||
    QCoreApplication::setOrganizationName("f4exb");
 | 
			
		||||
    QCoreApplication::setApplicationName("SDRangelSrv");
 | 
			
		||||
    QCoreApplication::setApplicationVersion(GIT_COMMIT_HASH_STR);
 | 
			
		||||
    QCoreApplication::setApplicationVersion(SDRANGEL_VERSION);
 | 
			
		||||
 | 
			
		||||
    int catchSignals[] = {SIGQUIT, SIGINT, SIGTERM, SIGHUP};
 | 
			
		||||
    std::vector<int> vsig(catchSignals, catchSignals + sizeof(catchSignals) / sizeof(int));
 | 
			
		||||
@ -69,41 +68,39 @@ static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *lo
 | 
			
		||||
 | 
			
		||||
#if QT_VERSION >= 0x050400
 | 
			
		||||
    qInfo("%s %s Qt %s %db %s %s DSP Rx:%db Tx:%db PID %lld",
 | 
			
		||||
            qPrintable(QCoreApplication::applicationName()),
 | 
			
		||||
            qPrintable(QCoreApplication::applicationVersion()),
 | 
			
		||||
            qPrintable(QString(QT_VERSION_STR)),
 | 
			
		||||
            QT_POINTER_SIZE*8,
 | 
			
		||||
            qPrintable(QSysInfo::currentCpuArchitecture()),
 | 
			
		||||
            qPrintable(QSysInfo::prettyProductName()),
 | 
			
		||||
            SDR_RX_SAMP_SZ,
 | 
			
		||||
            SDR_TX_SAMP_SZ,
 | 
			
		||||
            QCoreApplication::applicationPid());
 | 
			
		||||
          qPrintable(QCoreApplication::applicationName()),
 | 
			
		||||
          qPrintable(QCoreApplication::applicationVersion()),
 | 
			
		||||
          qPrintable(QString(QT_VERSION_STR)),
 | 
			
		||||
          QT_POINTER_SIZE*8,
 | 
			
		||||
          qPrintable(QSysInfo::currentCpuArchitecture()),
 | 
			
		||||
          qPrintable(QSysInfo::prettyProductName()),
 | 
			
		||||
          SDR_RX_SAMP_SZ,
 | 
			
		||||
          SDR_TX_SAMP_SZ,
 | 
			
		||||
          QCoreApplication::applicationPid());
 | 
			
		||||
#else
 | 
			
		||||
    qInfo("%s %s Qt %s %db DSP Rx:%db Tx:%db PID %lld",
 | 
			
		||||
            qPrintable(QCoreApplication::applicationName()),
 | 
			
		||||
            qPrintable((QCoreApplication::>applicationVersion()),
 | 
			
		||||
            qPrintable(QString(QT_VERSION_STR)),
 | 
			
		||||
            QT_POINTER_SIZE*8,
 | 
			
		||||
            SDR_RX_SAMP_SZ,
 | 
			
		||||
            SDR_TX_SAMP_SZ,
 | 
			
		||||
            QCoreApplication::applicationPid());
 | 
			
		||||
          qPrintable(QCoreApplication::applicationName()),
 | 
			
		||||
          qPrintable((QCoreApplication::>applicationVersion()),
 | 
			
		||||
                     qPrintable(QString(QT_VERSION_STR)),
 | 
			
		||||
                     QT_POINTER_SIZE*8,
 | 
			
		||||
                     SDR_RX_SAMP_SZ,
 | 
			
		||||
                     SDR_TX_SAMP_SZ,
 | 
			
		||||
                     QCoreApplication::applicationPid());
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    MainCore m(logger, parser, &a);
 | 
			
		||||
          MainCore m(logger, parser, &a);
 | 
			
		||||
 | 
			
		||||
    // This will cause the application to exit when the main core is finished
 | 
			
		||||
    QObject::connect(&m, SIGNAL(finished()), &a, SLOT(quit()));
 | 
			
		||||
 | 
			
		||||
    return a.exec();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int main(int argc, char* argv[])
 | 
			
		||||
{
 | 
			
		||||
    qtwebapp::LoggerWithFile *logger = new qtwebapp::LoggerWithFile(qApp);
 | 
			
		||||
    logger->installMsgHandler();
 | 
			
		||||
    int res = runQtApplication(argc, argv, logger);
 | 
			
		||||
    qWarning("SDRangel quit.");
 | 
			
		||||
    return res;
 | 
			
		||||
}
 | 
			
		||||
          // This will cause the application to exit when the main core is finished
 | 
			
		||||
          QObject::connect(&m, SIGNAL(finished()), &a, SLOT(quit()));
 | 
			
		||||
 | 
			
		||||
          return a.exec();
 | 
			
		||||
          }
 | 
			
		||||
 | 
			
		||||
      int main(int argc, char* argv[])
 | 
			
		||||
      {
 | 
			
		||||
        qtwebapp::LoggerWithFile *logger = new qtwebapp::LoggerWithFile(qApp);
 | 
			
		||||
        logger->installMsgHandler();
 | 
			
		||||
        int res = runQtApplication(argc, argv, logger);
 | 
			
		||||
        qWarning("SDRangel quit.");
 | 
			
		||||
        return res;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
#ifndef VERSION_H
 | 
			
		||||
#define VERSION_H
 | 
			
		||||
 | 
			
		||||
#define GIT_COMMIT_HASH_STR "@GIT_COMMIT_HASH@"
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user