<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
<br><br>&gt; Date: Tue, 28 Jul 2009 09:20:39 +0200<br>&gt; From: post@hendrik-sattler.de<br>&gt; To: alexisis-pristontale@hotmail.com<br>&gt; CC: cmake@cmake.org<br>&gt; Subject: Re: [CMake] specific target to gettext<br>&gt; <br>&gt; Hi,<br>&gt; <br>&gt; please don't top-post.<br>&gt; <br>&gt; Zitat von alexis lameire &lt;alexisis-pristontale@hotmail.com&gt;:<br>&gt; &gt; grumf :/<br>&gt; &gt; i have try this, can you help me to look what that don't match<br>&gt; &gt; http://pastie.org/561035<br>&gt; &gt;<br>&gt; &gt; he don't compile the po file :/ and i don't found the mo target dependancies<br>&gt; <br>&gt; You do lot's of things wrong there:<br>&gt; include(FindGettext)<br>&gt; find_package(Gettext)<br>&gt; is not correct: delete the include() line.<br>&gt; <br>&gt; link_directories(<br>&gt;        ${USE_gcrypt_LIBRARY}<br>&gt;        ${USE_glib2_LIBRARY}<br>&gt;        ${USE_ircclient_LIBRARY}<br>&gt;        ${SQLITE_LIBRARIES}<br>&gt; )<br>&gt; is most certainly not the right thing to do. It is not possible to  <br>&gt; look into the values of the variables but the probably contain file  <br>&gt; paths not directories. Link_directories() is no necessary if libraries  <br>&gt; are given with full path!<br>&gt; <br>&gt; target_link_libraries(<br>&gt;          d7c<br>&gt;          ${LIBRARIES}<br>&gt;          sqlite3<br>&gt; )<br>&gt; Why are you using "sqlite3" here and not "${SQLITE_LIBRARIES}" from above?<br>&gt; <br>&gt; add_custom_target(<br>&gt;        update_pot<br>&gt;        COMMAND xgettext -d ${package_name} -s -o<br>&gt;          ${package_name}.pot ./src/*.c -p ./po<br>&gt;          --from-code=utf-8 -j<br>&gt;          --keyword=_<br>&gt;          --package-name=${package_name}<br>&gt;          --package-version=${package_version}<br>&gt;          --msgid-bugs-address=${email_report}<br>&gt; )<br>&gt; You are missing the dependency on the source files here. You should  <br>&gt; not list them as src/*.c, instead use the ones from the d7c target.<br>&gt; You should also use full path names (variables for current build and  <br>&gt; current source directory exist) for input and output files. Since you  <br>&gt; create the .pot file on every build, you should not create it in the  <br>&gt; source directory but in the build directory instead. (but see below)<br>&gt; <br>&gt; add_custom_command(<br>&gt;      TARGET update_pot<br>&gt;      COMMAND msgmerge --update ${po_files} ./po/${package_name}.pot<br>&gt;    )<br>&gt; You are missing the dependency on the pot file here.<br>&gt; Additionally, you pollute the source directory with changed files on  <br>&gt; every build :-(<br>&gt; Additionally, msgmerge can only handle _one_ .po file at a time.<br>&gt; You should also use full path names (variables for current build and  <br>&gt; current source directory exist). Same for also all others command.  <br>&gt; (but see below)<br>&gt; <br>&gt; #ajout d'un fichier po<br>&gt; add_custom_target(<br>&gt;    create_po<br>&gt;    COMMAND msginit -l $(LANGUAGE) -o ./po/$(LANGUAGE).po -i  <br>&gt; ./po/${package_name}.pot<br>&gt; )<br>&gt; What if the .po file already exists. You will overwrite in in this  <br>&gt; case: not good. The dependency on the .pot file is missing. (see below)<br>&gt; <br>&gt; <br>&gt; Generally:<br>&gt; 1.<br>&gt; list all files that you use as dependencies to make it work. Else,  <br>&gt; make (not cmake) cannot determine the build order automatically and  <br>&gt; will eventually fail.<br>&gt; <br>&gt; 2.<br>&gt; Don't make it yourself too easy by using file(GLOB ....). That is not  <br>&gt; a good approach. It will give you major pain if you want to e.g.  <br>&gt; exlude some files from the build.<br>&gt; <br>&gt; 3. Don't create the .pot file on every build and don't merge it in the  <br>&gt; .po files as that always needs manual work afterwards. If it doesn't,  <br>&gt; then the two command were no-ops anyway. So: xgettext, msgmerge and  <br>&gt; msginit are a totally separate task that you do not need at  <br>&gt; build-time. Instead, they should be part of the development process,  <br>&gt; not of the build process.<br>&gt; So the only thing left is msgfmt. And that one is easy.<br>&gt; <br>&gt; HS<br>&gt; <br>thenks i have not all understand but i have try this :)<br>http://pastie.org/561548<br>i don't understand the problem of create_pot and update_po target :)<br>i wouldn't this target launch at all :)&nbsp; it's easyeast to me to have this target :) and more proper them a bash script :)<br>at this time the mo file don't created correctly :/ why ?<br><br>i don't understand why pot file pollute the po dir :) it's a source file (genereted automaticily cert but a source file needed to do po file :))<br>i have correct the library_dirrectory and the name of variable :)<br>if you can look again lot thanks for your help<br><br><br><br /><hr />Discutez sur Messenger oł que vous soyez ! <a href='http://www.messengersurvotremobile.com/' target='_new'>Mettez Messenger sur votre mobile !</a></body>
</html>