Delete some redundant CMake parts (#240)
This commit is contained in:
parent
fc10a97c38
commit
20b9823aca
@ -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()
|
||||
|
@ -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()
|
Loading…
Reference in New Issue
Block a user