Commit 3ee7e5aa56a0e2bd44e58e00b888783fff5221ae

Authored by Francisco J. Santana Jorge
1 parent 3a8be6f1
Exists in master

Added GTK dependency and modified coolbot-bundle application

.gitignore
1 1 .DS_Store
2 2 *~
3   -
  3 +*.kdev4
  4 +build
  5 +bin
  6 +lib
  7 +pkg-config
... ...
cmake/check_dependencies.cmake
... ... @@ -6,6 +6,8 @@
6 6 # KERNEL_DEPENDENCIES: check all software dependencies.
7 7 # FRAMEWORK_DEPENDENCIES: check CoolBOT framework dependency
8 8 # COMPILER_DEPENDENCIES: check compiler dependency
  9 +# GTK_INCLUDE_DIR: GTK include directories
  10 +# GTK_LIBRARIES: GTK libraries
9 11 #
10 12 # The CoolBOT Project (<http://www.coolbotproject.org>)
11 13 # Copyright (C) 2003,2007,2009,2010
... ... @@ -37,9 +39,12 @@
37 39 SET(KERNEL_DEPENDENCIES FALSE)
38 40 SET(FRAMEWORK_DEPENDENCIES FALSE)
39 41 SET(COMPILER_DEPENDENCIES FALSE)
  42 +SET(GTK_INCLUDE_DIR)
  43 +SET(GTK_LIBRARIES)
40 44  
41 45 INCLUDE(${PROJECT_SOURCE_DIR}/cmake/check_pkgconfig.cmake)
42 46 INCLUDE(${PROJECT_SOURCE_DIR}/cmake/check_ace.cmake)
  47 +INCLUDE(${PROJECT_SOURCE_DIR}/cmake/check_gtk.cmake)
43 48 INCLUDE(${PROJECT_SOURCE_DIR}/cmake/check_flex.cmake)
44 49 INCLUDE(${PROJECT_SOURCE_DIR}/cmake/check_bison.cmake)
45 50  
... ... @@ -58,6 +63,16 @@ ELSE( PKG_CONFIG_FOUND AND ACE_FOUND )
58 63 MESSAGE(STATUS " pkg-config and ACE library dependency: failed")
59 64 ENDIF( PKG_CONFIG_FOUND AND ACE_FOUND )
60 65  
  66 +IF(GTK_FOUND)
  67 + SET(GTK_INCLUDE_DIR ${GTK2_INCLUDE_DIRS})
  68 + SET(GTK_LIBRARIES ${GTK2_LIBRARIES})
  69 + MESSAGE(STATUS " GTK library dependency: ok")
  70 + MESSAGE(STATUS " * GTK include dirs: ${GTK_INCLUDE_DIR}")
  71 + MESSAGE(STATUS " * GTK libraries: ${GTK_LIBRARIES}")
  72 +ELSE(GTK_FOUND)
  73 + MESSAGE(STATUS " WARNING: GTK not found. CoolBOT framework will not have support for GTK.")
  74 +ENDIF(GTK_FOUND)
  75 +
61 76 IF( FLEX_FOUND AND BISON_FOUND )
62 77 SET(COMPILER_DEPENDENCIES TRUE)
63 78 MESSAGE(STATUS " Compiler dependency: ok")
... ... @@ -67,7 +82,7 @@ ELSE( FLEX_FOUND AND BISON_FOUND )
67 82 MESSAGE(STATUS " Compiler dependency: failed")
68 83 ENDIF( FLEX_FOUND AND BISON_FOUND )
69 84  
70   -IF( FRAMEWORK_DEPENDENCIES AND COMPILER_DEPENDENCIES )
  85 +IF( FRAMEWORK_DEPENDENCIES AND COMPILER_DEPENDENCIES AND GTK_FOUND )
71 86 SET(KERNEL_DEPENDENCIES TRUE)
72 87 MESSAGE(STATUS " All software dependencies are resolved.")
73   -ENDIF( FRAMEWORK_DEPENDENCIES AND COMPILER_DEPENDENCIES )
  88 +ENDIF( FRAMEWORK_DEPENDENCIES AND COMPILER_DEPENDENCIES AND GTK_FOUND )
... ...
cmake/check_gtk.cmake 0 → 100644
... ... @@ -0,0 +1,40 @@
  1 +#=============================================================================
  2 +# check_gtk.cmake - Check GTK library dependency.
  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 +SET(GTK_FOUND FALSE)
  32 +
  33 +MESSAGE(STATUS "Looking for the module GTK")
  34 +FIND_PACKAGE(GTK2 2.6 REQUIRED gtk)
  35 +IF(GTK2_FOUND)
  36 + MESSAGE(STATUS "Looking for the module GTK - found")
  37 + SET(GTK_FOUND TRUE)
  38 +ELSE(GTK2_FOUND)
  39 + MESSAGE(STATUS "Looking for the module GTK - not found")
  40 +ENDIF(GTK2_FOUND)
... ...
cmake/cpack_config.cmake.in
... ... @@ -60,7 +60,7 @@ IF(UNIX)
60 60 IF( DPKG_IS_FOUND )
61 61 SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "@DEBIAN_PACKAGE_ARCHITECTURE@" )
62 62 SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "@PROJECT_MAINTAINER@")
63   - SET(CPACK_DEBIAN_PACKAGE_SECTION "utilities")
  63 + SET(CPACK_DEBIAN_PACKAGE_SECTION "Development")
64 64 SET(CPACK_DEBIAN_PACKAGE_PRIORITY "extra")
65 65 SET(CPACK_DEBIAN_PACKAGE_DEPENDS "lib32gcc1, lib32stdc++6, libc6, libc6-i386, libgcc1, libstdc++6, libwxbase2.8-0, libwxgtk2.8-0")
66 66 ENDIF( DPKG_IS_FOUND )
... ... @@ -73,8 +73,8 @@ IF(UNIX)
73 73 SET(CPACK_RPM_PACKAGE_RELEASE "1")
74 74 SET(CPACK_RPM_PACKAGE_LICENSE "GPL")
75 75 SET(CPACK_RPM_PACKAGE_GROUP "Development/Tools")
76   - SET(CPACK_RPM_PACKAGE_VENDOR "Roncali")
77   - SET(CPACK_RPM_PACKAGE_DESCRIPTION "The ske tool is a generator of workspaces and code")
  76 + SET(CPACK_RPM_PACKAGE_VENDOR "xxx")
  77 + SET(CPACK_RPM_PACKAGE_DESCRIPTION "xxxx")
