New static library VMisc.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2015-06-15 14:43:41 +03:00
parent a67cd0b855
commit cababbfc37
39 changed files with 232 additions and 38 deletions

View file

@ -15,7 +15,8 @@ DEPENDPATH += \
../src/libs/vobj \
../src/libs/vlayout \
../src/libs/vgeometry \
../src/libs/vpatterndb
../src/libs/vpatterndb \
../src/libs/vmisc
include(../src/app/app.pri)
include(../src/libs/qmuparser/qmuparser.pri)

View file

@ -46,7 +46,6 @@ UI_DIR = uic
# Suport subdirectories. Just better project code tree.
include(app.pri)
include(../utils/utils.pri)
# This include path help promoute VMainGraphicsView on main window. Without it compiler can't find path to custom view
INCLUDEPATH += "$${PWD}/widgets"
@ -600,7 +599,7 @@ DEPENDPATH += $$PWD/../libs/vgeometry
win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vgeometry/$${DESTDIR}/vgeometry.lib
else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vgeometry/$${DESTDIR}/libvgeometry.a
#VPatternDB staic library
#VPatternDB static library
unix|win32: LIBS += -L$$OUT_PWD/../libs/vpatterndb/$${DESTDIR}/ -lvpatterndb
INCLUDEPATH += $$PWD/../libs/vpatterndb
@ -609,6 +608,15 @@ DEPENDPATH += $$PWD/../libs/vpatterndb
win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vpatterndb/$${DESTDIR}/vpatterndb.lib
else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vpatterndb/$${DESTDIR}/libvpatterndb.a
#VMisc static library
unix|win32: LIBS += -L$$OUT_PWD/../libs/vmisc/$${DESTDIR}/ -lvmisc
INCLUDEPATH += $$PWD/../libs/vmisc
DEPENDPATH += $$PWD/../libs/vmisc
win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vmisc/$${DESTDIR}/vmisc.lib
else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/vmisc/$${DESTDIR}/libvmisc.a
noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols
# do nothing
} else {

View file

@ -34,7 +34,7 @@
#include "../libs/ifc/exception/vexceptionwrongid.h"
#include "vmaingraphicsview.h"
#include "../version.h"
#include "../../utils/logging.h"
#include "../vmisc/logging.h"
#include <QDebug>
#include <QDir>

View file

@ -32,7 +32,7 @@
#include "../../core/vapplication.h"
#include "../../core/vsettings.h"
#include "../../libs/vpatterndb/vcontainer.h"
#include "../../utils/logging.h"
#include "../vmisc/logging.h"
#include <QDir>
#include <QPushButton>

View file

@ -30,7 +30,7 @@
#define DIALOGTOOL_H
#include "../../core/vapplication.h"
#include "../../utils/logging.h"
#include "../vmisc/logging.h"
#include "../../widgets/vmaingraphicsscene.h"
#include "../../visualization/visualization.h"
#include "../../xml/vpattern.h"

View file

@ -44,7 +44,7 @@
#include "vtooloptionspropertybrowser.h"
#include "options.h"
#include "../libs/ifc/xml/vpatternconverter.h"
#include "../../utils/logging.h"
#include "../vmisc/logging.h"
#include <QInputDialog>
#include <QDebug>

View file

@ -32,7 +32,7 @@
#include "../libs/ifc/ifcdef.h"
#include "../libs/vgeometry/vgeometrydef.h"
#include "../libs/qmuparser/qmudef.h"
#include "../../utils/def.h"
#include "../vmisc/def.h"
#ifdef Q_OS_WIN32
# if defined( Q_CC_MSVC ) // MSVC USED

View file

@ -27,7 +27,7 @@
*************************************************************************/
#include "vtoolpoint.h"
#include "../../utils/logging.h"
#include "../vmisc/logging.h"
#include "../../libs/vgeometry/vpointf.h"
#include "../../visualization/vgraphicssimpletextitem.h"
#include "../../undocommands/movelabel.h"

View file

@ -30,7 +30,7 @@
#define VDATATOOL_H
#include "../libs/vpatterndb/vcontainer.h"
#include "../../utils/logging.h"
#include "../vmisc/logging.h"
Q_DECLARE_LOGGING_CATEGORY(vTool)

View file

@ -32,7 +32,7 @@
#include <QUndoCommand>
#include <QDomElement>
#include "../../utils/logging.h"
#include "../vmisc/logging.h"
#include "../xml/vpattern.h"
Q_DECLARE_LOGGING_CATEGORY(vUndo)

View file

@ -34,7 +34,7 @@
#include "../core/vapplication.h"
#include "../widgets/vmaingraphicsscene.h"
#include "../../utils/logging.h"
#include "../vmisc/logging.h"
#include "../../libs/vpatterndb/vcontainer.h"
Q_DECLARE_LOGGING_CATEGORY(vVis)

View file

@ -31,7 +31,7 @@
#include <QGraphicsPathItem>
#include "../libs/vgeometry/vabstractcurve.h"
#include "../../utils/def.h"
#include "../vmisc/def.h"
enum class SimpleCurvePoint : char { FirstPoint, ForthPoint };

View file

@ -28,7 +28,7 @@
#include "doubledelegate.h"
#include <QDoubleSpinBox>
#include "../../utils/def.h"
#include "../vmisc/def.h"
//---------------------------------------------------------------------------------------------------------------------
/**

View file

@ -30,7 +30,7 @@
#define VMAINGRAPHICSSCENE_H
#include <QGraphicsScene>
#include "../../utils/def.h"
#include "../vmisc/def.h"
/**
* @brief The VMainGraphicsScene class main scene.

View file

@ -29,6 +29,7 @@
#include "vstandardmeasurements.h"
#include <QDebug>
#include "../core/vapplication.h"
#include "../../libs/vmisc/def.h"
const QString VStandardMeasurements::TagDescription = QStringLiteral("description");
const QString VStandardMeasurements::TagId = QStringLiteral("id");

View file

@ -27,8 +27,8 @@
*************************************************************************/
#include "vexception.h"
#include "../../../utils/logging.h"
#include "../../../utils/def.h"
#include "../vmisc/logging.h"
#include "../vmisc/def.h"
#include <QGridLayout>
#include <QMessageBox>

View file

@ -31,7 +31,6 @@ CONFIG -= debug_and_release debug_and_release_target
DEFINES += QT_MESSAGELOGCONTEXT
include(ifc.pri)
include(../../utils/utils.pri)
# This is static library so no need in "make install"

View file

@ -34,7 +34,7 @@
#include <QCoreApplication>
#include "ifcdef.h"
#include "../../../utils/logging.h"
#include "../vmisc/logging.h"
Q_DECLARE_LOGGING_CATEGORY(vXML)

View file

@ -29,7 +29,7 @@
#ifndef VTOOLRECORD_H
#define VTOOLRECORD_H
#include "../../utils/def.h"
#include "../vmisc/def.h"
#include <QString>

View file

@ -6,6 +6,7 @@ SUBDIRS = \
vobj \
vlayout \
vgeometry \
vpatterndb
vpatterndb \
vmisc
vgeometry.depends = ifc

View file

@ -25,7 +25,6 @@ CONFIG -= debug_and_release debug_and_release_target
DEFINES += QT_MESSAGELOGCONTEXT
include(vgeometry.pri)
include(../../utils/utils.pri)
# This is static library so no need in "make install"

View file

@ -27,7 +27,6 @@ CONFIG -= debug_and_release debug_and_release_target
DEFINES += QT_MESSAGELOGCONTEXT
include(vlayout.pri)
include(../../utils/utils.pri)
# This is static library so no need in "make install"

View file

@ -27,7 +27,7 @@
*************************************************************************/
#include "vposition.h"
#include "../../utils/def.h"
#include "../vmisc/def.h"
#include <QPointF>
#include <QRectF>

View file

@ -35,7 +35,7 @@
# include <QtMath>
#endif
#include "../../utils/def.h"
#include "../vmisc/def.h"
//---------------------------------------------------------------------------------------------------------------------
VPoster::VPoster(const QPrinter *printer)

30
src/libs/vmisc/stable.cpp Normal file
View file

@ -0,0 +1,30 @@
/************************************************************************
**
** @file stable.cpp
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date 10 12, 2014
**
** @brief
** @copyright
** This source code is part of the Valentine project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2013-2015 Valentina project
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/
// Build the precompiled headers.
#include "stable.h"

52
src/libs/vmisc/stable.h Normal file
View file

@ -0,0 +1,52 @@
/************************************************************************
**
** @file stable.h
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date 10 12, 2014
**
** @brief
** @copyright
** This source code is part of the Valentine project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2013-2015 Valentina project
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#ifndef STABLE_H
#define STABLE_H
/* I like to include this pragma too, so the build log indicates if pre-compiled headers were in use. */
#ifndef __clang__
#pragma message("Compiling precompiled headers for VMisc library.\n")
#endif
/* Add C includes here */
#if defined __cplusplus
/* Add C++ includes here */
#ifdef QT_CORE_LIB
#include <QtCore>
#endif
#ifdef QT_GUI_LIB
# include <QtGui>
#endif
#endif/*__cplusplus*/
#endif // STABLE_H

12
src/libs/vmisc/vmisc.pri Normal file
View file

@ -0,0 +1,12 @@
# ADD TO EACH PATH $$PWD VARIABLE!!!!!!
# This need for corect working file translations.pro
SOURCES += \
$$PWD/stable.cpp \
$$PWD/def.cpp
HEADERS += \
$$PWD/stable.h \
$$PWD/def.h \
$$PWD/logging.h \
$$PWD/vmath.h

101
src/libs/vmisc/vmisc.pro Normal file
View file

@ -0,0 +1,101 @@
#-------------------------------------------------
#
# Project created by QtCreator 2015-06-15T14:07:14
#
#-------------------------------------------------
# File with common stuff for whole project
include(../../../Valentina.pri)
# Name of library
TARGET = vmisc
# We want to create a library
TEMPLATE = lib
CONFIG += \
staticlib \# Making static library
c++11 # We use C++11 standard
# Use out-of-source builds (shadow builds)
CONFIG -= debug_and_release debug_and_release_target
# Since Qt 5.4.0 the source code location is recorded only in debug builds.
# We need this information also in release builds. For this need define QT_MESSAGELOGCONTEXT.
DEFINES += QT_MESSAGELOGCONTEXT
include(vmisc.pri)
# This is static library so no need in "make install"
# directory for executable file
DESTDIR = bin
# files created moc
MOC_DIR = moc
# objecs files
OBJECTS_DIR = obj
# Set using ccache. Function enable_ccache() defined in Valentina.pri.
$$enable_ccache()
# Set precompiled headers. Function set_PCH() defined in Valentina.pri.
$$set_PCH()
CONFIG(debug, debug|release){
# Debug mode
unix {
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$GCC_DEBUG_CXXFLAGS # See Valentina.pri for more details.
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$CLANG_DEBUG_CXXFLAGS # See Valentina.pri for more details.
# -isystem key works only for headers. In some cases it's not enough. But we can't delete these warnings and
# want them in global list. Compromise decision delete them from local list.
QMAKE_CXXFLAGS -= \
-Wmissing-prototypes
}
} else {
*-g++{
QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See Valentina.pri for more details.
}
}
}else{
# Release mode
DEFINES += V_NO_ASSERT
!unix:*-g++{
QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll
}
noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols
# do nothing
} else {
!macx:!win32-msvc*{
# Turn on debug symbols in release mode on Unix systems.
# On Mac OS X temporarily disabled. TODO: find way how to strip binary file.
QMAKE_CXXFLAGS_RELEASE += -g -gdwarf-3
QMAKE_CFLAGS_RELEASE += -g -gdwarf-3
QMAKE_LFLAGS_RELEASE =
}
}
}

