Browse Source

Fixes #124

merge-requests/365/head
eidheim 10 years ago
parent
commit
c52e6b9cf1
  1. 4
      src/cmake.cc

4
src/cmake.cc

@ -8,9 +8,11 @@
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 *\\(.*$");
const boost::regex project_regex("^ *project *\\( *([^ ]+).*\\) *$");
boost::smatch sm;
if(boost::regex_match(line, sm, project_regex)) {
variables["CMAKE_PROJECT_NAME"]=sm[1].str(); //TODO: is this variable deprecated/non-standard?
variables["PROJECT_NAME"]=sm[1].str();
return true;
}
}

Loading…
Cancel
Save