<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16809" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=641473115-02032009><FONT face=Arial color=#0000ff size=2>Hi
Eric,</FONT></SPAN></DIV>
<DIV><SPAN class=641473115-02032009><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=641473115-02032009><FONT face=Arial color=#0000ff size=2>genrb
does not create libraries to link against, but binary resource files that will
be loaded by an application using ICU at runtime.</FONT></SPAN></DIV>
<DIV><SPAN class=641473115-02032009><FONT face=Arial color=#0000ff size=2>Here's
an example how we are using genrb in our project:</FONT></SPAN></DIV>
<DIV><SPAN class=641473115-02032009><FONT face=Arial><BR><FONT
face="Courier New" color=#0000ff size=2>macro(IcuResources
Encoding)<BR> set(${CurrPkg}_resdir
${CMAKE_INSTALL_PREFIX}/lang/${CurrPkg})</FONT></DIV>
<DIV><FONT face="Courier New" color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face="Courier New" color=#0000ff size=2>
file(MAKE_DIRECTORY ${${CurrPkg}_resdir})<BR> <BR>
foreach(Locale ${ARGN})<BR>
set(${CurrPkg}_${Locale}_res
${${CurrPkg}_resdir}/${Locale}.res)<BR>
<BR> add_custom_command(OUTPUT
${${CurrPkg}_${Locale}_res}<BR>
COMMAND ${ICU_GENRB} -d${${CurrPkg}_resdir} -k -e ${Encoding}
${CMAKE_SOURCE_DIR}/${CurrPkg}/${Locale}.txt<BR>
MAIN_DEPENDENCY
${CMAKE_SOURCE_DIR}/${CurrPkg}/${Locale}.txt<BR>
VERBATIM)</FONT></DIV>
<DIV><FONT face="Courier New" color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face="Courier New" color=#0000ff
size=2> list(APPEND
${CurrPkg}_ICU_resources<BR>
${${CurrPkg}_${Locale}_res})<BR> endforeach(Locale)<BR></FONT><FONT
face="Courier New" color=#0000ff size=2>endmacro(IcuResources)<BR></FONT></DIV>
<DIV><FONT><SPAN class=641473115-02032009><FONT color=#0000ff size=2>Our
software consists of several packages, each of which uses its own set of ICU
resources. The name of the current package is contained in the <FONT
face="Courier New">CurrPkg</FONT> variable.</FONT></SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2><SPAN class=641473115-02032009><FONT
face="Courier New">ICU_GENRB</FONT> contains the full path of the genrb
utility.</SPAN></FONT></DIV>
<DIV><FONT><SPAN class=641473115-02032009><FONT color=#0000ff size=2>An example
call of this macro would be:</FONT></SPAN></FONT></DIV>
<DIV><FONT><SPAN class=641473115-02032009><FONT color=#0000ff
size=2></FONT></SPAN></FONT> </DIV>
<DIV><FONT><SPAN class=641473115-02032009><FONT face="Courier New" color=#0000ff
size=2>IcuResources(cp1252 root de)</FONT></SPAN></FONT></DIV>
<DIV><FONT><SPAN class=641473115-02032009><FONT color=#0000ff
size=2></FONT></SPAN></FONT> </DIV>
<DIV><FONT><SPAN class=641473115-02032009><FONT color=#0000ff size=2>This would
compile the source files <FONT face="Courier New">root.txt</FONT> (for the root
locale, usually English) and <FONT face="Courier New">de.txt</FONT> (for the
German locale). Both source files are assumed to be encoded in
cp1252.</FONT></SPAN></FONT></DIV>
<DIV><FONT><SPAN class=641473115-02032009><FONT color=#0000ff size=2>The output
files would be <FONT face="Courier New">root.res</FONT> and <FONT
face="Courier New">de.res</FONT>.</FONT></SPAN></FONT></DIV>
<DIV><FONT><SPAN class=641473115-02032009><FONT color=#0000ff size=2>For more
information and examples, see the file "ResourceManagement.html" in the ICU User
Guide.</FONT></SPAN></FONT></DIV>
<DIV><FONT><SPAN class=641473115-02032009><FONT color=#0000ff
size=2></FONT></SPAN></FONT> </DIV>
<DIV><FONT><SPAN class=641473115-02032009><FONT color=#0000ff size=2>Best
regards,</FONT></SPAN></FONT></DIV>
<DIV><FONT><SPAN class=641473115-02032009><FONT color=#0000ff
size=2></FONT></SPAN></FONT> </DIV>
<DIV><FONT><SPAN class=641473115-02032009><FONT color=#0000ff
size=2>Gerhard</FONT></SPAN></DIV></FONT></FONT></SPAN>
<BLOCKQUOTE>
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Ursprüngliche Nachricht-----<BR><B>Von:</B>
cmake-bounces@cmake.org [mailto:cmake-bounces@cmake.org]<B>Im Auftrag von
</B>E. Wing<BR><B>Gesendet:</B> Samstag, 28. Februar 2009 01:30<BR><B>An:</B>
cmake@cmake.org<BR><B>Betreff:</B> [CMake] Any experiences with ICU
genrb?<BR><BR></FONT></DIV>Anybody out there know anything about ICU and
genrb? I need to convert a build system that uses genrb.<BR><BR>As I
understand it, genrb is a tool that creates a static library from some input
and you are supposed to link against it.<BR><BR>So I have 2 different
questions about this.<BR><BR>1) Using CMake, what is the correct way to set
this up?<BR>I assume I will need ADD_CUSTOM_COMMAND with OUTPUT. Do I just use
TARGET_LINK_LIBRARIES with the output that it provides?<BR><BR>2) Is this
genrb tool actually cross-platform and going to handle all the different
compilers? For example, will it generate the correct output that both gcc and
Visual Studio can handle? Does it be used to generate Universal Binaries on
the Mac? If neither of these things are true, do people have alternative ways
of accomplishing what genrb does in a truly cross-platform
way?<BR><BR>Thanks,<BR>Eric<BR><BR><BR><BR></BLOCKQUOTE></BODY></HTML>