Comments in qmake scripts. Broken installation on macx.

--HG--
branch : develop
This commit is contained in:
dismine 2014-10-27 16:29:31 +02:00
parent f1a38431fa
commit ebfe0b4fc3
11 changed files with 887 additions and 614 deletions

View File

@ -40,415 +40,495 @@ defineTest(copyToDestdir) {
export(QMAKE_POST_LINK) export(QMAKE_POST_LINK)
} }
# We use precompiled headers for more fast compilation source code.
defineReplace(set_PCH){
macx:clang*{
# Precompiled headers don't work with clang on macx.
} else {
CONFIG += precompile_header # Turn on creation precompiled headers (PCH).
export(CONFIG) # export value to global variable.
GCC_CXXFLAGS += \ PRECOMPILED_HEADER = stable.h # Header file with all all static headers: libraries, static local headers.
-O0 \ export(PRECOMPILED_HEADER) # export value to global variable
-Wall \
-Wextra \
-pedantic \
-Weffc++ \
-Woverloaded-virtual \
-Wctor-dtor-privacy \
-Wnon-virtual-dtor \
-Wold-style-cast \
-Wconversion \
-Winit-self \
-Wstack-protector \
-Wunreachable-code \
-Wcast-align \
-Wcast-qual \
-Wdisabled-optimization \
-Wfloat-equal \
-Wformat=2 \
-Wimport \
-Wmissing-include-dirs \
-Wpacked \
-Wredundant-decls \
-Winline \
-Winvalid-pch \
-Wunsafe-loop-optimizations \
-Wlong-long \
-Wmissing-format-attribute \
-Wswitch-default \
-Wuninitialized \
-Wvariadic-macros \
-Wlogical-op \
-Wnoexcept \
-Wmissing-noreturn \
-Wpointer-arith \
-Wstrict-null-sentinel \
-Wstrict-overflow=5 \
-Wundef \
-Wno-unused \
-gdwarf-3 \
-ftrapv
CLANG_CXXFLAGS += \ win32-msvc* {
-O0 \ PRECOMPILED_SOURCE = stable.cpp # MSVC need also cpp file.
-fparse-all-comments \ export(PRECOMPILED_SOURCE) # export value to global variable.
-Wabi \ }
-Wabstract-final-class \ }
-Wabstract-vbase-init \ return(true)
-Waddress \ }
-Waddress-of-array-temporary \
-Waddress-of-temporary \ defineReplace(enable_ccache){
-Waggregate-return \ # ccache support only Unix systems.
-Wall \ unix {
-Wambiguous-macro \ # This need for turn on ccache.
-Wambiguous-member-template \ *-g++{
-Wanalyzer-incompatible-plugin \ QMAKE_CC = ccache gcc
-Wanonymous-pack-parens \ export(QMAKE_CC) # export value to global variable.
-Warc \
-Warc-abi \ QMAKE_CXX = ccache g++
-Warc-bridge-casts-disallowed-in-nonarc \ export(QMAKE_CXX) # export value to global variable.
-Warc-maybe-repeated-use-of-weak \ }
-Warc-non-pod-memaccess \ clang*{
-Warc-performSelector-leaks \ QMAKE_CC = ccache clang
-Warc-repeated-use-of-weak \ export(QMAKE_CC) # export value to global variable.
-Warc-retain-cycles \
-Warc-unsafe-retained-assign \ QMAKE_CXX = ccache clang++
-Warray-bounds \ export(QMAKE_CXX) # export value to global variable.
-Warray-bounds-pointer-arithmetic \ }
-Wasm \ }
-Wasm-operand-widths \ return(true)
-Wassign-enum \ }
-Watomic-properties \
-Watomic-property-with-user-defined-accessor \ # Default prefix. Use for creation install path.
-Wattributes \ DEFAULT_PREFIX = /usr
-Wauto-import \
-Wauto-storage-class \ # In debug mode on Unix system we use all usefull for us compilers keys for checking errors.
-Wauto-var-id \ # Also trying make all possible for speed up build time.
-Wavailability \ unix {
-Wbackslash-newline-escape \
-Wbad-array-new-length \ # Key -isystem disable checking errors in system headers. Mark ignore warnings Qt headers.
-Wbad-function-cast \ ISYSTEM += \
-Wbind-to-temporary-copy \ -isystem "$$[QT_INSTALL_HEADERS]" \
-Wbitfield-constant-conversion \ -isystem "$$[QT_INSTALL_HEADERS]/QtWidgets" \
-Wbitwise-op-parentheses \ -isystem "$$[QT_INSTALL_HEADERS]/QtXml" \
-Wbool-conversion \ -isystem "$$[QT_INSTALL_HEADERS]/QtGui" \
-Wbool-conversions \ -isystem "$$[QT_INSTALL_HEADERS]/QtXmlPatterns" \
-Wbuiltin-macro-redefined \ -isystem "$$[QT_INSTALL_HEADERS]/QtCore"
-Wbuiltin-requires-header \
-Wc++-compat \ # Usefull GCC warnings keys.
-Wc++0x-compat \ GCC_DEBUG_CXXFLAGS += \
-Wc++0x-extensions \ -O0 \ # Turn off oprimization.
-Wc++0x-narrowing \ $$ISYSTEM \ # Ignore warnings Qt headers.
-Wc++11-compat \ # Last gdb doesn't show debug symbols with Qt Creator (issue with Python 3 and debug scripts that use Python 2.7).
-Wc++11-compat-pedantic \ # Solution to use older version gdb, that's why we use old standard of debug information.
-Wc++11-compat-reserved-user-defined-literal \ -gdwarf-3 \
-Wc++11-extensions \ -Wall \
-Wc++11-extra-semi \ -Wextra \
-Wc++11-long-long \ -pedantic \
-Wc++11-narrowing \ -Weffc++ \
-Wc11-extensions \ -Woverloaded-virtual \
-Wcast-align \ -Wctor-dtor-privacy \
-Wcast-of-sel-type \ -Wnon-virtual-dtor \
-Wcast-qual \ -Wold-style-cast \
-WCFString-literal \ -Wconversion \
-Wchar-align \ -Winit-self \
-Wchar-subscripts \ -Wstack-protector \
-Wcomment \ -Wunreachable-code \
-Wcomments \ -Wcast-align \
-Wcompare-distinct-pointer-types \ -Wcast-qual \
-Wcomplex-component-init \ -Wdisabled-optimization \
-Wconditional-type-mismatch \ -Wfloat-equal \
-Wconditional-uninitialized \ -Wformat=2 \
-Wconfig-macros \ -Wimport \
-Wconstant-conversion \ -Wmissing-include-dirs \
-Wconstant-logical-operand \ -Wpacked \
-Wconstexpr-not-const \ -Wredundant-decls \
-Wconversion \ -Winline \
-Wconversion-null \ -Winvalid-pch \
-Wno-covered-switch-default \ -Wunsafe-loop-optimizations \
-Wctor-dtor-privacy \ -Wlong-long \
-Wcustom-atomic-properties \ -Wmissing-format-attribute \
-Wdangling-else \ -Wswitch-default \
-Wdangling-field \ -Wuninitialized \
-Wdangling-initializer-list \ -Wvariadic-macros \
-Wdeclaration-after-statement \ -Wlogical-op \
-Wdelegating-ctor-cycles \ -Wnoexcept \
-Wdelete-incomplete \ -Wmissing-noreturn \
-Wdelete-non-virtual-dtor \ -Wpointer-arith \
-Wdeprecated \ -Wstrict-null-sentinel \
-Wdeprecated-declarations \ -Wstrict-overflow=5 \
-Wdeprecated-implementations \ -Wundef \
-Wdeprecated-objc-isa-usage \ -Wno-unused \
-Wdeprecated-objc-pointer-introspection \ -ftrapv
-Wdeprecated-objc-pointer-introspection-performSelector \
-Wdeprecated-register \ # Usefull Clang warnings keys.
-Wdeprecated-writable-strings \ CLANG_DEBUG_CXXFLAGS += \
-Wdirect-ivar-access \ -O0 \ # Turn off oprimization.
-Wdisabled-macro-expansion \ $$ISYSTEM \ # Ignore warnings Qt headers.
-Wdisabled-optimization \ # Last gdb doesn't show debug symbols with Qt Creator (issue with Python 3 and debug scripts that use Python 2.7).
-Wdiscard-qual \ # Solution to use older version gdb, that's why we use old standard of debug information.
-Wdistributed-object-modifiers \ -gdwarf-3 \
-Wdiv-by-zero \ -fparse-all-comments \
-Wdivision-by-zero \ -Wabi \
-Wdocumentation \ -Wabstract-final-class \
-Wdocumentation-deprecated-sync \ -Wabstract-vbase-init \
-Wdocumentation-html \ -Waddress \
-Wdollar-in-identifier-extension \ -Waddress-of-array-temporary \
-Wduplicate-decl-specifier \ -Waddress-of-temporary \
-Wduplicate-enum \ -Waggregate-return \
-Wduplicate-method-arg \ -Wall \
-Wduplicate-method-match \ -Wambiguous-macro \
-Wdynamic-class-memaccess \ -Wambiguous-member-template \
-Weffc++ \ -Wanalyzer-incompatible-plugin \
-Wembedded-directive \ -Wanonymous-pack-parens \
-Wempty-body \ -Warc \
-Wempty-translation-unit \ -Warc-abi \
-Wendif-labels \ -Warc-bridge-casts-disallowed-in-nonarc \
-Wenum-compare \ -Warc-maybe-repeated-use-of-weak \
-Wenum-conversion \ -Warc-non-pod-memaccess \
-Wexplicit-ownership-type \ -Warc-performSelector-leaks \
-Wextended-offsetof \ -Warc-repeated-use-of-weak \
-Wextern-initializer \ -Warc-retain-cycles \
-Wextra \ -Warc-unsafe-retained-assign \
-Wextra-semi \ -Warray-bounds \
-Wextra-tokens \ -Warray-bounds-pointer-arithmetic \
-Wflexible-array-extensions \ -Wasm \
-Wfloat-equal \ -Wasm-operand-widths \
-Wformat \ -Wassign-enum \
-Wformat-extra-args \ -Watomic-properties \
-Wformat-invalid-specifier \ -Watomic-property-with-user-defined-accessor \
-Wformat-non-iso \ -Wattributes \
-Wformat-nonliteral \ -Wauto-import \
-Wformat-security \ -Wauto-storage-class \
-Wformat-y2k \ -Wauto-var-id \
-Wformat-zero-length \ -Wavailability \
-Wformat=2 \ -Wbackslash-newline-escape \
-Wfour-char-constants \ -Wbad-array-new-length \
-Wgcc-compat \ -Wbad-function-cast \
-Wgnu \ -Wbind-to-temporary-copy \
-Wgnu-array-member-paren-init \ -Wbitfield-constant-conversion \
-Wgnu-designator \ -Wbitwise-op-parentheses \
-Wgnu-static-float-init \ -Wbool-conversion \
-Wheader-guard \ -Wbool-conversions \
-Wheader-hygiene \ -Wbuiltin-macro-redefined \
-Widiomatic-parentheses \ -Wbuiltin-requires-header \
-Wignored-attributes \ -Wc++-compat \
-Wignored-qualifiers \ -Wc++0x-compat \
-Wimplicit \ -Wc++0x-extensions \
-Wimplicit-atomic-properties \ -Wc++0x-narrowing \
-Wimplicit-conversion-floating-point-to-bool \ -Wc++11-compat \
-Wimplicit-exception-spec-mismatch \ -Wc++11-compat-pedantic \
-Wimplicit-fallthrough \ -Wc++11-compat-reserved-user-defined-literal \
-Wimplicit-fallthrough-per-function \ -Wc++11-extensions \
-Wimplicit-function-declaration \ -Wc++11-extra-semi \
-Wimplicit-int \ -Wc++11-long-long \
-Wimplicit-retain-self \ -Wc++11-narrowing \
-Wimport \ -Wc11-extensions \
-Wimport-preprocessor-directive-pedantic \ -Wcast-align \
-Wincompatible-library-redeclaration \ -Wcast-of-sel-type \
-Wincompatible-pointer-types \ -Wcast-qual \
-Wincompatible-pointer-types-discards-qualifiers \ -WCFString-literal \
-Wincomplete-implementation \ -Wchar-align \
-Wincomplete-module \ -Wchar-subscripts \
-Wincomplete-umbrella \ -Wcomment \
-Winherited-variadic-ctor \ -Wcomments \
-Winit-self \ -Wcompare-distinct-pointer-types \
-Winitializer-overrides \ -Wcomplex-component-init \
-Winline \ -Wconditional-type-mismatch \
-Wint-conversion \ -Wconditional-uninitialized \
-Wint-conversions \ -Wconfig-macros \
-Wint-to-pointer-cast \ -Wconstant-conversion \
-Wint-to-void-pointer-cast \ -Wconstant-logical-operand \
-Winteger-overflow \ -Wconstexpr-not-const \
-Winvalid-constexpr \ -Wconversion \
-Winvalid-iboutlet \ -Wconversion-null \
-Winvalid-noreturn \ -Wno-covered-switch-default \
-Winvalid-offsetof \ -Wctor-dtor-privacy \
-Winvalid-pch \ -Wcustom-atomic-properties \
-Winvalid-pp-token \ -Wdangling-else \
-Winvalid-source-encoding \ -Wdangling-field \
-Winvalid-token-paste \ -Wdangling-initializer-list \
-Wknr-promoted-parameter \ -Wdeclaration-after-statement \
-Wlanguage-extension-token \ -Wdelegating-ctor-cycles \
-Wlarge-by-value-copy \ -Wdelete-incomplete \
-Wliteral-conversion \ -Wdelete-non-virtual-dtor \
-Wliteral-range \ -Wdeprecated \
-Wlocal-type-template-args \ -Wdeprecated-declarations \
-Wlogical-not-parentheses \ -Wdeprecated-implementations \
-Wlogical-op-parentheses \ -Wdeprecated-objc-isa-usage \
-Wlong-long \ -Wdeprecated-objc-pointer-introspection \
-Wloop-analysis \ -Wdeprecated-objc-pointer-introspection-performSelector \
-Wmain \ -Wdeprecated-register \
-Wmain-return-type \ -Wdeprecated-writable-strings \
-Wmalformed-warning-check \ -Wdirect-ivar-access \
-Wmethod-signatures \ -Wdisabled-macro-expansion \
-Wmicrosoft \ -Wdisabled-optimization \
-Wmicrosoft-exists \ -Wdiscard-qual \
-Wmismatched-parameter-types \ -Wdistributed-object-modifiers \
-Wmismatched-return-types \ -Wdiv-by-zero \
-Wmismatched-tags \ -Wdivision-by-zero \
-Wmissing-braces \ -Wdocumentation \
-Wmissing-declarations \ -Wdocumentation-deprecated-sync \
-Wmissing-field-initializers \ -Wdocumentation-html \
-Wmissing-format-attribute \ -Wdollar-in-identifier-extension \
-Wmissing-include-dirs \ -Wduplicate-decl-specifier \
-Wmissing-method-return-type \ -Wduplicate-enum \
-Wmissing-noreturn \ -Wduplicate-method-arg \
-Wmissing-prototypes \ -Wduplicate-method-match \
-Wmissing-selector-name \ -Wdynamic-class-memaccess \
-Wmissing-sysroot \ -Weffc++ \
-Wmissing-variable-declarations \ -Wembedded-directive \
-Wmodule-conflict \ -Wempty-body \
-Wmost \ -Wempty-translation-unit \
-Wmultichar \ -Wendif-labels \
-Wnarrowing \ -Wenum-compare \
-Wnested-externs \ -Wenum-conversion \
-Wnewline-eof \ -Wexplicit-ownership-type \
-Wnon-gcc \ -Wextended-offsetof \
-Wnon-literal-null-conversion \ -Wextern-initializer \
-Wnon-pod-varargs \ -Wextra \
-Wnon-virtual-dtor \ -Wextra-semi \
-Wnonnull \ -Wextra-tokens \
-Wnonportable-cfstrings \ -Wflexible-array-extensions \
-WNSObject-attribute \ -Wfloat-equal \
-Wnull-arithmetic \ -Wformat \
-Wnull-character \ -Wformat-extra-args \
-Wnull-conversion \ -Wformat-invalid-specifier \
-Wnull-dereference \ -Wformat-non-iso \
-Wodr \ -Wformat-nonliteral \
-Wold-style-cast \ -Wformat-security \
-Wold-style-definition \ -Wformat-y2k \
-Wout-of-line-declaration \ -Wformat-zero-length \
-Wover-aligned \ -Wformat=2 \
-Woverflow \ -Wfour-char-constants \
-Woverlength-strings \ -Wgcc-compat \
-Woverloaded-shift-op-parentheses \ -Wgnu \
-Woverloaded-virtual \ -Wgnu-array-member-paren-init \
-Woverriding-method-mismatch \ -Wgnu-designator \
-Wpacked \ -Wgnu-static-float-init \
-Wparentheses \ -Wheader-guard \
-Wparentheses-equality \ -Wheader-hygiene \
-Wpedantic \ -Widiomatic-parentheses \
-Wpointer-arith \ -Wignored-attributes \
-Wpointer-sign \ -Wignored-qualifiers \
-Wpointer-to-int-cast \ -Wimplicit \
-Wpointer-type-mismatch \ -Wimplicit-atomic-properties \
-Wpredefined-identifier-outside-function \ -Wimplicit-conversion-floating-point-to-bool \
-Wprivate-extern \ -Wimplicit-exception-spec-mismatch \
-Wprotocol \ -Wimplicit-fallthrough \
-Wprotocol-property-synthesis-ambiguity \ -Wimplicit-fallthrough-per-function \
-Wreadonly-iboutlet-property \ -Wimplicit-function-declaration \
-Wreceiver-expr \ -Wimplicit-int \
-Wreceiver-forward-class \ -Wimplicit-retain-self \
-Wreceiver-is-weak \ -Wimport \
-Wredundant-decls \ -Wimport-preprocessor-directive-pedantic \
-Wreinterpret-base-class \ -Wincompatible-library-redeclaration \
-Wreorder \ -Wincompatible-pointer-types \
-Wrequires-super-attribute \ -Wincompatible-pointer-types-discards-qualifiers \
-Wreserved-user-defined-literal \ -Wincomplete-implementation \
-Wreturn-stack-address \ -Wincomplete-module \
-Wreturn-type \ -Wincomplete-umbrella \
-Wreturn-type-c-linkage \ -Winherited-variadic-ctor \
-Wsection \ -Winit-self \
-Wselector \ -Winitializer-overrides \
-Wselector-type-mismatch \ -Winline \
-Wself-assign \ -Wint-conversion \
-Wself-assign-field \ -Wint-conversions \
-Wsemicolon-before-method-body \ -Wint-to-pointer-cast \
-Wsentinel \ -Wint-to-void-pointer-cast \
-Wsequence-point \ -Winteger-overflow \
-Wserialized-diagnostics \ -Winvalid-constexpr \
-Wshadow-ivar \ -Winvalid-iboutlet \
-Wshift-count-negative \ -Winvalid-noreturn \
-Wshift-count-overflow \ -Winvalid-offsetof \
-Wshift-op-parentheses \ -Winvalid-pch \
-Wshift-overflow \ -Winvalid-pp-token \
-Wshift-sign-overflow \ -Winvalid-source-encoding \
-Wshorten-64-to-32 \ -Winvalid-token-paste \
-Wsign-compare \ -Wknr-promoted-parameter \
-Wsign-conversion \ -Wlanguage-extension-token \
-Wsign-promo \ -Wlarge-by-value-copy \
-Wsizeof-array-argument \ -Wliteral-conversion \
-Wsizeof-array-decay \ -Wliteral-range \
-Wsizeof-pointer-memaccess \ -Wlocal-type-template-args \
-Wsometimes-uninitialized \ -Wlogical-not-parentheses \
-Wsource-uses-openmp \ -Wlogical-op-parentheses \
-Wstack-protector \ -Wlong-long \
-Wstatic-float-init \ -Wloop-analysis \
-Wstatic-in-inline \ -Wmain \
-Wstatic-local-in-inline \ -Wmain-return-type \
-Wstatic-self-init \ -Wmalformed-warning-check \
-Wstrict-aliasing \ -Wmethod-signatures \
-Wstrict-aliasing=0 \ -Wmicrosoft \
-Wstrict-aliasing=1 \ -Wmicrosoft-exists \
-Wstrict-aliasing=2 \ -Wmismatched-parameter-types \
-Wstrict-overflow \ -Wmismatched-return-types \
-Wstrict-overflow=0 \ -Wmismatched-tags \
-Wstrict-overflow=1 \ -Wmissing-braces \
-Wstrict-overflow=2 \ -Wmissing-declarations \
-Wstrict-overflow=3 \ -Wmissing-field-initializers \
-Wstrict-overflow=4 \ -Wmissing-format-attribute \
-Wstrict-overflow=5 \ -Wmissing-include-dirs \
-Wstrict-prototypes \ -Wmissing-method-return-type \
-Wstrict-selector-match \ -Wmissing-noreturn \
-Wstring-compare \ -Wmissing-prototypes \
-Wstring-conversion \ -Wmissing-selector-name \
-Wstring-plus-int \ -Wmissing-sysroot \
-Wstrlcpy-strlcat-size \ -Wmissing-variable-declarations \
-Wstrncat-size \ -Wmodule-conflict \
-Wsuper-class-method-mismatch \ -Wmost \
-Wswitch \ -Wmultichar \
-Wswitch-default \ -Wnarrowing \
-Wsynth \ -Wnested-externs \
-Wtautological-compare \ -Wnewline-eof \
-Wtautological-constant-out-of-range-compare \ -Wnon-gcc \
-Wtentative-definition-incomplete-type \ -Wnon-literal-null-conversion \
-Wthread-safety \ -Wnon-pod-varargs \
-Wthread-safety-analysis \ -Wnon-virtual-dtor \
-Wthread-safety-attributes \ -Wnonnull \
-Wthread-safety-beta \ -Wnonportable-cfstrings \
-Wthread-safety-precise \ -WNSObject-attribute \
-Wtrigraphs \ -Wnull-arithmetic \
-Wtype-limits \ -Wnull-character \
-Wtype-safety \ -Wnull-conversion \
-Wtypedef-redefinition \ -Wnull-dereference \
-Wtypename-missing \ -Wodr \
-Wundeclared-selector \ -Wold-style-cast \
-Wundef \ -Wold-style-definition \
-Wundefined-inline \ -Wout-of-line-declaration \
-Wundefined-internal \ -Wover-aligned \
-Wundefined-reinterpret-cast \ -Woverflow \
-Wunicode \ -Woverlength-strings \
-Wunicode-whitespace \ -Woverloaded-shift-op-parentheses \
-Wuninitialized \ -Woverloaded-virtual \
-Wunknown-warning-option \ -Woverriding-method-mismatch \
-Wunnamed-type-template-args \ -Wpacked \
-Wunneeded-internal-declaration \ -Wparentheses \
-Wunneeded-member-function \ -Wparentheses-equality \
-Wunsequenced \ -Wpedantic \
-Wunsupported-visibility \ -Wpointer-arith \
-Wunused \ -Wpointer-sign \
-Wunused-argument \ -Wpointer-to-int-cast \
-Wunused-command-line-argument \ -Wpointer-type-mismatch \
-Wunused-comparison \ -Wpredefined-identifier-outside-function \
-Wunused-exception-parameter \ -Wprivate-extern \
-Wunused-function \ -Wprotocol \
-Wunused-label \ -Wprotocol-property-synthesis-ambiguity \
-Wunused-member-function \ -Wreadonly-iboutlet-property \
-Wunused-parameter \ -Wreceiver-expr \
-Wunused-private-field \ -Wreceiver-forward-class \
-Wunused-result \ -Wreceiver-is-weak \
-Wunused-sanitize-argument \ -Wredundant-decls \
-Wunused-value \ -Wreinterpret-base-class \
-Wunused-variable \ -Wreorder \
-Wunused-volatile-lvalue \ -Wrequires-super-attribute \
-Wuser-defined-literals \ -Wreserved-user-defined-literal \
-Wvarargs \ -Wreturn-stack-address \
-Wvariadic-macros \ -Wreturn-type \
-Wvector-conversion \ -Wreturn-type-c-linkage \
-Wvector-conversions \ -Wsection \
-Wvexing-parse \ -Wselector \
-Wvisibility \ -Wselector-type-mismatch \
-Wvla \ -Wself-assign \
-Wvla-extension \ -Wself-assign-field \
-Wvolatile-register-var \ -Wsemicolon-before-method-body \
-Wweak-template-vtables \ -Wsentinel \
-Wweak-vtables \ -Wsequence-point \
-Wwrite-strings \ -Wserialized-diagnostics \
-Wzero-length-array \ -Wshadow-ivar \
-Qunused-arguments \ -Wshift-count-negative \
-fcolor-diagnostics -Wshift-count-overflow \
-Wshift-op-parentheses \
-Wshift-overflow \
-Wshift-sign-overflow \
-Wshorten-64-to-32 \
-Wsign-compare \
-Wsign-conversion \
-Wsign-promo \
-Wsizeof-array-argument \
-Wsizeof-array-decay \
-Wsizeof-pointer-memaccess \
-Wsometimes-uninitialized \
-Wsource-uses-openmp \
-Wstack-protector \
-Wstatic-float-init \
-Wstatic-in-inline \
-Wstatic-local-in-inline \
-Wstatic-self-init \
-Wstrict-aliasing \
-Wstrict-aliasing=0 \
-Wstrict-aliasing=1 \
-Wstrict-aliasing=2 \
-Wstrict-overflow \
-Wstrict-overflow=0 \
-Wstrict-overflow=1 \
-Wstrict-overflow=2 \
-Wstrict-overflow=3 \
-Wstrict-overflow=4 \
-Wstrict-overflow=5 \
-Wstrict-prototypes \
-Wstrict-selector-match \
-Wstring-compare \
-Wstring-conversion \
-Wstring-plus-int \
-Wstrlcpy-strlcat-size \
-Wstrncat-size \
-Wsuper-class-method-mismatch \
-Wswitch \
-Wswitch-default \
-Wsynth \
-Wtautological-compare \
-Wtautological-constant-out-of-range-compare \
-Wtentative-definition-incomplete-type \
-Wthread-safety \
-Wthread-safety-analysis \
-Wthread-safety-attributes \
-Wthread-safety-beta \
-Wthread-safety-precise \
-Wtrigraphs \
-Wtype-limits \
-Wtype-safety \
-Wtypedef-redefinition \
-Wtypename-missing \
-Wundeclared-selector \
-Wundef \
-Wundefined-inline \
-Wundefined-internal \
-Wundefined-reinterpret-cast \
-Wunicode \
-Wunicode-whitespace \
-Wuninitialized \
-Wunknown-warning-option \
-Wunnamed-type-template-args \
-Wunneeded-internal-declaration \
-Wunneeded-member-function \
-Wunsequenced \
-Wunsupported-visibility \
-Wunused \
-Wunused-argument \
-Wunused-command-line-argument \
-Wunused-comparison \
-Wunused-exception-parameter \
-Wunused-function \
-Wunused-label \
-Wunused-member-function \
-Wunused-parameter \
-Wunused-private-field \
-Wunused-result \
-Wunused-sanitize-argument \
-Wunused-value \
-Wunused-variable \
-Wunused-volatile-lvalue \
-Wuser-defined-literals \
-Wvarargs \
-Wvariadic-macros \
-Wvector-conversion \
-Wvector-conversions \
-Wvexing-parse \
-Wvisibility \
-Wvla \
-Wvla-extension \
-Wvolatile-register-var \
-Wweak-template-vtables \
-Wweak-vtables \
-Wwrite-strings \
-Wzero-length-array \
-Qunused-arguments \
-fcolor-diagnostics
} else {
# Don't use additional GCC and Clang keys on Windows system.
# Can't find way mark ignore Qt header on Windows.
GCC_DEBUG_CXXFLAGS += \
-O0 \
-Wall \
-Wextra \
-pedantic \
CLANG_DEBUG_CXXFLAGS += \
-O0 \
-Wall \
-Wextra \
-pedantic \
}

