Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build
.vscode
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not fully on board with adding vscode specific ignores. The idea was for this repository to be a template - if an user will use CLion IDE, they don't need this entry, but need other, CLion specific ones.
We could either keep the gitignore as brief as possible and let users extend it as they need, or we could try to pull in as broad gitignore as possible, ignoring stuff from vscode, CLion, clangd, vim, emacs, etc...


cmake/credentials.cmake
cmake/pico_sdk_import.cmake
Expand Down
45 changes: 30 additions & 15 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,36 @@
set(PROGRAM_NAME pico_w_webserver)

set(MAKE_FS_DATA_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/external/makefsdata)

if (NOT EXISTS ${MAKE_FS_DATA_SCRIPT})
file(DOWNLOAD
https://raw.githubusercontent.com/krzmaz/lwip/e15654409d14a238aec5ed4bd5516063938c9345/src/apps/http/makefsdata/makefsdata
${MAKE_FS_DATA_SCRIPT}
)
if (CMAKE_HOST_WIN32)
set(MAKE_FS_DATA_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/external/makefsdata.py)
if(NOT EXISTS ${MAKE_FS_DATA_SCRIPT})
file(DOWNLOAD
https://gist.githubusercontent.com/rspeir/99e6c28e98930872f684bbe2f7aa2dee/raw/8d2a0d904dc4b67872e6f8c2b7cb3d8be5666beb/makefsdata.py
${MAKE_FS_DATA_SCRIPT}
)
endif()
find_package(Python3 COMPONENTS Interpreter REQUIRED)
execute_process(COMMAND
${Python3_EXECUTABLE} ${MAKE_FS_DATA_SCRIPT}
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
RESULT_VARIABLE FSDATA_RESULT
)
else()
set(MAKE_FS_DATA_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/external/makefsdata)
if (NOT EXISTS ${MAKE_FS_DATA_SCRIPT})
file(DOWNLOAD
https://raw.githubusercontent.com/krzmaz/lwip/e15654409d14a238aec5ed4bd5516063938c9345/src/apps/http/makefsdata/makefsdata
${MAKE_FS_DATA_SCRIPT}
)
endif()
execute_process(COMMAND
perl ${MAKE_FS_DATA_SCRIPT}
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
ECHO_OUTPUT_VARIABLE
ECHO_ERROR_VARIABLE
COMMAND_ERROR_IS_FATAL ANY
)
endif()
message("Running makefsdata script")
execute_process(COMMAND
perl ${MAKE_FS_DATA_SCRIPT}
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
ECHO_OUTPUT_VARIABLE
ECHO_ERROR_VARIABLE
COMMAND_ERROR_IS_FATAL ANY
)

file(RENAME fsdata.c my_fsdata.c)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome, I wasn't aware of RENAME functionality!
This should definitely go in.


add_executable(${PROGRAM_NAME}
Expand Down