78 78 SET(CPACK_RPM_PACKAGE_REQUIRES "lib32gcc1, lib32stdc++6, libc6, libc6-i386, libgcc1, libstdc++6, glibc wxGTK")
79 79 SET(CPACK_RPM_PACKAGE_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
80 80 ENDIF( RPM_IS_FOUND)
... ...
coolbot-bundle/src/cblBundle.cpp
... ... @@ -57,30 +57,46 @@
57 57 #define SHOW_ERROR(message) \
58 58 std::cerr<<"Error: "<<message<<std::endl;
59 59  
  60 +/// Shows warning messages
  61 +#define SHOW_WARNING(message) \
  62 + std::cout<<"Warning: "<<message<<std::endl;
  63 +
60 64 ///*****************************************************************************
61 65  
62 66 bool cblBundle::Generate(const std::string& DirName,
63 67 const std::string& ProyectName,
64   - const std::string& ProyectType,
65   - bool IsModule)
  68 + const std::string& ProyectType)
66 69 {
67 70 bool Result=false;
68 71 std::string Path=RESOURCE_PATH;
69 72 std::string DLName=ctString::Normalize(ProyectName);
70 73 std::string Msg;
  74 + bool GeneratesGNUFiles=false;
71 75 bool IsOk=false;
72   - bool IsComponent=false;
73 76 bool IsIntegration=false;
74   - bool IsPackets=false;
75   - bool IsView=false;
76   - bool IsApplication=false;
  77 + bool IsModule=false;
77 78 cblResource Node;
78 79  
79 80 Path+="/coolbot-bundle/";
80 81  
81 82 Node.SetRootDir(DirName);
82 83  
83   - if(!IsModule) {
  84 + if(ctString::IsEqual(ProyectType,"bundle",false)) {
  85 + Node.SetSubDir("bin");
  86 + Node.SetSubDir("build");
  87 + Node.SetSubDir("cmake");
  88 + Node.SetSubDir("lib");
  89 + Node.SetSubDir("pkg-config");
  90 + Node.SetTemplate(Path+"keepme.template",
  91 + "/bin/.keepme");
  92 + Node.SetTemplate(Path+"keepme.template",
  93 + "/build/.keepme");
  94 + Node.SetTemplate(Path+"keepme.template",
  95 + "/lib/.keepme");
  96 + Node.SetTemplate(Path+"keepme.template",
  97 + "/pkg-config/.keepme");
  98 + Node.SetTemplate(Path+"cmake/include_targets.cmake.template",
  99 + "/cmake/include_targets.cmake");
84 100 Node.SetTemplate(Path+"cmake/check_dependencies.cmake.template",
85 101 "/cmake/check_dependencies.cmake");
86 102 Node.SetTemplate(Path+"cmake/cmake_uninstall.cmake.in.template",
... ... @@ -95,137 +111,34 @@ bool cblBundle::Generate(const std::string&amp; DirName,
95 111 "/cmake/uninstall_target.cmake");
96 112 Node.SetTemplate(Path+"cmake/CMakeLists.txt.template",
97 113 "/CMakeLists.txt");
  114 + GeneratesGNUFiles=true;
  115 + IsModule=false;
98 116 } else {
99   - if(!ctString::IsEqual(ProyectType,"integration",false)) {
100   - Node.SetTemplate(Path+"cmake/CMakeLists-module-lib.template",
101   - "/CMakeLists.txt");
102   - } else {
  117 + GeneratesGNUFiles=false;
  118 + IsModule=true;
  119 + if(ctString::IsEqual(ProyectType,"integration",false)) {
103 120 Node.SetTemplate(Path+"cmake/CMakeLists-module-exe.template",
104 121 "/CMakeLists.txt");
105   - }
106   - }
107   -
108   - if(ctString::IsEqual(ProyectType,"component",false)) {
109   - if(!IsModule) {
110   - Node.SetSubDir("bin");
111   - Node.SetSubDir("build");
112   - Node.SetSubDir("cmake");
113   - Node.SetSubDir("lib");
114   - Node.SetSubDir("pkg-config");
115   - Node.SetSubDir("src");
116   - Node.SetSubDir("src/examples");
117   - Node.SetTemplate(Path+"keepme.template",
118   - "/bin/.keepme");
119   - Node.SetTemplate(Path+"keepme.template",
120   - "/build/.keepme");
121   - Node.SetTemplate(Path+"keepme.template",
122   - "/lib/.keepme");
123   - Node.SetTemplate(Path+"keepme.template",
124   - "/pkg-config/.keepme");
125   - Node.SetTemplate(Path+"/coolbot/component_example.template",
126   - "src/examples/"+DirName+"-test.cpp");
127   - Node.SetTemplate(Path+"coolbot/coolbot_component.template",
128   - "src/"+DirName+".coolbot-component");
129   - } else {
130   - Node.SetTemplate(Path+"coolbot/coolbot_component.template",
131   - "/"+DirName+".coolbot-component");
132   - }
133   - IsComponent=true;
134   - } else if(ctString::IsEqual(ProyectType,"integration",false)) {
135   - if(!IsModule) {
136   - Node.SetSubDir("bin");
137   - Node.SetSubDir("build");
138   - Node.SetSubDir("cmake");
139   - Node.SetSubDir("src");
140   - Node.SetTemplate(Path+"keepme.template",
141   - "/bin/.keepme");
142   - Node.SetTemplate(Path+"keepme.template",
143   - "/build/.keepme");
144   - Node.SetTemplate(Path+"coolbot/coolbot_integration.template",
145   - "src/"+DirName+".coolbot-integration");
146   - } else {
147 122 Node.SetTemplate(Path+"coolbot/coolbot_integration.template",
148 123 "/"+DirName+".coolbot-integration");
149   - }
150   - IsIntegration=true;
151   - } else if(ctString::IsEqual(ProyectType,"view",false)) {
152   - if(!IsModule) {
153   - Node.SetSubDir("bin");
154   - Node.SetSubDir("build");
155   - Node.SetSubDir("cmake");
156   - Node.SetSubDir("lib");
157   - Node.SetSubDir("pkg-config");
158   - Node.SetSubDir("src");
159   - Node.SetTemplate(Path+"keepme.template",
160   - "/bin/.keepme");
161   - Node.SetTemplate(Path+"keepme.template",
162   - "/build/.keepme");
163   - Node.SetTemplate(Path+"keepme.template",
164   - "/lib/.keepme");
165   - Node.SetTemplate(Path+"keepme.template",
166   - "/pkg-config/.keepme");
167   - Node.SetTemplate(Path+"coolbot/coolbot_view.template",
168   - "src/"+DirName+".coolbot-view");
  124 + IsIntegration=true;
169 125 } else {
170   - Node.SetTemplate(Path+"coolbot/coolbot_view.template",
171   - "/"+DirName+".coolbot-view");
172   - }
173   - IsView=true;
174   - } else if(ctString::IsEqual(ProyectType,"packets",false)) {
175   - if(!IsModule) {
176   - Node.SetSubDir("bin");
177   - Node.SetSubDir("build");
178   - Node.SetSubDir("cmake");
179   - Node.SetSubDir("lib");
180   - Node.SetSubDir("pkg-config");
181   - Node.SetSubDir("src");
182   - Node.SetTemplate(Path+"keepme.template",
183   - "/bin/.keepme");
184   - Node.SetTemplate(Path+"keepme.template",
185   - "/build/.keepme");
186   - Node.SetTemplate(Path+"keepme.template",
187   - "/lib/.keepme");
188   - Node.SetTemplate(Path+"keepme.template",
189   - "/pkg-config/.keepme");
190   - Node.SetTemplate(Path+"coolbot/coolbot_packets.template",
191   - "src/"+DirName+".coolbot-packets");
192   - } else {
193   - Node.SetTemplate(Path+"coolbot/coolbot_packets.template",
194   - "/"+DirName+".coolbot-packets");
195   - }
196   - IsPackets=true;
197   - } else if(ctString::IsEqual(ProyectType,"application",false)) {
198   - if(!IsModule) {
199   - Node.SetSubDir("bin");
200   - Node.SetSubDir("build");
201   - Node.SetSubDir("cmake");
202   - Node.SetSubDir("lib");
203   - Node.SetSubDir("pkg-config");
204   - Node.SetSubDir("components");
205   - Node.SetSubDir("packets");
206   - Node.SetSubDir("views");
207   - Node.SetSubDir("integrations");
208   - Node.SetTemplate(Path+"keepme.template",
209   - "/bin/.keepme");
210   - Node.SetTemplate(Path+"keepme.template",
211   - "/build/.keepme");
212   - Node.SetTemplate(Path+"keepme.template",
213   - "/lib/.keepme");
214   - Node.SetTemplate(Path+"keepme.template",
215   - "/pkg-config/.keepme");
216   - Node.SetTemplate(Path+"keepme.template",
217   - "/components/.keepme");
218   - Node.SetTemplate(Path+"keepme.template",
219   - "/views/.keepme");
220   - Node.SetTemplate(Path+"keepme.template",
221   - "/packets/.keepme");
  126 + Node.SetTemplate(Path+"cmake/CMakeLists-module-lib.template",
  127 + "/CMakeLists.txt");
  128 + if(ctString::IsEqual(ProyectType,"view",false)) {
  129 + Node.SetTemplate(Path+"coolbot/coolbot_view.template",
  130 + "/"+DirName+".coolbot-view");
  131 + } else if(ctString::IsEqual(ProyectType,"packets",false)) {
  132 + Node.SetTemplate(Path+"coolbot/coolbot_packets.template",
  133 + "/"+DirName+".coolbot-packets");
  134 + } else if(ctString::IsEqual(ProyectType,"component",false)) {
  135 + Node.SetTemplate(Path+"coolbot/coolbot_component.template",
  136 + "/"+DirName+".coolbot-component");
  137 + }
222 138 }
223   - Node.SetTemplate(Path+"coolbot/coolbot_integration.template",
224   - "integrations/"+DirName+".coolbot-integration");
225   - IsApplication=true;
226 139 }
227 140  
228   - if(!IsModule){
  141 + if(GeneratesGNUFiles) {
229 142 IsOk=Node.CreateDirectoryStructure()&&Node.CreateGNUFiles(DirName);
230 143 } else {
231 144 IsOk=Node.CreateDirectoryStructure();
... ... @@ -233,106 +146,81 @@ bool cblBundle::Generate(const std::string&amp; DirName,
233 146  
234 147 if(IsOk) {
235 148 std::string Template;
236   - std::string TemplateSettings;
237   - std::string TemplateTargets;
238   - std::string TemplateDisplay;
239 149 std::string InputFileName;
240 150 std::string OutputFileName;
241 151  
242   - if(!IsModule){
243   - if(IsComponent) {
244   - TemplateSettings=ctTemplate::Load(ctString::ConvertSlash(Path+"cmake/CMakeLists-setting-lib.template"));
245   - TemplateTargets=ctTemplate::Load(ctString::ConvertSlash(Path+"cmake/CMakeLists-target-example-lib.template"));
246   - TemplateDisplay=ctTemplate::Load(ctString::ConvertSlash(Path+"cmake/CMakeLists-displaysetting-lib.template"));
247   - } else if(IsIntegration) {
248   - TemplateSettings=ctTemplate::Load(ctString::ConvertSlash(Path+"cmake/CMakeLists-setting-exe.template"));
249   - TemplateTargets=ctTemplate::Load(ctString::ConvertSlash(Path+"cmake/CMakeLists-target-exe.template"));
250   - TemplateDisplay=ctTemplate::Load(ctString::ConvertSlash(Path+"cmake/CMakeLists-displaysetting-exe"));
251   - } else if(IsPackets) {
252   - TemplateSettings=ctTemplate::Load(ctString::ConvertSlash(Path+"cmake/CMakeLists-setting-lib.template"));
253   - TemplateTargets=ctTemplate::Load(ctString::ConvertSlash(Path+"cmake/CMakeLists-target-lib.template"));
254   - TemplateDisplay=ctTemplate::Load(ctString::ConvertSlash(Path+"cmake/CMakeLists-displaysetting-lib.template"));
255   - } else if(IsView) {
256   - TemplateSettings=ctTemplate::Load(ctString::ConvertSlash(Path+"cmake/CMakeLists-setting-lib.template"));
257   - TemplateTargets=ctTemplate::Load(ctString::ConvertSlash(Path+"cmake/CMakeLists-target-lib.template"));
258   - TemplateDisplay=ctTemplate::Load(ctString::ConvertSlash(Path+"cmake/CMakeLists-displaysetting-lib.template"));
259   - } else if(IsApplication) {
260   - TemplateSettings=ctTemplate::Load(ctString::ConvertSlash(Path+"cmake/CMakeLists-setting-exe.template"));
261   - TemplateTargets=ctTemplate::Load(ctString::ConvertSlash(Path+"cmake/CMakeLists-target-exe.template"));
262   - TemplateDisplay=ctTemplate::Load(ctString::ConvertSlash(Path+"cmake/CMakeLists-displaysetting-exe.template"));
263   - }
264   - if( (TemplateSettings!="")&&
265   - (TemplateTargets!="") &&
266   - (TemplateDisplay!="") ) {
267   - TemplateSettings=ctString::Replace(TemplateSettings,
268   - "@PROJECTNAME@",
269   - DLName);
270   - TemplateTargets=ctString::Replace(TemplateTargets,
271   - "@PROJECTNAME@",
272   - DLName);
273   - TemplateDisplay=ctString::Replace(TemplateDisplay,
274   - "@PROJECTNAME@",
275   - DLName);
276   - IsOk=true;
  152 + Node.Begin(MODE_TEMPLATE);
  153 + while(!Node.IsEnd(MODE_TEMPLATE)) {
  154 + InputFileName=ctString::ConvertSlash(Node.GetTemplate());
  155 + OutputFileName=ctString::ConvertSlash(DirName+"/"+Node.GetOutputFileName());
  156 +
  157 + Template=ctTemplate::Load(InputFileName);
  158 + if(Template!="") {
  159 + Template=ctString::Replace(Template,
  160 + "@VERSION@",
  161 + COOLBOT_BUNDLE_VERSION);
  162 + Template=ctString::Replace(Template,
  163 + "@FILENAME@",
  164 + DirName);
  165 + if( (IsIntegration) &&
  166 + (InputFileName==ctString::ConvertSlash(Path+"coolbot/coolbot_integration.template")) ) {
  167 + if(ctString::MustNormalize(DirName)) {
  168 + DLName=ctString::Normalize(DirName);
  169 + Msg="The name of integration has to be normalized: "
  170 + +DirName+" --> "+DLName;
  171 + SHOW_WARNING(Msg);
  172 + }
  173 + } else {
  174 + DLName=ctString::Normalize(ProyectName);
  175 + }
  176 + Template=ctString::Replace(Template,
  177 + "@DLNAME@",
  178 + DLName);
  179 + Template=ctString::Replace(Template,
  180 + "@PROJECTNAME@",
  181 + DirName);
  182 + Template=ctString::Replace(Template,
  183 + "@PROJECTNAME_UPPER@",
  184 + ctString::Upper(ctString::Normalize(DirName)));
  185 + Template=ctString::Replace(Template,
  186 + "@DATE@",
  187 + ctString::GetDate());
  188 + Template=ctString::Replace(Template,
  189 + "@PROJECTDIRECTORY@",
  190 + DirName);
  191 +
  192 + if(!Node.CreateFile(OutputFileName,Template)) {
  193 + Result=false;
  194 + break;
  195 + } else {
  196 + Result=true;
  197 + }
277 198 } else {
278   - Msg="I could not read a template about CMake section(setting or target or display).";
  199 + Msg="Can not read the file: "+ctString::ConvertSlash(OutputFileName);
279 200 SHOW_ERROR(Msg);
280   - IsOk=false;
281 201 Result=false;
  202 + break;
282 203 }
  204 + Node.Next(MODE_TEMPLATE);
283 205 }
284 206  
285   - if(IsOk) {
286   - Node.Begin(MODE_TEMPLATE);
287   - while(!Node.IsEnd(MODE_TEMPLATE)) {
288   - InputFileName=ctString::ConvertSlash(Node.GetTemplate());
289   - OutputFileName=ctString::ConvertSlash(DirName+"/"+Node.GetOutputFileName());
290   -
291   - Template=ctTemplate::Load(InputFileName);
292   - if(Template!="") {
293   - Template=ctString::Replace(Template,
294   - "@VERSION@",
295   - COOLBOT_BUNDLE_VERSION);
296   - Template=ctString::Replace(Template,
297   - "@FILENAME@",
298   - DirName);
299   - Template=ctString::Replace(Template,
300   - "@DLNAME@",
301   - DLName);
302   - Template=ctString::Replace(Template,
303   - "@PROJECTNAME@",
304   - DirName);
305   - Template=ctString::Replace(Template,
306   - "@DATE@",
307   - ctString::GetDate());
308   - Template=ctString::Replace(Template,
309   - "@PROJECTDIRECTORY@",
310   - DirName);
311   - Template=ctString::Replace(Template,
312   - "@PROJECTSETTINGS@",
313   - TemplateSettings);
314   - Template=ctString::Replace(Template,
315   - "@PROJECTTARGETS@",
316   - TemplateTargets);
317   - Template=ctString::Replace(Template,
318   - "@DISPLAYPROJECTSETTINGS@",
319   - TemplateDisplay);
320   -
321   - if(!Node.CreateFile(OutputFileName,Template)) {
322   - Result=false;
323   - break;
324   - } else {
325   - Result=true;
326   - }
327   - } else {
328   - Msg="Can not read the file: "+ctString::ConvertSlash(OutputFileName);
329   - SHOW_ERROR(Msg);
  207 + if( (Result) && (IsModule) ) {
  208 + Template=ctTemplate::Load(ctString::ConvertSlash("./cmake/include_targets.cmake"));
  209 + OutputFileName=ctString::ConvertSlash("./cmake/include_targets.cmake");
  210 + Msg="The target could not be added in the file: "+OutputFileName;
  211 + if(Template!="") {
  212 + Template="ADD_SUBDIRECTORY(${PROJECT_SOURCE_DIR}/"+DirName+")\n";
  213 + if(!Node.CreateFile(OutputFileName,Template,true)) {
330 214 Result=false;
331   - break;
  215 + SHOW_WARNING(Msg);
  216 + } else {
  217 + Result=true;
332 218 }
333   - Node.Next(MODE_TEMPLATE);
  219 + } else {
  220 + SHOW_WARNING(Msg);
334 221 }
335 222 }
  223 +
336 224 }
337 225  
338 226 return Result;
... ...
coolbot-bundle/src/cblBundle.h
... ... @@ -58,13 +58,11 @@ public:
58 58 ** @param DirName the root directory name
59 59 ** @param ProyectName the proyect name(related with the descriptive language)
60 60 ** @param ProyectType the proyect type(component, integration,...)
61   - ** @param IsModule Determines if it's generates a subspace of workspace
62 61 ** @return Returns true if the process runs correctly.
63 62 **/
64 63 static bool Generate(const std::string& DirName,
65 64 const std::string& ProyectName,
66   - const std::string& ProyectType,
67   - bool IsModule=false);
  65 + const std::string& ProyectType);
68 66  
69 67 /**
70 68 ** Generates a CoolBOT descriptive file in Description Language.
... ...
coolbot-bundle/src/cblMain.cpp
... ... @@ -44,6 +44,7 @@
44 44  
45 45 #include "cblBundle.h"
46 46 #include "ctConfig.h"
  47 +#include <ctString.h>
47 48  
48 49 #include <iostream>
49 50 #include <cstdlib>
... ... @@ -133,10 +134,14 @@
133 134 static std::string Commads[][2]=
134 135 {
135 136 {
136   - "-h, -H, -help, /?, -usage, --help",
  137 + "-h, -H, -help, /?, --help",
137 138 "Show this output and exit."
138 139 },
139 140 {
  141 + "-usage, --usage",
  142 + "Show brief usage message and exit."
  143 + },
  144 + {
140 145 "-V, -version, --version",
141 146 "Display the version number and exit."
142 147 },
... ... @@ -153,8 +158,8 @@ static std::string Commads[][2]=
153 158 "Prints the directory that contains the resources and exit."
154 159 },
155 160 {
156   - "-c, --create, --create-workspace",
157   - "Creates the workspace specified by user."
  161 + "-c, --create, --create-bundle",
  162 + "Creates the bundle specified by user."
158 163 },
159 164 {
160 165 "-dirname, --dirname, --directory-name",
... ... @@ -163,17 +168,9 @@ static std::string Commads[][2]=
163 168 {
164 169 "-name, --name",
165 170 "Specifies the name of project."
166   - },
167   - {
168   - "-module, --module",
169   - "Creates a subspace of workspace."
170   - },
171   - {
172   - "-dl, -create-dl, --create-dl-file",
173   - "Creates a CoolBOT description file based on the workspaces available and exit."
174 171 }
175 172 };
176   -static unsigned char NumCommads=10;
  173 +static unsigned char NumCommads=9;
177 174  
178 175 /**
179 176 ** Workspaces available in coolbot-bundle tools.
... ... @@ -197,8 +194,8 @@ static std::string WorkspacesAvailable[][2]=
197 194 "Creates workspaces for programming CoolBOT components."
198 195 },
199 196 {
200   - "application",
201   - "Creates workspaces for programming CoolBOT application."
  197 + "bundle",
  198 + "Creates workspaces for programming CoolBOT bundle."
202 199 }
203 200 };
204 201 static unsigned char NumWorkspacesAvailable=5;
... ... @@ -221,18 +218,49 @@ bool FindWorkSpace(const std::string&amp; Name)
221 218 } // FindWorkSpace
222 219  
223 220 /**
  221 + ** Show brief usage message.
  222 + **/
  223 +void ShowUSAGE(void)
  224 +{
  225 + std::string Output="";
  226 + unsigned char Counter=1;
  227 + unsigned char First=1;
  228 +
  229 + std::cout<<"Usage: coolbot-bundle";
  230 + for(int k=0; k<(NumCommads-3); k++) {
  231 + Output+=" ["+ctString::Replace(Commads[k][0],","," |")+"]";
  232 + if( (Counter==2) || (k==(NumCommads-1)) ) {
  233 + if(First==1) {
  234 + std::cout<<Output<<std::endl;
  235 + First++;
  236 + } else {
  237 + std::cout<<" "<<Output<<std::endl;
  238 + }
  239 + Output="";
  240 + Counter=0;
  241 + }
  242 + Counter++;
  243 + }
  244 + std::cout<<" [ [-c | --create | --create-workspace] <my-workspace> ]"<<std::endl
  245 + <<" [ [-dirname | --dirname | --directory-name] <directory-name> ]"<<std::endl
  246 + <<" [ [-name | --name] <project-name> ]"<<std::endl
  247 + <<" [ <my-bundle> ]"<<std::endl;
  248 + std::cout<<std::endl;
  249 + std::cout<<"coolbot-bundle creates a workspace to develop a CoolBOT package (bundle). A"<<std::endl;
  250 + std::cout<<"CoolBOT package contains components, views, packets and integrations. Finally,"<<std::endl;
  251 + std::cout<<"CMake is used for the management of the bundle."<<std::endl;
  252 + std::cout<<std::endl;
  253 +} // ShowUSAGE
  254 +
  255 +/**
224 256 ** Show help information about the program.
225 257 **/
226 258 void ShowHelp(void)
227 259 {
228 260 SHOW_HEADER(COOLBOT_BUNDLE_VERSION);
229 261  
230   - std::cout<<"Usage: coolbot-bundle [options]"<<std::endl
231   - <<" [-c | --create | --create-workspace] [workspace]"<<std::endl
232   - <<" [-dirname | --dirname | --directory-name] [directory-name]"<<std::endl
233   - <<" [-name | --name] [project-name]"<<std::endl
234   - <<" [-dl | -create-dl | --create-dl-file workspace coolbot-DL-name coolbot-DL-filename ]"<<std::endl;
235   - std::cout<<std::endl;
  262 + ShowUSAGE();
  263 +
236 264 std::cout<<"Options available:" << std::endl;
237 265 std::cout<<std::endl;
238 266  
... ... @@ -278,13 +306,17 @@ void ShowHelp(void)
278 306 std::cout << std::endl;
279 307 std::cout<<"Examples:"<<std::endl;
280 308 std::cout<<std::endl;
281   - std::cout<<"$ coolbot-bundle application <application-directory-name> <application-name>"<<std::endl;
282   - std::cout<<"$ coolbot-bundle -c integration -dirname <integration-directory-name> -name <integration-name>"<<std::endl;
  309 + std::cout<<"$ coolbot-bundle <my-bundlen-directory-name>"<<std::endl;
  310 + std::cout<<"$ coolbot-bundle bundle <my-bundlen-directory-name>"<<std::endl;
  311 + std::cout<<"$ coolbot-bundle component <component-directory-name> <component-c++-class-name>"<<std::endl;
  312 + std::cout<<"$ coolbot-bundle packets <packets-directory-name> <packets-c++-namespace>"<<std::endl;
  313 + std::cout<<"$ coolbot-bundle view <view-directory-name> <view-c++-class-name>"<<std::endl;
  314 + std::cout<<"$ coolbot-bundle integration <integration-directory-name> "<<std::endl;
  315 + std::cout<<"$ coolbot-bundle --create bundle --directory-name <my-bundlen-directory-name>"<<std::endl;
  316 + std::cout<<"$ coolbot-bundle -c component -dirname <component-directory-name> -name <component-c++-class-name>"<<std::endl;
  317 + std::cout<<"$ coolbot-bundle -c integration -dirname <integration-directory-name>"<<std::endl;
283 318 std::cout<<"$ coolbot-bundle -c view -dirname <view-directory-name> -name <view-c++-class-name>"<<std::endl;
284 319 std::cout<<"$ coolbot-bundle -c packets -dirname <packets-directory-name> -name <packets-c++-namespace>"<<std::endl;
285   - std::cout<<"$ coolbot-bundle -c component -dirname <component-directory-name> -name <component-c++-class-name>"<<std::endl;
286   - std::cout<<"$ coolbot-bundle -c application -dirname <application-directory-name> -name <application-name>"<<std::endl;
287   - std::cout<<"$ coolbot-bundle -dl component FirstComponent first-component"<<std::endl;
288 320 std::cout << std::endl;
289 321 } // ShowHelp
290 322  
... ... @@ -295,8 +327,7 @@ int main(int argc, char** argv)
295 327 {
296 328 int Result=EXIT_SUCCESS; /* Successful exit status. */
297 329 bool ExitFlag=false;
298   - bool ModuleFlag=false;
299   - std::string DLName="";
  330 + bool IsOk=false;
300 331 std::string WorkSpace="";
301 332 std::string DirName="";
302 333 std::string Name="";
... ... @@ -309,13 +340,18 @@ int main(int argc, char** argv)
309 340 (strcmp(argv[i],"-h")==0) ||
310 341 (strcmp(argv[i],"-H")==0) ||
311 342 (strcmp(argv[i],"-help")==0) ||
312   - (strcmp(argv[i],"/?")==0) ||
313   - (strcmp(argv[i],"-usage")==0) )
  343 + (strcmp(argv[i],"/?")==0) )
314 344 {
315 345 ShowHelp();
316 346 ExitFlag=true;
317 347 break;
318 348 }
  349 + else if( (strcmp(argv[i],"-usage")==0) ||
  350 + (strcmp(argv[i],"--usage")==0) ) {
  351 + ShowUSAGE();
  352 + ExitFlag=true;
  353 + break;
  354 + }
319 355 else if( (strcmp(argv[i],"--version")==0) ||
320 356 (strcmp(argv[i],"-version")==0) ||
321 357 (strcmp(argv[i],"-V")==0) )
... ... @@ -340,7 +376,8 @@ int main(int argc, char** argv)
340 376 }
341 377 else if(strcmp(argv[i],"--print-resourcedir")==0)
342 378 {
343   - SHOW_RESOURCEDIR(RESOURCE_PATH);
  379 + std::string Path=RESOURCE_PATH;
  380 + SHOW_RESOURCEDIR(ctString::ConvertSlash(Path+"coolbot-bundle/"));
344 381 ExitFlag=true;
345 382 break;
346 383 }
... ... @@ -396,36 +433,6 @@ int main(int argc, char** argv)
396 433 i++;
397 434 ExitFlag=false;
398 435 }
399   - }
400   - else if( (strcmp(argv[i],"--module")==0) ||
401   - (strcmp(argv[i],"-module")==0) )
402   - {
403   - ModuleFlag=true;
404   - ExitFlag=false;
405   - }
406   - else if( (strcmp(argv[i],"--create-dl-file")==0) ||
407   - (strcmp(argv[i],"-create-dl")==0) ||
408   - (strcmp(argv[i],"-dl")==0) )
409   - {
410   - CHECK_ARGUMENT(Arg,(i+1),argc,argv); //workspace
411   - CHECK_ARGUMENT(Arg1,(i+2),argc,argv); // dl-namespace
412   - CHECK_ARGUMENT(Arg2,(i+3),argc,argv); // dl-filename
413   -
414   - if( (Arg=="") || (Arg1=="") || (Arg2=="") ||
415   - ((Arg[0]=='-') && (Arg[1]=='-')) ||
416   - (Arg[0]=='-') || (Arg[0]=='/') ||
417   - ((Arg1[0]=='-') && (Arg1[1]=='-')) ||
418   - (Arg1[0]=='-') || (Arg1[0]=='/') ||
419   - ((Arg2[0]=='-') && (Arg2[1]=='-')) ||
420   - (Arg2[0]=='-') || (Arg2[0]=='/') ) {
421   - ShowHelp();
422   - } else {
423   - if(!cblBundle::GenerateDescriptionFile(Arg1,Arg2,Arg)) {
424   - Result=EXIT_FAILURE;
425   - }
426   - }
427   - ExitFlag=true;
428   - break;
429 436 } else {
430 437 std::string Arg=argv[i];
431 438  
... ... @@ -434,7 +441,12 @@ int main(int argc, char** argv)
434 441 ShowHelp();
435 442 ExitFlag=true;
436 443 } else {
437   - if(Counter==1) WorkSpace=Arg;
  444 + if((Counter==1) && ((i+1)==argc)) {
  445 + WorkSpace="bundle";
  446 + DirName=Arg;
  447 + } else {
  448 + if(Counter==1) WorkSpace=Arg;
  449 + }
438 450 if(Counter==2) DirName=Arg;
439 451 if(Counter==3) Name=Arg;
440 452 Counter++;
... ... @@ -448,10 +460,22 @@ int main(int argc, char** argv)
448 460 }
449 461  
450 462 if(!ExitFlag) {
451   - if( ((WorkSpace!="") && (DirName!="") && (Name!="")) &&
452   - FindWorkSpace(WorkSpace)) {
453   - if(!cblBundle::Generate(DirName,Name,WorkSpace,ModuleFlag)) {
454   - Result=EXIT_FAILURE;
  463 + if(FindWorkSpace(WorkSpace)) {
  464 + if(WorkSpace!="bundle") {
  465 + if( (WorkSpace=="integration") && (DirName!="") ) {
  466 + IsOk=true;
  467 + } else if( (WorkSpace!="") && (DirName!="") && (Name!="") ) {
  468 + IsOk=true;
  469 + }
  470 + } else {
  471 + IsOk=true;
  472 + }
  473 + if(IsOk) {
  474 + if(!cblBundle::Generate(DirName,Name,WorkSpace)) {
  475 + Result=EXIT_FAILURE;
  476 + }
  477 + } else {
  478 + ShowHelp();
455 479 }
456 480 } else {
457 481 ShowHelp();
... ...
coolbot-bundle/src/cblResource.cpp
... ... @@ -240,13 +240,22 @@ bool cblResource::CreateEmptyFile(const std::string&amp; FileName)
240 240 return Result;
241 241 } // CreateEmptyFile
242 242  
243   -bool cblResource::CreateFile(const std::string& FileName,const std::string& Value)
  243 +bool cblResource::CreateFile(const std::string& FileName,
  244 + const std::string& Value,
  245 + bool AppendMode)
244 246 {
245 247 bool Result=false;
246 248 ctFile Output;
247 249 std::string Msg="Can not create the file: "+ctString::ConvertSlash(FileName);
  250 + bool IsOk;
248 251  
249   - if(Output.Open(ctString::ConvertSlash(FileName),"w")) {
  252 + if(AppendMode) {
  253 + IsOk=Output.Open(ctString::ConvertSlash(FileName),"a");
  254 + } else {
  255 + IsOk=Output.Open(ctString::ConvertSlash(FileName),"w");
  256 + }
  257 +
  258 + if(IsOk) {
250 259 if(Output.Write(Value,Value.length())) {
251 260 Result=true;
252 261 }
... ...
coolbot-bundle/src/cblResource.h
... ... @@ -224,12 +224,14 @@ public:
224 224  
225 225 /**
226 226 ** Creates a file with the specified content.
227   - ** @param FileName the file name
228   - ** @param Value value to string
  227 + ** @param FileName the file name
  228 + ** @param Value value to string
  229 + ** @param AppendMode if is true, append to a file.
229 230 ** @return Returns true if the file is created with the specified content.
230 231 **/
231   - static bool CreateFile(const std::string& FileName,const std::string& Value);
232   -
  232 + static bool CreateFile(const std::string& FileName,
  233 + const std::string& Value,
  234 + bool AppendMode=false);
233 235 /**
234 236 ** Creates the GNU files(AUTHOR,README,...)
235 237 ** @param DirName the directory name
... ...
coolbot-c/src/ctcCoolbot.cpp
... ... @@ -333,7 +333,8 @@ bool ctcCoolbot::Execute(int argc, char** argv)
333 333 }
334 334 else if(strcmp(argv[i],"--print-resourcedir")==0)
335 335 {
336   - SHOW_RESOURCEDIR(RESOURCE_PATH);
  336 + std::string Path=RESOURCE_PATH;
  337 + SHOW_RESOURCEDIR(ctString::ConvertSlash(Path+"coolbot-c/"));
337 338 FlagExit=true;
338 339 break;
339 340 } else {
... ...
coolbot-config/src/cfgMain.cpp
... ... @@ -372,7 +372,7 @@ int main(int argc, char** argv)
372 372 }
373 373 else if(strcmp(argv[i],"--base-dir")==0)
374 374 {
375   - std::cout<<RESOURCE_PATH<<std::endl;
  375 + std::cout<<INSTALL_PATH<<std::endl;
376 376 break;
377 377 }
378 378 else if(strcmp(argv[i],"--binary-dir")==0)
... ...
coolbot-toolkit/ctConfig.h
... ... @@ -1,78 +0,0 @@
1   -/*
2   - ctConfig.h - The coolbot configuration file.
3   -
4   - Inst. Universitario de Sistemas Inteligentes y Aplicaciones Numéricas
5   - Universidad de Las Palmas de Gran Canaria
6   -
7   - Copyright (C) 2003,2007,2009,2010
8   - Universidad de Las Palmas de Gran Canaria (ULPGC) (<http://www.ulpgc.es>)
9   -
10   - This software is a collective project which has been designed, developed and
11   - written, and is maintained by members, students and collaborators of the División
12   - de Inteligencia Artificial y Sistemas (DIAS) at the Instituto Universitario de
13   - Sistemas Inteligentes y Aplicaciones Numéricas en Ingeniería (SIANI)
14   - (<http://www.siani.es/>), and also of the Departamento de Informática y Sistemas
15   - (DIS) (<http://www.dis.ulpgc.es>) both at ULPGC. The AUTHOR file lists all
16   - developers and contributors.The particular authors of each file are explicitly
17   - specified on each one of them.
18   -
19   - This file is part of the CoolBOT Project.
20   - The CoolBOT Project is free software: you can redistribute it and/or modify
21   - it under the terms of the GNU General Public License as published by
22   - the Free Software Foundation, either version 3 of the License, or any
23   - later version.
24   -
25   - The CoolBOT Project is distributed in the hope that it will be useful,
26   - but WITHOUT ANY WARRANTY; without even the implied warranty of
27   - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28   - GNU General Public License for more details.
29   -
30   - You should have received a copy (COPYING file) of the GNU General Public License
31   - along with the CoolBOT Project . If not, see <http://www.gnu.org/licenses/>.
32   -
33   - In addition to the GNU General Public License, the CoolBOT Project Compiler License
34   - Exception is applicable to the C++ skeletons generated by the CoolBOT Compiler
35   - (coolbot-c). The purpose of this Exception is to allow distribution of CoolBOT
36   - Compiler's (coolbot-c) typical output under terms of the recipient's choice
37   - (including proprietary). You should have received a copy of the CoolBOT Project
38   - Compiler License Exception (COPYING.EXCEPTION file) along with the CoolBOT Project.
39   - If not see <http://www.coolbotproject.org>.
40   -*/
41   -
42   -#ifndef __ctConfig_h
43   -#define __ctConfig_h
44   -
45   -#define MODE 1 // Production mode
46   -#define COOLBOT_FRAMEWORK_VERSION "1.0.0"
47   -#define COOLBOT_C_VERSION "1.9.0"
48   -#define COOLBOT_BUNDLE_VERSION "1.0.0"
49   -#define COOLBOT_CONFIG_VERSION "1.0.0"
50   -
51   -#define __UNIX__
52   -
53   -/*
54   - * Information about CoolBOT installation
55   - */
56   -#define INSTALL_PATH "/usr/share/coolbot-project"
57   -#define RESOURCE_PATH "/usr/share/coolbot-project/resources/"
58   -#define PKGCONFIG_PATH "/usr/local/lib/pkgconfig/"
59   -#define INCLUDE_DIR_PATH "/usr/local/include/coolbot"
60   -#define LIBRARIES_PATH "/usr/local/lib/"
61   -#define BINARIES_PATH "/usr/local/bin/"
62   -
63   -/*
64   - * Information about CoolBOT linker and compiler flags.
65   - */
66   -#define COOLBOT_LINKER_FLAGS "-DCOOLBOT_IN_LINUX -pthread -DACE_AS_STATIC_LIBS -L/usr/local/lib -L/usr/lib64 -lcoolbot -lACE -ldl -lpthread -lrt"
67   -#define COOLBOT_COMPILER_FLAGS "-DCOOLBOT_IN_LINUX"
68   -#define COOLBOT_CFLAGS_FLAGS "-DCOOLBOT_IN_LINUX -I/usr/local/coolbot -I/usr/include/ace"
69   -#define COOLBOT_CFLAGS_ONLY_I "-I/usr/local/coolbot -I/usr/include/ace"
70   -/*
71   - * Information about development
72   - */
73   -#define COMPILER "GNU gcc"
74   -#define ARCHITECTURE "x86_64"
75   -#define SYSTEM_NAME "Linux-3.0.0-12-generic"
76   -#define COMPILATION_DATE "06/11/2011"
77   -
78   -#endif ///__ctConfig_h
coolbot-toolkit/ctString.cpp
... ... @@ -189,6 +189,19 @@ std::string ctString::Normalize(const std::string &amp;Name)
189 189 return Result;
190 190 } // Normalize
191 191  
  192 +bool ctString::MustNormalize(const std::string& Name)
  193 +{
  194 + bool Result=false;
  195 + size_t PosA=Name.find_first_of('-');
  196 + size_t PosB=Name.find_first_of('.');
  197 +
  198 + if( (PosA!=std::string::npos) || (PosB!=std::string::npos) ) {
  199 + Result=true;
  200 + }
  201 +
  202 + return Result;
  203 +} // MustNormalize
  204 +
192 205 std::string ctString::GetSlash(void)
193 206 {
194 207 #ifdef __UNIX__
... ...
coolbot-toolkit/ctString.h
... ... @@ -147,6 +147,13 @@ public:
147 147 static std::string Normalize(const std::string &Name);
148 148  
149 149 /**
  150 + ** Determines if the name has to be normalized(change "." and "-" by "_").
  151 + ** @param Name the name to normalize
  152 + ** @return Returns true if the name has to be normalized
  153 + **/
  154 + static bool MustNormalize(const std::string& Name);
  155 +
  156 + /**
150 157 ** Gets the slash("\" for MS-Windows and "/" for GNU/Unix).
151 158 ** @return the slash
152 159 **/
... ...
coolbot/CMakeLists.txt
... ... @@ -303,9 +303,9 @@ MESSAGE(STATUS &quot; * Flags(compiler): ${COOLBOT_COMPILER_FLAGS}&quot;)
303 303  
304 304 SET(COMPILER_FLAGS "${COOLBOT_COMPILER_FLAGS}" CACHE PATH "CoolBOT compiler flags" FORCE)
305 305  
306   -INCLUDE_DIRECTORIES(${COOLBOT_INCLUDE_DIR} ${ACE_INCLUDE_DIRS})
  306 +INCLUDE_DIRECTORIES(${COOLBOT_INCLUDE_DIR} ${ACE_INCLUDE_DIRS} ${GTK_INCLUDE_DIR})
307 307 ADD_LIBRARY(coolbot ${COOLBOT_SRCS})
308   -TARGET_LINK_LIBRARIES(coolbot ${ACE_LIBRARIES})
  308 +TARGET_LINK_LIBRARIES(coolbot ${ACE_LIBRARIES} ${GTK_LIBRARIES})
309 309 SET_TARGET_PROPERTIES(coolbot PROPERTIES
310 310 LINK_FLAGS "${COOLBOT_LINKER_FLAGS} ${ACE_LINKER_FLAGS}"
311 311 COMPILE_FLAGS "${COOLBOT_COMPILER_FLAGS}"
... ... @@ -321,12 +321,17 @@ ENDIF( WIN32 )
321 321 REGISTER_NEW_TARGET("coolbot")
322 322 MESSAGE(STATUS " * Created coolbot target")
323 323  
  324 +SET(COOLBOT_PKGCONFIG_REQUIRE "ACE")
  325 +IF(GTK_FOUND)
  326 + SET(COOLBOT_PKGCONFIG_REQUIRE "${COOLBOT_PKGCONFIG_REQUIRE}, gtk+-2.0")
  327 +ENDIF(GTK_FOUND)
  328 +
324 329 CREATE_PKGCONFIG_FILE("${COOLBOT_INSTALL_PATH}"
325 330 "coolbot"
326 331 "coolbot"
327 332 "The CoolBOT project."
328 333 "${VERSION}"
329   - "ACE"
  334 + "${COOLBOT_PKGCONFIG_REQUIRE}"
330 335 "${COOLBOT_LINKER_FLAGS} ${ACE_LINKER_FLAGS}"
331 336 "${PKG_CONFIG_PATH_DIRECTORY}"
332 337 "${PROJECT_SOURCE_DIR}/cmake/pkg_config.pc.in")
... ...
resources/coolbot-bundle/cmake/CMakeLists-module-exe.template
... ... @@ -30,14 +30,31 @@
30 30 #=============================================================================
31 31 MESSAGE(STATUS "Generating @PROJECTNAME@ target")
32 32  
  33 +#
  34 +# NOTE: In the directory cmake you have a file called include_targets.cmake.
  35 +# Check to see that in this file, you have the following entry:
  36 +#
  37 +# ADD_SUBDIRECTORY(${PROJECT_SOURCE_DIR}/@PROJECTDIRECTORY@)
  38 +#
  39 +# In the event that the entry is not available, add the line in this file or in
  40 +# the main CMakeLists.txt file.
  41 +#
  42 +
  43 +SET(MAJOR 1)
  44 +SET(MINOR 0)
  45 +SET(REVISION 0)
  46 +SET(@PROJECTNAME_UPPER@_VERSION "${MAJOR}.${MINOR}.${REVISION}" CACHE STRING "project version")
  47 +
  48 +MESSAGE(STATUS " * Version: ${@PROJECTNAME_UPPER@_VERSION}")