Feature: Show included libraries (3rd Party) and checkboxes to include them in: Libraries, Applications, Packages. Now shows found libraries but doesn't include/exclude them.
{
std::getline(CMFile, line);
while(line[0]==' ')
- line.erase(0);
+ line.erase(0,1);
if(line[0] != '#')
{
std::vector<std::string> lineSeg;
std::map<std::string, bool> modelCDMApplication::Get3rdPartyLibraries()
{
+ std::map<std::string, std::string> 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<std::string, bool> 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<std::string> 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;
}
{
std::getline(CMFile, line);
while(line[0]==' ')
- line.erase(0);
+ line.erase(0,1);
if(line[0] != '#')
{
std::vector<std::string> lineSeg;
std::map<std::string, bool> modelCDMLibrary::Get3rdPartyLibraries()
{
+ std::map<std::string, std::string> 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<std::string, bool> 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<std::string> 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] == "${LIBRARY_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;
}
std::map<std::string, bool> modelCDMPackage::Get3rdPartyLibraries()
{
+ std::map<std::string, std::string> correspondence;
+ correspondence["${BBTK_PACKAGE_NAME}_USE_VTKON"] = "VTK";
+ correspondence["${BBTK_PACKAGE_NAME}_USE_ITKON"] = "ITK";
+ correspondence["${BBTK_PACKAGE_NAME}_USE_GDCMON"] = "GDCM";
+ correspondence["${BBTK_PACKAGE_NAME}_USE_GDCM_VTKON"] = "GDCM_VTK";
+ correspondence["${BBTK_PACKAGE_NAME}_USE_GSMISON"] = "GSMIS";
+ correspondence["${BBTK_PACKAGE_NAME}_USE_WXWIDGETSON"] = "WxWidgets";
+ correspondence["${BBTK_PACKAGE_NAME}_USE_KWWIDGETSON"] = "KWWidgets";
std::map<std::string, bool> res;
- res["Test"] = false;
+ res["VTK"] = false;
+ res["ITK"] = false;
+ res["GDCM"] = false;
+ res["GDCM_VTK"] = false;
+ res["GSMIS"] = false;
+ res["WxWidgets"] = false;
+ res["KWWidgets"] = 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<std::string> lineSeg;
+ CDMUtilities::splitter::split(lineSeg,line,"\n",CDMUtilities::splitter::no_empties);
+ for(int i = 0; lineSeg.size() > 0 && i < lineSeg[lineSeg.size()-1].size(); ++i)
+ if (lineSeg[lineSeg.size()-1][i] == ' ')
+ {
+ lineSeg[lineSeg.size()-1].erase(i,1);
+ --i;
+ }
+ if(lineSeg.size() > 0 && lineSeg[lineSeg.size()-1][0]!='#' && lineSeg[lineSeg.size()-1] == "SET")
+ {
+ std::getline(CMFile, line, ')');
+ CDMUtilities::splitter::split(lineSeg,line,"\t\n",CDMUtilities::splitter::no_empties);
+ if(lineSeg.size() > 0)
+ {
+ for(int i = 0; i < lineSeg[0].size(); ++i)
+ if (lineSeg[0][i] == ' ')
+ {
+ lineSeg[0].erase(i,1);
+ --i;
+ }
+
+ if(lineSeg[0].size() > 0 && lineSeg[0][0] == '$' && correspondence.find(lineSeg[0]) != correspondence.end())
+ {
+ res[correspondence[lineSeg[0]]] = true;
+ }
+ }
+ }
+ }
+ CMFile.close();
+ }
+ }
return res;
}
{
std::getline(CMFile, line);
while(line[0]==' ')
- line.erase(0);
+ line.erase(0,1);
if(line[0] != '#')
{
std::vector<std::string> lineSeg;
long style
)
{
- wxCDMPackageConfigurationDialog::Create(parent, id, caption, position, size, style);
this->package = package;
+ wxCDMPackageConfigurationDialog::Create(parent, id, caption, position, size, style);
}
wxCDMPackageConfigurationDialog::~wxCDMPackageConfigurationDialog()
wxStaticText* title = new wxStaticText(this, wxID_ANY, wxT("Please select the libraries that are used in this package."), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);//new wxRichTextCtrl(this,wxID_ANY, wxString("Create a new project"), wxDefaultPosition, wxDefaultSize, wxRE_READONLY);
- v_sizer1->Add(title, 0, wxALIGN_LEFT | wxALL, 5);
+ v_sizer1->Add(title, 0, wxEXPAND | wxALIGN_LEFT | wxALL, 5);
+
+ wxScrolledWindow* includesPanel = new wxScrolledWindow(this);
+ includesPanel->FitInside();
+ includesPanel->SetScrollRate(5,5);
wxBoxSizer* includesPanelSizer = new wxBoxSizer(wxVERTICAL);
//Third Party Libraries
- wxStaticText* Title1 = new wxStaticText(this, wxID_ANY, wxT("Third Party Libraries:"));
+ wxStaticText* Title1 = new wxStaticText(includesPanel, wxID_ANY, wxT("Third Party Libraries:"));
wxFont font = Title1->GetFont();
font.SetWeight(wxFONTWEIGHT_BOLD);
Title1->SetFont(font);
wxFlexGridSizer* includesGridSizer = new wxFlexGridSizer(inclusions.size()+1, 2, 0, 5);
wxStaticText* ChBTitle = new wxStaticText(
- this,
+ includesPanel,
wxID_ANY,
wxT("Included"),
wxDefaultPosition,
wxALIGN_CENTER
);
wxStaticText* LNmTitle = new wxStaticText(
- this,
+ includesPanel,
wxID_ANY,
wxT("Library Name"),
wxDefaultPosition,
for (std::map<std::string, bool>::iterator it = inclusions.begin(); it != inclusions.end(); ++it) {
wxCheckBox* ChBIncl = new wxCheckBox(
- this, ID_CHECK_INCLUDE_3RDLIBRARY, wxT(""), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT
+ includesPanel, ID_CHECK_INCLUDE_3RDLIBRARY, wxT(""), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT
);
ChBIncl->SetToolTip(crea::std2wx("When this box is checked the " + it->first + " library is included in the project configuration for this library."));
ChBIncl->SetName(crea::std2wx(it->first));
ChBIncl->SetValue(it->second);
includesGridSizer->Add(ChBIncl, 1, wxEXPAND);
- wxStaticText* LNmIncl = new wxStaticText(this, wxID_ANY, crea::std2wx(it->first));
+ wxStaticText* LNmIncl = new wxStaticText(includesPanel, wxID_ANY, crea::std2wx(it->first));
includesGridSizer->Add(LNmIncl, 1, wxEXPAND);
}
includesPanelSizer->Add(includesGridSizer, 1, wxEXPAND, 0);
//Custom Libraries
- wxStaticText* Title2 = new wxStaticText(this, wxID_ANY, wxT("Custom Libraries:"));
+ wxStaticText* Title2 = new wxStaticText(includesPanel, wxID_ANY, wxT("Custom Libraries:"));
font = Title2->GetFont();
font.SetWeight(wxFONTWEIGHT_BOLD);
Title2->SetFont(font);
wxFlexGridSizer* includesLibGridSizer = new wxFlexGridSizer(inclusionsLibs.size()+1, 2, 0, 5);
wxStaticText* ChBTitle1 = new wxStaticText(
- this,
+ includesPanel,
wxID_ANY,
wxT("Included"),
wxDefaultPosition,
wxALIGN_CENTER
);
wxStaticText* LNmTitle1 = new wxStaticText(
- this,
+ includesPanel,
wxID_ANY,
wxT("Library Name"),
wxDefaultPosition,
for (std::map<std::string, bool>::iterator it = inclusionsLibs.begin(); it != inclusionsLibs.end(); ++it) {
wxCheckBox* ChBIncl = new wxCheckBox(
- this, ID_CHECK_INCLUDE_LIBRARY, wxT(""), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT
+ includesPanel, ID_CHECK_INCLUDE_LIBRARY, wxT(""), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT
);
ChBIncl->SetToolTip(crea::std2wx("When this box is checked the " + it->first + " custom library is included in the project configuration for this library."));
ChBIncl->SetName(crea::std2wx(it->first));
ChBIncl->SetValue(it->second);
includesLibGridSizer->Add(ChBIncl, 1, wxEXPAND);
- wxStaticText* LNmIncl = new wxStaticText(this, wxID_ANY, crea::std2wx(it->first));
+ wxStaticText* LNmIncl = new wxStaticText(includesPanel, wxID_ANY, crea::std2wx(it->first));
includesLibGridSizer->Add(LNmIncl, 1, wxEXPAND);
}
includesPanelSizer->Add(includesLibGridSizer, 1, wxEXPAND, 0);
- v_sizer1->Add(includesPanelSizer, 1, wxEXPAND);
+ includesPanel->SetSizer(includesPanelSizer);
+
+ v_sizer1->Add(includesPanel, 1, wxEXPAND);
v_sizer1->Add(new wxButton(this, wxID_OK, wxT("Close")), 0, wxALIGN_CENTER | wxRIGHT | wxBOTTOM, 30);
const wxString& caption = wxT("Package Library Configuration"),
const wxPoint& position = wxDefaultPosition,
const wxSize& size = wxSize(350,370),
- long style = wxDEFAULT_DIALOG_STYLE
+ long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER
);
/**
* Destructor.