diff --git a/preferences/Preferences.cpp b/preferences/Preferences.cpp index 4a13224..bd2426d 100644 --- a/preferences/Preferences.cpp +++ b/preferences/Preferences.cpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include // TODO: implement versioning for preference files diff --git a/preferences/TextColor.cpp b/preferences/TextColor.cpp index a2ebf42..9214b42 100644 --- a/preferences/TextColor.cpp +++ b/preferences/TextColor.cpp @@ -9,7 +9,7 @@ #include "session/SessionCommon.h" #include #include -#include +#include const std::string FOREGROUND_KEY = "foreground"; const std::string BACKGROUND_KEY = "background"; diff --git a/session/AppSession.cpp b/session/AppSession.cpp index f1070cc..54f8922 100644 --- a/session/AppSession.cpp +++ b/session/AppSession.cpp @@ -9,7 +9,7 @@ #include "FileSession.h" #include "SearchSession.h" #include "SessionCommon.h" -#include +#include #include const std::string AppSession::GEOMETRY_KEY = "geometry"; diff --git a/session/FileSession.cpp b/session/FileSession.cpp index e37357a..b223a65 100644 --- a/session/FileSession.cpp +++ b/session/FileSession.cpp @@ -1,6 +1,6 @@ #include "FileSession.h" #include "SessionCommon.h" -#include +#include const std::string FileSession::PATH_KEY = "path"; const std::string FileSession::ADDRESS_KEY = "address"; diff --git a/session/SearchSession.cpp b/session/SearchSession.cpp index a3a6531..c80e37b 100644 --- a/session/SearchSession.cpp +++ b/session/SearchSession.cpp @@ -1,6 +1,6 @@ #include "SearchSession.h" #include "SessionCommon.h" -#include +#include const std::string SearchSession::EXPRESSION_KEY = "expression"; diff --git a/session/SessionCommon.h b/session/SessionCommon.h index 8ba14fd..5df3c1e 100644 --- a/session/SessionCommon.h +++ b/session/SessionCommon.h @@ -3,7 +3,7 @@ // TODO: move this to a yaml subdirectory, since it's being used by preferences serialization, not just session. -#include +#include #include template T getValue(const YAML::Node & in, const std::string & key) diff --git a/yata.pro b/yata.pro index 422f19e..b8fcf8d 100644 --- a/yata.pro +++ b/yata.pro @@ -107,8 +107,6 @@ SOURCES += \ RESOURCES += \ resource/resources.qrc -#QT += widgets - win32 { isEmpty(YAMLCPP): YAMLCPP = $$PWD/../yaml-cpp INCLUDEPATH += $$YAMLCPP/include @@ -120,12 +118,37 @@ win32 { /DVERSION=$$VERSION $$PWD\\win\\installer.nsi INSTALLS += target } + LIBS += -lyaml-cpp +} + +defineReplace(findFile) { + baseDirs=$$1 + components=$$2 + for(baseDir, baseDirs) { + for(component, components) { + path=$$baseDir/$$component + exists($$path) { + return($$path) + } + } + } } unix { + isEmpty(YAMLCPPINC) { + + includeDirs=/usr/local/include /usr/include + prospectives=yaml-cpp03 yaml-cpp + + YAMLCPPINC=$$findFile($$includeDirs, $$prospectives) + + isEmpty(YAMLCPPINC): error(Could not find yaml-cpp include path) + } + message(YAMLCPPINC: $$YAMLCPPINC) + INCLUDEPATH += $$YAMLCPPINC isEmpty(INSTALLDIR): INSTALLDIR = /usr/local/bin target.path = $$INSTALLDIR INSTALLS += target -} -LIBS += -lyaml-cpp + LIBS += -l:libyaml-cpp.so.0.3 +}