View file

@ -25,7 +25,6 @@ CONFIG -= debug_and_release debug_and_release_target
DEFINES += QT_MESSAGELOGCONTEXT
include(vobj.pri)
include(../../utils/utils.pri)
# This is static library so no need in "make install"

View file

@ -31,7 +31,7 @@
#include <QString>
#include <QSharedDataPointer>
#include "../../utils/def.h"
#include "../vmisc/def.h"
class VInternalVariableData;

View file

@ -29,7 +29,7 @@
#include "vcontainer.h"
#include "../vgeometry/varc.h"
#include "../vgeometry/vsplinepath.h"
#include "../../utils/logging.h"
#include "../vmisc/logging.h"
#include "vtranslatevars.h"
#include <QLineF>

View file

@ -32,7 +32,7 @@
#include <QMetaType>
#include <QSharedDataPointer>
#include "../../utils/def.h"
#include "../vmisc/def.h"
class VNodeDetailData;

View file

@ -25,7 +25,6 @@ CONFIG -= debug_and_release debug_and_release_target
DEFINES += QT_MESSAGELOGCONTEXT
include(vpatterndb.pri)
include(../../utils/utils.pri)
# This is static library so no need in "make install"

View file

@ -28,7 +28,7 @@
#include "vtranslatevars.h"
#include "calculator.h"
#include "../../utils/def.h"
#include "../vmisc/def.h"
#include "../vgeometry/vgeometrydef.h"
using namespace qmu;

View file

@ -1,7 +0,0 @@
HEADERS += \
$$PWD/logging.h \
$$PWD/vmath.h \
$$PWD/def.h
SOURCES += \
$$PWD/def.cpp