project(Drivers) set(P_SOURCES STM32F0xx_HAL_Driver/Src/stm32f0xx_ll_exti.c STM32F0xx_HAL_Driver/Src/stm32f0xx_ll_gpio.c STM32F0xx_HAL_Driver/Src/stm32f0xx_ll_pwr.c STM32F0xx_HAL_Driver/Src/stm32f0xx_ll_rcc.c STM32F0xx_HAL_Driver/Src/stm32f0xx_ll_utils.c) add_library(${PROJECT_NAME} ${P_SOURCES}) target_compile_options(${PROJECT_NAME} PRIVATE ${C_FLAGS}) target_compile_definitions(${PROJECT_NAME} PRIVATE ${C_DEFS}) target_include_directories(${PROJECT_NAME} PUBLIC CMSIS/Device/ST/STM32F0xx/Include CMSIS/Include STM32F0xx_HAL_Driver/Inc ) #To create an alias to be used on the main CMAKE. add_library(sub::drivers ALIAS ${PROJECT_NAME})