[CMake] how to define a target that will be run on request only, and always on install?

Crni Gorac cgorac at gmail.com
Mon Mar 31 09:31:56 EDT 2008


On Mon, Mar 31, 2008 at 8:03 AM, Timenkov Yuri <ytimenkov at parallels.com> wrote:
> You may try to add install(SCRIPT/CODE) command which ensures that
>  translations are built.
>
>  install(code "
>         execute_process(
>                 COMMAND \${CMAKE_MAKE_PROGRAM} translations
>                 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
>         )
>         FILE(INSTALL
>                 DESTINATION translations
>                 TYPE FILE
>                 FILES \"${CMAKE_CURRENT_BINARY_DIR}/foo.trans\")
>  ")
>
>  This may work only on linux / or only with make program.

Seems like nice idea, but - if I understand relevant section (it's
"NOTE:" paragraph at the end of INSTALL command description in CMake
man page) of CMake documentation, there is no guarantee that "make
translations", defined as above, will be executed before installing
"foo.trans" file, right?

Regards.


More information about the CMake mailing list