[CMake] CMake and create/install additional files

David Cole david.cole at kitware.com
Wed Oct 31 10:24:28 EDT 2007


Try this:
ADD_CUSTOM_TARGET(BuildDeMo ALL
  DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/de.mo"
)

The custom target will build when "all" builds or when you build it
specifically. The fact that it depends on the output of the custom
command will cause the custom command to build whenever the target
builds...

HTH,
David

On 10/31/07, Stefan Achatz <stefan_achatz at web.de> wrote:
> 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
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>


More information about the CMake mailing list