cmake通配符的问题

jiangteng
Posts: 25
Joined: Wed Jan 30, 2019 7:08 am

cmake通配符的问题

Postby jiangteng » Fri Jun 16, 2023 9:21 am

我要编译一个数学库,里面又上百个.c文件,在写CMakeList.txt时,发现idf_component_register(SRCS "./*.c")这样的写法不起作用,提示找不到*.c文件,为什么呢?难不成只能手动输入一百多个文件的文件名吗?

liyang5945
Posts: 11
Joined: Fri Jun 23, 2023 6:49 pm

Re: cmake通配符的问题

Postby liyang5945 » Tue Jun 27, 2023 10:02 am

file(GLOB_RECURSE LIB_SRCS
"../lib/WS2812FX/src/*.cpp"
"../lib/factory/*.c"

)

idf_component_register(SRCS
"imageScroll.cpp"
${LIB_SRCS}

这样写可以

Who is online

Users browsing this forum: No registered users and 53 guests