Skip to content

Commit 040f29d

Browse files
committed
Respect EXECUTABLE_OUTPUT_PATH when set
This is a small change to make the toolchain obey the EXECUTABLE_OUTPUT_PATH CMake variable when set by the user. This variable is a CMake convention and documented here: http://www.cmake.org/Wiki/CMake_Useful_Variables
1 parent 5cf635d commit 040f29d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cmake/Platform/Arduino.cmake

+4-1
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,10 @@ function(setup_arduino_target TARGET_NAME BOARD_ID ALL_SRCS ALL_LIBS COMPILE_FLA
10751075
LINK_FLAGS "${ARDUINO_LINK_FLAGS} ${LINK_FLAGS}")
10761076
target_link_libraries(${TARGET_NAME} ${ALL_LIBS} "-lc -lm")
10771077

1078-
set(TARGET_PATH ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME})
1078+
if(NOT EXECUTABLE_OUTPUT_PATH)
1079+
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
1080+
endif()
1081+
set(TARGET_PATH ${EXECUTABLE_OUTPUT_PATH}/${TARGET_NAME})
10791082
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
10801083
COMMAND ${CMAKE_OBJCOPY}
10811084
ARGS ${ARDUINO_OBJCOPY_EEP_FLAGS}

0 commit comments

Comments
 (0)