[cmake-developers] Tests for PRE_BUILD | PRE_LINK | POST_BUILD

James Bigler jamesbigler at gmail.com
Wed Dec 12 13:09:46 EST 2012


Ah, I had some goofy unicode character in my shell that was preventing the
grep search to work properly.

With the correct stuff I see coverage for PRE_BUILD and POST_BUILD, but not
PRE_LINK.  I'm seeing problems with PRE_LINK not working in VS 2010, so I
wanted to see if it was actually being tested.

[5343] Tests $ find . -name "*.cmake" -o -name "CMakeLists.txt" -print0 |
xargs -0 grep -n --color PRE_BUILD
./CMakeLib/CMakeLists.txt:28:    PRE_BUILD COMMAND ${CMAKE_COMMAND} -E
make_directory "${CMAKE_CFG_INTDIR}"
./Complex/Executable/CMakeLists.txt:91:add_custom_command(TARGET complex
PRE_BUILD
./Complex/Executable/CMakeLists.txt:94:add_custom_command(TARGET complex
PRE_BUILD
./Complex/Library/CMakeLists.txt:78:add_custom_command(TARGET
CMakeTestLibraryShared PRE_BUILD
./Complex/Library/CMakeLists.txt:81:add_custom_command(TARGET
CMakeTestLibraryShared PRE_BUILD
./ComplexOneConfig/Executable/CMakeLists.txt:91:add_custom_command(TARGET
complex PRE_BUILD
./ComplexOneConfig/Executable/CMakeLists.txt:94:add_custom_command(TARGET
complex PRE_BUILD
./ComplexOneConfig/Library/CMakeLists.txt:78:add_custom_command(TARGET
CMakeTestLibraryShared PRE_BUILD
./ComplexOneConfig/Library/CMakeLists.txt:81:add_custom_command(TARGET
CMakeTestLibraryShared PRE_BUILD
./CTestTestMemcheck/CMakeLists.txt:13:                       PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CFG_INTDIR}"
./CustomCommand/CMakeLists.txt:113:  TARGET TDocument PRE_BUILD

[5344] Tests $ find . -name "*.cmake" -o -name "CMakeLists.txt" -print0 |
xargs -0 grep -n --color POST_BUILD
./Complex/Executable/CMakeLists.txt:97:add_custom_command(TARGET complex
POST_BUILD
./Complex/Executable/CMakeLists.txt:100:add_custom_command(TARGET complex
POST_BUILD
./Complex/Library/CMakeLists.txt:84:add_custom_command(TARGET
CMakeTestLibraryShared POST_BUILD
./Complex/Library/CMakeLists.txt:87:add_custom_command(TARGET
CMakeTestLibraryShared POST_BUILD
./ComplexOneConfig/Executable/CMakeLists.txt:97:add_custom_command(TARGET
complex POST_BUILD
./ComplexOneConfig/Executable/CMakeLists.txt:100:add_custom_command(TARGET
complex POST_BUILD
./ComplexOneConfig/Library/CMakeLists.txt:84:add_custom_command(TARGET
CMakeTestLibraryShared POST_BUILD
./ComplexOneConfig/Library/CMakeLists.txt:87:add_custom_command(TARGET
CMakeTestLibraryShared POST_BUILD
./CustomCommand/CMakeLists.txt:119:  TARGET TDocument POST_BUILD
./CustomCommand/CMakeLists.txt:204:add_custom_command(TARGET
CustomCommandUsingTargetTest POST_BUILD
./CustomCommand/GeneratorInExtraDir/CMakeLists.txt:7:# add an executable
which will be called from add_custom_command( ... POST_BUILD)
./Jump/Library/Shared/CMakeLists.txt:23:    POST_BUILD COMMAND
${CMAKE_COMMAND} ARGS -E copy
./MakeClean/CMakeLists.txt:46:  POST_BUILD
./SimpleInstall/CMakeLists.txt:385:  POST_BUILD
./SimpleInstallS2/CMakeLists.txt:385:  POST_BUILD
./SubDir/Examples/example1/CMakeLists.txt:5:add_custom_command(TARGET
example1 POST_BUILD
./SubDirSpaces/Some
Examples/example1/CMakeLists.txt:5:add_custom_command(TARGET example1
POST_BUILD

[5345] Tests $ find . -name "*.cmake" -o -name "CMakeLists.txt" -print0 |
xargs -0 grep -n --color PRE_LINK




On Wed, Dec 12, 2012 at 9:32 AM, Brad King <brad.king at kitware.com> wrote:

> On 12/12/2012 11:02 AM, James Bigler wrote:
> > Are there any tests for PRE_BUILD | PRE_LINK | POST_BUILD arguments to
> add_custom_command?  I did a search in the repository, but I'm not seeing
> anything:
> >
> > $ find . -name "*.cmake" -o -name "CMakeLists.txt" -print0 | xargs -0
> grep -n --color PRE_BUILD
> >
> > $ find . -name "*.cmake" -o -name "CMakeLists.txt" -print0 | xargs -0
> grep -n --color PRE_LINK
> >
> > $ find . -name "*.cmake" -o -name "CMakeLists.txt" -print0 | xargs -0
> grep -n --color POST_BUILD
>
> There are mentions of it in the Tests directory:
>
>  $ git grep -l -E '(PRE|POST)_BUILD|PRE_LINK' -- Tests |wc -l
>  22
>
> but I don't know how robustly they are covered.
>
> -Brad
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20121212/3b2cccc6/attachment.html>


More information about the cmake-developers mailing list