Hello,

I'm trying to build GTK-Qt-Engine 1.1, which use CMake as build system, but it 
fails almost halfway through with the following message:
[ 44%] Generating ../../po/bg.gmo
/System/Links/Executables/msgfmt: error while opening "bg.po" for reading: No 
such file or directory

(part of) the directory structure is as follows:
gtk-qt-engine/po
gtk-qt-engine/po/bg.po
[...]
gtk-qt-engine/po/tr.po
gtk-qt-engine/po/CMakeLists.txt
gtk-qt-engine/po/gtkqtengine.pot

gtk-qt-engine/_build/po
gtk-qt-engine/_build/po/Makefile
gtk-qt-engine/_build/po/cmake_install.cmake
gtk-qt-engine/_build/po/CMakeFiles/progress.make
gtk-qt-engine/_build/po/CMakeFiles/CMakeDirectoryInformation.cmake
gtk-qt-engine/_build/po/CMakeFiles/pofiles.dir/progress.make
gtk-qt-engine/_build/po/CMakeFiles/pofiles.dir/cmake_clean.cmake
gtk-qt-engine/_build/po/CMakeFiles/pofiles.dir/build.make
gtk-qt-engine/_build/po/CMakeFiles/extract_messages.dir/progress.make
gtk-qt-engine/_build/po/CMakeFiles/extract_messages.dir/cmake_clean.cmake
gtk-qt-engine/_build/po/CMakeFiles/extract_messages.dir/build.make

where _build is the build directory.

As I have understood CMake build.make files are generated from CMakeLists.txt 
and I could find the following extract in pofiles.dir/build.cmake (one for each 
po file):
../po/bg.gmo: ../po/bg.po
         $(CMAKE_COMMAND) -E cmake_progress_report 
/Files/Compile/Sources/gtk-qt-engine/_build/CMakeFiles $(CMAKE_PROGRESS_1)
         @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --blue --bold 
"Generating ../../po/bg.gmo"
         cd /Files/Compile/Sources/gtk-qt-engine/_build/po && 
/System/Links/Executables/msgfmt -o bg.gmo bg.po

That would correspond to the following rules in CMakeLists.txt:
FILE(GLOB _pofiles *.po)

FOREACH(_file ${_pofiles})
         GET_FILENAME_COMPONENT(_file_we ${_file} NAME_WE)
         SET(_out "${_file_we}.gmo")
         SET(_in "${_file_we}.po")

         ADD_CUSTOM_COMMAND(
                 OUTPUT ${_out}
                 COMMAND ${MSGFMT_EXECUTABLE} -o ${_out} ${_in}
                 DEPENDS ${_in}
         )

         INSTALL(
                 FILES ${_out}
                 DESTINATION share/locale/${_file_we}/LC_MESSAGES/
                 RENAME gtkqtengine.mo
         )

         SET(_outputs ${_outputs} ${_out})
ENDFOREACH(_file)

My question is what should be expected from ADD_CUSTOM_COMMAND here? I can see 
that OUTPUT and DEPENDS get relative paths the the po file while COMMAND does 
not. On the other hand COMMAND is prefixed with "cd <some path>", so should 
that path be where the po files really are, i.e. 
/Files/Compile/Sources/gtk-qt-engine/po (or ../../po)?. What is the expected 
behaviour? Is the CMakeLists.txt badly written or is it a bug?

-- 
/Jonas

PS. I've attached gtk-qt-engine/po/CMakeLists.txt and 
gtk-qt-engine/_build/po/CMakeFiles/pofiles.dir/build.make
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

Attachment: build.make
Description: Binary data

# .po to .gmo stuff
FILE(GLOB _pofiles *.po)

FOREACH(_file ${_pofiles})
        GET_FILENAME_COMPONENT(_file_we ${_file} NAME_WE)
        SET(_out "${_file_we}.gmo")
        SET(_in "${_file_we}.po")
        
        ADD_CUSTOM_COMMAND(
                OUTPUT ${_out}
                COMMAND ${MSGFMT_EXECUTABLE} -o ${_out} ${_in}
                DEPENDS ${_in}
        )
        
        INSTALL(
                FILES ${_out}
                DESTINATION share/locale/${_file_we}/LC_MESSAGES/
                RENAME gtkqtengine.mo
        )
        
        SET(_outputs ${_outputs} ${_out})
ENDFOREACH(_file)

ADD_CUSTOM_TARGET(
        pofiles ALL
        DEPENDS ${_outputs}
)


# Stuff to generate the .pot
FILE(GLOB POT_UIFILES ../kcm_gtk/*.ui)
SET(POT_SOURCES ../kcm_gtk/kcmgtk.cpp)
SET(POT_OUTPUT gtkqtengine.pot)

ADD_CUSTOM_COMMAND(
        OUTPUT _${POT_OUTPUT}
        COMMAND ${EXTRACTRC_PATH} ${POT_UIFILES} > rc.cpp
        COMMAND ${XGETTEXT_PATH} --foreign-user -C -ci18n -ki18n -ktr2i18n
                -kI18N_NOOP -kI18N_NOOP2 -kaliasLocale -o ${POT_OUTPUT} rc.cpp 
${POT_SOURCES}
        COMMAND rm rc.cpp
)

ADD_CUSTOM_TARGET(
        extract_messages
        DEPENDS _${POT_OUTPUT}
)
_______________________________________________
CMake mailing list
[email protected]
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to