List:Commits« Previous MessageNext Message »
From:Vladislav Vaintroub Date:January 21 2011 9:56pm
Subject:RE: bzr commit into mysql-5.5-bugteam branch (joerg:3209) Bug#42969
View as plain text  
Hi Joerg,

> -----Original Message-----
> From: Joerg Bruehe [mailto:joerg@stripped]
> Sent: Freitag, 21. Januar 2011 21:40
> To: commits@stripped
> Subject: bzr commit into mysql-5.5-bugteam branch (joerg:3209) Bug#42969


> +ADD_CUSTOM_TARGET(VERSION_BIN ALL
> +  COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/version_files.cmake
> +  WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
> +)

A problem with ADD_CUSTOM_TARGET when it is used like this is that it is always rebuilt
(there are no inputs and not outputs , so it
is always considered out-of-date). However there is a way to make it work more like
classic make utility with input and output,
where rebuild is done only if input changes.

How about something like:

ADD_CUSTOM_COMMAND(
   OUTPUT ${CMAKE_BINARY_DIR}/VERSION_bin
   COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/version_files.cmake
   DEPENDS ${CMAKE_BINARY_DIR}/CMakeCache.txt
  )

ADD_CUSTOM_TARGET(VERSION_BIN  ALL  
  DEPENDS ${CMAKE_BINARY_DIR}/VERSION_bin)

Disclaimer: I have not tried that with your patch :)   just took the technique from the
Cmake FAQ (
http://www.cmake.org/Wiki/CMake_FAQ , section "How do I generate an executable, then use
the executable to generate a file? " ) and
applied to your example (your example is simpler, because you do not have to generate an
executable).   I assumed you generate the
VERSION_bin from CMakeCache.txt and there are no other dependencies , at least it seems so
to me.


Thread
bzr commit into mysql-5.5-bugteam branch (joerg:3209) Bug#42969Joerg Bruehe21 Jan
  • RE: bzr commit into mysql-5.5-bugteam branch (joerg:3209) Bug#42969Vladislav Vaintroub21 Jan
    • Re: bzr commit into mysql-5.5-bugteam branch (joerg:3209) Bug#42969Joerg Bruehe22 Jan
      • RE: bzr commit into mysql-5.5-bugteam branch (joerg:3209) Bug#42969Vladislav Vaintroub22 Jan
        • RE: bzr commit into mysql-5.5-bugteam branch (joerg:3209) Bug#42969Vladislav Vaintroub22 Jan
          • Re: bzr commit into mysql-5.5-bugteam branch (joerg:3209) Bug#42969Joerg Bruehe31 Jan
            • RE: bzr commit into mysql-5.5-bugteam branch (joerg:3209) Bug#42969Vladislav Vaintroub31 Jan
              • Re: bzr commit into mysql-5.5-bugteam branch (joerg:3209) Bug#42969Joerg Bruehe31 Jan
        • Re: bzr commit into mysql-5.5-bugteam branch (joerg:3209) Bug#42969Joerg Bruehe25 Jan
          • Re: bzr commit into mysql-5.5-bugteam branch (joerg:3209) Bug#42969Joerg Bruehe26 Jan
          • RE: bzr commit into mysql-5.5-bugteam branch (joerg:3209) Bug#42969Vladislav Vaintroub26 Jan