diff --git a/src/cmake.cc b/src/cmake.cc index 03c9004..cbcfa5c 100644 --- a/src/cmake.cc +++ b/src/cmake.cc @@ -1,18 +1,19 @@ #include "cmake.h" #include "singletons.h" #include "filesystem.h" -#include #include "dialogs.h" +#include + #include //TODO: remove using namespace std; //TODO: remove CMake::CMake(const boost::filesystem::path &path) { const auto find_cmake_project=[this](const boost::filesystem::path &cmake_path) { for(auto &line: filesystem::read_lines(cmake_path)) { - const boost::regex project_regex("^ *project *\\(.*$"); - boost::smatch sm; - if(boost::regex_match(line, sm, project_regex)) { + const std::regex project_regex("^ *project *\\(.*$"); + std::smatch sm; + if(std::regex_match(line, sm, project_regex)) { return true; } } @@ -142,9 +143,9 @@ void CMake::find_variables() { end_line=file.size(); if(end_line>start_line) { auto line=file.substr(start_line, end_line-start_line); - const boost::regex set_regex("^ *set *\\( *([A-Za-z_][A-Za-z_0-9]*) +(.*)\\) *$"); - boost::smatch sm; - if(boost::regex_match(line, sm, set_regex)) { + const std::regex set_regex("^ *set *\\( *([A-Za-z_][A-Za-z_0-9]*) +(.*)\\) *$"); + std::smatch sm; + if(std::regex_match(line, sm, set_regex)) { auto data=sm[2].str(); while(data.size()>0 && data.back()==' ') data.pop_back(); @@ -264,10 +265,10 @@ std::vector > > CMak end_line=file.size(); if(end_line>start_line) { auto line=file.substr(start_line, end_line-start_line); - const boost::regex function_regex("^ *"+name+" *\\( *(.*)\\) *$"); - boost::smatch sm; - if(boost::regex_match(line, sm, function_regex)) { - auto data=sm[1].str(); + const std::regex function_regex("^ *"+name+" *\\( *(.*)\\) *$"); + std::smatch sm; + if(std::regex_match(line, sm, function_regex)) { + auto data=sm[1].str(); while(data.size()>0 && data.back()==' ') data.pop_back(); auto parameters=get_function_parameters(data);