On Mon, Aug 27, 2018 at 12:43 PM Brad King <[email protected]> wrote:
> On 08/25/2018 05:48 PM, Richard Shaw wrote:
> > set(CMAKE_EXE_LINKER_FLAGS "-T${CMAKE_SOURCE_DIR}/stm32_flash.ld")
> >
> > The build dir is the binary directory, not the source directory...
>
> Toolchain files cannot reference variables like CMAKE_SOURCE_DIR
> that depend on the source and build tree locations. They are loaded
> inside try_compile projects in addition to the main project, and those
> have their own source and build trees.
>
Ok, fixed but it's really a PITA to have to type -DCMAKE_TOOLCHAIN_FILE=..
so often when 100% of the people on this project are cross-compiling.
And I'm still being bit by differences between Fedora and Ubuntu...
Compiling is working fine again on Fedora but on Ubuntu it's failing to
find the STM32 library. I quite clearly specify its in the BINARY directory
but on Ubuntu it's still looking for it in the SOURCE directory...
set(PERIPHLIBVER 1.8.0)
set(PERIPHLIBNAME STM32F4xx_DSP_StdPeriph_Lib_V)
set(PERIPHLIBDIR ${CMAKE_BINARY_DIR}/${PERIPHLIBNAME}${PERIPHLIBVER})
set(CMSIS ${PERIPHLIBDIR}/Libraries/CMSIS)
set(STM32F4LIB ${PERIPHLIBDIR}/Libraries/STM32F4xx_StdPeriph_Driver)
set(STM32F4TEMPLATE ${PERIPHLIBDIR}/Project/STM32F4xx_StdPeriph_Templates)
set(DSPLIB ${PERIPHLIBDIR}/Libraries/CMSIS/DSP_Lib)
Output on Ubuntu:
cmake -DCMAKE_TOOLCHAIN_FILE=STM32_Toolchain.cmake
~/svn/freetel/codec2-dev/stm32/-- Configuring done
CMake Error at CMakeLists.txt:134 (add_executable):
Cannot find source file:
/home/richard/svn/freetel/codec2-dev/stm32/STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/CMSIS/DSP_Lib/Examples/arm_fft_bin_example/GCC/arm_fft_bin_data.c
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