X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcreaDevManagerLib%2FmodelCDMApplication.cpp;h=c15bedf6c2cb04bdf49cd95282d5a03209b1be4e;hb=35dd4d1ddf73a91d308cc49fc394104169936055;hp=1a9c3ad4c8c1f84e3d9658397948c4d912d072a6;hpb=71c071fbb1e2af618f6caa489351b966e1a54b1a;p=crea.git diff --git a/lib/creaDevManagerLib/modelCDMApplication.cpp b/lib/creaDevManagerLib/modelCDMApplication.cpp index 1a9c3ad..c15bedf 100644 --- a/lib/creaDevManagerLib/modelCDMApplication.cpp +++ b/lib/creaDevManagerLib/modelCDMApplication.cpp @@ -517,8 +517,76 @@ void modelCDMApplication::CheckStructure(std::map& properties std::map modelCDMApplication::Get3rdPartyLibraries() { + std::map correspondence; + correspondence["${crea_LIBRARIES}"] = "Crea"; + correspondence["${WXWIDGETS_LIBRARIES}"] = "WxWidgets"; + correspondence["${KWWidgets_LIBRARIES}"] = "KWWidgets"; + correspondence["${VTK_LIBRARIES}"] = "VTK"; + correspondence["${ITK_LIBRARIES}"] = "ITK"; + correspondence["${GDCM_LIBRARIES}"] = "GDCM"; + correspondence["${BOOST_LIBRARIES}"] = "Boost"; std::map res; - res["Test"] = false; + res["Crea"] = false; + res["WxWidgets"] = false; + res["KWWidgets"] = false; + res["VTK"] = false; + res["ITK"] = false; + res["GDCM"] = false; + res["Boost"] = false; + + if(this->HasCMakeLists()) + { + std::ifstream CMFile(this->CMakeLists->GetPath().c_str()); + if (CMFile.is_open()) + { + std::string line; + while(!CMFile.eof()) + { + std::getline(CMFile, line, '('); + + std::vector lineSeg; + CDMUtilities::splitter::split(lineSeg,line,"\n ",CDMUtilities::splitter::no_empties); + + if(lineSeg.size() > 0 && lineSeg[lineSeg.size()-1] == "SET") + { + //std::cout << "found set" << std::endl; + std::getline(CMFile, line, ')'); + //std::cout << line << std::endl; + CDMUtilities::splitter::split(lineSeg,line,"\n",CDMUtilities::splitter::no_empties); + if(lineSeg.size() > 0) + { + //std::cout << lineSeg[0] << std::endl; + for(int i = 0; i < lineSeg[0].size(); ++i) + if (lineSeg[0][i] == ' ') + { + lineSeg[0].erase(i,1); + --i; + } + //std::cout << lineSeg[0] << std::endl; + if (lineSeg[0] == "${EXE_NAME}_LINK_LIBRARIES") + { + //std::cout << "link" << std::endl; + for (int l = 1; l < lineSeg.size(); ++l) + { + for(int i = 0;i < lineSeg[l].size(); i++) + if (lineSeg[l][i] == ' ') + { + lineSeg[l].erase(i,1); + i--; + } + if(lineSeg[l].size() > 0 && lineSeg[l][0] == '$') + { + //std::cout << "found " << lineSeg[l] << std::endl; + res[correspondence[lineSeg[l]]] = true; + } + } + } + } + } + } + CMFile.close(); + } + } return res; }