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