if(${ARGC} GREATER 2)
foreach(loop_var IN LISTS
A
R
G
N
)
o
r
s
e
t
(
l
i
s
t
v
a
r
"
{ARGN}) or set(list_var "
ARGN)orset(listvar"{ARGN}")
foreach(loop_var IN LISTS list_var)
一个简单的例子
macro(FOO arg1 arg2 arg3)
message(STATUS “this is arg1:
a
r
g
1
,
A
R
G
V
0
=
{arg1},ARGV0=
arg1,ARGV0={ARGV0}”)
message(STATUS “this is arg2:
a
r
g
2
,
A
R
G
V
1
=
{arg2},ARGV1=
arg2,ARGV1={ARGV1}”)
message(STATUS “this is arg3:
a
r
g
3
,
A
R
G
V
2
=
{arg3},ARGV2=
arg3,ARGV2={ARGV2}”)
message(STATUS "this is argc:
A
R
G
C
"
)
m
e
s
s
a
g
e
(
S
T
A
T
U
S
"
t
h
i
s
i
s
a
r
g
s
:
{ARGC}") message(STATUS "this is args:
ARGC")message(STATUS"thisisargs:{ARGV},ARGN=
A
R
G
N
"
)
i
f
(
a
r
g
1
S
T
R
E
Q
U
A
L
o
n
e
)
m
e
s
s
a
g
e
(
S
T
A
T
U
S
"
t
h
i
s
i
s
a
r
g
1
"
)
e
n
d
i
f
(
)
i
f
(
A
R
G
V
2
S
T
R
E
Q
U
A
L
"
t
w
o
"
)
m
e
s
s
a
g
e
(
S
T
A
T
U
S
"
t
h
i
s
i
s
a
r
g
2
"
)
e
n
d
i
f
(
)
s
e
t
(
{ARGN}") if(arg1 STREQUAL one) message(STATUS "this is arg1") endif() if(ARGV2 STREQUAL "two") message(STATUS "this is arg2") endif() set(
ARGN")if(arg1STREQUALone)message(STATUS"thisisarg1")endif()if(ARGV2STREQUAL"two")message(STATUS"thisisarg2")endif()set({arg1} nine)
message(STATUS “after set arg1=KaTeX parse error: Expected '}', got 'EOF' at end of input: {{arg1}}”)
endmacro(FOO)
function(BAR arg1)
message(STATUS “this is arg1:
a
r
g
1
,
A
R
G
V
0
=
{arg1},ARGV0=
arg1,ARGV0={ARGV0}”)
message(STATUS “this is argn:
A
R
G
N
"
)
i
f
(
a
r
g
1
S
T
R
E
Q
U
A
L
f
i
r
s
t
)
m
e
s
s
a
g
e
(
S
T
A
T
U
S
"
t
h
i
s
i
s
f
i
r
s
t
"
)
e
n
d
i
f
(
)
s
e
t
(
a
r
g
1
t
e
n
)
m
e
s
s
a
g
e
(
S
T
A
T
U
S
"
a
f
t
e
r
s
e
t
a
r
g
1
=
{ARGN}") if(arg1 STREQUAL first) message(STATUS "this is first") endif() set(arg1 ten) message(STATUS "after set arg1=
ARGN")if(arg1STREQUALfirst)message(STATUS"thisisfirst")endif()set(arg1ten)message(STATUS"aftersetarg1={arg1}”)
endfunction(BAR arg1)
set(p1 one)
set(p2 two)
set(p3 three)
set(p4 four)
set(p5 five)
set(p6 first)
set(p7 second)
FOO(${p1} ${p2} ${p3} ${p4} p 5 ) B A R ( {p5}) BAR( p5)BAR({p6} p 7 ) m e s s a g e ( S T A T U S " a f t e r b a r p 6 = {p7}) message(STATUS "after bar p6= p7)message(STATUS"afterbarp6={p6}")
输出结果如下:
– this is arg1:one,ARGV0=one
– this is arg2:two,ARGV1=two
– this is arg3:three,ARGV2=three
– this is argc:5
– this is args:one;two;three;four;five,ARGN=four;five
– after set arg1=nine
– this is arg1:first,ARGV0=first
– this is argn:second
– this is first
– after set arg1=ten
– after bar p6=first
接下来看一个让我们蛋都能疼碎了的例子,简直不想用cmake:
macro(_bar)
foreach(arg IN LISTS ARGN)
message(STATUS “this is in macro ${arg}”)
endforeach()
endmacro()
function(_foo)
foreach(arg IN LISTS ARGN)
message(STATUS “this in function is ${arg}”)
endforeach()
_bar(x y z)
endfunction()
_foo(a b c)
看一下输出:
– this in function is a
– this in function is b
自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。
深知大多数初中级安卓工程师,想要提升技能,往往是自己摸索成长,但自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!
因此收集整理了一份《2024年最新Android移动开发全套学习资料》送给大家,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频
如果你觉得这些内容对你有帮助,可以添加下面V无偿领取!(备注Android)
最后
这里附上上述的技术体系图相关的几十套腾讯、头条、阿里、美团等公司2021年的面试题,把技术点整理成了视频和PDF(实际上比预期多花了不少精力),包含知识脉络 + 诸多细节,由于篇幅有限,这里以图片的形式给大家展示一部分。
相信它会给大家带来很多收获:
上述高清技术脑图以及配套的架构技术PDF可以点击我的GitHub免费获取
当程序员容易,当一个优秀的程序员是需要不断学习的,从初级程序员到高级程序员,从初级架构师到资深架构师,或者走向管理,从技术经理到技术总监,每个阶段都需要掌握不同的能力。早早确定自己的职业方向,才能在工作和能力提升中甩开同龄人。
- 无论你现在水平怎么样一定要 持续学习 没有鸡汤,别人看起来的毫不费力,其实费了很大力,这四个字就是我的建议!!!
- 我希望每一个努力生活的IT工程师,都会得到自己想要的,因为我们很辛苦,我们应得的。
当我们在抱怨环境,抱怨怀才不遇的时候,没有别的原因,一定是你做的还不够好!
汤,别人看起来的毫不费力,其实费了很大力,这四个字就是我的建议!!!
- 我希望每一个努力生活的IT工程师,都会得到自己想要的,因为我们很辛苦,我们应得的。
当我们在抱怨环境,抱怨怀才不遇的时候,没有别的原因,一定是你做的还不够好!