From c97668d3d37e54cee94a9a77669f231da2cc11a8 Mon Sep 17 00:00:00 2001 From: dismine Date: Wed, 10 Dec 2014 19:18:22 +0200 Subject: [PATCH] Initial commit for new static library IFC (internal format converter). --HG-- branch : feature --- share/translations.pro | 4 +- src/app/app.pro | 8 +++ src/libs/ifc/ifc.pri | 10 ++++ src/libs/ifc/ifc.pro | 84 +++++++++++++++++++++++++++++ src/libs/ifc/stable.cpp | 30 +++++++++++ src/libs/ifc/stable.h | 67 +++++++++++++++++++++++ src/libs/ifc/vabstractconverter.cpp | 34 ++++++++++++ src/libs/ifc/vabstractconverter.h | 40 ++++++++++++++ src/libs/libs.pro | 3 +- 9 files changed, 278 insertions(+), 2 deletions(-) create mode 100644 src/libs/ifc/ifc.pri create mode 100644 src/libs/ifc/ifc.pro create mode 100644 src/libs/ifc/stable.cpp create mode 100644 src/libs/ifc/stable.h create mode 100644 src/libs/ifc/vabstractconverter.cpp create mode 100644 src/libs/ifc/vabstractconverter.h diff --git a/share/translations.pro b/share/translations.pro index 5cc97ecdb..6701b5a6d 100644 --- a/share/translations.pro +++ b/share/translations.pro @@ -10,11 +10,13 @@ TEMPLATE = app DEPENDPATH += \ ../src/app \ ../src/libs/qmuparser \ - ../src/libs/vpropertyexplorer + ../src/libs/vpropertyexplorer \ + ../src/libs/ifc include(../src/app/app.pri) include(../src/libs/qmuparser/qmuparser.pri) include(../src/libs/vpropertyexplorer/vpropertyexplorer.pri) +include(../src/libs/ifc/ifc.pri) # Add here path to new translation file with name "valentina_*_*.ts" if you want to add new language. # Same paths in variable INSTALL_TRANSLATIONS (app.pro). diff --git a/src/app/app.pro b/src/app/app.pro index 68ef40daa..08cf66634 100644 --- a/src/app/app.pro +++ b/src/app/app.pro @@ -346,6 +346,14 @@ else:unix: LIBS += -L$${OUT_PWD}/../libs/vpropertyexplorer/$${DESTDIR} -lvproper INCLUDEPATH += $${PWD}/../libs/vpropertyexplorer DEPENDPATH += $${PWD}/../libs/vpropertyexplorer +# IFC static library +unix|win32: LIBS += -L$$OUT_PWD/../libs/ifc/$${DESTDIR}/ -lifc + +INCLUDEPATH += $$PWD/../libs/ifc +DEPENDPATH += $$PWD/../libs/ifc + +win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/ifc/$${DESTDIR}/ifc.lib +else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../libs/ifc/$${DESTDIR}/libifc.a # Strip after you link all libaries. CONFIG(release, debug|release){ diff --git a/src/libs/ifc/ifc.pri b/src/libs/ifc/ifc.pri new file mode 100644 index 000000000..ee70c94c8 --- /dev/null +++ b/src/libs/ifc/ifc.pri @@ -0,0 +1,10 @@ +# ADD TO EACH PATH $$PWD VARIABLE!!!!!! +# This need for corect working file translations.pro + +HEADERS += \ + $$PWD/vabstractconverter.h \ + $$PWD/stable.h + +SOURCES += \ + $$PWD/vabstractconverter.cpp \ + $$PWD/stable.cpp diff --git a/src/libs/ifc/ifc.pro b/src/libs/ifc/ifc.pro new file mode 100644 index 000000000..99424515d --- /dev/null +++ b/src/libs/ifc/ifc.pro @@ -0,0 +1,84 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2014-12-10T17:53:37 +# +#------------------------------------------------- + +# File with common stuff for whole project +include(../../../Valentina.pri) + +# Library work with xml. +QT += xml xmlpatterns printsupport + +# We don't need gui library. +QT -= gui + +# Name of library +TARGET = ifc # Internal Format Converter + +# We want create 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 + +include(ifc.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. + } + 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. + } + } else { + *-g++{ + QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See Valentina.pri for more details. + } + } + +}else{ + # Release mode + + !unix:*-g++{ + QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll + } + + !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 = + } +} diff --git a/src/libs/ifc/stable.cpp b/src/libs/ifc/stable.cpp new file mode 100644 index 000000000..877ab2ddf --- /dev/null +++ b/src/libs/ifc/stable.cpp @@ -0,0 +1,30 @@ +/************************************************************************ + ** + ** @file stable.cpp + ** @author Roman Telezhynskyi + ** @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 Valentina project + ** 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 . + ** + *************************************************************************/ + +// Build the precompiled headers. +#include "stable.h" diff --git a/src/libs/ifc/stable.h b/src/libs/ifc/stable.h new file mode 100644 index 000000000..c2c2a7780 --- /dev/null +++ b/src/libs/ifc/stable.h @@ -0,0 +1,67 @@ +/************************************************************************ + ** + ** @file stable.h + ** @author Roman Telezhynskyi + ** @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 Valentina project + ** 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 . + ** + *************************************************************************/ + +#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 IFC library.\n") +#endif + +/* Add C includes here */ + +#if defined __cplusplus +/* Add C++ includes here */ + +#ifdef QT_CORE_LIB +#include +#endif + +#ifdef QT_XML_LIB +# include +#endif + +//In Windows you can't use those headers in all modes. +#if !defined(Q_OS_WIN) +# ifdef QT_PRINTSUPPORT_LIB +# include +# endif + +# ifdef QT_XMLPATTERNS_LIB +# include +# endif + +# ifdef QT_NETWORK_LIB +# include +# endif +#endif/*Q_OS_WIN*/ + +#endif/*__cplusplus*/ + +#endif // STABLE_H diff --git a/src/libs/ifc/vabstractconverter.cpp b/src/libs/ifc/vabstractconverter.cpp new file mode 100644 index 000000000..85911600d --- /dev/null +++ b/src/libs/ifc/vabstractconverter.cpp @@ -0,0 +1,34 @@ +/************************************************************************ + ** + ** @file vabstractconverter.cpp + ** @author Roman Telezhynskyi + ** @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) 2014 Valentina project + ** 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 . + ** + *************************************************************************/ + +#include "vabstractconverter.h" + + +VAbstractConverter::VAbstractConverter() +{ +} diff --git a/src/libs/ifc/vabstractconverter.h b/src/libs/ifc/vabstractconverter.h new file mode 100644 index 000000000..c62cd9fe4 --- /dev/null +++ b/src/libs/ifc/vabstractconverter.h @@ -0,0 +1,40 @@ +/************************************************************************ + ** + ** @file vabstractconverter.h + ** @author Roman Telezhynskyi + ** @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) 2014 Valentina project + ** 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 . + ** + *************************************************************************/ + +#ifndef VABSTRACTCONVERTER_H +#define VABSTRACTCONVERTER_H + + +class VAbstractConverter +{ + +public: + VAbstractConverter(); +}; + +#endif // VABSTRACTCONVERTER_H diff --git a/src/libs/libs.pro b/src/libs/libs.pro index bd493ca45..5084ac28c 100644 --- a/src/libs/libs.pro +++ b/src/libs/libs.pro @@ -1,4 +1,5 @@ TEMPLATE = subdirs CONFIG += ordered SUBDIRS = qmuparser \ - vpropertyexplorer + vpropertyexplorer \ + ifc