commit d1edce71135cc6d98c0a4b5729774542b676e769 Author: sophgo-forum-service <forum_service@sophgo.com> Date: Fri Mar 15 16:07:33 2024 +0800 [fix] recommend using ssh method to clone repo. [fix] fix sensor driver repo branch name.
30 lines
889 B
CMake
30 lines
889 B
CMake
|
|
function(ParseConfiguration DotConfigFile)
|
|
if (NOT EXISTS ${DotConfigFile})
|
|
message(FATAL_ERROR
|
|
"${DotConfigFile} not exist,
|
|
please source build/envsetup_soc.sh and defconfig relative board_defconfig")
|
|
endif()
|
|
file(READ "${DotConfigFile}" DotConfig)
|
|
string(REPLACE "\\\n" "" DotConfig ${DotConfig})
|
|
string(REPLACE "\n" ";" DotConfLines ${DotConfig})
|
|
list(REMOVE_ITEM DotConfLines "")
|
|
foreach(configline ${DotConfLines})
|
|
string(REPLACE "=" ";" line_split ${configline})
|
|
list(LENGTH line_split count)
|
|
if (count LESS 2)
|
|
continue()
|
|
endif()
|
|
list(GET line_split -1 value)
|
|
string(STRIP ${value} value)
|
|
separate_arguments(value)
|
|
list(REMOVE_AT line_split -1)
|
|
foreach(conf_name ${line_split})
|
|
set(${conf_name} ${value} PARENT_SCOPE)
|
|
message("${conf_name}=${value}")
|
|
# add_definitions(-D${conf_name}=${value} )
|
|
endforeach()
|
|
endforeach()
|
|
endfunction()
|
|
|