From 20b9823aca5a2bac33aa8a9b68b20c97c97ad72c Mon Sep 17 00:00:00 2001 From: Andrew Scheller Date: Mon, 8 Mar 2021 18:02:22 +0000 Subject: [PATCH] Delete some redundant CMake parts (#240) --- tools/CMakeLists.txt | 14 ------------- tools/FindPicotool.cmake | 43 ---------------------------------------- 2 files changed, 57 deletions(-) delete mode 100644 tools/FindPicotool.cmake diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 9ac6f6f..2e908b2 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -44,17 +44,3 @@ function(pico_add_uf2_output TARGET) COMMAND ELF2UF2 ${TARGET}${CMAKE_EXECUTABLE_SUFFIX} ${TARGET}.uf2) endif() endfunction() - -if (NOT DEFINED PICO_BUILD_PICOFLASH) - if (DEFINED ENV{PICO_BUILD_PICOFLASH}) - set(PICO_BUILD_PICOFLASH $ENV{PICO_BUILD_PICOFLASH}) - else() - # for now - set(PICO_BUILD_PICOFLASH 1) - endif() -endif() - -if (PICO_BUILD_PICOTOOL) - set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PICO_SDK_PATH}/tools) - find_package(Picotool REQUIRED) -endif() diff --git a/tools/FindPicotool.cmake b/tools/FindPicotool.cmake deleted file mode 100644 index 3e28f03..0000000 --- a/tools/FindPicotool.cmake +++ /dev/null @@ -1,43 +0,0 @@ -# Finds (or builds) the PICOTOOL executable -# -# This will define the following variables -# -# PICOTOOL_FOUND -# -# and the following imported targets -# -# PICOTOOL -# - -if (NOT PICOTOOL_FOUND) - # todo we would like to use pckgconfig to look for it first - # see https://pabloariasal.github.io/2018/02/19/its-time-to-do-cmake-right/ - - include(ExternalProject) - - set(PICOTOOL_SOURCE_DIR ${PICO_SDK_PATH}/tools/picotool) - set(PICOTOOL_BINARY_DIR ${CMAKE_BINARY_DIR}/picotool) - - set(PICOTOOL_BUILD_TARGET PicotoolBuild) - set(PICOTOOL_TARGET Picotool) - - if (NOT TARGET ${PICOTOOL_BUILD_TARGET}) - message("PICOTOOL will need to be built") - ExternalProject_Add(${PICOTOOL_BUILD_TARGET} - PREFIX picotool SOURCE_DIR ${PICOTOOL_SOURCE_DIR} - BINARY_DIR ${PICOTOOL_BINARY_DIR} - BUILD_ALWAYS 1 # force dependency checking - INSTALL_COMMAND "" - ) - endif() - - set(PICOTOOL_EXECUTABLE ${PICOTOOL_BINARY_DIR}/picotool) - if(NOT TARGET ${PICOTOOL_TARGET}) - add_executable(${PICOTOOL_TARGET} IMPORTED) - endif() - set_property(TARGET ${PICOTOOL_TARGET} PROPERTY IMPORTED_LOCATION - ${PICOTOOL_EXECUTABLE}) - - add_dependencies(${PICOTOOL_TARGET} ${PICOTOOL_BUILD_TARGET}) - set(PICOTOOL_FOUND 1) -endif() \ No newline at end of file