View File

@ -1,6 +1,6 @@
include(Valentina.pri) include(Valentina.pri)
#version check qt #Check if Qt version >= 5.0.2
!minQtVersion(5, 0, 2) { !minQtVersion(5, 0, 2) {
message("Cannot build Valentina with Qt version $${QT_VERSION}.") message("Cannot build Valentina with Qt version $${QT_VERSION}.")
error("Use at least Qt 5.0.2.") error("Use at least Qt 5.0.2.")

BIN
dist/Valentina.icns vendored Normal file

Binary file not shown.

View File

@ -4,36 +4,43 @@
# #
#------------------------------------------------- #-------------------------------------------------
# Use out-of-source builds (shadow builds) # Compilation main binary file
# File with common stuff for whole project
include(../../Valentina.pri) include(../../Valentina.pri)
# Here we don't see "network" library, but, i think, "printsupport" depend on this library, so we still need this
# library in installer.
QT += core gui widgets xml svg printsupport xmlpatterns QT += core gui widgets xml svg printsupport xmlpatterns
# We want create executable file
TEMPLATE = app TEMPLATE = app
# Name of binary file
TARGET = valentina TARGET = valentina
# Use out-of-source builds (shadow builds)
CONFIG -= debug_and_release debug_and_release_target CONFIG -= debug_and_release debug_and_release_target
# We use C++11 standard
CONFIG += c++11 CONFIG += c++11
#DEFINES += ... # Directory for executable file
# directory for executable file
DESTDIR = bin DESTDIR = bin
# files created moc # Directory for files created moc
MOC_DIR = moc MOC_DIR = moc
# objecs files # Directory for objecs files
OBJECTS_DIR = obj OBJECTS_DIR = obj
# files created rcc # Directory for files created rcc
RCC_DIR = rcc RCC_DIR = rcc
# files created uic # Directory for files created uic
UI_DIR = uic UI_DIR = uic
# Suport subdirectories. Just better project code tree.
include(container/container.pri) include(container/container.pri)
include(dialogs/dialogs.pri) include(dialogs/dialogs.pri)
include(exception/exception.pri) include(exception/exception.pri)
@ -45,8 +52,10 @@ include(undocommands/undocommands.pri)
include(visualization/visualization.pri) include(visualization/visualization.pri)
include(core/core.pri) include(core/core.pri)
# This include path help promoute VMainGraphicsView on main window. Without it compiler can't find path to custom view
INCLUDEPATH += "$${PWD}/widgets" INCLUDEPATH += "$${PWD}/widgets"
# Some source files
SOURCES += \ SOURCES += \
main.cpp \ main.cpp \
mainwindow.cpp \ mainwindow.cpp \
@ -55,6 +64,7 @@ SOURCES += \
version.cpp \ version.cpp \
options.cpp options.cpp
# Some header files
HEADERS += \ HEADERS += \
mainwindow.h \ mainwindow.h \
options.h \ options.h \
@ -62,21 +72,30 @@ HEADERS += \
stable.h \ stable.h \
version.h version.h
# Main forms
FORMS += \ FORMS += \
mainwindow.ui \ mainwindow.ui \
tablewindow.ui tablewindow.ui
# Resource files. This files will be included in binary.
RESOURCES += \ RESOURCES += \
share/resources/icon.qrc \ share/resources/icon.qrc \ # All other icons except cursors and Windows theme.
share/resources/cursor.qrc \ share/resources/cursor.qrc \ # Tools cursor icons.
share/resources/theme.qrc \ share/resources/theme.qrc \ # Windows theme icons.
share/resources/schema.qrc \ share/resources/schema.qrc \ # Schemas for validation xml files.
share/resources/measurements.qrc share/resources/measurements.qrc # For measurements files that we save as resource.
# Compilation will fail without this files after we added them to this section.
OTHER_FILES += \ OTHER_FILES += \
share/resources/valentina.rc \ share/resources/valentina.rc \ # For Windows system.
share/resources/icon/64x64/icon64x64.ico share/resources/icon/64x64/icon64x64.ico # Valentina's logo.
# Add here path to new translation file with name "valentina_*_*.ts" if you want to add new language.
# Same paths in variable INSTALL_TRANSLATIONS.
# File valentina.ts we use in transifex.com. It is empty translation file only with english inside. transifex.com use
# this file like base for new language. Don't add path to valentina.ts to INSTALL_TRANSLATIONS variable.
# When adding a translation here, also add it in the macx part.
TRANSLATIONS += share/translations/valentina.ts \ TRANSLATIONS += share/translations/valentina.ts \
share/translations/valentina_ru_RU.ts \ share/translations/valentina_ru_RU.ts \
share/translations/valentina_uk_UA.ts \ share/translations/valentina_uk_UA.ts \
@ -87,59 +106,35 @@ TRANSLATIONS += share/translations/valentina.ts \
share/translations/valentina_it_IT.ts \ share/translations/valentina_it_IT.ts \
share/translations/valentina_nl_NL.ts share/translations/valentina_nl_NL.ts
unix { # Set using ccache. Function enable_ccache() defined in Valentina.pri.
*-g++{ $$enable_ccache()
QMAKE_CC = ccache gcc
QMAKE_CXX = ccache g++
}
clang*{
QMAKE_CC = ccache clang
QMAKE_CXX = ccache clang++
}
}
unix:!macx:!clang*{ # Set precompiled headers. Function set_PCH() defined in Valentina.pri.
CONFIG += precompile_header $$set_PCH()
# Precompiled headers (PCH)
PRECOMPILED_HEADER = stable.h
win32-msvc* {
PRECOMPILED_SOURCE = stable.cpp
}
}
CONFIG(debug, debug|release){ CONFIG(debug, debug|release){
# Debug # Debug mode
unix { unix {
#Turn on compilers warnings.
*-g++{ *-g++{
QMAKE_CXXFLAGS += \ QMAKE_CXXFLAGS += \
-isystem "$$[QT_INSTALL_HEADERS]" \ # Key -isystem disable checking errors in system headers.
-isystem "$$[QT_INSTALL_HEADERS]/QtWidgets" \
-isystem "$$[QT_INSTALL_HEADERS]/QtXml" \
-isystem "$$[QT_INSTALL_HEADERS]/QtGui" \
-isystem "$$[QT_INSTALL_HEADERS]/QtXmlPatterns" \
-isystem "$$[QT_INSTALL_HEADERS]/QtCore" \
-isystem "$${OUT_PWD}/$${UI_DIR}" \ -isystem "$${OUT_PWD}/$${UI_DIR}" \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \ -isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \ -isystem "$${OUT_PWD}/$${RCC_DIR}" \
$$GCC_CXXFLAGS $$GCC_DEBUG_CXXFLAGS # See Valentina.pri for more details.
} }
#Turn on Clang warnings
clang*{ clang*{
QMAKE_CXXFLAGS += \ QMAKE_CXXFLAGS += \
-isystem "$$[QT_INSTALL_HEADERS]" \ # Key -isystem disable checking errors in system headers.
-isystem "$$[QT_INSTALL_HEADERS]/QtWidgets" \
-isystem "$$[QT_INSTALL_HEADERS]/QtXml" \
-isystem "$$[QT_INSTALL_HEADERS]/QtGui" \
-isystem "$$[QT_INSTALL_HEADERS]/QtCore" \
-isystem "$$[QT_INSTALL_HEADERS]/QtXmlPatterns" \
-isystem "$${OUT_PWD}/$${UI_DIR}" \ -isystem "$${OUT_PWD}/$${UI_DIR}" \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \ -isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \ -isystem "$${OUT_PWD}/$${RCC_DIR}" \
$$CLANG_CXXFLAGS $$CLANG_DEBUG_CXXFLAGS # See Valentina.pri for more details.
} }
} else { } else {
*-g++{#Don't use additional GCC keys on Windows system. *-g++{
QMAKE_CXXFLAGS += -O0 -Wall -Wextra -pedantic QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See Valentina.pri for more details.
} }
} }
@ -147,19 +142,22 @@ CONFIG(debug, debug|release){
#precompiled headers file. #precompiled headers file.
DEFINES += "LOC_REV=0" DEFINES += "LOC_REV=0"
}else{ }else{
# Release # Release mode
DEFINES += QT_NO_DEBUG_OUTPUT DEFINES += QT_NO_DEBUG_OUTPUT
unix:!macx:QMAKE_CXXFLAGS_RELEASE += -g # Turn on debug symbols in release mode on Unix systems.
# On Mac OS X temporarily disabled. Need find way how to strip binary file.
unix:!macx:QMAKE_CXXFLAGS_RELEASE += -g -gdwarf-3
#local revision number for using in version #local revision number for using in version
HG_REV=$$system(hg parents --template '{rev}') HG_REV=$$system(hg parents --template '{rev}')
isEmpty(HG_REV){ isEmpty(HG_REV){
HG_REV = 0 HG_REV = 0 # if we can't find local revision left 0.
} }
DEFINES += "LOC_REV=$${HG_REV}" DEFINES += "LOC_REV=$${HG_REV}" # Make available local revision number in sources.
} }
# Some extra information about Qt. Can be usefull.
message(Qt version: $$[QT_VERSION]) message(Qt version: $$[QT_VERSION])
message(Qt is installed in $$[QT_INSTALL_PREFIX]) message(Qt is installed in $$[QT_INSTALL_PREFIX])
message(Qt resources can be found in the following locations:) message(Qt resources can be found in the following locations:)
@ -173,49 +171,152 @@ message(Translation files: $$[QT_INSTALL_TRANSLATIONS])
message(Settings: $$[QT_INSTALL_SETTINGS]) message(Settings: $$[QT_INSTALL_SETTINGS])
message(Examples: $$[QT_INSTALL_EXAMPLES]) message(Examples: $$[QT_INSTALL_EXAMPLES])
# Path to recource file.
win32:RC_FILE = share/resources/valentina.rc win32:RC_FILE = share/resources/valentina.rc
INSTALL_TRANSLATIONS += \ # Set "make install" command for Unix-like systems.
share/translations/valentina_ru_RU.qm \ unix{
share/translations/valentina_uk_UA.qm \ isEmpty(PREFIX){
share/translations/valentina_de_DE.qm \ PREFIX = $$DEFAULT_PREFIX
share/translations/valentina_cs_CZ.qm \
share/translations/valentina_he_IL.qm \
share/translations/valentina_fr_FR.qm \
share/translations/valentina_it_IT.qm \
share/translations/valentina_nl_NL.qm
INSTALL_STANDARD_MEASHUREMENTS += share/resources/tables/standard/GOST_man_ru.vst
unix {
#VARIABLES
isEmpty(PREFIX) {
PREFIX = /usr
} }
DATADIR =$$PREFIX/share
DEFINES += DATADIR=\\\"$$DATADIR\\\" PKGDATADIR=\\\"$$PKGDATADIR\\\" # Prefix for binary file.
#MAKE INSTALL
unix:!macx{ unix:!macx{
target.path = $$PREFIX/bin # Add to this variable all translation files that you want install with program.
# For generation *.qm file first you need create *.ts. See section TRANSLATIONS.
INSTALL_TRANSLATIONS += \
share/translations/valentina_ru_RU.qm \
share/translations/valentina_uk_UA.qm \
share/translations/valentina_de_DE.qm \
share/translations/valentina_cs_CZ.qm \
share/translations/valentina_he_IL.qm \
share/translations/valentina_fr_FR.qm \
share/translations/valentina_it_IT.qm \
share/translations/valentina_nl_NL.qm
# Keep path to all files with standard measurements we support right now
INSTALL_STANDARD_MEASHUREMENTS += share/resources/tables/standard/GOST_man_ru.vst
DATADIR =$$PREFIX/share
DEFINES += DATADIR=\\\"$$DATADIR\\\" PKGDATADIR=\\\"$$PKGDATADIR\\\"
# Path to bin file after installation
target.path = $$PREFIX/bin
# .desctop file
desktop.path = $$DATADIR/applications/
desktop.files += ../../dist/$${TARGET}.desktop
# logo
pixmaps.path = $$DATADIR/pixmaps/
pixmaps.files += ../../dist/$${TARGET}.png
# Path to translation files after installation
translations.path = $$DATADIR/$${TARGET}/translations/
translations.files = $$INSTALL_TRANSLATIONS
# Path to standard measurement after installation
standard.path = $$DATADIR/$${TARGET}/tables/standard/
standard.files = $$INSTALL_STANDARD_MEASHUREMENTS
INSTALLS += \
target \
desktop \
pixmaps \
translations \
standard
}
}else{ }else{
target.path = $$PREFIX/ # Some macx stuff
} QMAKE_MAC_SDK = "/Developer/SDKs/MacOSX10.6.sdk"
desktop.path = $$DATADIR/applications/ QMAKE_MACOSX_DEPLOYMENT_TARGET = "10.5"
desktop.files += ../../dist/$${TARGET}.desktop
pixmaps.path = $$DATADIR/pixmaps/ # Path to resources in app bundle
pixmaps.files += ../../dist/$${TARGET}.png RESOURCES_DIR = "Contents/Resources"
translations.path = $$DATADIR/$${TARGET}/translations/
translations.files = $$INSTALL_TRANSLATIONS # On macx we will use app bundle. Bundle doesn't need bin directory inside.
standard.path = $$DATADIR/$${TARGET}/tables/standard/ # See issue #166: Creating OSX Homebrew (Mac OS X package manager) formula.
standard.files = $$INSTALL_STANDARD_MEASHUREMENTS target.path = $$PREFIX/
INSTALLS += \
target \ # Copy in bundle translation files.
desktop \ exists(share/translations/valentina_ru_RU.qm){
pixmaps \ TRANSLATION_ru_RU.files += \
translations \ share/translations/valentina_ru_RU.qm \
standard share/translations/Localizable.strings
TRANSLATION_ru_RU.path = "$$RESOURCES_DIR/translations/ru_RU.lproj"
QMAKE_BUNDLE_DATA += TRANSLATION_ru_RU
}
exists(share/translations/valentina_uk_UA.qm){
TRANSLATION_uk_UA.files += \
share/translations/valentina_uk_UA.qm \
share/translations/Localizable.strings
TRANSLATION_uk_UA.path = "$$RESOURCES_DIR/translations/uk_UA.lproj"
QMAKE_BUNDLE_DATA += TRANSLATION_uk_UA
}
exists(share/translations/valentina_de_DE.qm){
TRANSLATION_de_DE.files += \
share/translations/valentina_de_DE.qm \
share/translations/Localizable.strings
TRANSLATION_de_DE.path = "$$RESOURCES_DIR/translations/de_DE.lproj"
QMAKE_BUNDLE_DATA += TRANSLATION_de_DE
}
exists(share/translations/valentina_cs_CZ.qm){
TRANSLATION_cs_CZ.files += \
share/translations/valentina_cs_CZ.qm \
share/translations/Localizable.strings
TRANSLATION_cs_CZ.path = "$$RESOURCES_DIR/translations/cs_CZ.lproj"
QMAKE_BUNDLE_DATA += TRANSLATION_cs_CZ
}
exists(share/translations/valentina_he_IL.qm){
TRANSLATION_he_IL.files += \
share/translations/valentina_he_IL.qm \
share/translations/Localizable.strings
TRANSLATION_he_IL.path = "$$RESOURCES_DIR/translations/he_IL.lproj"
QMAKE_BUNDLE_DATA += TRANSLATION_he_IL
}
exists(share/translations/valentina_fr_FR.qm){
TRANSLATION_fr_FR.files += \
share/translations/valentina_fr_FR.qm \
share/translations/Localizable.strings
TRANSLATION_fr_FR.path = "$$RESOURCES_DIR/translations/fr_FR.lproj"
QMAKE_BUNDLE_DATA += TRANSLATION_fr_FR
}
exists(share/translations/valentina_it_IT.qm){
TRANSLATION_it_IT.files += \
share/translations/valentina_it_IT.qm \
share/translations/Localizable.strings
TRANSLATION_it_IT.path = "$$RESOURCES_DIR/translations/it_IT.lproj"
QMAKE_BUNDLE_DATA += TRANSLATION_it_IT
}
exists(share/translations/valentina_nl_NL.qm){
TRANSLATION_nl_NL.files += \
share/translations/valentina_nl_NL.qm \
share/translations/Localizable.strings
TRANSLATION_nl_NL.path = "$$RESOURCES_DIR/translations/nl_NL.lproj"
QMAKE_BUNDLE_DATA += TRANSLATION_nl_NL
}
# logo on macx.
icon.files = "Valentina.icns"
icon.path = $$RESOURCES_DIR
# Copy to bundle standard measurements files
standard.path = $$RESOURCES_DIR/tables/standard/
standard.files = $$INSTALL_STANDARD_MEASHUREMENTS
QMAKE_BUNDLE_DATA += \
standard \
icons \
} }
# Run generation *.qm file for available *.ts files each time you run qmake.
!isEmpty(TRANSLATIONS): { !isEmpty(TRANSLATIONS): {
for(_translation_name, TRANSLATIONS) { for(_translation_name, TRANSLATIONS) {
_translation_name_qm = $$section(_translation_name,".", 0, 0).qm _translation_name_qm = $$section(_translation_name,".", 0, 0).qm
@ -230,6 +331,7 @@ for(DIR, INSTALL_TRANSLATIONS) {
tr_path += $${PWD}/$$DIR tr_path += $${PWD}/$$DIR
} }
# Make possible run program even you do not install it. Seek files in local directory.
copyToDestdir($$tr_path, $$shell_path($${OUT_PWD}/$$DESTDIR/translations)) copyToDestdir($$tr_path, $$shell_path($${OUT_PWD}/$$DESTDIR/translations))
for(DIR, INSTALL_STANDARD_MEASHUREMENTS) { for(DIR, INSTALL_STANDARD_MEASHUREMENTS) {
@ -240,6 +342,7 @@ for(DIR, INSTALL_STANDARD_MEASHUREMENTS) {
copyToDestdir($$st_path, $$shell_path($${OUT_PWD}/$$DESTDIR/tables/standard)) copyToDestdir($$st_path, $$shell_path($${OUT_PWD}/$$DESTDIR/tables/standard))
# QMuParser library
win32:CONFIG(release, debug|release): LIBS += -L$${OUT_PWD}/../libs/qmuparser/$${DESTDIR} -lqmuparser2 win32:CONFIG(release, debug|release): LIBS += -L$${OUT_PWD}/../libs/qmuparser/$${DESTDIR} -lqmuparser2
else:win32:CONFIG(debug, debug|release): LIBS += -L$${OUT_PWD}/../libs/qmuparser/$${DESTDIR} -lqmuparser2 else:win32:CONFIG(debug, debug|release): LIBS += -L$${OUT_PWD}/../libs/qmuparser/$${DESTDIR} -lqmuparser2
else:unix: LIBS += -L$${OUT_PWD}/../libs/qmuparser/$${DESTDIR} -lqmuparser else:unix: LIBS += -L$${OUT_PWD}/../libs/qmuparser/$${DESTDIR} -lqmuparser
@ -247,6 +350,7 @@ else:unix: LIBS += -L$${OUT_PWD}/../libs/qmuparser/$${DESTDIR} -lqmuparser
INCLUDEPATH += $${PWD}/../libs/qmuparser INCLUDEPATH += $${PWD}/../libs/qmuparser
DEPENDPATH += $${PWD}/../libs/qmuparser DEPENDPATH += $${PWD}/../libs/qmuparser
# VPropertyExplorer library
win32:CONFIG(release, debug|release): LIBS += -L$${OUT_PWD}/../libs/vpropertyexplorer/$${DESTDIR} -lvpropertyexplorer win32:CONFIG(release, debug|release): LIBS += -L$${OUT_PWD}/../libs/vpropertyexplorer/$${DESTDIR} -lvpropertyexplorer
else:win32:CONFIG(debug, debug|release): LIBS += -L$${OUT_PWD}/../libs/vpropertyexplorer/$${DESTDIR} -lvpropertyexplorer else:win32:CONFIG(debug, debug|release): LIBS += -L$${OUT_PWD}/../libs/vpropertyexplorer/$${DESTDIR} -lvpropertyexplorer
else:unix: LIBS += -L$${OUT_PWD}/../libs/vpropertyexplorer/$${DESTDIR} -lvpropertyexplorer else:unix: LIBS += -L$${OUT_PWD}/../libs/vpropertyexplorer/$${DESTDIR} -lvpropertyexplorer
@ -254,9 +358,10 @@ else:unix: LIBS += -L$${OUT_PWD}/../libs/vpropertyexplorer/$${DESTDIR} -lvproper
INCLUDEPATH += $${PWD}/../libs/vpropertyexplorer INCLUDEPATH += $${PWD}/../libs/vpropertyexplorer
DEPENDPATH += $${PWD}/../libs/vpropertyexplorer DEPENDPATH += $${PWD}/../libs/vpropertyexplorer
# Strip after you link all libaries.
CONFIG(release, debug|release){ CONFIG(release, debug|release){
unix:!macx{ unix:!macx{
# On Linux # Strip debug symbols.
QMAKE_POST_LINK += objcopy --only-keep-debug $(TARGET) $(TARGET).debug && QMAKE_POST_LINK += objcopy --only-keep-debug $(TARGET) $(TARGET).debug &&
QMAKE_POST_LINK += strip --strip-debug --strip-unneeded $(TARGET) && QMAKE_POST_LINK += strip --strip-debug --strip-unneeded $(TARGET) &&
QMAKE_POST_LINK += objcopy --add-gnu-debuglink $(TARGET).debug $(TARGET) QMAKE_POST_LINK += objcopy --add-gnu-debuglink $(TARGET).debug $(TARGET)

View File

@ -0,0 +1 @@
/* Intentionally empty */

View File

@ -4,12 +4,22 @@
# #
#------------------------------------------------- #-------------------------------------------------
# File with common stuff for whole project
include(../../../Valentina.pri)
# We don't need gui library.
QT -= gui QT -= gui
# Name of library
TARGET = qmuparser TARGET = qmuparser
# We want create library
TEMPLATE = lib TEMPLATE = lib
# Use out-of-source builds (shadow builds)
CONFIG -= debug_and_release debug_and_release_target CONFIG -= debug_and_release debug_and_release_target
# We use C++11 standard
CONFIG += c++11 CONFIG += c++11
DEFINES += QMUPARSER_LIBRARY DEFINES += QMUPARSER_LIBRARY
@ -49,73 +59,56 @@ HEADERS += \
VERSION = 2.2.4 VERSION = 2.2.4
unix { # Set "make install" command for Unix-like systems.
isEmpty(PREFIX) { unix{
PREFIX = /usr/lib isEmpty(PREFIX){
PREFIX = $$DEFAULT_PREFIX/lib
} }
}
unix:!macx{
target.path = $$PREFIX/lib target.path = $$PREFIX/lib
INSTALLS += target INSTALLS += target
*-g++{
QMAKE_CC = ccache gcc
QMAKE_CXX = ccache g++
}
clang*{
QMAKE_CC = ccache clang
QMAKE_CXX = ccache clang++
}
} }
unix:!macx:!clang*{ # Set using ccache. Function enable_ccache() defined in Valentina.pri.
CONFIG += precompile_header $$enable_ccache()
# Precompiled headers (PCH)
PRECOMPILED_HEADER = stable.h
win32-msvc* {
PRECOMPILED_SOURCE = stable.cpp
}
}
include(../../../Valentina.pri) # Set precompiled headers. Function set_PCH() defined in Valentina.pri.
$$set_PCH()
CONFIG(debug, debug|release){ CONFIG(debug, debug|release){
# Debug # Debug mode
unix { unix {
#Turn on compilers warnings.
*-g++{ *-g++{
QMAKE_CXXFLAGS += \ QMAKE_CXXFLAGS += \
-isystem "$$[QT_INSTALL_HEADERS]" \ # Key -isystem disable checking errors in system headers.
-isystem "$$[QT_INSTALL_HEADERS]/QtWidgets" \
-isystem "$$[QT_INSTALL_HEADERS]/QtXml" \
-isystem "$$[QT_INSTALL_HEADERS]/QtGui" \
-isystem "$$[QT_INSTALL_HEADERS]/QtXmlPatterns" \
-isystem "$$[QT_INSTALL_HEADERS]/QtCore" \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \ -isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$GCC_CXXFLAGS $$GCC_DEBUG_CXXFLAGS # See Valentina.pri for more details.
} }
#Turn on Clang warnings
clang*{ clang*{
QMAKE_CXXFLAGS += \ QMAKE_CXXFLAGS += \
-isystem "/usr/include/qt5" \ # Key -isystem disable checking errors in system headers.
-isystem "/usr/include/qt5/QtWidgets" \
-isystem "/usr/include/qt5/QtXml" \
-isystem "/usr/include/qt5/QtGui" \
-isystem "/usr/include/qt5/QtCore" \
-isystem "/usr/include/qt5/QtXmlPatterns" \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \ -isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$CLANG_CXXFLAGS $$CLANG_DEBUG_CXXFLAGS # See Valentina.pri for more details.
} }
} else { } else {
*-g++{#Don't use additional GCC keys on Windows system. *-g++{
QMAKE_CXXFLAGS += -O0 -Wall -Wextra -pedantic QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See Valentina.pri for more details.
} }
} }
}else{ }else{
# Release # Release mode
DEFINES += QT_NO_DEBUG_OUTPUT DEFINES += QT_NO_DEBUG_OUTPUT
unix:!macx:QMAKE_CXXFLAGS_RELEASE += -g
unix:!macx{ unix:!macx{
# On Linux # 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
# Strip debug symbols.
QMAKE_POST_LINK += objcopy --only-keep-debug $(DESTDIR)/$(TARGET) $(DESTDIR)/$(TARGET).debug && QMAKE_POST_LINK += objcopy --only-keep-debug $(DESTDIR)/$(TARGET) $(DESTDIR)/$(TARGET).debug &&
QMAKE_POST_LINK += strip --strip-debug --strip-unneeded $(DESTDIR)/$(TARGET) && QMAKE_POST_LINK += strip --strip-debug --strip-unneeded $(DESTDIR)/$(TARGET) &&
QMAKE_POST_LINK += objcopy --add-gnu-debuglink $(DESTDIR)/$(TARGET).debug $(DESTDIR)/$(TARGET) QMAKE_POST_LINK += objcopy --add-gnu-debuglink $(DESTDIR)/$(TARGET).debug $(DESTDIR)/$(TARGET)

View File

@ -4,13 +4,22 @@
# #
#------------------------------------------------- #-------------------------------------------------
# File with common stuff for whole project
include(../../../Valentina.pri)
# Library use widgets
QT += widgets QT += widgets
# We don't need gui library.
QT -= gui QT -= gui
# Name of library
TARGET = vpropertyexplorer TARGET = vpropertyexplorer
# We want create library
TEMPLATE = lib TEMPLATE = lib
# We use C++11 standard
CONFIG += c++11 CONFIG += c++11
DEFINES += VPROPERTYEXPLORER_LIBRARY DEFINES += VPROPERTYEXPLORER_LIBRARY
@ -53,7 +62,7 @@ SOURCES += \
stable.cpp stable.cpp
HEADERS +=\ HEADERS +=\
vpropertyexplorer_global.h \ vpropertyexplorer_global.h \
vpropertyfactorymanager_p.h \ vpropertyfactorymanager_p.h \
vpropertytreeview_p.h \ vpropertytreeview_p.h \
vpropertyset_p.h \ vpropertyset_p.h \
@ -92,72 +101,54 @@ HEADERS +=\
vproperties.h \ vproperties.h \
stable.h stable.h
unix { # Set "make install" command for Unix-like systems.
isEmpty(PREFIX) { unix{
PREFIX = /usr/lib isEmpty(PREFIX){
PREFIX = $$DEFAULT_PREFIX/lib
} }
}
unix:!macx{
target.path = $$PREFIX/lib target.path = $$PREFIX/lib
INSTALLS += target INSTALLS += target
*-g++{
QMAKE_CC = ccache gcc
QMAKE_CXX = ccache g++
}
clang*{
QMAKE_CC = ccache clang
QMAKE_CXX = ccache clang++
}
} }
unix:!macx:!clang*{ # Set using ccache. Function enable_ccache() defined in Valentina.pri.
CONFIG += precompile_header $$enable_ccache()
# Precompiled headers (PCH)
PRECOMPILED_HEADER = stable.h
win32-msvc* {
PRECOMPILED_SOURCE = stable.cpp
}
}
include(../../../Valentina.pri) # Set precompiled headers. Function set_PCH() defined in Valentina.pri.
$$set_PCH()
CONFIG(debug, debug|release){ CONFIG(debug, debug|release){
# Debug # Debug mode
unix { unix {
#Turn on compilers warnings.
*-g++{ *-g++{
QMAKE_CXXFLAGS += \ QMAKE_CXXFLAGS += \
-isystem "$$[QT_INSTALL_HEADERS]" \ # Key -isystem disable checking errors in system headers.
-isystem "$$[QT_INSTALL_HEADERS]/QtWidgets" \
-isystem "$$[QT_INSTALL_HEADERS]/QtXml" \
-isystem "$$[QT_INSTALL_HEADERS]/QtGui" \
-isystem "$$[QT_INSTALL_HEADERS]/QtXmlPatterns" \
-isystem "$$[QT_INSTALL_HEADERS]/QtCore" \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \ -isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$GCC_CXXFLAGS $$GCC_DEBUG_CXXFLAGS # See Valentina.pri for more details.
} }
#Turn on Clang warnings
clang*{ clang*{
QMAKE_CXXFLAGS += \ QMAKE_CXXFLAGS += \
-isystem "$$[QT_INSTALL_HEADERS]" \ # Key -isystem disable checking errors in system headers.
-isystem "$$[QT_INSTALL_HEADERS]/QtWidgets" \
-isystem "$$[QT_INSTALL_HEADERS]/QtXml" \
-isystem "$$[QT_INSTALL_HEADERS]/QtGui" \
-isystem "$$[QT_INSTALL_HEADERS]/QtCore" \
-isystem "$$[QT_INSTALL_HEADERS]/QtXmlPatterns" \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \ -isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$CLANG_CXXFLAGS $$CLANG_DEBUG_CXXFLAGS # See Valentina.pri for more details.
} }
} else { } else {
*-g++{#Don't use additional GCC keys on Windows system. *-g++{
QMAKE_CXXFLAGS += -O0 -Wall -Wextra -pedantic QMAKE_CXXFLAGS += $$CLANG_DEBUG_CXXFLAGS # See Valentina.pri for more details.
} }
} }
}else{ }else{
# Release # Release mode
DEFINES += QT_NO_DEBUG_OUTPUT DEFINES += QT_NO_DEBUG_OUTPUT
unix:!macx:QMAKE_CXXFLAGS_RELEASE += -g
unix:!macx{ unix:!macx{
# 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
# On Linux # On Linux
QMAKE_POST_LINK += objcopy --only-keep-debug $(DESTDIR)/$(TARGET) $(DESTDIR)/$(TARGET).debug && QMAKE_POST_LINK += objcopy --only-keep-debug $(DESTDIR)/$(TARGET) $(DESTDIR)/$(TARGET).debug &&
QMAKE_POST_LINK += strip --strip-debug --strip-unneeded $(DESTDIR)/$(TARGET) && QMAKE_POST_LINK += strip --strip-debug --strip-unneeded $(DESTDIR)/$(TARGET) &&

View File

@ -1,6 +1,7 @@
TEMPLATE = subdirs TEMPLATE = subdirs
CONFIG += ordered CONFIG += ordered
# Order is important
SUBDIRS = \ SUBDIRS = \
libs \ libs \
app \ app \

View File

@ -4,14 +4,27 @@
# #
#------------------------------------------------- #-------------------------------------------------
# Build QMuParser tests.
# File with common stuff for whole project
include(../../../Valentina.pri)
# We use many core functions.
QT += core QT += core
# Consol application doesn't need gui.
QT -= gui QT -= gui
# Name of binary file.
TARGET = ParserTest TARGET = ParserTest
# Console application, we use C++11 standard.
CONFIG += console c++11 CONFIG += console c++11
# Use out-of-source builds (shadow builds)
CONFIG -= app_bundle debug_and_release debug_and_release_target CONFIG -= app_bundle debug_and_release debug_and_release_target
# We want create executable file
TEMPLATE = app TEMPLATE = app
# directory for executable file # directory for executable file
@ -20,48 +33,59 @@ DESTDIR = bin
# objecs files # objecs files
OBJECTS_DIR = obj OBJECTS_DIR = obj
SOURCES += main.cpp HEADERS += \
stable.h
unix { SOURCES += \
QMAKE_CXX = ccache g++ main.cpp \
} stable.cpp
# 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){ CONFIG(debug, debug|release){
# Debug # Debug mode
unix { unix {
#Turn on compilers warnings.
*-g++{ *-g++{
QMAKE_CXXFLAGS += -isystem "/usr/include/qt5" -isystem "/usr/include/qt5/QtCore" \ QMAKE_CXXFLAGS += \
-O0 -Wall -Wextra -pedantic -Weffc++ -Woverloaded-virtual -Wctor-dtor-privacy \ $$GCC_DEBUG_CXXFLAGS # See Valentina.pri for more details.
-Wnon-virtual-dtor -Wold-style-cast -Wconversion -Winit-self -Wstack-protector \ }
-Wunreachable-code -Wcast-align -Wcast-qual -Wdisabled-optimization -Wfloat-equal \ clang*{
-Wformat=2 -Wimport \ QMAKE_CXXFLAGS += \
-Winvalid-pch -Wunsafe-loop-optimizations -Wlong-long -Wmissing-format-attribute \ $$CLANG_DEBUG_CXXFLAGS # See Valentina.pri for more details.
-Wmissing-include-dirs -Wpacked -Wredundant-decls -Winline \
-Wswitch-default -Wswitch-enum -Wuninitialized -Wvariadic-macros \
-Wlogical-op -Wnoexcept -Wmissing-noreturn -Wpointer-arith\
-Wstrict-null-sentinel -Wstrict-overflow=5 -Wundef -Wno-unused -gdwarf-3 \
-ftrapv
} }
} else { } else {
*-g++{#Don't use additional GCC keys on Windows system. *-g++{
QMAKE_CXXFLAGS += -O0 -Wall -Wextra -pedantic QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See Valentina.pri for more details.
} }
} }
}else{ }else{
# Release # Release mode
*-g++{ DEFINES += QT_NO_DEBUG_OUTPUT
QMAKE_CXXFLAGS += -O2
} # Turn on debug symbols in release mode on Unix systems.
# On Mac OS X temporarily disabled. Need find way how to strip binary file.
unix:!macx:QMAKE_CXXFLAGS_RELEASE += -g -gdwarf-3
} }
# Remove generated files at cleaning
QMAKE_DISTCLEAN += $${DESTDIR}/* \
$${OBJECTS_DIR}/*
win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../libs/qmuparser/bin/ -lqmuparser2 win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../libs/qmuparser/bin/ -lqmuparser2
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../libs/qmuparser/bin/ -lqmuparser2 else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../libs/qmuparser/bin/ -lqmuparser2
else:unix: LIBS += -L$$OUT_PWD/../../libs/qmuparser/bin/ -lqmuparser else:unix: LIBS += -L$$OUT_PWD/../../libs/qmuparser/bin/ -lqmuparser
INCLUDEPATH += $$PWD/../../libs/qmuparser INCLUDEPATH += $$PWD/../../libs/qmuparser
DEPENDPATH += $$PWD/../../libs/qmuparser DEPENDPATH += $$PWD/../../libs/qmuparser
# Strip after you link all libaries.
CONFIG(release, debug|release){
unix:!macx{
# Strip debug symbols.
QMAKE_POST_LINK += objcopy --only-keep-debug $(TARGET) $(TARGET).debug &&
QMAKE_POST_LINK += strip --strip-debug --strip-unneeded $(TARGET) &&
QMAKE_POST_LINK += objcopy --add-gnu-debuglink $(TARGET).debug $(TARGET)
}
}

View File

@ -0,0 +1,30 @@
/************************************************************************
**
** @file stable.cpp
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date November 15, 2013
**
** @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
** <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"

View File

@ -0,0 +1,48 @@
/************************************************************************
**
** @file stable.h
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date November 15, 2013
**
** @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
** <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 QmuParser tests.\n")
#endif
/* Add C includes here */
#if defined __cplusplus
/* Add C++ includes here */
#ifdef QT_CORE_LIB
#include <QtCore>
#endif
#endif
#endif // STABLE_H