<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Thu, Aug 23, 2018 at 11:58 AM Brad King <<a href="mailto:brad.king@kitware.com">brad.king@kitware.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 08/22/2018 04:23 PM, Richard Shaw wrote:<br><br>
Meanwhile you can use just<br>
<br>
set(CMAKE_EXECUTABLE_SUFFIX ".elf")<br></blockquote><div><br></div><div>Ok, interestingly that had no effect, but if I moved the set(CMAKE_EXECUTABLE_SUFFIX_<LANG>) to the main CMakeFiles.txt file below the project() call it worked.</div><div><br></div><div>On Fedora, when I commented out the include for the toolchain file and applied it on the command line I ran into an issue where it seems like cmake doesn't understand the source directory as it no longer looked in the right place for the linker script. In the toolchain file it's set to a sub-directory of the source dir but it's looking in the binary dir:</div><div><br></div><div><div>set(CMAKE_EXE_LINKER_FLAGS "-T${CMAKE_SOURCE_DIR}/stm32_flash.ld")</div></div><div><br></div><div>Output:</div><div><div> Linking C executable cmTC_51be3.elf</div><div> /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_51be3.dir/link.txt --verbose=1</div><div> /usr/lib64/ccache/arm-none-eabi-gcc -Wall -std=gnu11 -mlittle-endian -mthumb -mthumb-interwork -nostartfiles -mcpu=cortex-m4 -fsingle-precision-constant -Wdouble-promotion -mfpu=fpv4-sp-d16 -mfloat-abi=hard -D__FPU_PRESENT=1 -D__FPU_USED=1 --specs=nosys.specs -T/home/build/build/stm32/CMakeFiles/CMakeTmp/stm32_flash.ld CMakeFiles/cmTC_51be3.dir/testCCompiler.c.obj -o cmTC_51be3.elf </div><div> /usr/lib/gcc/arm-none-eabi/7.1.0/../../../../arm-none-eabi/bin/ld: cannot open linker script file /home/build/build/stm32/CMakeFiles/CMakeTmp/stm32_flash.ld: No such file or directory</div></div><div><br></div><div>The build dir is the binary directory, not the source directory...</div><div><br></div><div>Thanks,</div><div>Richard</div></div></div>