From c52e6b9cf19912db57a4a567a8e96965477377c8 Mon Sep 17 00:00:00 2001 From: eidheim Date: Wed, 16 Dec 2015 16:41:15 +0100 Subject: [PATCH] Fixes #124 --- src/cmake.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cmake.cc b/src/cmake.cc index 2281ae5..9c49e49 100644 --- a/src/cmake.cc +++ b/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; } }