Subfolders structure and CMakeLists.txt
Posted: Wed Jun 19, 2019 3:50 pm
I cant execute (because 'undefined reference to `test_function'') any function from subfolder.
My files structure looks like:
CMakeLists.txt (/main/CMakeLists.txt) like:
How to valid cmakefile for subfolder project structure?
My files structure looks like:
Code: Select all
PROJECT
CMakeLists.txt
- main
main.c
component.mk
CMakeLists.txt
-- subfolder
file.c
file.h
component.mk
Code: Select all
set(COMPONENT_ADD_INCLUDEDIRS include)
#set(COMPONENT_ADD_INCLUDEDIRS ".")
set(MAIN_SRCS "main.c"
"subfolder/file.c")
set(COMPONENT_SRCS ${MAIN_SRCS})
add_executable(${PROJECT_NAME} ${MAIN_SRCS})
set(COMPONENT_REQUIRES driver sdmmc)
register_component()