diff --git a/boards/px4/raspberrypi/cmake/upload.cmake b/boards/px4/raspberrypi/cmake/upload.cmake index f0ee765a62..ce0472b8a7 100644 --- a/boards/px4/raspberrypi/cmake/upload.cmake +++ b/boards/px4/raspberrypi/cmake/upload.cmake @@ -31,7 +31,7 @@ # ############################################################################ -if($ENV{AUTOPILOT_HOST}) +if(DEFINED ENV{AUTOPILOT_HOST}) set(AUTOPILOT_HOST $ENV{AUTOPILOT_HOST}) else() set(AUTOPILOT_HOST "raspberrypi")