#project(CSources) set (C_INCLUDES # ${CPP_ENTRY_HEADER} ../Inc ../Drivers/STM32F0xx_HAL_Driver/Inc ../Drivers/CMSIS/Device/ST/STM32F0xx/Include ../Drivers/CMSIS/Include) set(C_SOURCES stm32f0xx_csl.c stm32f0xx_it.c system_stm32f0xx.c) #add_subdirectory(Drivers) add_library(${PROJECT_NAME} ${C_SOURCES}) target_compile_options(${PROJECT_NAME} PRIVATE ${C_FLAGS}) target_compile_definitions(${PROJECT_NAME} PRIVATE ${C_DEFS}) target_include_directories(${PROJECT_NAME} PUBLIC ${C_INCLUDES}) target_link_libraries(${PROJECT_NAME} sub::drivers) #To create an alias to be used on the main CMAKE. add_library(sub::cSources ALIAS ${PROJECT_NAME})