Re: [CMake] add_custom_command, POST_BUILD

2016-06-02 Thread iosif neitzke
On Thu, Jun 2, 2016 at 2:43 PM, Chuck Atkins wrote: > Could you just make the tests run in the post-build of the test? > > add_library(Foo Foo.cxx) > > add_executable(FooTest FooTest.cxx) > target_link_libraries(FooTest Foo) > > add_custom_command(TARGET FooTest POST_BUILD > COMMAND $ $ > ) > >

Re: [CMake] add_custom_command, POST_BUILD

2016-06-02 Thread Chuck Atkins
Could you just make the tests run in the post-build of the test? add_library(Foo Foo.cxx) add_executable(FooTest FooTest.cxx) target_link_libraries(FooTest Foo) add_custom_command(TARGET FooTest POST_BUILD COMMAND $ $ ) That way the the test is run as part of it's build. - Chuck On Wed, Ju

Re: [CMake] add_custom_command, POST_BUILD

2016-06-02 Thread Vladimir Chebotarev
Hi. The reason is to make build to fail as soon as possible if core library doesn't work properly. In C++ world that could be critical as hell because building process can last hours even on 32 cores. And it will make CMake more ecological tool as it will reduce the energy wasted. :) On Jun 1

Re: [CMake] add_custom_command, POST_BUILD

2016-06-01 Thread Magnus Therning
Vladimir Chebotarev writes: > Hi there. > > At the moment one can add a command executing after a build of a target > using: > add_custom_command(... POST_BUILD...) > > However if the command have a dependencies which build after the target, > there is practically no way to specify it. > > Simpl

[CMake] add_custom_command, POST_BUILD

2016-06-01 Thread Vladimir Chebotarev
Hi there. At the moment one can add a command executing after a build of a target using: add_custom_command(... POST_BUILD...) However if the command have a dependencies which build after the target, there is practically no way to specify it. Simple case: we have a library and tests for it. E.g.