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

2016-04-19 Thread Clark Wang
ILD 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 do whether or not t

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

Re: [CMake] set(a b); set(b c); if(a STREQUAL b OR a STREQUAL c) ...

2014-09-03 Thread Clark Wang
On Thu, Sep 4, 2014 at 1:44 PM, Clark Wang wrote: > On Thu, Sep 4, 2014 at 1:36 PM, Chuck Atkins > wrote: > >> Hi Clark >> >> The expression inside the if statement has it's variables dereferenced >> before evaluating and the non-variables are treated as

Re: [CMake] set(a b); set(b c); if(a STREQUAL b OR a STREQUAL c) ...

2014-09-03 Thread Clark Wang
On Thu, Sep 4, 2014 at 1:36 PM, Chuck Atkins wrote: > Hi Clark > > The expression inside the if statement has it's variables dereferenced > before evaluating and the non-variables are treated as constant > expressions. In this case, a resolves to "b", b resolves to "c", and c is > not a variable

[CMake] set(a b); set(b c); if(a STREQUAL b OR a STREQUAL c) ...

2014-09-03 Thread Clark Wang
Hi, I don't understand why the following code would not print "true" (tested with cmake-3.0): set(a b) set(b c) if(a STREQUAL b OR a STREQUAL c) message("true") endif() >From my understanding, no matter how magic the if command interprets its arguments, one of the expressions (a STRE

[CMake] Write CMakeLists in another programming language?

2014-04-03 Thread Clark Wang
I've been using cmake for some time but still I'm confused about the syntax. Following are 2 examples from me: - http://www.cmake.org/pipermail/cmake/2013-September/055924.html - http://www.cmake.org/pipermail/cmake/2013-October/056036.html Someone ever told me cmake 3.0 may do some language cl

Re: [CMake] How to write a correct wrapper of MESSAGE()?

2014-03-05 Thread Clark Wang
On Mon, Oct 21, 2013 at 6:06 PM, Johannes Zarl wrote: > On Thursday, 17. October 2013, 07:12:51, Clark WANG wrote: > > When I'm using CMake more and more I find it's not a real serious > > "language". It's so tricky. > > I can see why you are

Re: [CMake] How to write a correct wrapper of MESSAGE()?

2013-10-16 Thread Clark WANG
On Tue, Oct 15, 2013 at 8:12 PM, Johannes Zarl wrote: > On Monday, 14. October 2013, 19:07:06, Matthew Woehlke wrote: > > > The "IN LISTS" signature of foreach seems to do additional list > > > splitting, leading to ("foo;bar" "baz") appearing as 3 elements. > > > Accessing the ARGV array by the

Re: [CMake] ARGC != list(LENGTH ARGV) and ARGV0 != list(GET ARGV 0)

2013-10-10 Thread Clark WANG
On Fri, Oct 11, 2013 at 2:20 PM, Rolf Eike Beer wrote: > Am Freitag, 11. Oktober 2013, 12:07:58 schrieb Clark WANG: > > See following example: > > > > $ cmake --version > > cmake version 2.8.11.2 > > $ cat CMakeLists.txt > >

Re: [CMake] ARGC != list(LENGTH ARGV) and ARGV0 != list(GET ARGV 0)

2013-10-10 Thread Clark WANG
On Fri, Oct 11, 2013 at 2:20 PM, Rolf Eike Beer wrote: > Am Freitag, 11. Oktober 2013, 12:07:58 schrieb Clark WANG: > > See following example: > > > > $ cmake --version > > cmake version 2.8.11.2 > > $ cat CMakeLists.txt > >

[CMake] ARGC != list(LENGTH ARGV) and ARGV0 != list(GET ARGV 0)

2013-10-10 Thread Clark WANG
See following example: $ cmake --version cmake version 2.8.11.2 $ cat CMakeLists.txt cmake_minimum_required(VERSION 2.8) FUNCTION(foo) list(LENGTH ARGV argc) message("ARGC=${ARGC} list(LENGTH ARGV)=${argc}") list(GET ARGV 0 argv0) message("ARGV

Re: [CMake] How to write a correct wrapper of MESSAGE()?

2013-10-09 Thread Clark WANG
:bar;baz spaceFOO > twowords > -- [info] twowords > > The "IN LISTS" signature of foreach seems to do additional list splitting, > leading to ("foo;bar" "baz") appearing as 3 elements. Accessing the ARGV > array > by the positional indices (e.g. ${ARGV0}) pr

Re: [CMake] How to write a correct wrapper of MESSAGE()?

2013-10-08 Thread Clark WANG
On Sat, Oct 5, 2013 at 1:38 AM, Matthew Woehlke wrote: > On 2013-09-27 04:18, Clark WANG wrote: > >> I'm trying to write some MESSAGE() wrappers like info(), warning(), >> fatal(), etc which may be a bit easier to use. But I failed to simulate >> the >> correct

[CMake] How to write a correct wrapper of MESSAGE()?

2013-09-27 Thread Clark WANG
I'm trying to write some MESSAGE() wrappers like info(), warning(), fatal(), etc which may be a bit easier to use. But I failed to simulate the correct MESSAGE() behavior no matter I use MACRO or FUNCTION. For example: MACRO(info_mac_1) message("[MACRO 1] " ${ARGV}) ENDMACRO() MACRO(in