Commit c9039ad343bb0234c588f0cdaa1c6b5549b2b61c

Authored by Francisco J. Santana Jorge
1 parent 8c9bec9f
Exists in master

coolbot-bundle: a new version available (see my-first-bundle example)

Showing 629 changed files with 15149 additions and 177003 deletions   Show diff stats

Too many changes.

To preserve performance only 100 of 629 files displayed.

AUTHOR
... ... @@ -2,15 +2,15 @@ CoolBOT Project Developers and Contributors:
2 2  
3 3 - Antonio Carlos Domínguez Brito (adominguez@iusiani.ulpgc.es)
4 4 CoolBOT project main developer and project maintainer.
5   -
  5 +
6 6 - Francisco Jesús Santana Jorge (francisco.jesus.santana@gmail.com)
7 7 CoolBOT compiler and tools main developer and contributor.
8 8 CMake installation and compiling support development.
9 9 CPack support.
10   -
  10 +
11 11 - Soraya Santana de la Fe (soraya.santanaf@gmail.com) and
12 12 Jose Manuel Martínez García (josemmg@gmail.com)
13 13 Main developers and contributors of the CoolBOT project network
14 14 support (coolbot/network).
15 15 Java support for CoolBOT views.
16   -
  16 +
... ...
CMakeLists.txt
... ... @@ -141,7 +141,7 @@ SET(COOLBOT_INCLUDE_DIR_INSTALL_PATH "${COOLBOT_INSTALL_PATH}/include/")
141 141 SET(COOLBOT_LIBRARIES_INSTALL_PATH "${COOLBOT_INSTALL_PATH}/lib/")
142 142 SET(COOLBOT_BINARIES_INSTALL_PATH "${COOLBOT_INSTALL_PATH}/bin/")
143 143 SET(COOLBOT_PKGCONFIG_INSTALL_PATH "${COOLBOT_INSTALL_PATH}/lib/pkgconfig/")
144   -SET(COOLBOT_RESOURCES_INSTALL_PATH "${COOLBOT_INSTALL_PATH}/resources/")
  144 +SET(COOLBOT_RESOURCES_INSTALL_PATH "${RESOURCE_INSTALL_PATH}/resources/")
145 145  
146 146 #
147 147 # To generate API documentation with doxygen, we must do the following:
... ... @@ -275,6 +275,7 @@ IF(NOT DEBUG_MODE)
275 275 WORLD_READ
276 276 )
277 277 MESSAGE(STATUS "Generated install commands for GNU files")
  278 +message("COOLBOT_RESOURCES_INSTALL_PATH= ${COOLBOT_RESOURCES_INSTALL_PATH}")
