From 368b5dffdf5c4e7df410d39851c1920c496fe18a Mon Sep 17 00:00:00 2001 From: Bartosz Wieczorek Date: Wed, 24 Jan 2018 11:51:33 +0100 Subject: [PATCH] fixup --- CMakeLists.txt | 18 +---------- cmake/FindAllRequirements.cmake | 6 ++++ src/CMakeLists.txt | 4 +-- src/app/CMakeLists.txt | 5 --- src/app/main.cpp | 56 +++++---------------------------- src/eedb/CMakeLists.txt | 23 +++++++------- src/eedb/EEDB.cpp | 27 +++++++--------- src/eedb/EEDB.hpp | 2 +- src/eedb/Session.hpp | 4 +-- src/eedb/auth/PgUserAuth.hpp | 2 +- 10 files changed, 44 insertions(+), 103 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ea80633..c13fcc3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,23 +14,7 @@ set(HUNTER_BUILD_SHARED_LIBS TRUE) include(cmake/Compiler.cmake) include(cmake/FindAllRequirements.cmake) - -#hunter_add_package(Boost COMPONENTS system filesystem) -#find_package(Boost CONFIG REQUIRED system filesystem) -#target_link_libraries(... Boost::system Boost::filesystem) -#add_executable(main main.cpp) -#target_link_libraries(main PUBLIC nlohmann_json) -#target_link_libraries(foo GTest::main) # GTest::gtest will be linked automatically -#target_link_libraries(boo GTest::gtest) -#target_link_libraries(... benchmark::benchmark) -#target_link_libraries(... spdlog::spdlog) -#add_executable(comprehensions comprehensions.cpp) -#target_link_libraries(comprehensions PUBLIC range-v3::range-v3) - -#set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "/usr/share/cmake/Modules/") -#find_package(Wt REQUIRED) -#find_package(Sqlpp11 REQUIRED) -#target_link_libraries(... PostgreSQL::libpq) +include_directories(${CMAKE_BINARY_DIR}/external/include) add_subdirectory(src) #add_subdirectory(tests) diff --git a/cmake/FindAllRequirements.cmake b/cmake/FindAllRequirements.cmake index 7531694..ddcba15 100644 --- a/cmake/FindAllRequirements.cmake +++ b/cmake/FindAllRequirements.cmake @@ -112,12 +112,18 @@ build_external_project(project_hhdate date -DTZ_CXX_STANDARD=14 ) +add_library(date INTERFACE IMPORTED) +add_dependencies(date project_hhdate) + build_external_project(project_sqlpp sqlpp https://github.com/rbock/sqlpp11.git -DCMAKE_INSTALL_PREFIX=${EXTERNAL_LOCATION} -DENABLE_TESTS=FALSE ) +add_library(sqlpp INTERFACE IMPORTED) +add_dependencies(sqlpp project_sqlpp) + link_directories(${_HUNTER_ROOT}/lib) find_library(wt REQUIRED) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a3c236e..2fc7868 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,6 +1,6 @@ project( eedb_app ) INCLUDE_DIRECTORIES(.) -#add_subdirectory(utils) -#add_subdirectory(eedb) +add_subdirectory(utils) +add_subdirectory(eedb) add_subdirectory(app) diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index 40aebe3..bcece7d 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -3,23 +3,18 @@ set(SOURCES #INCLUDE_DIRECTORIES(${PostgreSQL_INCLUDE_DIRS}) -include_directories(${CMAKE_BINARY_DIR}/external/include) add_executable(eedb ${SOURCES} ) -#add_dependencies(eedb project_wt) target_link_libraries(eedb wthttp # or {Wt_HTTP_DEBUG_LIBRARY} wt # or {Wt_DEBUG_LIBRARY} -# ${Wt_LIBRARY} # or {Wt_DEBUG_LIBRARY} -# ${Wt_HTTP_LIBRARY} # or {Wt_HTTP_DEBUG_LIBRARY} Boost::system Boost::filesystem Boost::thread Boost::program_options z -# ${Boost_LIBRARIES} # eedb_db auth ) diff --git a/src/app/main.cpp b/src/app/main.cpp index 57e946e..c01f4fb 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -11,12 +11,12 @@ //#include //#include -//#include -//#include +#include +#include -//Wt::WApplication * createApplication(const Wt::WEnvironment & env) { -// using std::move; +Wt::WApplication * createApplication(const Wt::WEnvironment & env) { // using std::make_unique; +// using std::move; // using std::unique_ptr; // auto dbConfig = make_unique< eedb::db::PgConfig >(env); @@ -37,9 +37,9 @@ // }; // return new eedb::EEDB{std::move(session), authPageFactory, homePageFactory}; -//} +} -//int main(int argc, char ** argv) { +int main(int argc, char ** argv) { // try { // Wt::WServer server(argc, argv, WTHTTP_CONFIGURATION); // server.addEntryPoint(Wt::Application, createApplication); @@ -50,47 +50,5 @@ // } catch(std::exception & e) { // std::cerr << "exception: " << e.what() << std::endl; // } -// return 0; -//} - - -#include -#include -#include -#include -#include -#include - -class HelloApplication : public Wt::WApplication -{ -public: - HelloApplication(const Wt::WEnvironment& env); - -private: - Wt::WLineEdit *nameEdit_; - Wt::WText *greeting_; - - void greet(); -}; - -HelloApplication::HelloApplication(const Wt::WEnvironment& env) - : Wt::WApplication(env) -{ - setTitle("Hello world"); - - root()->addWidget(std::make_unique("Your name, please? ")); - nameEdit_ = root()->addWidget(std::make_unique()); - Wt::WPushButton *button = root()->addWidget(std::make_unique("Greet me.")); - root()->addWidget(std::make_unique()); - greeting_ = root()->addWidget(std::make_unique()); - button->clicked().connect(this, [this](){ - greeting_->setText("Hello there, " + nameEdit_->text()); - }); -} - -int main(int argc, char **argv) -{ - return Wt::WRun(argc, argv, [](const Wt::WEnvironment& env) { - return std::make_unique(env); - }); + return 0; } diff --git a/src/eedb/CMakeLists.txt b/src/eedb/CMakeLists.txt index fe28490..ce4bf0a 100644 --- a/src/eedb/CMakeLists.txt +++ b/src/eedb/CMakeLists.txt @@ -1,16 +1,17 @@ file(GLOB SOURCE - EEDB.cpp - Session.cpp +# EEDB.cpp +# Session.cpp - auth/PgUserAuth.cpp - auth/Services.cpp - data/* - widgets/* - model/*) +# auth/PgUserAuth.cpp +# auth/Services.cpp +# data/* +# widgets/* +# model/* +) -add_subdirectory(db) -include_directories( ${PostgreSQL_INCLUDE_DIRS} ) +#add_subdirectory(db) +#include_directories( ${PostgreSQL_INCLUDE_DIRS} ) -add_library(auth STATIC ${SOURCE}) -target_link_libraries( auth eedb_db ) +#add_library(auth STATIC ${SOURCE}) +#target_link_libraries( auth eedb_db ) diff --git a/src/eedb/EEDB.cpp b/src/eedb/EEDB.cpp index 8e65bf6..3e122f7 100644 --- a/src/eedb/EEDB.cpp +++ b/src/eedb/EEDB.cpp @@ -1,8 +1,5 @@ #include "EEDB.hpp" -#include -#include - #include #include #include @@ -12,18 +9,18 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include using std::move; diff --git a/src/eedb/EEDB.hpp b/src/eedb/EEDB.hpp index 47cfdff..409fc56 100644 --- a/src/eedb/EEDB.hpp +++ b/src/eedb/EEDB.hpp @@ -1,7 +1,7 @@ #include #include -#include +#include namespace Wt { class WContainerWidget; diff --git a/src/eedb/Session.hpp b/src/eedb/Session.hpp index b029478..739df01 100644 --- a/src/eedb/Session.hpp +++ b/src/eedb/Session.hpp @@ -1,7 +1,7 @@ #pragma once -#include -#include +#include +#include namespace eedb::auth { class PgUserAuth; diff --git a/src/eedb/auth/PgUserAuth.hpp b/src/eedb/auth/PgUserAuth.hpp index 262629d..1ec4ac8 100644 --- a/src/eedb/auth/PgUserAuth.hpp +++ b/src/eedb/auth/PgUserAuth.hpp @@ -1,6 +1,6 @@ #pragma once -#include +#include namespace eedb::db { class PgConnection;