From 780d912cd195fc8792d62eee3e9189a9b0f26767 Mon Sep 17 00:00:00 2001 From: eelke Date: Tue, 18 Sep 2018 20:24:54 +0200 Subject: [PATCH] Adjusted project files for new boost version. This should be handled differently the location of boost should not be baked into the project files. --- common.pri | 12 ++++++++++++ core/core.pro | 19 +++++-------------- core/my_boost_assert_handler.cpp | 4 ++-- ctk/ctk.pro | 2 +- pglab/UserConfiguration.cpp | 1 + pglab/UserConfiguration.h | 4 ++++ pglab/pglab.pro | 11 +++++++---- pglabAll.pro | 2 -- pglablib/pglablib.pro | 12 ++++-------- pgsql/pgsql.pro | 9 +++------ tests/PgsqlTests/PgsqlTests.pro | 9 ++++++--- tests/pglabtests/pglabtests.pro | 8 ++++++-- tests/pglabtests/tst_CodeBuilder.cpp | 2 +- 13 files changed, 52 insertions(+), 43 deletions(-) create mode 100644 common.pri diff --git a/common.pri b/common.pri new file mode 100644 index 0000000..39e9269 --- /dev/null +++ b/common.pri @@ -0,0 +1,12 @@ +INCLUDEPATH += C:\prog\include C:\prog\include\pgsql C:\VSproj\boost\include\boost-1_68 + +LIBS += -LC:\VSproj\boost\lib -LC:/PROG/LIB -lws2_32 -llibpq + +QMAKE_CXXFLAGS += /std:c++17 + +# The following define makes your compiler emit warnings if you use +# any feature of Qt which as been marked as deprecated (the exact warnings +# depend on your compiler). Please consult the documentation of the +# deprecated API in order to know how to port your code away from it. +DEFINES += QT_DEPRECATED_WARNINGS +DEFINES += WIN32_LEAN_AND_MEAN NOMINMAX diff --git a/core/core.pro b/core/core.pro index 7b165a1..f603227 100644 --- a/core/core.pro +++ b/core/core.pro @@ -8,23 +8,14 @@ QT -= gui TARGET = core TEMPLATE = lib -CONFIG += staticlib c++14 +CONFIG += staticlib c++17 -QMAKE_CXXFLAGS += /std:c++17 +! include( ../common.pri ) { +error( "Couldn't find the common.pri file!" ) +} -INCLUDEPATH += C:\prog\include \ -C:\Prog\include\pgsql \ -C:\VSproj\boost32\include\boost-1_65_1 +INCLUDEPATH += C:\Prog\include\pgsql -DEFINES += WIN32_LEAN_AND_MEAN NOMINMAX -#LIBS += /LIBPATH:C:\VSproj\boost_1_63_0\stage\lib /LIBPATH:c:\prog\lib\ libpq.lib fmt.lib User32.lib ws2_32.lib - - -# The following define makes your compiler emit warnings if you use -# any feature of Qt which as been marked as deprecated (the exact warnings -# depend on your compiler). Please consult the documentation of the -# deprecated API in order to know how to port your code away from it. -DEFINES += QT_DEPRECATED_WARNINGS # You can also make your code fail to compile if you use deprecated APIs. # In order to do so, uncomment the following line. diff --git a/core/my_boost_assert_handler.cpp b/core/my_boost_assert_handler.cpp index fda7bba..d3739fa 100644 --- a/core/my_boost_assert_handler.cpp +++ b/core/my_boost_assert_handler.cpp @@ -6,14 +6,14 @@ namespace boost void assertion_failed(char const * expr, char const * function, char const * file, long line) { std::ostringstream out; - out << "Assertion failure int " << function << " " << file << ":" << line; + out << "Assertion failure int " << function << " " << file << ":" << line << "\n" << expr; throw std::runtime_error(out.str()); } void assertion_failed_msg(char const * expr, char const * msg, char const * function, char const * file, long line) { std::ostringstream out; - out << "Assertion failure int " << function << " " << file << ":" << line << "\n"<< msg; + out << "Assertion failure int " << function << " " << file << ":" << line << "\n" << msg << "\n" << expr; throw std::runtime_error(out.str()); } } diff --git a/ctk/ctk.pro b/ctk/ctk.pro index cf4d827..6e42fbb 100644 --- a/ctk/ctk.pro +++ b/ctk/ctk.pro @@ -14,7 +14,7 @@ QMAKE_CXXFLAGS += /std:c++17 INCLUDEPATH += C:\prog\include \ C:\Prog\include\pgsql \ -C:\VSproj\boost32\include\boost-1_65_1 +C:\VSproj\boost32\include DEFINES += WIN32_LEAN_AND_MEAN NOMINMAX diff --git a/pglab/UserConfiguration.cpp b/pglab/UserConfiguration.cpp index 3b0ef95..2cecd67 100644 --- a/pglab/UserConfiguration.cpp +++ b/pglab/UserConfiguration.cpp @@ -23,3 +23,4 @@ QFont UserConfiguration::codeFont() const font.setPointSize(size); return font; } + diff --git a/pglab/UserConfiguration.h b/pglab/UserConfiguration.h index 897f1ce..2eb1a5f 100644 --- a/pglab/UserConfiguration.h +++ b/pglab/UserConfiguration.h @@ -2,6 +2,8 @@ #define USERCONFIGURATION_H #include + + /** Class for most of the program configuration * * The settings represented by this class are stored in a settings file @@ -17,6 +19,8 @@ public: UserConfiguration(); QFont codeFont() const; + + private: QSettings m_settings; }; diff --git a/pglab/pglab.pro b/pglab/pglab.pro index 18b7a69..be8e656 100644 --- a/pglab/pglab.pro +++ b/pglab/pglab.pro @@ -9,15 +9,18 @@ QT += core gui concurrent greaterThan(QT_MAJOR_VERSION, 4): QT += widgets sql -QMAKE_CXXFLAGS += /std:c++17 TARGET = pglab TEMPLATE = app -INCLUDEPATH += C:\prog\include C:\Prog\include\pgsql C:\VSproj\boost32\include\boost-1_65_1 -DEFINES += WIN32_LEAN_AND_MEAN NOMINMAX _WIN32_WINNT=0x0501 +! include( ../common.pri ) { +error( "Couldn't find the common.pri file!" ) +} + +INCLUDEPATH += C:\Prog\include\pgsql +DEFINES += _WIN32_WINNT=0x0501 #LIBS += -LC:/prog/boost/lib -Lc:/prog/lib libpq.lib fmt.lib User32.lib ws2_32.lib -LIBS += -LC:\VSproj\boost32\lib -LC:/PROG/LIB -lws2_32 -llibpq +#LIBS += -LC:\VSproj\boost32\lib -LC:/PROG/LIB -lws2_32 -llibpq #debug { LIBS += c:/prog/lib/botand_imp.lib diff --git a/pglabAll.pro b/pglabAll.pro index ae61f1d..c6dfff3 100644 --- a/pglabAll.pro +++ b/pglabAll.pro @@ -2,7 +2,6 @@ TEMPLATE = subdirs DEFINES += BOOST_ENABLE_ASSERT_HANDLER - SUBDIRS += core \ ctk \ pgsql \ @@ -15,7 +14,6 @@ pglablib.depends = core pgsql tests.depends = core pgsql pglablib - CONFIG(debug, debug|release) { SUBDIRS += tests } diff --git a/pglablib/pglablib.pro b/pglablib/pglablib.pro index 4441836..1d0acf9 100644 --- a/pglablib/pglablib.pro +++ b/pglablib/pglablib.pro @@ -10,15 +10,11 @@ TARGET = pglablib TEMPLATE = lib CONFIG += staticlib -QMAKE_CXXFLAGS += /std:c++17 +! include( ../common.pri ) { +error( "Couldn't find the common.pri file!" ) +} -# The following define makes your compiler emit warnings if you use -# any feature of Qt which has been marked as deprecated (the exact warnings -# depend on your compiler). Please consult the documentation of the -# deprecated API in order to know how to port your code away from it. -DEFINES += QT_DEPRECATED_WARNINGS - -INCLUDEPATH += C:\prog\include C:\Prog\include\pgsql C:\VSproj\boost32\include\boost-1_65_1 +INCLUDEPATH += C:\Prog\include\pgsql # You can also make your code fail to compile if you use deprecated APIs. # In order to do so, uncomment the following line. diff --git a/pgsql/pgsql.pro b/pgsql/pgsql.pro index da88da9..6999c72 100644 --- a/pgsql/pgsql.pro +++ b/pgsql/pgsql.pro @@ -12,13 +12,10 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets sql TARGET = pgsql TEMPLATE = lib -INCLUDEPATH += C:\prog\include \ -C:\Prog\include\pgsql \ -C:\VSproj\boost32\include\boost-1_65_1 +! include( ../common.pri ) { +error( "Couldn't find the common.pri file!" ) +} -QMAKE_CXXFLAGS += /std:c++17 - -DEFINES += WIN32_LEAN_AND_MEAN NOMINMAX #LIBS += -LC:/prog/boost/lib -Lc:/prog/lib libpq.lib fmt.lib User32.lib ws2_32.lib LIBS += -LC:/PROG/LIB -lws2_32 -llibpq diff --git a/tests/PgsqlTests/PgsqlTests.pro b/tests/PgsqlTests/PgsqlTests.pro index 18845c9..3136f67 100644 --- a/tests/PgsqlTests/PgsqlTests.pro +++ b/tests/PgsqlTests/PgsqlTests.pro @@ -1,16 +1,19 @@ +! include( ../../common.pri ) { +error( "Couldn't find the common.pri file!" ) +} include(gtest_dependency.pri) TEMPLATE = app -CONFIG += console c++11 +CONFIG += console c++17 CONFIG -= app_bundle CONFIG += thread CONFIG += qt QT += core -QMAKE_CXXFLAGS += /std:c++17 +INCLUDEPATH += C:\Prog\include\pgsql + -INCLUDEPATH += C:\prog\include C:\Prog\include\pgsql HEADERS += diff --git a/tests/pglabtests/pglabtests.pro b/tests/pglabtests/pglabtests.pro index e2da178..ed131bf 100644 --- a/tests/pglabtests/pglabtests.pro +++ b/tests/pglabtests/pglabtests.pro @@ -9,7 +9,11 @@ CONFIG += qt QT += core widgets QMAKE_CXXFLAGS += /std:c++17 -LIBS += -LC:\VSproj\boost32\lib -LC:/PROG/LIB -lws2_32 -llibpq + +! include( ../../common.pri ) { +error( "Couldn't find the common.pri file!" ) +} + HEADERS += @@ -30,7 +34,7 @@ else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../core/debug/ - INCLUDEPATH += C:\prog\include \ C:\Prog\include\pgsql \ -C:\VSproj\boost32\include\boost-1_65_1 +C:\VSproj\boost32\include INCLUDEPATH += $$PWD/../../core DEPENDPATH += $$PWD/../../core diff --git a/tests/pglabtests/tst_CodeBuilder.cpp b/tests/pglabtests/tst_CodeBuilder.cpp index 206d1fe..cf7d349 100644 --- a/tests/pglabtests/tst_CodeBuilder.cpp +++ b/tests/pglabtests/tst_CodeBuilder.cpp @@ -1,9 +1,9 @@ #include #include +#include "PrintTo_Qt.h" #include #include "PgType.h" #include "PgTypeContainer.h" -#include "PrintTo_Qt.h" #include "codebuilder/IndentationConfig.h" #include "codebuilder/TypeMappings.h" #include "Pgsql_oids.h"