@@ -265,23 +265,31 @@ void addLibraryName(const pugi::xpath_node_set & nodes, std::string libName) {
265265 }
266266}
267267
268- void visualStudioProject::addLibrary (const LibraryBinary & lib){
268+ void visualStudioProject::addProps (std::string propsFile){
269+ pugi::xpath_node_set items = doc.select_nodes (" //ImportGroup" );
270+ for (int i = 0 ; i < items.size (); i++) {
271+ pugi::xml_node additionalOptions;
272+ items[i].node ().append_child (" Import" ).append_attribute (" Project" ).set_value (propsFile.c_str ());
273+ }
274+ }
275+
276+ void visualStudioProject::addLibrary (const LibraryBinary & lib) {
269277 auto libraryName = lib.path ;
270- fixSlashOrder (libraryName);
278+ fixSlashOrder (libraryName);
271279
272- // ok first, split path and library name.
273- size_t found = libraryName.find_last_of (" \\ " );
274- std::string libFolder = libraryName.substr (0 ,found);
275- std::string libName = libraryName.substr (found+ 1 );
280+ // ok first, split path and library name.
281+ size_t found = libraryName.find_last_of (" \\ " );
282+ std::string libFolder = libraryName.substr (0 , found);
283+ std::string libName = libraryName.substr (found + 1 );
276284
277- std::string libBaseName;
278- std::string libExtension;
285+ std::string libBaseName;
286+ std::string libExtension;
279287
280- splitFromLast ( libName, " ." , libBaseName, libExtension );
288+ splitFromLast (libName, " ." , libBaseName, libExtension);
281289
282290 // ---------| invariant: libExtension is `lib`
283291
284- // paths for libraries
292+ // paths for libraries
285293 std::string linkPath;
286294 if (!lib.target .empty () && !lib.arch .empty ()) {
287295 linkPath = " //ItemDefinitionGroup[contains(@Condition,'" + lib.target + " ') and contains(@Condition,'" + lib.arch + " ')]/Link/" ;
@@ -295,13 +303,13 @@ void visualStudioProject::addLibrary(const LibraryBinary & lib){
295303 else {
296304 linkPath = " //ItemDefinitionGroup/Link/" ;
297305 }
298-
306+
299307 if (!libFolder.empty ()) {
300308 pugi::xpath_node_set addlLibsDir = doc.select_nodes ((linkPath + " AdditionalLibraryDirectories" ).c_str ());
301309 addLibraryPath (addlLibsDir, libFolder);
302310 }
303-
304- pugi::xpath_node_set addlDeps = doc.select_nodes ((linkPath + " AdditionalDependencies" ).c_str ());
311+
312+ pugi::xpath_node_set addlDeps = doc.select_nodes ((linkPath + " AdditionalDependencies" ).c_str ());
305313 addLibraryName (addlDeps, libName);
306314
307315 ofLogVerbose () << " adding lib path " << libFolder;
@@ -392,6 +400,11 @@ void visualStudioProject::addAddon(ofAddon & addon){
392400 addInclude (addon.includePaths [i]);
393401 }
394402
403+ for (auto & props : addon.propsFiles ) {
404+ ofLogVerbose () << " adding addon props: " << props;
405+ addProps (props);
406+ }
407+
395408 for (auto & lib: addon.libs ){
396409 ofLogVerbose () << " adding addon libs: " << lib.path ;
397410 addLibrary (lib);
0 commit comments