[CMake] specific target to gettext

alexis lameire alexisis-pristontale at hotmail.com
Tue Jul 28 09:11:24 EDT 2009




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

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 :))
i have correct the library_dirrectory and the name of variable :)
if you can look again lot thanks for your help



_________________________________________________________________
Téléphonez gratuitement à tous vos proches avec Windows Live Messenger  !  Téléchargez-le maintenant !
http://www.windowslive.fr/messenger/1.asp
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090728/e562f85e/attachment.htm>


More information about the CMake mailing list