278 279 INSTALL( DIRECTORY ${PROJECT_SOURCE_DIR}/resources/
279 280 DESTINATION ${COOLBOT_RESOURCES_INSTALL_PATH}
280 281 FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ
... ...
coolbot-bundle/src/cblBundle.cpp
... ... @@ -63,48 +63,6 @@
63 63  
64 64 ///*****************************************************************************
65 65  
66   -std::string cblBundle::_GetProjectSettings(const std::string& ResourcePath,
67   - const std::string& ProjectName,
68   - bool Integration,
69   - bool DisplaySettings)
70   -{
71   - std::string Result="";
72   - std::string InputFileName;
73   - std::string Template;
74   - std::string Msg="Can not load the file: ";
75   -
76   - if(Integration) {
77   - if(DisplaySettings) {
78   - InputFileName=ctString::ConvertSlash(ResourcePath+"cmake/cmake-exe-display-settings.template");
79   - } else {
80   - InputFileName=ctString::ConvertSlash(ResourcePath+"cmake/cmake-exe-settings.template");
81   - }
82   - } else {
83   - if(DisplaySettings) {
84   - InputFileName=ctString::ConvertSlash(ResourcePath+"cmake/cmake-lib-display-settings.template");
85   - } else {
86   - InputFileName=ctString::ConvertSlash(ResourcePath+"cmake/cmake-lib-settings.template");
87   - }
88   - }
89   -
90   - Template=ctTemplate::Load(InputFileName);
91   - if(Template!="")
92   - {
93   - Template=ctString::Replace(Template,
94   - "@PROJECTNAME@",
95   - ProjectName);
96   - Template=ctString::Replace(Template,
97   - "@PROJECTNAME_UPPER@",
98   - ctString::Upper(ctString::Normalize(ProjectName)));
99   - Result=Template;
100   - } else {
101   - Msg+=InputFileName;
102   - SHOW_ERROR(Msg);
103   - }
104   -
105   - return Result;
106   -} // _GetProjectSettings
107   -
108 66 std::string cblBundle::_GetProjectTestTarget(const std::string& ResourcePath,
109 67 const std::string& ProjectName,
110 68 const std::string& ProjectDir)
... ... @@ -136,67 +94,34 @@ std::string cblBundle::_GetProjectTestTarget(const std::string& ResourcePath,
136 94 return Result;
137 95 } // _GetProjectTestTarget
138 96  
139   -std::string cblBundle::_GetProjectTarget(const std::string& ResourcePath,
140   - const std::string& ProjectName,
141   - const std::string& ProjectDir,
142   - bool Integration,
143   - bool Component,
144   - bool BundleInside)
  97 +bool cblBundle::_UpdateBundle(const std::string& OutputFileName,
  98 + const std::string& Name)
145 99 {
146   - std::string Result="";
147   - std::string InputFileName;
148   - std::string Txt="";
149   - std::string Template;
150   - std::string Msg="Can not load the file: ";
151   -
152   - if(Integration) {
153   - InputFileName=ctString::ConvertSlash(ResourcePath+"cmake/cmake-exe-target.template");
154   - } else {
155   - InputFileName=ctString::ConvertSlash(ResourcePath+"cmake/cmake-lib-target.template");
156   - }
  100 + bool Result=false;
  101 + std::string Msg;
  102 + std::string Txt;
  103 + std::string Template=ctTemplate::Load(OutputFileName);
157 104  
158   - Template=ctTemplate::Load(InputFileName);
159   - if(Template!="")
160   - {
161   - if(Component) {
162   - Txt=_GetProjectTestTarget(ResourcePath,ProjectName,ProjectDir);
163   - }
164   - Template=ctString::Replace(Template,
165   - "@PROJECT_COMPONENT_EXAMPLE_TARGET@",
166   - Txt);
167   - Template=ctString::Replace(Template,
168   - "@PROJECTNAME@",
169   - ProjectName);
170   - Template=ctString::Replace(Template,
171   - "@PROJECTNAME_UPPER@",
172   - ctString::Upper(ctString::Normalize(ProjectName)));
173   - Template=ctString::Replace(Template,
174   - "@PROJECTDIRECTORY@",
175   - ProjectDir);
  105 + if(Template!="") {
  106 + Template="ADD_SUBDIRECTORY(${PROJECT_SOURCE_DIR}/"+Name+")\n";
176 107  
177   - if(!BundleInside) {
178   - Template=ctString::Replace(Template,
179   - "@PROJECT_PATH@",
180   - "/");
  108 + if(!cblResource::CreateFile(OutputFileName,Template,true)) {
  109 + Msg="The target could not be added in the file: "+OutputFileName;
  110 + SHOW_WARNING(Msg);
181 111 } else {
182   - Template=ctString::Replace(Template,
183   - "@PROJECT_PATH@",
184   - "/../resources/");
  112 + Result=true;
185 113 }
186   -
187   - Result=Template;
188 114 } else {
189   - Msg+=InputFileName;
  115 + Msg="You're not within a bundle. I could not find the file: "+OutputFileName;
190 116 SHOW_ERROR(Msg);
191 117 }
192 118  
193 119 return Result;
194   -} // _GetProjectTarget
  120 +} // _UpdateBundle
195 121  
196 122 bool cblBundle::Generate(const std::string& DirName,
197 123 const std::string& ProyectName,
198 124 const std::string& ProyectType,
199   - bool EnableBundle,
200 125 bool EnableGNUFiles)
201 126 {
202 127 bool Result=false;
... ... @@ -204,109 +129,91 @@ bool cblBundle::Generate(const std::string& DirName,
204 129 std::string DLName=ctString::Normalize(ProyectName);
205 130 std::string Msg;
206 131 bool IsOk=false;
207   - bool IsIntegration=false;
208   - bool IsComponent=false;
  132 + bool IsBundle=(ctString::IsEqual(ProyectType,"bundle",false));
  133 + bool IsIntegration=(ctString::IsEqual(ProyectType,"integration",false));
  134 + bool IsComponent=(ctString::IsEqual(ProyectType,"component",false));
  135 + bool IsPacket=(ctString::IsEqual(ProyectType,"packets",false));
  136 + bool IsView=(ctString::IsEqual(ProyectType,"view",false));
209 137 cblResource Node;
210 138  
211 139 Path+="/coolbot-bundle/";
212 140  
213 141 Node.SetRootDir(DirName);
214 142  
215   - if(ctString::IsEqual(ProyectType,"bundle",false)) {
  143 + if( IsBundle ) {
  144 + Node.SetSubDir("bin");
  145 + Node.SetSubDir("build");
  146 + Node.SetSubDir("lib");
  147 + Node.SetSubDir("pkg-config");
216 148 Node.SetSubDir("resources");
217 149 Node.SetSubDir("resources/cmake");
218 150 Node.SetSubDir("resources/modules");
  151 + Node.SetSubDir("tests");
  152 +
219 153 Node.SetTemplate(Path+"cmake/check_dependencies.cmake.template",
220 154 "/resources/cmake/check_dependencies.cmake");
221 155 Node.SetTemplate(Path+"cmake/cmake_uninstall.cmake.in.template",
222   - "/resources/cmake/cmake_uninstall.cmake.in");
  156 + "/resources/cmake/cmake_uninstall.cmake.in");
223 157 Node.SetTemplate(Path+"cmake/check_dependencies.cmake.template",
224   - "/resources/cmake/check_dependencies.cmake");
  158 + "/resources/cmake/check_dependencies.cmake");
225 159 Node.SetTemplate(Path+"cmake/pkg_config.pc.in.template",
226   - "/resources/cmake/pkg_config.pc.in");
  160 + "/resources/cmake/pkg_config.pc.in");
227 161 Node.SetTemplate(Path+"cmake/toolkit.cmake.template",
228   - "/resources/cmake/toolkit.cmake");
  162 + "/resources/cmake/toolkit.cmake");
229 163 Node.SetTemplate(Path+"cmake/uninstall_target.cmake.template",
230   - "/resources/cmake/uninstall_target.cmake");
231   - } else {
232   - Node.SetSubDir("bin");
233   - Node.SetSubDir("build");
234   - if(!ctString::IsEqual(ProyectType,"integration",false)) {
235   - Node.SetSubDir("lib");
236   - Node.SetSubDir("pkg-config");
237   - Node.SetTemplate(Path+"keepme.template",
238   - "/lib/.keepme");
239   - Node.SetTemplate(Path+"keepme.template",
240   - "/pkg-config/.keepme");
241   - }
242   - Node.SetSubDir("src");
243   - if(ctString::IsEqual(ProyectType,"component",false)) {
244   - Node.SetSubDir("tests");
245   - }
  164 + "/resources/cmake/uninstall_target.cmake");
  165 + Node.SetTemplate(Path+"cmake/cmake_targets.cmake.template",
  166 + "/resources/cmake/cmake_targets.cmake");
  167 + Node.SetTemplate(Path+"cmake/CMakeLists.txt.template",
  168 + "CMakeLists.txt");
246 169 Node.SetTemplate(Path+"keepme.template",
247   - "/bin/.keepme");
  170 + "/bin/.keepme");
