From 2df245d4baf0cea56de0276c0d4b03a3c900e04b Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Tue, 27 Dec 2022 12:53:41 +0100 Subject: [PATCH] Project files re-organized --- CMakeLists.txt | 35 +++++++++++++++++------------------ src/CMakeLists.txt | 34 ++++++++++++++++++++++++++++++++++ abfall.cpp => src/abfall.cpp | 0 3 files changed, 51 insertions(+), 18 deletions(-) create mode 100644 src/CMakeLists.txt rename abfall.cpp => src/abfall.cpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c24ad5..1e13695 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,35 +18,34 @@ if (PICO_SDK_VERSION_STRING VERSION_LESS "1.4.0") message(FATAL_ERROR "Raspberry Pi Pico SDK version 1.4.0 (or later) required. Your version is ${PICO_SDK_VERSION_STRING}") endif() -project(abfall C CXX ASM) +#project(abfall C CXX ASM) +project(abfall VERSION "1.0.0" LANGUAGES C CXX ASM) + # Initialise the Raspberry Pi Pico SDK pico_sdk_init() + # Add executable. Default name is the project name, version 0.1 -add_executable(abfall abfall.cpp ) - -pico_set_program_name(abfall "abfall") -pico_set_program_version(abfall "0.1") - -pico_enable_stdio_uart(abfall 1) -pico_enable_stdio_usb(abfall 0) +# add_executable(abfall abfall.cpp ) # Add the standard library to the build -target_link_libraries(abfall - pico_stdlib) +#target_link_libraries(abfall +# pico_stdlib) # Add the standard include files to the build -target_include_directories(abfall PRIVATE - ${CMAKE_CURRENT_LIST_DIR} - ${CMAKE_CURRENT_LIST_DIR}/.. # for our common lwipopts or any other standard includes, if required -) +#target_include_directories(abfall PRIVATE +# ${CMAKE_CURRENT_LIST_DIR} +# ${CMAKE_CURRENT_LIST_DIR}/.. # for our common lwipopts or any other standard includes, if required +#) # Add any user requested libraries -target_link_libraries(abfall - pico_cyw43_arch_lwip_threadsafe_background - ) +#target_link_libraries(abfall +# pico_cyw43_arch_lwip_threadsafe_background +# ) -pico_add_extra_outputs(abfall) +#pico_add_extra_outputs(abfall) + +add_subdirectory(src) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..60207e1 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,34 @@ +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(SOURCES + abfall.cpp) + +add_executable(${CMAKE_PROJECT_NAME} ${SOURCES}) + +pico_set_program_name(${CMAKE_PROJECT_NAME} "abfall") +pico_set_program_version(${CMAKE_PROJECT_NAME} ${PROJECT_VERSION}) + +# Add the standard include files to the build +target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE + ${CMAKE_CURRENT_LIST_DIR} + ${CMAKE_CURRENT_LIST_DIR}/.. # for our common lwipopts or any other standard includes, if required +) + +set_target_properties(${CMAKE_PROJECT_NAME} + PROPERTIES + CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" + CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" + CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" +) + +pico_enable_stdio_uart(${CMAKE_PROJECT_NAME} 1) +pico_enable_stdio_usb(${CMAKE_PROJECT_NAME} 0) + + + +target_link_libraries(${CMAKE_PROJECT_NAME} + pico_stdlib + pico_cyw43_arch_lwip_threadsafe_background +) + +pico_add_extra_outputs(${CMAKE_PROJECT_NAME}) diff --git a/abfall.cpp b/src/abfall.cpp similarity index 100% rename from abfall.cpp rename to src/abfall.cpp