Skip to content

Commit

Permalink
Merge branch 'libs-fix'
Browse files Browse the repository at this point in the history
  • Loading branch information
francoiscampbell committed Feb 17, 2016
2 parents 12aade6 + 13668d9 commit 3c7817f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmake/Platform/Arduino.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -955,15 +955,18 @@ function(find_arduino_libraries VAR_NAME SRCS ARDLIBS)
foreach(LIB_SEARCH_PATH ${include_dirs} ${LIBRARY_SEARCH_PATH} ${ARDUINO_LIBRARIES_PATH} ${${ARDUINO_PLATFORM}_LIBRARIES_PATH} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/libraries ${ARDUINO_EXTRA_LIBRARIES_PATH})
if(EXISTS ${LIB_SEARCH_PATH}/${INCLUDE_NAME}/${CMAKE_MATCH_1})
list(APPEND ARDUINO_LIBS ${LIB_SEARCH_PATH}/${INCLUDE_NAME})
include_directories(${LIB_SEARCH_PATH}/${INCLUDE_NAME})
break()
endif()
if(EXISTS ${LIB_SEARCH_PATH}/${INCLUDE_NAME}/src/${CMAKE_MATCH_1})
list(APPEND ARDUINO_LIBS ${LIB_SEARCH_PATH}/${INCLUDE_NAME})
include_directories(${LIB_SEARCH_PATH}/${INCLUDE_NAME}/src)
break()
endif()
get_source_file_property(_header_generated ${LIB_SEARCH_PATH}/${CMAKE_MATCH_1} GENERATED)
if((EXISTS ${LIB_SEARCH_PATH}/${CMAKE_MATCH_1}) OR ${_header_generated})
list(APPEND ARDUINO_LIBS ${LIB_SEARCH_PATH})
include_directories(${LIB_SEARCH_PATH})
break()
endif()
endforeach()
Expand Down Expand Up @@ -1801,9 +1804,13 @@ function(SETUP_ARDUINO_SKETCH TARGET_NAME SKETCH_PATH OUTPUT_VAR)

# Find all sketch files
file(GLOB SKETCH_SOURCES ${SKETCH_PATH}/*.pde ${SKETCH_PATH}/*.ino)
set(ALL_SRCS ${SKETCH_SOURCES})

list(REMOVE_ITEM SKETCH_SOURCES ${MAIN_SKETCH})
list(SORT SKETCH_SOURCES)



generate_cpp_from_sketch("${MAIN_SKETCH}" "${SKETCH_SOURCES}" "${SKETCH_CPP}")

# Regenerate build system if sketch changes
Expand Down

0 comments on commit 3c7817f

Please sign in to comment.