248 171 Node.SetTemplate(Path+"keepme.template",
249   - "/build/.keepme");
250   -
251   - if(!EnableBundle) {
252   - //creo un proyecto completo independiente
253   - Node.SetSubDir("cmake");
254   - Node.SetSubDir("modules");
255   -
256   - /// CMake resources directory
257   - Node.SetTemplate(Path+"cmake/check_dependencies.cmake.template",
258   - "/cmake/check_dependencies.cmake");
259   - Node.SetTemplate(Path+"cmake/cmake_uninstall.cmake.in.template",
260   - "/cmake/cmake_uninstall.cmake.in");
261   - Node.SetTemplate(Path+"cmake/check_dependencies.cmake.template",
262   - "/cmake/check_dependencies.cmake");
263   - Node.SetTemplate(Path+"cmake/pkg_config.pc.in.template",
264   - "/cmake/pkg_config.pc.in");
265   - Node.SetTemplate(Path+"cmake/toolkit.cmake.template",
266   - "/cmake/toolkit.cmake");
267   - Node.SetTemplate(Path+"cmake/uninstall_target.cmake.template",
268   - "/cmake/uninstall_target.cmake");
269   - if(!ctString::IsEqual(ProyectType,"integration",false)) {
270   - Node.SetTemplate(Path+"cmake/find_package.cmake.template",
271   - "/modules/Find"+ctString::Upper(ctString::Normalize(DirName))+".cmake");
272   - }
  172 + "/build/.keepme");
  173 + Node.SetTemplate(Path+"keepme.template",
  174 + "/lib/.keepme");
  175 + Node.SetTemplate(Path+"keepme.template",
  176 + "/pkg-config/.keepme");
  177 + Node.SetTemplate(Path+"keepme.template",
  178 + "/tests/.keepme");
  179 + Node.SetTemplate(Path+"keepme.template",
  180 + "/resources/modules/.keepme");
  181 + } else {
  182 + if(!IsIntegration) {
  183 + Node.SetTemplate(Path+"cmake/find_package.cmake.template",
  184 + "../resources/modules/Find"+ctString::Upper(ctString::Normalize(DirName))+".cmake");
  185 + Node.SetTemplate(Path+"cmake/cmake-lib-target.template",
  186 + "CMakeLists.txt");
273 187 } else {
274   - if(!ctString::IsEqual(ProyectType,"integration",false)) {
275   - Node.SetTemplate(Path+"cmake/find_package.cmake.template",
276   - "../resources/modules/Find"+ctString::Upper(ctString::Normalize(DirName))+".cmake");
277   - }
  188 + Node.SetTemplate(Path+"cmake/cmake-exe-target.template",
  189 + "CMakeLists.txt");
278 190 }
279   - Node.SetTemplate(Path+"cmake/CMakeLists.txt.template",
280   - "/CMakeLists.txt");
281 191  
282   - if(ctString::IsEqual(ProyectType,"integration",false))
  192 + if( IsComponent )
283 193 {
284   - Node.SetTemplate(Path+"coolbot/coolbot_integration.template",
285   - "/src/"+DirName+".coolbot-integration");
286   - IsIntegration=true;
  194 + Node.SetTemplate(Path+"coolbot/coolbot_component.template",
  195 + DirName+".coolbot-component");
  196 + Node.SetTemplate(Path+"component_example.template",
  197 + "../tests/"+DirName+"-test.cpp");
287 198 }
288   - else if(ctString::IsEqual(ProyectType,"view",false))
  199 + else if( IsView )
289 200 {
290 201 Node.SetTemplate(Path+"coolbot/coolbot_view.template",
291   - "/src/"+DirName+".coolbot-view");
292   - } else if(ctString::IsEqual(ProyectType,"packets",false))
  202 + DirName+".coolbot-view");
  203 + }
  204 + else if( IsPacket )
