[CMake] CMake and create/install additional files

Stefan Achatz stefan_achatz at web.de
Wed Oct 31 09:38:19 EDT 2007


Hello,
I'm trying to automate the generation and installation of my gettext object 
files.
This is what I came up with first:

ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/de.mo
    COMMAND msgfmt --output-file=${CMAKE_CURRENT_BINARY_DIR}/de.mo 
${CMAKE_CURRENT_SOURCE_DIR}/de.po
    DEPENDENCIES ${CMAKE_CURRENT_SOURCE_DIR}/de.po
)

INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/de.mo
    DESTINATION ${LOCALE_PATH}/de/LC_MESSAGES
    RENAME foobar.mo
)

The problem is, that de.mo doesn't get built so install can't find it.
I wanted to put these two commands in a foreach loop to work with multiple 
languages.

How do I get ADD_CUSTOM_COMMAND to build de.mo when I call make?

Thanks in advance
Stefan


More information about the CMake mailing list