Qt5
This commit is contained in:
@ -10,6 +10,11 @@ set(current_target_sources
|
||||
add_executable(${current_target} ${current_target_sources})
|
||||
common_target_properties(${current_target})
|
||||
|
||||
# Qt5
|
||||
qt_translation(TARGET ${current_target} TS_DIR ${CMAKE_SOURCE_DIR}/l10n LANGUAGES ru_RU)
|
||||
target_include_directories(${current_target} SYSTEM PUBLIC ${Qt5Core_INCLUDE_DIRS})
|
||||
target_link_libraries(${current_target} Qt5::Core)
|
||||
|
||||
# Зависимость от библиотеки из текущего проекта
|
||||
add_dependencies(${current_target} cmex)
|
||||
|
||||
|
@ -1,17 +1,25 @@
|
||||
#include "compiler_features.hpp"
|
||||
#include "config.hpp"
|
||||
|
||||
#include <QtCore>
|
||||
#include <iostream>
|
||||
#include <cmext/cmext.hpp>
|
||||
|
||||
#include "cmex.hpp"
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
std::cout << CMEX_COMPILER_VERSION_MAJOR << std::endl; // Значение из compiler_features.hpp
|
||||
std::cout << BUILD_TYPE << std::endl; // Значение из config.hpp
|
||||
std::cout << CMEX_VERSION_STR << std::endl; // Значение из config.hpp
|
||||
std::cout << cmex_init(4) << std::endl; // Функция из внутренней библиотеки
|
||||
std::cout << cmext_init(9) << std::endl; // Функция из внешней библиотеки
|
||||
QCoreApplication app(argc, argv);
|
||||
QTranslator translator;
|
||||
|
||||
if (translator.load(QLocale(), "cmex_app", QLatin1String("_"), QLatin1String(":/qm")))
|
||||
{
|
||||
app.installTranslator(&translator);
|
||||
}
|
||||
std::cout << QObject::tr("Compiler version: ").toStdString() << CMEX_COMPILER_VERSION_MAJOR << std::endl; // Значение из compiler_features.hpp
|
||||
std::cout << QObject::tr("Project version: ").toStdString() << CMEX_VERSION_STR << std::endl; // Значение из config.hpp
|
||||
std::cout << QObject::tr("Build type: ").toStdString() << BUILD_TYPE << std::endl; // Значение из config.hpp
|
||||
std::cout << QObject::tr("libcmex function call: ").toStdString() << cmex_init(4) << std::endl; // Функция из внутренней библиотеки
|
||||
std::cout << QObject::tr("libcmext function call: ").toStdString() << cmext_init(9) << std::endl; // Функция из внешней библиотеки
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user