I've got a follow-up question about cross-compiling for dSpace. My Toolchain file so far:
set(CMAKE_SYSTEM_NAME dSpace) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) file(TO_CMAKE_PATH "C:\\Program Files\\dSPACE RCPHIL 2016-B" DSPACE_TOOLS) set(DSPACE_PPCTOOLS ${DSPACE_TOOLS}/Compiler/PPCTools) find_program(CMAKE_C_COMPILER NAMES ${DSPACE_PPCTOOLS}/bin/mccppc.exe) find_program(CMAKE_C_COMPILER NAMES ${DSPACE_PPCTOOLS}/bin/cccppc.exe) find_program(CMAKE_MAKE_PROGRAM ${DSPACE_TOOLS}/Exe/DSMAKE.EXE) set(CMAKE_FIND_ROOT_PATH ${DSPACE_PPCTOOLS}) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) CMake is actually able to locate the C compiler (called "mccppc.exe") and CMake thus tries to compile a test program ('CompilerIdC.c'). I can compile this source file 'by hand' with said compiler. However, from CMake (which automatically uses MSBuild.exe), I get the error output below. How can I circumvent MSBuild.exe and/or the attempted loading of the SDK? Do I forget to set some other important variables (e.g. CMAKE_MAKE_PROGRAM seems to be ignored?) The C compiler "C:/Program Files/dSPACE RCPHIL 2016-B/Compiler/PPCTools/bin/mccppc.exe" is not able to compile a simple test program. It fails with the following output: Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. Compiler: C:/Program Files/dSPACE RCPHIL 2016-B/Compiler/PPCTools/bin/mccppc.exe Build flags: Id flags: The output was: 1 … Microsoft (R) Build Engine version 15.1.1012.6693 Copyright (C) Microsoft Corporation. All rights reserved. Build started 8/11/2017 11:34:36 AM. Project "C:\Users\SYSCOP\Documents\GitHub\acados-master\build\CMakeFiles\3.8.2\CompilerIdC\CompilerIdC.vcxproj" on node 1 (default targets). C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Platforms\Win32\PlatformToolsets\v141\Toolset.targets(34,5): error MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\Users\SYSCOP\Documents\GitHub\acados-master\build\CMakeFiles\3.8.2\CompilerIdC\CompilerIdC.vcxproj] Done Building Project "C:\Users\SYSCOP\Documents\GitHub\acados-master\build\CMakeFiles\3.8.2\CompilerIdC\CompilerIdC.vcxproj" (default targets) -- FAILED. Build FAILED. On Fri, 23 Jun 2017 at 22:37 Robin Verschueren <robin.verschue...@gmail.com> wrote: > Dear Nils, > > Perfect! This was exactly what I was looking for. > It works, and the CMAKE_INCLUDE_FLAG_C > is not overwritten. > > Thanks, > Robin > > > On Fri, 23 Jun 2017 at 13:29 Nils Gladitz <nilsglad...@gmail.com> wrote: > >> On 23.06.2017 21:47, Robin Verschueren wrote: >> >> Dear CMake, >> >> We are trying to build our application for the dSPACE embedded system >> (www.dspace.com), more specifically their MicroAutobox-II. This makes >> use of a specific compiler called mccppc (Microtec C/C++ PowerPC >> compiler). >> >> I was following the instructions on this wiki page >> <https://cmake.org/Wiki/CMake_Cross_Compiling>, when I got the following >> warning, >> when trying to use a custom 'Toolchain' file: >> >> System is unknown to cmake, create: >> >> Platform/dSPACE to use this system, please send your config file to >> >> cm...@www.cmake.org so it can be added to cmake >> >> We would be glad to send it to you when it is finished, but in the >> meantime, >> we cannot debug our toolchain file because of above warning. >> >> Is there a way of including it without having to include it in the >> official CMake >> distribution? I tried setting CMAKE_MODULE_PATH but that did not help.. >> >> >> In the Toolchain file: >> set(CMAKE_SYSTEM_NAME dSPACE) >> >> list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) >> >> ... >> >> Then having Platform/dSPACE.cmake next to your toolchain file should work >> (works for me). >> >> >> Nils >> >>
-- 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: http://public.kitware.com/mailman/listinfo/cmake