On Thu, Aug 23, 2018 at 11:58 AM Brad King <brad.k...@kitware.com> wrote:

> On 08/22/2018 04:23 PM, Richard Shaw wrote:
>
> Meanwhile you can use just
>
>   set(CMAKE_EXECUTABLE_SUFFIX ".elf")
>

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.

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:

set(CMAKE_EXE_LINKER_FLAGS "-T${CMAKE_SOURCE_DIR}/stm32_flash.ld")

Output:
    Linking C executable cmTC_51be3.elf
    /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_51be3.dir/link.txt
--verbose=1
    /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
    /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

The build dir is the binary directory, not the source directory...

Thanks,
Richard
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

Reply via email to