77# _library_name - Name of the Arduino library to find.
88# _board_id - Board ID associated with the linked Core Lib.
99# [3RD_PARTY] - Whether library should be treated as a 3rd Party library.
10- # [HEADER_ONLY] - Whether library is a header-only library, i.e has no source files
1110#=============================================================================#
1211function (find_arduino_library _target_name _library_name _board_id)
1312
14- set (argument_options "3RD_PARTY" "HEADER_ONLY" )
13+ set (argument_options "3RD_PARTY" )
1514 cmake_parse_arguments (parsed_args "${argument_options} " "" "" ${ARGN} )
1615
1716 if (NOT parsed_args_3RD_PARTY)
@@ -34,23 +33,17 @@ function(find_arduino_library _target_name _library_name _board_id)
3433 set (error_message "Couldn't find any header files for the ${_library_name} library" )
3534 message (SEND_ERROR "${error_message} " )
3635 else ()
37- if (parsed_args_HEADER_ONLY)
38- add_arduino_header_only_library(${_target_name} ${_board_id}
39- ARCH ${ARDUINO_CMAKE_PLATFORM_ARCHITECTURE}
40- HEADERS ${library_headers} )
36+ find_library_source_files("${library_path} " library_sources)
37+ if (NOT library_sources)
38+ string (CONCAT error_message
39+ "Couldn't find any source files for the ${_library_name} library - "
40+ "Is it a header-only library?\n "
41+ "If so, please pass the HEADER_ONLY option as an argument to the function" )
42+ message (SEND_ERROR "${error_message} " )
4143 else ()
42- find_library_source_files("${library_path} " library_sources)
43- if (NOT library_sources)
44- string (CONCAT error_message
45- "Couldn't find any source files for the ${_library_name} library - "
46- "Is it a header-only library?\n "
47- "If so, please pass the HEADER_ONLY option as an argument to the function" )
48- message (SEND_ERROR "${error_message} " )
49- else ()
50- set (sources ${library_headers} ${library_sources} )
51- add_arduino_library(${_target_name} ${_board_id} ${library_path} "${sources} "
52- LIB_PROPS_FILE ${library_properties_file} )
53- endif ()
44+ set (sources ${library_headers} ${library_sources} )
45+ add_arduino_library(${_target_name} ${_board_id} ${library_path} "${sources} "
46+ LIB_PROPS_FILE ${library_properties_file} )
5447 endif ()
5548 endif ()
5649 endif ()
0 commit comments