File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -202,6 +202,13 @@ int main(int argc, char **argv)
202202 return EXIT_FAILURE;
203203 }
204204
205+ std::vector<std::string> libfiles_h;
206+ for (const std::string &libfile : libfiles) {
207+ std::string fname (libfile.substr (4 ));
208+ fname.erase (fname.find (" .cpp" ));
209+ libfiles_h.emplace_back (fname + " .h" );
210+ }
211+
205212 // QMAKE - lib/lib.pri
206213 {
207214 std::ofstream fout1 (" lib/lib.pri" );
@@ -211,13 +218,9 @@ int main(int argc, char **argv)
211218 fout1 << " include($$PWD/../externals/externals.pri)\n " ;
212219 fout1 << " INCLUDEPATH += $$PWD\n " ;
213220 fout1 << " HEADERS += " ;
214- for (const std::string &libfile : libfiles) {
215- std::string fname (libfile.substr (4 ));
216- if (fname.find (" .cpp" ) == std::string::npos)
217- continue ; // shouldn't happen
218- fname.erase (fname.find (" .cpp" ));
219- fout1 << " $${PWD}/" << fname << " .h" ;
220- if (libfile != libfiles.back ())
221+ for (const std::string &libfile_h : libfiles_h) {
222+ fout1 << " $${PWD}/" << libfile_h;
223+ if (libfile_h != libfiles_h.back ())
221224 fout1 << " \\\n " << std::string (11 , ' ' );
222225 }
223226 fout1 << " \n\n SOURCES += " ;
You can’t perform that action at this time.
0 commit comments