Re: [CMake] CMake: how to use 'if condition' in command add_custom_command(...)

2016-04-19 Thread Clark Wang
On Tue, Apr 19, 2016 at 4:55 PM, Chaos Zhang wrote: > I have read the description of PRE_BUILD before in CMake doc, but when i > use it, i found something confuesed. > (1) In CMakeLists.txt, the content as below: > > ​(2)After i make the makefile generated by this CMakeLists.txt, i get > result a

Re: [CMake] CMake: how to use 'if condition' in command add_custom_command(...)

2016-04-19 Thread Chaos Zhang
I have read the description of PRE_BUILD before in CMake doc, but when i use it, i found something confuesed. (1) In CMakeLists.txt, the content as below: ​(2)After i make the makefile generated by this CMakeLists.txt, i get result as below: "3_pre_build" is behind "1_pre_link", if POST_BUILD gets

Re: [CMake] CMake: how to use 'if condition' in command add_custom_command(...)

2016-04-19 Thread Craig Scott
In case it matters, in Clark's suggested code, note that PRE_BUILD is only fully honoured with Visual Studio generators. For everything else, it gets treated as PRE_LINK, which occurs later (i.e. after compiling all the sources rather than before). So it depends on what your "if" test is trying to

Re: [CMake] CMake: how to use 'if condition' in command add_custom_command(...)

2016-04-19 Thread Clark Wang
On Tue, Apr 19, 2016 at 1:15 PM, Chaos Zhang wrote: > Hi, > > Is there a way to use Linux command 'if' like this : > > For i need to execute 'if condition' in make phase rather than cmake phase. > Try like this: % cat CMak

[CMake] CMake: how to use 'if condition' in command add_custom_command(...)

2016-04-18 Thread Chaos Zhang
Hi, Is there a way to use Linux command 'if' like this : For i need to execute 'if condition' in make phase rather than cmake phase. Thanks a lot Chaos Zhang -- View this message in context: http://cmake.3232098.n2