diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index d8a4c88a..907787cb 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -6,18 +6,6 @@ add_files( utility/commandline/CommandLineParser.cpp utility/commandline/CommandLineParser.h - utility/headerSearch/CompilerDetector.cpp - utility/headerSearch/CompilerDetector.h - utility/headerSearch/DetectorBase.cpp - utility/headerSearch/DetectorBase.h - utility/headerSearch/StandardHeaderDetection.cpp - utility/headerSearch/StandardHeaderDetection.h - utility/headerSearch/VisualStudioDetector.cpp - utility/headerSearch/VisualStudioDetector.h - - utility/utilityApp.cpp - utility/utilityApp.h - isTrial.cpp LicenseChecker.h main.cpp diff --git a/src/app/main.cpp b/src/app/main.cpp index 775d1954..fcfaa772 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -20,9 +20,6 @@ #include "settings/ProjectSettings.h" - -#include "utility/headerSearch/StandardHeaderDetection.h" - void init() { std::shared_ptr consoleLogger = std::make_shared(); @@ -86,10 +83,6 @@ int main(int argc, char *argv[]) LicenseChecker checker; - StandardHeaderDetection detection; - detection.printdetectedCompilers(); - detection.printAvailableDetectors(); - utility::loadFontsFromDirectory(ResourcePaths::getFontsPath(), ".otf"); std::shared_ptr app = Application::create(version, &viewFactory, &networkFactory); diff --git a/src/app/utility/headerSearch/CompilerDetector.cpp b/src/app/utility/headerSearch/CompilerDetector.cpp deleted file mode 100644 index 2c616a5c..00000000 --- a/src/app/utility/headerSearch/CompilerDetector.cpp +++ /dev/null @@ -1,37 +0,0 @@ -#include "utility/headerSearch/CompilerDetector.h" - -#include "utility/utilityApp.h" -#include "utility/utilityString.h" - -CompilerDetector::CompilerDetector(const std::string& name) - : DetectorBase(name) -{ -} - -CompilerDetector::~CompilerDetector() -{ -} - -std::vector CompilerDetector::getStandardHeaderPaths() -{ - std::string command = m_name + " -x c++ -v -E /dev/null"; - std::string clangOutput = utility::executeProcess(command.c_str()); - std::string standardHeaders = utility::substrBetween(clangOutput, "#include <...> search starts here:\n","\nEnd of search list"); - std::vector paths; - - if (!standardHeaders.empty()) - { - for (std::string s : utility::splitToVector(standardHeaders, '\n')) - { - paths.push_back(s); - } - } - - return paths; -} - -// Add Gcc to Available Detectors -static StandardHeaderDetection::Add gcc("gcc"); -// Add Clang to Available Detectors -static StandardHeaderDetection::Add clang("clang"); - diff --git a/src/app/utility/headerSearch/DetectorProxy.h b/src/app/utility/headerSearch/DetectorProxy.h deleted file mode 100644 index 6f5fbd42..00000000 --- a/src/app/utility/headerSearch/DetectorProxy.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef DETECTOR_PROXY_H -#define DETECTOR_PROXY_H - -class DetectorProxyBase -{ -public: - - -}; - - -#endif // DETECTOR_PROXY_H - diff --git a/src/app/utility/headerSearch/StandardHeaderDetection.cpp b/src/app/utility/headerSearch/StandardHeaderDetection.cpp deleted file mode 100644 index 08a98fcb..00000000 --- a/src/app/utility/headerSearch/StandardHeaderDetection.cpp +++ /dev/null @@ -1,87 +0,0 @@ -#include "utility/headerSearch/StandardHeaderDetection.h" - -#include -#include -#include -#include -#include -#include - -#include "utility/file/FilePath.h" -#include "utility/logging/logging.h" -#include "utility/utilityApp.h" -#include "utility/utilityString.h" - -#include "clang/Driver/ToolChain.h" -#include "clang/Driver/Options.h" -#include "clang/Driver/Tool.h" -#include "clang/Driver/DriverDiagnostic.h" - -typedef std::pair> DetectorPair; - -DetectorMap* StandardHeaderDetection::s_availableDetectors; - -StandardHeaderDetection::StandardHeaderDetection() -{ - detectHeaders(); -} - -StandardHeaderDetection::~StandardHeaderDetection() -{ - if ( s_availableDetectors != nullptr ) - { - delete s_availableDetectors; - } -} - -void StandardHeaderDetection::detectHeaders() -{ - for ( DetectorPair detector : *s_availableDetectors) - { - if ( detector.second->detect() ) - { - m_detectedCompilers.insert(detector); - } - } -} - -std::vector StandardHeaderDetection::getDetectedCompilers() -{ - std::vector v; - for ( DetectorPair detector : m_detectedCompilers) - { - v.push_back(detector.first); - } - return v; -} - -std::vector StandardHeaderDetection::getStandardHeaderPaths(std::string compiler) -{ - auto it = m_detectedCompilers.find(compiler); - if(it != m_detectedCompilers.end()) - { - return it->second->getStandardHeaderPaths(); - } - return std::vector(); -} - -void StandardHeaderDetection::printdetectedCompilers() -{ - std::cout << "Detected Compilers: " << std::endl; - std::vector compilers = getDetectedCompilers(); - for ( std::string compiler : compilers) - { - std::cout << compiler << std::endl; - } -} - -void StandardHeaderDetection::printAvailableDetectors() -{ - std::cout << "printAvailableDetectors: " << std::endl; - - for ( DetectorPair detector : *s_availableDetectors) - { - std::cout << detector.first << std::endl; - } -} - diff --git a/src/app/utility/headerSearch/StandardHeaderDetection.h b/src/app/utility/headerSearch/StandardHeaderDetection.h deleted file mode 100644 index 0559f6a8..00000000 --- a/src/app/utility/headerSearch/StandardHeaderDetection.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef STANDARDHEADER_DETECTION_H -#define STANDARDHEADER_DETECTION_H - -#include -#include -#include - -#include "utility/headerSearch/DetectorBase.h" - -typedef std::map> DetectorMap; - -class FilePath; - -class StandardHeaderDetection -{ -public: - StandardHeaderDetection(); - ~StandardHeaderDetection(); - - /// Checks all availabe detectors and saves found Compilers - void detectHeaders(); - - /// Returns alls found compilers - std::vector getDetectedCompilers(); - - /// Returns the headerpaths from a found compiler - std::vector getStandardHeaderPaths(std::string compiler); - - /// Declare a instance of this class to add a detector - template - class Add - { - public: - Add(const std::string& name) - { - std::shared_ptr detector = std::shared_ptr(new U(name)); - if (!s_availableDetectors) - { - s_availableDetectors = new DetectorMap(); - } - s_availableDetectors->insert(std::make_pair(detector->getName(), detector)); - } - }; - - /// Debugging Output - void printAvailableDetectors(); - void printdetectedCompilers(); -private: - static DetectorMap* s_availableDetectors; - DetectorMap m_detectedCompilers; -}; - -#endif //STANDARDHEADER_DETECTION_H diff --git a/src/lib/utility/utilityString.cpp b/src/lib/utility/utilityString.cpp index 08810295..3943b131 100644 --- a/src/lib/utility/utilityString.cpp +++ b/src/lib/utility/utilityString.cpp @@ -122,12 +122,17 @@ namespace utility bool isPrefix(const std::string& prefix, const std::string& text) { - typedef std::pair ResType; - ResType res = std::mismatch(prefix.begin(), prefix.end(), text.begin()); + std::pair res = + std::mismatch(prefix.begin(), prefix.end(), text.begin()); return res.first == prefix.end(); } + bool isPostfix(const std::string& postfix, const std::string& text) + { + return text.size() >= postfix.size() && text.rfind(postfix) == (text.size() - postfix.size()); + } + std::string toUpperCase(const std::string& in) { std::string out; diff --git a/src/lib/utility/utilityString.h b/src/lib/utility/utilityString.h index 7b618e11..184d50bb 100644 --- a/src/lib/utility/utilityString.h +++ b/src/lib/utility/utilityString.h @@ -35,6 +35,7 @@ namespace utility std::string substrBetween(const std::string& str, const std::string& delimiter1, const std::string& delimiter2); bool isPrefix(const std::string& prefix, const std::string& text); + bool isPostfix(const std::string& postfix, const std::string& text); std::string toUpperCase(const std::string& in); std::string toLowerCase(const std::string& in); diff --git a/src/lib_gui/CMakeLists.txt b/src/lib_gui/CMakeLists.txt index 2ad184dd..84302094 100644 --- a/src/lib_gui/CMakeLists.txt +++ b/src/lib_gui/CMakeLists.txt @@ -151,4 +151,16 @@ add_files( qt/QtApplication.h qt/QtCoreApplication.cpp qt/QtCoreApplication.h + + utility/headerSearch/CompilerDetector.cpp + utility/headerSearch/CompilerDetector.h + utility/headerSearch/DetectorBase.cpp + utility/headerSearch/DetectorBase.h + utility/headerSearch/StandardHeaderDetection.cpp + utility/headerSearch/StandardHeaderDetection.h + utility/headerSearch/VisualStudioDetector.cpp + utility/headerSearch/VisualStudioDetector.h + + utility/utilityApp.cpp + utility/utilityApp.h ) diff --git a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzard.cpp b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzard.cpp index 32c2a9a8..4be965ea 100644 --- a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzard.cpp +++ b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzard.cpp @@ -92,7 +92,7 @@ void QtProjectWizzard::newProjectFromSolution(const std::string& ideId, const st std::string title = "NEW PROJECT FROM "; title += ideId; title += " SOLUTION"; - + boost::algorithm::to_upper(title); window->updateTitle(QString(title.c_str())); @@ -232,8 +232,8 @@ QtProjectWizzardWindow* QtProjectWizzard::createWindowWithContentsetContent(content); window->setup(); diff --git a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPaths.cpp b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPaths.cpp index f0b465b1..62db55b7 100644 --- a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPaths.cpp +++ b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPaths.cpp @@ -7,6 +7,7 @@ #include "qt/element/QtDirectoryListBox.h" #include "settings/ApplicationSettings.h" #include "utility/file/FileSystem.h" +#include "utility/headerSearch/StandardHeaderDetection.h" #include "utility/utility.h" QtProjectWizzardContentPaths::QtProjectWizzardContentPaths(ProjectSettings* settings, QtProjectWizzardWindow* window) @@ -47,6 +48,11 @@ void QtProjectWizzardContentPaths::populateWindow(QGridLayout* layout, int& row) addFilesButton(m_showFilesString, layout, row); } + if (m_detectionString.size() > 0) + { + addDetection(m_detectionString, layout, row); + } + row++; layout->setColumnStretch(QtProjectWizzardWindow::FRONT_COL, 1); @@ -72,6 +78,12 @@ void QtProjectWizzardContentPaths::populateForm(QGridLayout* layout, int& row) addFilesButton(m_showFilesString, layout, row); row++; } + + if (m_detectionString.size() > 0) + { + addDetection(m_detectionString, layout, row); + row++; + } } QSize QtProjectWizzardContentPaths::preferredWindowSize() const @@ -101,6 +113,60 @@ void QtProjectWizzardContentPaths::setHelpString(const QString& help) m_helpString = help; } +void QtProjectWizzardContentPaths::addDetection(QString name, QGridLayout* layout, int row) +{ + StandardHeaderDetection detection; + std::vector compilers = detection.getDetectedCompilers(); + if (!compilers.size()) + { + return; + } + + QLabel* label = new QLabel("Auto detection from:"); + + m_detectorBox = new QComboBox(); + + for (const std::string& compiler : compilers) + { + m_detectorBox->addItem(compiler.c_str()); + } + + QPushButton* button = new QPushButton("detect"); + button->setObjectName("windowButton"); + connect(button, SIGNAL(clicked()), this, SLOT(detectionClicked())); + + QHBoxLayout* hlayout = new QHBoxLayout(); + hlayout->addWidget(label); + hlayout->addWidget(m_detectorBox); + hlayout->addWidget(button); + + layout->addLayout(hlayout, row, QtProjectWizzardWindow::BACK_COL, Qt::AlignLeft | Qt::AlignTop); +} + +void QtProjectWizzardContentPaths::detectionClicked() +{ + StandardHeaderDetection detection; + + std::vector paths; + if (m_detectionString == "headers") + { + paths = detection.getStandardHeaderPaths(m_detectorBox->currentText().toStdString()); + } + else if (m_detectionString == "frameworks") + { + paths = detection.getStandardFrameworkPaths(m_detectorBox->currentText().toStdString()); + } + + std::vector oldPaths = m_list->getList(); + + std::set uniquePaths; + uniquePaths.insert(oldPaths.begin(), oldPaths.end()); + uniquePaths.insert(paths.begin(), paths.end()); + + m_list->setList(utility::toVector(uniquePaths)); +} + + QtProjectWizzardContentPathsSource::QtProjectWizzardContentPathsSource( ProjectSettings* settings, QtProjectWizzardWindow* window ) @@ -291,14 +357,16 @@ QtProjectWizzardContentPathsHeaderSearchGlobal::QtProjectWizzardContentPathsHead { setInfo( "Global Header Search Paths", - "These header search paths will be used in all your projects. Use it to add system header and Standard Library " - "header paths (See Finding " - "System Header Locations).", + "These header search paths will be used in all your projects. Use it to add system header paths " + "(See Finding System Header Locations " + "or use the auto detection below).", "Header Search Paths define where additional headers, that your project depends on, are found. Usually they are " "header files of frameworks or libraries that your project uses. These files won't be analyzed, but Coati needs " "them for correct analysis.\n\n" "Header Search Paths defined here will be used for all projects." ); + + m_detectionString = "headers"; } void QtProjectWizzardContentPathsHeaderSearchGlobal::load() @@ -350,11 +418,13 @@ QtProjectWizzardContentPathsFrameworkSearchGlobal::QtProjectWizzardContentPathsF "Global Framework Search Paths", "These framework search paths will be used in all your projects. Use it to add system frameworks " "(See " - "Finding System Header Locations).", + "Finding System Header Locations or use the auto detection below).", "Framework Search Paths define where MacOS framework containers (.framework), that your project depends on, are " "found.\n\n" "Framework Search Paths defined here will be used for all projects." ); + + m_detectionString = "frameworks"; } void QtProjectWizzardContentPathsFrameworkSearchGlobal::load() diff --git a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPaths.h b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPaths.h index 15d9f596..375a96b4 100644 --- a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPaths.h +++ b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPaths.h @@ -1,6 +1,7 @@ #ifndef QT_PROJECT_WIZZARD_CONTENT_PATHS_H #define QT_PROJECT_WIZZARD_CONTENT_PATHS_H +#include #include #include "qt/window/project_wizzard/QtProjectWizzardContent.h" @@ -31,14 +32,22 @@ protected: void setDescriptionString(const QString& description); void setHelpString(const QString& help); + void addDetection(QString name, QGridLayout* layout, int row); + QtDirectoryListBox* m_list; QString m_showFilesString; + QString m_detectionString; + +private slots: + void detectionClicked(); private: QString m_titleString; QString m_descriptionString; QString m_helpString; + + QComboBox* m_detectorBox; }; diff --git a/src/lib_gui/utility/headerSearch/CompilerDetector.cpp b/src/lib_gui/utility/headerSearch/CompilerDetector.cpp new file mode 100644 index 00000000..163e3d35 --- /dev/null +++ b/src/lib_gui/utility/headerSearch/CompilerDetector.cpp @@ -0,0 +1,62 @@ +#include "utility/headerSearch/CompilerDetector.h" + +#include "utility/utilityApp.h" +#include "utility/utilityString.h" + +CompilerDetector::CompilerDetector(const std::string& name) + : DetectorBase(name) +{ +} + +CompilerDetector::~CompilerDetector() +{ +} + +std::vector CompilerDetector::getHeaderPaths() +{ + std::string command = m_name + " -x c++ -v -E /dev/null"; + std::string clangOutput = utility::executeProcess(command.c_str()); + std::string standardHeaders = + utility::substrBetween(clangOutput, "#include <...> search starts here:\n","\nEnd of search list"); + std::vector paths; + + if (!standardHeaders.empty()) + { + for (std::string s : utility::splitToVector(standardHeaders, '\n')) + { + paths.push_back(utility::trim(s)); + } + } + + return paths; +} + +std::vector CompilerDetector::getStandardHeaderPaths() +{ + std::vector paths = getHeaderPaths(); + std::vector headerPaths; + for (const std::string& path : paths) + { + if (!utility::isPostfix(" (framework directory)", path)) + { + headerPaths.push_back(FilePath(path).canonical()); + } + } + + return headerPaths; +} + +std::vector CompilerDetector::getStandardFrameworkPaths() +{ + std::vector paths = getHeaderPaths(); + std::vector frameworkPaths; + for (const std::string& path : paths) + { + if (utility::isPostfix(" (framework directory)", path)) + { + frameworkPaths.push_back(FilePath(utility::replace(path, " (framework directory)", "")).canonical()); + } + } + + return frameworkPaths; +} diff --git a/src/app/utility/headerSearch/CompilerDetector.h b/src/lib_gui/utility/headerSearch/CompilerDetector.h similarity index 64% rename from src/app/utility/headerSearch/CompilerDetector.h rename to src/lib_gui/utility/headerSearch/CompilerDetector.h index c972c66b..6ec6113d 100644 --- a/src/app/utility/headerSearch/CompilerDetector.h +++ b/src/lib_gui/utility/headerSearch/CompilerDetector.h @@ -2,16 +2,19 @@ #define COMPILER_DETECTOR_H #include "utility/headerSearch/DetectorBase.h" -#include "utility/headerSearch/StandardHeaderDetection.h" -class CompilerDetector : public DetectorBase +class CompilerDetector + : public DetectorBase { public: CompilerDetector(const std::string& name); + virtual ~CompilerDetector(); + + std::vector getHeaderPaths(); + virtual std::vector getStandardHeaderPaths(); -private: + virtual std::vector getStandardFrameworkPaths(); }; - #endif // COMPILER_DETECTOR_H diff --git a/src/app/utility/headerSearch/DetectorBase.cpp b/src/lib_gui/utility/headerSearch/DetectorBase.cpp similarity index 78% rename from src/app/utility/headerSearch/DetectorBase.cpp rename to src/lib_gui/utility/headerSearch/DetectorBase.cpp index 01029dc3..001318a9 100644 --- a/src/app/utility/headerSearch/DetectorBase.cpp +++ b/src/lib_gui/utility/headerSearch/DetectorBase.cpp @@ -1,7 +1,5 @@ #include "utility/headerSearch/DetectorBase.h" -#include - DetectorBase::DetectorBase(const std::string name) { setName(name); @@ -12,6 +10,11 @@ bool DetectorBase::detect() return !getStandardHeaderPaths().empty(); } +std::vector DetectorBase::getStandardFrameworkPaths() +{ + return std::vector(); +} + std::string DetectorBase::getName() const { return m_name; diff --git a/src/app/utility/headerSearch/DetectorBase.h b/src/lib_gui/utility/headerSearch/DetectorBase.h similarity index 87% rename from src/app/utility/headerSearch/DetectorBase.h rename to src/lib_gui/utility/headerSearch/DetectorBase.h index e8e92082..ca4dd020 100644 --- a/src/app/utility/headerSearch/DetectorBase.h +++ b/src/lib_gui/utility/headerSearch/DetectorBase.h @@ -2,6 +2,7 @@ #define DETECTOR_BASE_H #include + #include "utility/file/FilePath.h" class DetectorBase @@ -11,19 +12,11 @@ public: virtual ~DetectorBase(){}; virtual bool detect(); virtual std::vector getStandardHeaderPaths() = 0; + virtual std::vector getStandardFrameworkPaths(); virtual std::string getName() const; virtual void setName(const std::string& name); protected: std::string m_name; }; -class Detector -{ -public: - virtual ~Detector(); - -}; - - #endif // DETECTOR_BASE_H - diff --git a/src/lib_gui/utility/headerSearch/StandardHeaderDetection.cpp b/src/lib_gui/utility/headerSearch/StandardHeaderDetection.cpp new file mode 100644 index 00000000..b72676df --- /dev/null +++ b/src/lib_gui/utility/headerSearch/StandardHeaderDetection.cpp @@ -0,0 +1,106 @@ +#include "utility/headerSearch/StandardHeaderDetection.h" + +#include +#include +#include +#include +#include +#include + +#include "utility/file/FilePath.h" +#include "utility/headerSearch/CompilerDetector.h" +#include "utility/headerSearch/VisualStudioDetector.h" +#include "utility/logging/logging.h" +#include "utility/utilityApp.h" +#include "utility/utilityString.h" + +StandardHeaderDetection::DetectorMap StandardHeaderDetection::s_availableDetectors; +StandardHeaderDetection::DetectorMap StandardHeaderDetection::s_detectedCompilers; + +StandardHeaderDetection::StandardHeaderDetection() +{ + if (!s_availableDetectors.size()) + { + addDetector(std::make_shared("gcc")); + addDetector(std::make_shared("clang")); + + addDetector(std::make_shared("14")); + addDetector(std::make_shared("12")); + addDetector(std::make_shared("11")); + addDetector(std::make_shared("9")); + + detectHeaders(); + } +} + +StandardHeaderDetection::~StandardHeaderDetection() +{ +} + +void StandardHeaderDetection::addDetector(std::shared_ptr detector) +{ + s_availableDetectors.emplace(detector->getName(), detector); +} + +void StandardHeaderDetection::detectHeaders() +{ + for ( DetectorPair detector : s_availableDetectors) + { + if ( detector.second->detect() ) + { + s_detectedCompilers.insert(detector); + } + } +} + +std::vector StandardHeaderDetection::getDetectedCompilers() +{ + std::vector v; + for ( DetectorPair detector : s_detectedCompilers) + { + v.push_back(detector.first); + } + return v; +} + +std::vector StandardHeaderDetection::getStandardHeaderPaths(std::string compiler) +{ + auto it = s_detectedCompilers.find(compiler); + if (it != s_detectedCompilers.end()) + { + return it->second->getStandardHeaderPaths(); + } + return std::vector(); +} + +std::vector StandardHeaderDetection::getStandardFrameworkPaths(std::string compiler) +{ + auto it = s_detectedCompilers.find(compiler); + if (it != s_detectedCompilers.end()) + { + return it->second->getStandardFrameworkPaths(); + } + return std::vector(); +} + +void StandardHeaderDetection::printDetectedCompilers() +{ + std::cout << "Detected Compilers: " << std::endl; + + std::vector compilers = getDetectedCompilers(); + for ( std::string compiler : compilers) + { + std::cout << compiler << std::endl; + } +} + +void StandardHeaderDetection::printAvailableDetectors() +{ + std::cout << "Available Detectors: " << std::endl; + + for ( DetectorPair detector : s_availableDetectors) + { + std::cout << detector.first << std::endl; + } +} + diff --git a/src/lib_gui/utility/headerSearch/StandardHeaderDetection.h b/src/lib_gui/utility/headerSearch/StandardHeaderDetection.h new file mode 100644 index 00000000..e578e447 --- /dev/null +++ b/src/lib_gui/utility/headerSearch/StandardHeaderDetection.h @@ -0,0 +1,43 @@ +#ifndef STANDARD_HEADER_DETECTION_H +#define STANDARD_HEADER_DETECTION_H + +#include +#include +#include +#include + +#include "utility/headerSearch/DetectorBase.h" + +class FilePath; + +class StandardHeaderDetection +{ +public: + StandardHeaderDetection(); + ~StandardHeaderDetection(); + + void addDetector(std::shared_ptr detector); + + /// Checks all availabe detectors and saves found Compilers + void detectHeaders(); + + /// Returns alls found compilers + std::vector getDetectedCompilers(); + + /// Returns the headerpaths from a found compiler + std::vector getStandardHeaderPaths(std::string compiler); + std::vector getStandardFrameworkPaths(std::string compiler); + + /// Debugging Output + void printAvailableDetectors(); + void printDetectedCompilers(); + +private: + typedef std::map> DetectorMap; + typedef std::pair> DetectorPair; + + static DetectorMap s_availableDetectors; + static DetectorMap s_detectedCompilers; +}; + +#endif // STANDARD_HEADER_DETECTION_H diff --git a/src/app/utility/headerSearch/VisualStudioDetector.cpp b/src/lib_gui/utility/headerSearch/VisualStudioDetector.cpp similarity index 85% rename from src/app/utility/headerSearch/VisualStudioDetector.cpp rename to src/lib_gui/utility/headerSearch/VisualStudioDetector.cpp index 79f15bc3..015ead85 100644 --- a/src/app/utility/headerSearch/VisualStudioDetector.cpp +++ b/src/lib_gui/utility/headerSearch/VisualStudioDetector.cpp @@ -1,14 +1,13 @@ #include "utility/headerSearch/VisualStudioDetector.h" +#include + #include #include #include -#include #include "utility/file/FilePath.h" #include "utility/logging/logging.h" -#include "utility/headerSearch/StandardHeaderDetection.h" -#include VisualStudioDetector::VisualStudioDetector(const std::string name) : DetectorBase("") @@ -116,10 +115,3 @@ bool VisualStudioDetector::getStanardHeaderPathsUsingRegistry(std::vector vs2015("14"); -static StandardHeaderDetection::Add vs2013("12"); -static StandardHeaderDetection::Add vs2012("11"); -static StandardHeaderDetection::Add vs2010("9"); - diff --git a/src/app/utility/headerSearch/VisualStudioDetector.h b/src/lib_gui/utility/headerSearch/VisualStudioDetector.h similarity index 99% rename from src/app/utility/headerSearch/VisualStudioDetector.h rename to src/lib_gui/utility/headerSearch/VisualStudioDetector.h index 579df7c7..e171b4fd 100644 --- a/src/app/utility/headerSearch/VisualStudioDetector.h +++ b/src/lib_gui/utility/headerSearch/VisualStudioDetector.h @@ -2,6 +2,7 @@ #define VISUAL_STUDIO_DETECTOR_H #include + #include "utility/headerSearch/DetectorBase.h" class FilePath; diff --git a/src/app/utility/utilityApp.cpp b/src/lib_gui/utility/utilityApp.cpp similarity index 100% rename from src/app/utility/utilityApp.cpp rename to src/lib_gui/utility/utilityApp.cpp diff --git a/src/app/utility/utilityApp.h b/src/lib_gui/utility/utilityApp.h similarity index 100% rename from src/app/utility/utilityApp.h rename to src/lib_gui/utility/utilityApp.h diff --git a/web/documentation/img/preferences_screen.png b/web/documentation/img/preferences_screen.png index 6cb3502e..b2779fd6 100644 Binary files a/web/documentation/img/preferences_screen.png and b/web/documentation/img/preferences_screen.png differ diff --git a/web/documentation/img/project_setup_wizard_empty_header_paths_advanced.png b/web/documentation/img/project_setup_wizard_empty_header_paths_advanced.png index 051e402f..d3892da4 100644 Binary files a/web/documentation/img/project_setup_wizard_empty_header_paths_advanced.png and b/web/documentation/img/project_setup_wizard_empty_header_paths_advanced.png differ diff --git a/web/documentation/img/project_setup_wizard_empty_header_paths_simple.png b/web/documentation/img/project_setup_wizard_empty_header_paths_simple.png index 71661d1b..27a3b865 100644 Binary files a/web/documentation/img/project_setup_wizard_empty_header_paths_simple.png and b/web/documentation/img/project_setup_wizard_empty_header_paths_simple.png differ diff --git a/web/documentation/index.html b/web/documentation/index.html index 71e5e1c2..a29aae1a 100644 --- a/web/documentation/index.html +++ b/web/documentation/index.html @@ -579,13 +579,24 @@

If you chose the advanced setup method Coati needs you to specify all the project's internal include paths in addition to the external dependencies. Project internal include paths are those paths your project internal #include directives are relative to.

+

Additionally you can also specify Global Header Search Paths, which will be used by all yout projects. These are usually the paths to system headers, which can also be auto detected by choosing a compiler below and pressing detect.

+ + + + + + + + +
Setting Description
Header Search Paths These paths are used to find the files specified by #include directives. (For instructions on how to add paths see Path List Box.)
Global Header Search Paths These Header Search Paths will be used in all your projects. (For instructions on how to add paths see Path List Box. For instructions on how to find the system header paths see Finding System Header Locations)
Interactions:
    +
  • Selecting a compiler from the dropdown list below and pressing detect will automatically detect system header search paths used by this compiler and add them to the Global Header Search Paths.
  • Clicking Cancel or pressing ESC will close the window and abort the setup process.
  • Clicking Next will take you to the New Project Summary Window.
  • Clicking Previous take you to the previous step of the setup process. All the information you entered will be saved.