[CMake] PRE_BUILD custom commands don't appear to be working....

Josef Karthauser joe.karthauser at geomerics.com
Thu Dec 13 13:31:19 EST 2007


I'm trying to add a prebuild custom command to a NMake target, but it
doesn't appear to be running in the right place.

 

Here's an example:

 

 CMakelists.txt:

Project(Hello)

add_library (Hello hello.cxx hello.h)

add_custom_command(TARGET Hello PRE_BUILD

        COMMAND ${CMAKE_COMMAND}

        ARGS -P ${PROJECT_SOURCE_DIR}/Hello.cmake

)

 

  Hello.cmake

                                MESSAGE("Hello.cmake ran")

 

So, I would hope that the Hello.cmake file would get run first, but it
appears to be run as if it is a POST_BUILD.

 

 

$ cmake.exe -G "NMake Makefiles" .

... stuff ..

 

$ nmake

 

Microsoft (R) Program Maintenance Utility Version 8.00.50727.762

Copyright (C) Microsoft Corporation.  All rights reserved.

 

[100%] Building CXX object CMakeFiles/Hello.dir/hello.obj

hello.cxx

Linking CXX static library Hello.lib

Prebuild rule ran

[100%] Built target Hello

 

Joe at HARMONY /c/Devel/SVN/trunk/build/test/qq/Hello

 

Doesn't PRE_BUILD request that that command gets run before the
hello.cxx file gets compiled?

 

Joe

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20071213/cce38988/attachment.html


More information about the CMake mailing list