Skip to content

Commit

Permalink
Prebuilt libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
rpoisel committed Aug 16, 2016
1 parent d35d2b7 commit 3ea569a
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 31 deletions.
13 changes: 7 additions & 6 deletions arduino/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,9 @@ add_library(arduino STATIC
)

target_include_directories(arduino PUBLIC
$<INSTALL_INTERFACE:h>
$<INSTALL_INTERFACE:h/tools/sdk/include>
$<INSTALL_INTERFACE:h/variants/generic>
$<BUILD_INTERFACE:${ARDUINO_ESP8266_DIR}/cores/esp8266>
$<BUILD_INTERFACE:${ARDUINO_ESP8266_DIR}/tools/sdk/include>
$<BUILD_INTERFACE:${ARDUINO_ESP8266_DIR}/variants/generic>
${ARDUINO_ESP8266_DIR}/cores/esp8266
${ARDUINO_ESP8266_DIR}/tools/sdk/include
${ARDUINO_ESP8266_DIR}/variants/generic
)

install(DIRECTORY ${ARDUINO_ESP8266_DIR}/cores/esp8266/
Expand Down Expand Up @@ -93,5 +90,9 @@ target_compile_options(arduino PUBLIC
-U__STRICT_ANSI__
)

install(TARGETS arduino ARCHIVE DESTINATION lib)

install(DIRECTORY cmake/ DESTINATION cmake/Modules FILES_MATCHING PATTERN "Find*.cmake")
install(DIRECTORY cmake/ DESTINATION cmake FILES_MATCHING PATTERN "toolchain.*.cmake")

add_subdirectory(libraries)
6 changes: 6 additions & 0 deletions arduino/cmake/FindArduino.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ set(ARDUINO_INC_DIRS
${_IMPORT_PREFIX}/h
${_IMPORT_PREFIX}/h/variants/generic
${_IMPORT_PREFIX}/h/tools/sdk/include
${_IMPORT_PREFIX}/h/libraries/SPI
${_IMPORT_PREFIX}/h/libraries/Wire
${_IMPORT_PREFIX}/h/tools/sdk/lwip/include
${_IMPORT_PREFIX}/h/libraries/ESP8266WiFi
${_IMPORT_PREFIX}/h/libraries/ESP8266WiFi/include
${_IMPORT_PREFIX}/h/libraries/ESP8266Webserver
)

set(ARDUINO_DEP_LIBS
Expand Down
6 changes: 3 additions & 3 deletions arduino/libraries/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
add_subdirectory(ArduinoOTA)
#add_subdirectory(ArduinoOTA)
add_subdirectory(ESP8266WiFi)
add_subdirectory(ESP8266WebServer)
add_subdirectory(ESP8266mDNS)
add_subdirectory(GDBStub)
#add_subdirectory(ESP8266mDNS)
#add_subdirectory(GDBStub)
add_subdirectory(SPI)
add_subdirectory(Wire)
10 changes: 5 additions & 5 deletions arduino/libraries/ESP8266WebServer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ file(GLOB WEBSERVER_LIB_SRC
${ARDUINO_ESP8266_DIR}/libraries/ESP8266WebServer/src/*.cpp
)

add_library(esp8266webserver STATIC
target_sources(arduino PRIVATE
${WEBSERVER_LIB_SRC}
)

target_include_directories(esp8266webserver PUBLIC
target_include_directories(arduino PUBLIC
${ARDUINO_ESP8266_DIR}/libraries/ESP8266WebServer/src
)

target_link_libraries(esp8266webserver PUBLIC
arduino
esp8266wifi
install(DIRECTORY ${ARDUINO_ESP8266_DIR}/libraries/ESP8266WebServer/src/
DESTINATION h/libraries/ESP8266Webserver
FILES_MATCHING PATTERN "*.h"
)

18 changes: 14 additions & 4 deletions arduino/libraries/ESP8266WiFi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,28 @@ file(GLOB WIFI_LIB_SRC
${ARDUINO_ESP8266_DIR}/libraries/ESP8266WiFi/src/*.cpp
)

add_library(esp8266wifi STATIC
target_sources(arduino PRIVATE
${WIFI_LIB_SRC}
)

target_include_directories(esp8266wifi PUBLIC
target_include_directories(arduino PUBLIC
${ARDUINO_ESP8266_DIR}/tools/sdk/lwip/include
${ARDUINO_ESP8266_DIR}/libraries/ESP8266WiFi/src
${ARDUINO_ESP8266_DIR}/libraries/ESP8266WiFi/src/include
)

target_link_libraries(esp8266wifi PUBLIC
arduino
install(DIRECTORY ${ARDUINO_ESP8266_DIR}/tools/sdk/lwip/include/
DESTINATION h/tools/sdk/lwip/include
FILES_MATCHING PATTERN "*.h"
)

install(DIRECTORY ${ARDUINO_ESP8266_DIR}/libraries/ESP8266WiFi/src/
DESTINATION h/libraries/ESP8266WiFi
FILES_MATCHING PATTERN "*.h"
)

install(DIRECTORY ${ARDUINO_ESP8266_DIR}/libraries/ESP8266WiFi/src/include/
DESTINATION h/libraries/ESP8266WiFi/include
FILES_MATCHING PATTERN "*.h"
)

11 changes: 5 additions & 6 deletions arduino/libraries/SPI/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@ file(GLOB SPI_LIB_SRC
${ARDUINO_ESP8266_DIR}/libraries/SPI/*.cpp
)

add_library(esp8266spi STATIC
target_sources(arduino PRIVATE
${SPI_LIB_SRC}
)

target_include_directories(esp8266spi PUBLIC
target_include_directories(arduino PRIVATE
${ARDUINO_ESP8266_DIR}/libraries/SPI
)

target_link_libraries(esp8266spi PUBLIC
arduino
install(DIRECTORY ${ARDUINO_ESP8266_DIR}/libraries/SPI/
DESTINATION h/libraries/SPI
FILES_MATCHING PATTERN "*.h"
)



12 changes: 5 additions & 7 deletions arduino/libraries/Wire/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@ file(GLOB WIRE_LIB_SRC
${ARDUINO_ESP8266_DIR}/libraries/Wire/*.cpp
)

add_library(esp8266wire STATIC
target_sources(arduino PRIVATE
${WIRE_LIB_SRC}
)

target_include_directories(esp8266wire PUBLIC
target_include_directories(arduino PRIVATE
${ARDUINO_ESP8266_DIR}/libraries/Wire
)

target_link_libraries(esp8266wire PUBLIC
arduino
install(DIRECTORY ${ARDUINO_ESP8266_DIR}/libraries/Wire/
DESTINATION h/libraries/Wire
FILES_MATCHING PATTERN "*.h"
)




0 comments on commit 3ea569a

Please sign in to comment.