@@ -51,7 +51,7 @@ static std::vector<std::string> expand_cmake_path(const fs::path &p) {
5151 temp.push_back (p.string ());
5252 }
5353 // Normalize all paths to work with CMake (it needs a / on Windows as well)
54- for (auto & path : temp) {
54+ for (auto & path : temp) {
5555 std::replace (path.begin (), path.end (), ' \\ ' , ' /' );
5656 }
5757 return temp;
@@ -159,11 +159,13 @@ int generate_cmake(const char *path) {
159159 ss << " \n\n " ;
160160 }
161161
162+ std::string desc = " " ;
163+ if (!cmake.desc .empty ())
164+ desc = " \n\t LANGUAGES C CXX\n\t DESCRIPTION \" " + cmake.desc + " \" " ;
165+
162166 if (!cmake.proj_name .empty () && !cmake.proj_version .empty ()) {
163- ss << " set(" << cmake.proj_name << " _PROJECT_VERSION " << cmake.proj_version << " )\n "
164- << " project(" << cmake.proj_name << " VERSION "
165- << " ${" << cmake.proj_name << " _PROJECT_VERSION}"
166- << " )\n\n " ;
167+ ss << " project(" << cmake.proj_name << " \n\t VERSION " << cmake.proj_version << desc
168+ << " \n\t )\n\n " ;
167169 }
168170
169171 if (!cmake.packages .empty ()) {
@@ -206,7 +208,12 @@ int generate_cmake(const char *path) {
206208 } else {
207209 // don't change arg
208210 }
209- ss << " \t " << first_arg << " " << arg.second << " \n " ;
211+ if (first_arg != " GIT_REPOSITORY" )
212+ ss << " \t " << first_arg << " " << arg.second << " \n " ;
213+ else
214+ ss << " \t " << first_arg << " " << arg.second << " \n\t "
215+ << " GIT_SHALLOW "
216+ << " ON\n " ;
210217 }
211218 ss << " \t )\n\n "
212219 << " FetchContent_MakeAvailable(" << dep.first << " )\n\n " ;
0 commit comments