[CMake] Custom Command Execution

th.tom at gmx.de th.tom at gmx.de
Mon Sep 21 10:59:18 EDT 2009


Hey Eric,

> > Hi,
> >
> > I have the following CMakeLists.txt:
> >
> > ---------
> > cmake_minimum_required(VERSION 2.6)
> > MESSAGE (" CMAKE TEST ")
> >
> > ADD_CUSTOM_COMMAND (TARGET Hello PRE_BUILD
> >                    COMMAND ${CMAKE_COMMAND} -E echo "Prebuild
> execution"
> >                    COMMENT "Information string for prebuild
> execution"
> > )
> >
> > ADD_EXECUTABLE ( Hello abc.cpp )
> > ---------
> >
> > Why is the custom command not executed? Is it meat different?
> 
> >From my testing side (CMake 2.6.4 / Unix Makefile / Linux )
> it looks like you need to put your ADD_CUSTOM_COMMAND definition
> AFTER the ADD_EXECUTABLE statement.
> 
> May be this deserves a bug report since when you write it before it
> behaves as silently ignored.
> 
> Note that on Linux the doc is right:
> 
> "Note that the PRE_BUILD option is only supported on Visual Studio 7 or
>  later.  For all other generators PRE_BUILD will be treated as
>  PRE_LINK."
> 

It works this way round! 

THX - tom
 

BTW: I got flex/bison to run (It was the PATH and a system restart) - thanks for that, too!



More information about the CMake mailing list