293 205 {
294 206 Node.SetTemplate(Path+"coolbot/coolbot_packets.template",
295   - "/src/"+DirName+".coolbot-packets");
296   - } else if(ctString::IsEqual(ProyectType,"component",false))
297   - {
298   - Node.SetTemplate(Path+"coolbot/coolbot_component.template",
299   - "/src/"+DirName+".coolbot-component");
300   -
301   - Node.SetTemplate(Path+"component_example.template",
302   - "/tests/"+DirName+"-test.cpp");
303   - IsComponent=true;
  207 + DirName+".coolbot-packets");
  208 + }
  209 + else {
  210 + Node.SetTemplate(Path+"coolbot/coolbot_integration.template",
  211 + DirName+".coolbot-integration");
304 212 }
305 213 }
306 214  
307 215 if(Node.CreateDirectoryStructure()) {
308   -
309   - if(!ctString::IsEqual(ProyectType,"bundle",false)) {
  216 + if( IsBundle ) {
310 217 if(EnableGNUFiles) {
311 218 IsOk=Node.CreateGNUFiles(DirName);
312 219 } else {
... ... @@ -320,98 +227,93 @@ bool cblBundle::Generate(const std::string& DirName,
320 227 if(IsOk) {
321 228 std::string Template;
322 229 std::string Template_1;
  230 + std::string Txt;
323 231 std::string InputFileName;
324 232 std::string OutputFileName;
325 233  
326   - Node.Begin(MODE_TEMPLATE);
327   - while(!Node.IsEnd(MODE_TEMPLATE)) {
328   - InputFileName=ctString::ConvertSlash(Node.GetTemplate());
329   - OutputFileName=ctString::ConvertSlash(DirName+"/"+Node.GetOutputFileName());
330   -
331   - Template=ctTemplate::Load(InputFileName);
332   - if(Template!="") {
333   - Template=ctString::Replace(Template,
334   - "@VERSION@",
335   - COOLBOT_BUNDLE_VERSION);
336   - Template=ctString::Replace(Template,
337   - "@FILENAME@",
338   - DirName);
339   - if( (IsIntegration) &&
340   - (InputFileName==ctString::ConvertSlash(Path+"coolbot/coolbot_integration.template")) ) {
341   - if(ctString::MustNormalize(DirName)) {
342   - DLName=ctString::Normalize(DirName);
343   - Msg="The name of integration has to be normalized: "
344   - +DirName+" --> "+DLName;
345   - SHOW_WARNING(Msg);
  234 + if(IsComponent) {
  235 + Txt=_GetProjectTestTarget(Path,DirName,DirName);
  236 + if(Txt=="") {
  237 + IsOk=false;
  238 + }
  239 + }
  240 +
  241 + if(IsOk) {
  242 + Node.Begin(MODE_TEMPLATE);
  243 + while(!Node.IsEnd(MODE_TEMPLATE)) {
  244 + InputFileName=ctString::ConvertSlash(Node.GetTemplate());
  245 + OutputFileName=ctString::ConvertSlash(DirName+"/"+Node.GetOutputFileName());
  246 +
  247 + Template=ctTemplate::Load(InputFileName);
  248 + if(Template!="") {
  249 + Template=ctString::Replace(Template,
  250 + "@VERSION@",
  251 + COOLBOT_BUNDLE_VERSION);
  252 + Template=ctString::Replace(Template,
  253 + "@FILENAME@",
  254 + DirName);
  255 + if( (IsIntegration) &&
  256 + (InputFileName==ctString::ConvertSlash(Path+"coolbot/coolbot_integration.template")) ) {
  257 + if(ctString::MustNormalize(DirName)) {
  258 + DLName=ctString::Normalize(DirName);
  259 + Msg="The name of integration has to be normalized: "
  260 + +DirName+" --> "+DLName;
  261 + SHOW_WARNING(Msg);
  262 + }
346 263 }
347   - }
348   - Template=ctString::Replace(Template,
349   - "@DLNAME@",
350   - DLName);
351   - Template=ctString::Replace(Template,
352   - "@PROJECTNAME@",
353   - DirName);
354   - Template=ctString::Replace(Template,
355   - "@PROJECTNAME_UPPER@",
356   - ctString::Upper(ctString::Normalize(DirName)));
357   - Template=ctString::Replace(Template,
358   - "@DATE@",
359   - ctString::GetDate());
360   - Template=ctString::Replace(Template,
361   - "@PROJECTDIRECTORY@",
362   - DirName);
363   - Template=ctString::Replace(Template,
364   - "@FILENAME@",
365   - DirName);
366   - Template=ctString::Replace(Template,
367   - "@PROJECTNAME_HEADER_FILENAME@",
368   - DirName+".h");
369   -
370   - if(IsIntegration) {
371 264 Template=ctString::Replace(Template,
372   - "@PROJECT_SETTINGS@",
373   - _GetProjectSettings(Path,DirName,true));
  265 + "@DLNAME@",
  266 + DLName);
374 267 Template=ctString::Replace(Template,
375   - "@PROJECT_DISPLAY_SETTINGS@",
376   - _GetProjectSettings(Path,DirName,true,true));
  268 + "@PROJECTNAME@",
  269 + DirName);
377 270 Template=ctString::Replace(Template,
378   - "@PROJECT_TARGET@",
379   - _GetProjectTarget(Path,DirName,DirName,true));
380   - } else {
  271 + "@PROJECTNAME_UPPER@",
  272 + ctString::Upper(ctString::Normalize(DirName)));
381 273 Template=ctString::Replace(Template,
382   - "@PROJECT_SETTINGS@",
383   - _GetProjectSettings(Path,DirName));
  274 + "@DATE@",
  275 + ctString::GetDate());
384 276 Template=ctString::Replace(Template,
385   - "@PROJECT_DISPLAY_SETTINGS@",
386   - _GetProjectSettings(Path,DirName,false,true));
  277 + "@PROJECTDIRECTORY@",
  278 + DirName);
387 279 Template=ctString::Replace(Template,
388   - "@PROJECT_TARGET@",
389   - _GetProjectTarget(Path,DirName,DirName,false,IsComponent));
390   - }
  280 + "@FILENAME@",
  281 + DirName);
  282 + Template=ctString::Replace(Template,
  283 + "@PROJECTNAME_HEADER_FILENAME@",
  284 + DirName+".h");
  285 +
  286 + if(IsComponent) {
  287 + Template=ctString::Replace(Template,
  288 + "@PROJECT_COMPONENT_EXAMPLE_TARGET@",
  289 + Txt);
  290 + } else {
  291 + Template=ctString::Replace(Template,
  292 + "@PROJECT_COMPONENT_EXAMPLE_TARGET@",
  293 + "");
  294 + }
391 295  
392   - if(!EnableBundle) {
393   - Template=ctString::Replace(Template,
394   - "@PROJECT_PATH@",
395   - "/");
  296 + if(!Node.CreateFile(OutputFileName,Template)) {
  297 + Msg="You're probably not in a bundle.";
  298 + SHOW_ERROR(Msg);
  299 + Result=false;
  300 + break;
  301 + } else {
  302 + Result=true;
  303 + }
396 304 } else {
397   - Template=ctString::Replace(Template,
398   - "@PROJECT_PATH@",
399   - "/../resources/");
400   - }
401   -
402   - if(!Node.CreateFile(OutputFileName,Template)) {
  305 + Msg="Can not read the file: "+ctString::ConvertSlash(OutputFileName);
  306 + SHOW_ERROR(Msg);
403 307 Result=false;
404 308 break;
405   - } else {
406   - Result=true;
407 309 }
408   - } else {
409   - Msg="Can not read the file: "+ctString::ConvertSlash(OutputFileName);
410   - SHOW_ERROR(Msg);
411   - Result=false;
412   - break;
  310 + Node.Next(MODE_TEMPLATE);
413 311 }
414   - Node.Next(MODE_TEMPLATE);
  312 + }
  313 +
  314 + if(Result && (! IsBundle )) {
  315 + Result=_UpdateBundle(ctString::ConvertSlash(DirName+"/../resources/cmake/cmake_targets.cmake"),
  316 + DirName);
415 317 }
416 318 }
417 319  
... ...
coolbot-bundle/src/cblBundle.h
... ... @@ -54,19 +54,6 @@ class cblBundle
54 54 {
55 55 private:
56 56 /**
57   - ** Gets or displays the project settings.
58   - ** @param ResourcePath path of resources
59   - ** @param ProjectName the project name
60   - ** @param Integration indicates if the project is an integration
61   - ** @param DisplaySettings indicates if the project settings displayed
62   - ** @return Returns string with the project settings or empty string.
63   - **/
64   - static std::string _GetProjectSettings(const std::string& ResourcePath,
65   - const std::string& ProjectName,
66   - bool Integration=false,
67   - bool DisplaySettings=false);
68   -
69   - /**
70 57 ** Gets the project test target.
71 58 ** @param ResourcePath path of resources
72 59 ** @param ProjectName the project name
... ... @@ -78,21 +65,13 @@ private:
78 65 const std::string& ProjectDir);
79 66  
80 67 /**
81   - ** Gets the project target.
82   - ** @param ResourcePath path of resources
83   - ** @param ProjectName the project name
84   - ** @param ProjectDir the project directory
85   - ** @param Integration indicates if the project is an integration
86   - ** @param Component indicates if the project is a component
87   - ** @param BundleInside indicates if the project is inside of bundle.
88   - ** @return Returns string with the project target or empty string.
  68 + ** Updates the CMake files of bundle.
  69 + ** @param OutputFileName the output file name
  70 + ** @param Name the project name
  71 + ** @return Returns true if the process runs correctly.
89 72 **/
90   - static std::string _GetProjectTarget(const std::string& ResourcePath,
91   - const std::string& ProjectName,
92   - const std::string& ProjectDir,
93   - bool Integration=false,
94   - bool Component=false,
95   - bool BundleInside=true);
  73 + static bool _UpdateBundle(const std::string& OutputFileName,
  74 + const std::string& Name);
96 75  
97 76 public:
98 77 /**
... ... @@ -100,14 +79,12 @@ public:
100 79 ** @param DirName the root directory name
101 80 ** @param ProyectName the proyect name(related with the descriptive language)
102 81 ** @param ProyectType the proyect type(component, integration,...)
103   - ** @param EnableBundle indicates if it creates a workspace within the bundle
104 82 ** @param EnableGNUFiles indicates if it creates the GNU files
105 83 ** @return Returns true if the process runs correctly.
106 84 **/
107 85 static bool Generate(const std::string& DirName,
108 86 const std::string& ProyectName,
109 87 const std::string& ProyectType,
110   - bool EnableBundle=true,
111 88 bool EnableGNUFiles=true);
112 89  
113 90 /**
... ...
coolbot-bundle/src/cblMain.cpp
... ... @@ -158,10 +158,6 @@ static std::string Commads[][2]=
158 158 "Prints the directory that contains the resources and exit."
159 159 },
160 160 {
161   - "--disable-bundle",
162   - "Creates a workspace outside the bundle(as a separate project)."
163   - },
164   - {
165 161 "--disable-gnu-files",
166 162 "Not created the GNU files(AUTHOR, README, INSTALL,...) in the bundle."
167 163 },
... ... @@ -194,7 +190,7 @@ static std::string Commads[][2]=
194 190 "Specifies the name of project."
195 191 }
196 192 };
197   -static unsigned char NumCommads=15;
  193 +static unsigned char NumCommads=14;
198 194  
199 195 /**
200 196 ** Show brief usage message.
... ... @@ -204,11 +200,12 @@ void ShowUSAGE(void)
204 200 std::string Output="";
205 201 unsigned char Counter=1;
206 202 unsigned char First=1;
  203 + unsigned char N=NumCommads-8;
207 204  
208 205 std::cout<<"Usage: coolbot-bundle";
209   - for(int k=0; k<(NumCommads-6); k++) {
  206 + for(int k=0; k<N; k++) {
210 207 Output+=" ["+ctString::Replace(Commads[k][0],","," |")+"]";
211   - if( (Counter==2) || (k==(NumCommads-1)) ) {
  208 + if( (Counter==2) || (k==(N-1)) ) {
212 209 if(First==1) {
213 210 std::cout<<Output<<std::endl;
214 211 First++;
... ... @@ -220,14 +217,14 @@ void ShowUSAGE(void)
220 217 }
221 218 Counter++;
222 219 }
223   - std::cout<<" [ [bundle | --create-bundle] <my-bundle> ]"<<std::endl
  220 + std::cout<<" [ [--disable-gnu-files] [bundle | --create-bundle] <my-bundle> ]"<<std::endl
224 221 <<" [ [component | --create-component] [<component-directory-name> <component-c++-class-name>] ]"<<std::endl
225 222 <<" [ [packets | --create-packets] [<packets-directory-name> <packets-c++-namespace>] ]"<<std::endl
226 223 <<" [ [view | --create-view] [<view-directory-name> <view-c++-class-name>] ]"<<std::endl
227 224 <<" [ [integration | --create-integration] [<integration-directory-name>] ]"<<std::endl
228 225 <<" [ [-dirname | --dirname] <directory-name> ]"<<std::endl
229 226 <<" [ [-name | --name] <project-name> ]"<<std::endl
230   - <<" [ <my-bundle> ]"<<std::endl;
  227 + <<" [ [--disable-gnu-files] <my-bundle> ]"<<std::endl;
231 228 std::cout<<std::endl;
232 229 std::cout<<"coolbot-bundle creates a workspace to develop a CoolBOT package (bundle). A"<<std::endl;
233 230 std::cout<<"CoolBOT package contains components, views, packets and integrations. Finally,"<<std::endl;
... ... @@ -294,7 +291,6 @@ int main(int argc, char** argv)
294 291 int Result=EXIT_SUCCESS; /* Successful exit status. */
295 292 bool ExitFlag=false;
296 293 bool IsOk=false;
297   - bool EnableBundle=true;
298 294 bool EnableGNUFiles=true;
299 295 bool IsWorkSpaceSpecified=false;
300 296 std::string WorkSpace="";
... ... @@ -350,11 +346,6 @@ int main(int argc, char** argv)
350 346 ExitFlag=true;
351 347 break;
352 348 }
353   - else if(strcmp(argv[i],"--disable-bundle")==0)
354   - {
355   - EnableBundle=false;
356   - ExitFlag=false;
357   - }
358 349 else if(strcmp(argv[i],"--disable-gnu-files")==0)
359 350 {
360 351 EnableGNUFiles=false;
... ... @@ -468,13 +459,11 @@ int main(int argc, char** argv)
468 459 }
469 460 } else {
470 461 IsOk=true;
471   - EnableBundle=true;
472 462 }
473 463 if(IsOk) {
474 464 if(!cblBundle::Generate(DirName,
475 465 Name,
476 466 WorkSpace,
477   - EnableBundle,
478 467 EnableGNUFiles)) {
479 468 Result=EXIT_FAILURE;
480 469 }
... ...
coolbot-bundle/src/cblResource.cpp
... ... @@ -276,7 +276,7 @@ bool cblResource::CreateGNUFiles(const std::string&amp; DirName)
276 276 DirName+"/INSTALL",
277 277 DirName+"/TODO",
278 278 DirName+"/NEWS",
279   - DirName+"/ChangeLog" };
  279 + DirName+"/ChangeLog.txt" };
280 280  
281 281 for(int i=0;i<7;i++) {
282 282 if(!CreateEmptyFile(Files[i])) {
... ...
examples/coolbot-kinect/kinect-example/AUTHORS
... ... @@ -1,4 +0,0 @@
1   -CoolBOT Project Developers and Contributors:
2   -
3   -- Antonio Carlos Domínguez Brito (adominguez@iusiani.ulpgc.es)
4   - Main developer and project maintainer.
examples/coolbot-kinect/kinect-example/CMakeLists.txt
... ... @@ -1,475 +0,0 @@
1   -#=============================================================================
2   -# CMakeLists.txt - Rules for kinect-example project.
3   -#
4   -# The CoolBOT Project (<http://www.coolbotproject.org>)
5   -# Copyright (C) 2003,2007,2009,2010
6   -# Universidad de Las Palmas de Gran Canaria (ULPGC) (<http://www.ulpgc.es>)
7   -#
8   -# This software is a collective project which has been designed, developed and
9   -# written, and is maintained by members, students and collaborators of the División
10   -# de Inteligencia Artificial y Sistemas (DIAS) at the Instituto Universitario de
11   -# Sistemas Inteligentes y Aplicaciones Numéricas en Ingeniería (SIANI)
12   -# (<http://www.siani.es/>), and also of the Departamento de Informática y Sistemas
13   -# (DIS) (<http://www.dis.ulpgc.es>) both at ULPGC. The AUTHOR file lists all
14   -# developers and contributors.The particular authors of each file are explicitly
15   -# specified on each one of them.
16   -#
17   -# This file is part of the CoolBOT Project.
18   -# The CoolBOT Project is free software: you can redistribute it and/or modify
19   -# it under the terms of the GNU General Public License as published by
20   -# the Free Software Foundation, either version 3 of the License, or any
21   -# later version.
22   -#
23   -# The CoolBOT Project is distributed in the hope that it will be useful,
24   -# but WITHOUT ANY WARRANTY; without even the implied warranty of
25   -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26   -# GNU General Public License for more details.
27   -#
28   -# You should have received a copy (COPYING file) of the GNU General Public License
29   -# along with the CoolBOT Project . If not, see <http://www.gnu.org/licenses/>.
30   -#=============================================================================
31   -CMAKE_MINIMUM_REQUIRED(VERSION 2.6.4)
32   -PROJECT(kinect-example CXX C)
33   -
34   -# Sets the policy CMP0017. More info: cmake --help-policy CMP0017
35   -IF(POLICY CMP0017)
36   - IF(COMMAND CMAKE_POLICY)
37   - CMAKE_POLICY(SET CMP0017 NEW)
38   - ENDIF(COMMAND CMAKE_POLICY)
39   -ENDIF(POLICY CMP0017)
40   -
41   -#
42   -# Options available
43   -#
44   -OPTION(CREATE_ENV_VAR "Set to ON to create environment variables" OFF)
45   -OPTION(BUILD_SHARED_LIBS "Set to OFF to build static libraries" ON)
46   -OPTION(DEBUG_MODE "Set to ON to activate the debug mode" ON)
47   -OPTION(SHOW_DEBUG_INFO "Set to ON to show debug info" OFF)
48   -OPTION(SHOW_WARNINGS "Set to ON to show the project warnings" OFF)
49   -OPTION(BUILD_TEST "Set to ON to build tests" OFF)
50   -
51   -#
52   -# Sets CMAKE_MODULE_PATH for use FIND_PACKAGE() in local CMake directory.
53   -#
54   -# NOTE: In the modules directory(/../resources/modules) you can find a file named:
55   -#
56   -# FindKINECT_EXAMPLE.cmake
57   -#
58   -# This file contains the necessary instructions for CMake find the necessary
59   -# information related to this project. You must edit this file.
60   -#
61   -SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../resources/cmake
62   - ${CMAKE_CURRENT_SOURCE_DIR}/../resources/modules
63   - ${CMAKE_MODULE_PATH}
64   - ${CMAKE_ROOT}/Modules)
65   -
66   -#
67   -# Include CMake files
68   -#
69   -INCLUDE(${PROJECT_SOURCE_DIR}/../resources/cmake/toolkit.cmake)
70   -INCLUDE(${PROJECT_SOURCE_DIR}/../resources/cmake/check_dependencies.cmake)
71   -INCLUDE(${PROJECT_SOURCE_DIR}/../resources/cmake/uninstall_target.cmake)
72   -
73   -#
74   -# Initializes the list of targets. If you are in production mode, the list has install and uninstall target.
75   -#
76   -INIT_TARGETS_LIST()
77   -
78   -IF(NOT DEBUG_MODE)
79   - REGISTER_NEW_TARGET("install")
80   - REGISTER_NEW_TARGET("uninstall")
81   -ENDIF(NOT DEBUG_MODE)
82   -
83   -#
84   -# General project settings
85   -#
86   -IF( DEBUG_MODE )
87   - SET(CMAKE_BUILD_TYPE Debug CACHE STRING "Development mode" FORCE)
88   - SET(PROJECT_INSTALL_PATH ${PROJECT_SOURCE_DIR})
89   -ELSE( DEBUG_MODE )
90   - SET(CMAKE_BUILD_TYPE Release CACHE STRING "Production Mode" FORCE)
91   - SET(PROJECT_INSTALL_PATH ${CMAKE_INSTALL_PREFIX})
92   -ENDIF( DEBUG_MODE )
93   -
94   -SET(BIN_DIR "${PROJECT_SOURCE_DIR}/bin")
95   -SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${BIN_DIR} CACHE PATH "Directory for executables")
96   -SET(PROJECT_BINARIES_INSTALL_PATH "${PROJECT_INSTALL_PATH}/bin/")
97   -
98   -
99   -IF(SHOW_WARNINGS)
100   - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
101   - IF(NOT WIN32)
102   - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-write-strings")
103   - ENDIF(NOT WIN32)
104   -ELSE(SHOW_WARNINGS)
105   - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
106   -ENDIF(SHOW_WARNINGS)
107   -
108   -GET_OPERATING_SYSTEM( OS )
109   -
110   -#
111   -# Sets the targets available
112   -#
113   -IF(PROJECT_DEPENDENCIES)
114   - MESSAGE(STATUS "Generating kinect-example target")
115   -
116   - INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src)
117   -
118   - #
119   - # NOTE: It is preferable not to use the AUX_SOURCE_DIRECTORY command. It is
120   - # recommended to manually specify the source files and header. For example:
121   - #
122   - # SET(KINECT_EXAMPLE_SRCS
123   - # src/source.cpp
124   - # src/source1.cpp
125   - # ...
126   - # src/sourceN.cpp
127   - # )
128   - #
129   - # SET(KINECT_EXAMPLE_HDRS
130   - # src/header.h
131   - # src/header1.h
132   - # ...
133   - # src/headerN.h
134   - # )
135   - #
136   - # SET(KINECT_EXAMPLE_MAIN_SOURCE_FILES
137   - # ${KINECT_EXAMPLE_SRCS}
138   - # ${KINECT_EXAMPLE_HDRS})
139   - #
140   - AUX_SOURCE_DIRECTORY("${PROJECT_SOURCE_DIR}/src"
141   - KINECT_EXAMPLE_MAIN_SOURCE_FILES)
142   -
143   - IF(SHOW_DEBUG_INFO)
144   - MESSAGE(STATUS " * Source code:")
145   - MESSAGE("${KINECT_EXAMPLE_MAIN_SOURCE_FILES}")
146   - ENDIF(SHOW_DEBUG_INFO)
147   -
148   - #
149   - # Flags for the construction of the target kinect-example")
150   - # By default, sets the CoolBOT framework flags.
151   - # Here, you should add the flags you need.
152   - # You can use the RUN_PKGCONFIG macro:
153   - #
154   - # RUN_PKGCONFIG( <pkg-config option>
155   - # <pkg-config file>
156   - # <result of the execution>
157   - # <output variable with the flags> )
158   - #
159   - # NOTE: The RUN_PKGCONFIG macro accepts an optional parameter that indicates
160   - # the path where the file pkg-config:
161   - #
162   - # RUN_PKGCONFIG( <pkg-config option>
163   - # <pkg-config file>
164   - # <result of the execution>
165   - # <output variable with the flags> )
166   - # <pkg-config file path> )
167   - #
168   - # In this case, the pkg-config file must be extension ".pc".
169   - #
170   - MESSAGE(STATUS "Looking for the module libfreenect")
171   - FIND_PACKAGE(LIBFREENECT)
172   -
173   - IF(LIBFREENECT_FOUND)
174   - MESSAGE(STATUS "Looking for the module libfreenect - found")
175   - RUN_PKGCONFIG( "--libs"
176   - libfreenect
177   - result_pkg
178   - LIBFREENECT_LINKER_FLAGS)
179   -
180   - RUN_PKGCONFIG( "--cflags"
181   - libfreenect
182   - result_pkg
183   - LIBFREENECT_COMPILER_FLAGS )
184   - ELSE(LIBFREENECT_FOUND)
185   - MESSAGE(STATUS "Looking for the module libfreenect - not found")
186   - MESSAGE(SEND_ERROR "libfreenect package is required.")
187   - ENDIF(LIBFREENECT_FOUND)
188   -
189   - MESSAGE(STATUS "Looking for the module kinect-packets")
190   - FIND_PACKAGE(KINECT_PACKETS)
191   -
192   - IF(KINECT_PACKETS_FOUND)
193   - MESSAGE(STATUS "Looking for the module kinect-packets - found")
194   - IF(DEBUG_MODE)
195   - RUN_PKGCONFIG( "--libs"
196   - kinect-packets.pc
197   - result_pkg
198   - KINECT_PACKETS_LINKER_FLAGS
199   - ${PROJECT_SOURCE_DIR}/../kinect-packets/pkg-config/ )
200   -
201   - RUN_PKGCONFIG( "--cflags"
202   - kinect-packets.pc
203   - result_pkg
204   - KINECT_PACKETS_COMPILER_FLAGS
205   - ${PROJECT_SOURCE_DIR}/../kinect-packets/pkg-config/ )
206   - ELSE(DEBUG_MODE)
207   - RUN_PKGCONFIG( "--libs"
208   - kinect-packets
209   - result_pkg
210   - KINECT_PACKETS_LINKER_FLAGS)
211   -
212   - RUN_PKGCONFIG( "--cflags"
213   - kinect-packets
214   - result_pkg
215   - KINECT_PACKETS_COMPILER_FLAGS )
216   - ENDIF(DEBUG_MODE)
217   - ELSE(KINECT_PACKETS_FOUND)
218   - MESSAGE(STATUS "Looking for the module kinect-packets - not found")
219   - MESSAGE(SEND_ERROR "kinect-packets package is required.")
220   - ENDIF(KINECT_PACKETS_FOUND)
221   -
222   - MESSAGE(STATUS "Looking for the module kinect")
223   - FIND_PACKAGE(KINECT)
224   -
225   - IF(KINECT_FOUND)
226   - MESSAGE(STATUS "Looking for the module kinect - found")
227   - IF(DEBUG_MODE)
228   - RUN_PKGCONFIG( "--libs"
229   - kinect.pc
230   - result_pkg
231   - KINECT_LINKER_FLAGS
232   - ${PROJECT_SOURCE_DIR}/../kinect/pkg-config/ )
233   -
234   - RUN_PKGCONFIG( "--cflags"
235   - kinect.pc
236   - result_pkg
237   - KINECT_COMPILER_FLAGS
238   - ${PROJECT_SOURCE_DIR}/../kinect/pkg-config/ )
239   - ELSE(DEBUG_MODE)
240   - RUN_PKGCONFIG( "--libs"
241   - kinect
242   - result_pkg
243   - KINECT_LINKER_FLAGS)
244   -
245   - RUN_PKGCONFIG( "--cflags"
246   - kinect
247   - result_pkg
248   - KINECT_COMPILER_FLAGS )