parent
6e6f4f887c
commit
00a6e0c8e7
@ -1,2 +1,36 @@
|
|||||||
add_subdirectory(max7219)
|
|
||||||
add_subdirectory(max31865)
|
add_subdirectory(max31865)
|
||||||
|
|
||||||
|
function(addDriver alias _currentDriver)
|
||||||
|
if(EXISTS ${DRIVERS_DIR}/${alias} ) # Checks if the desired peripheral is implemented for the desired CSL.
|
||||||
|
message(" --> Driver directory : ${DRIVERS_DIR}/${alias} = FOUND")
|
||||||
|
if(EXISTS ${DRIVERS_DIR}/${alias}/${alias}.c)
|
||||||
|
message(" |-> Source File : ${DRIVERS_DIR}/${alias}/${alias}.c = FOUND")
|
||||||
|
if(EXISTS ${DRIVERS_DIR}/${alias}/${alias}.h)
|
||||||
|
|
||||||
|
message(" |-> Header File : ${DRIVERS_DIR}/${alias}/${alias}.h = FOUND")
|
||||||
|
|
||||||
|
#add_subdirectory(${DRIVERS_DIR}/${alias})
|
||||||
|
|
||||||
|
add_library(${alias}_submodule ${DRIVERS_DIR}/${alias}/${alias}.c)
|
||||||
|
target_compile_options(${alias}_submodule PRIVATE ${C_FLAGS})
|
||||||
|
target_compile_definitions(${alias}_submodule PRIVATE ${C_DEFS})
|
||||||
|
target_include_directories(${alias}_submodule PUBLIC ${PERIFERALS_DIR} ${CSL_INCLUDES})
|
||||||
|
add_library(sub::${alias} ALIAS ${alias}_submodule)
|
||||||
|
set(${_currentPripheral} sub::${alias} PARENT_SCOPE)
|
||||||
|
|
||||||
|
else ()
|
||||||
|
message("${BoldRed}")
|
||||||
|
message(FATAL_ERROR "\nThe Included ${alias} Driver's Header file was NOT found ### COMPILATION ABORTED ###\n")
|
||||||
|
message("${ColourReset}")
|
||||||
|
endif()
|
||||||
|
else ()
|
||||||
|
message("${BoldRed}")
|
||||||
|
message(FATAL_ERROR "\nThe Included ${alias} Driver's Source file was NOT found ### COMPILATION ABORTED ###\n")
|
||||||
|
message("${ColourReset}")
|
||||||
|
endif()
|
||||||
|
else ()
|
||||||
|
message("${BoldRed}")
|
||||||
|
message(FATAL_ERROR "\nThe Included ${alias} Driver was NOT found ### COMPILATION ABORTED ###\n")
|
||||||
|
message("${ColourReset}")
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
Loading…
Reference in new issue