> If you don't mind, please precede this patch with a change that > adds such subsection headers for the Clang and QCC cases.
Bellow you find the updated patch, I rearranged the cross compiling section a bit and added subsections. Pascal >From 01aa7fd739ff6bdaf05f882199e79549a04f7bda Mon Sep 17 00:00:00 2001 From: Pascal Bach <pascal.b...@siemens.com> Date: Fri, 19 Sep 2014 12:58:02 +0200 Subject: [PATCH] WINCE: Add toolchain documentation for Windows CE --- Help/manual/cmake-toolchains.7.rst | 58 ++++++++++++++++++++++++++++++------ 1 file changed, 49 insertions(+), 9 deletions(-) diff --git a/Help/manual/cmake-toolchains.7.rst b/Help/manual/cmake-toolchains.7.rst index f36a43c..05e05ff 100644 --- a/Help/manual/cmake-toolchains.7.rst +++ b/Help/manual/cmake-toolchains.7.rst @@ -97,12 +97,18 @@ Cross Compiling If :manual:`cmake(1)` is invoked with the command line parameter ``-DCMAKE_TOOLCHAIN_FILE=path/to/file``, the file will be loaded early to set -values for the compilers. A typical cross-compiling toolchain has content such +values for the compilers. + +Cross Compiling for Linux +------------------------- + +A typical cross-compiling toolchain for Linux has content such as: .. code-block:: cmake set(CMAKE_SYSTEM_NAME Linux) + set(CMAKE_SYSTEM_PROCESSOR arm) set(CMAKE_SYSROOT /home/devel/rasp-pi-rootfs) set(CMAKE_STAGING_PREFIX /home/devel/stage) @@ -118,6 +124,9 @@ as: The :variable:`CMAKE_SYSTEM_NAME` is the CMake-identifier of the target platform to build for. +The :variable:`CMAKE_SYSTEM_PROCESSOR` is the CMake-identifier of the target architecture +to build for. + The :variable:`CMAKE_SYSROOT` is optional, and may be specified if a sysroot is available. @@ -139,13 +148,17 @@ target system prefixes, whereas executables which must be run as part of the bui should be found only on the host and not on the target. This is the purpose of the ``CMAKE_FIND_ROOT_PATH_MODE_*`` variables. -Some compilers are inherently cross compilers, such as Clang and the QNX QCC -compiler. The :variable:`CMAKE_<LANG>_COMPILER_TARGET` can be set to pass a +Cross Compiling using Clang +--------------------------- + +Some compilers such as Clang are inherently cross compilers. +The :variable:`CMAKE_<LANG>_COMPILER_TARGET` can be set to pass a value to those supported compilers when compiling: .. code-block:: cmake set(CMAKE_SYSTEM_NAME Linux) + set(CMAKE_SYSTEM_PROCESSOR arm) set(triple arm-linux-gnueabihf) @@ -154,7 +167,18 @@ value to those supported compilers when compiling: set(CMAKE_CXX_COMPILER clang++) set(CMAKE_CXX_COMPILER_TARGET ${triple}) -Or, for QCC: +Similarly, some compilers do not ship their own supplementary utilities +such as linkers, but provide a way to specify the location of the external +toolchain which will be used by the compiler driver. The +:variable:`CMAKE_<LANG>_COMPILER_EXTERNAL_TOOLCHAIN` variable can be set in a +toolchain file to pass the path to the compiler driver. + +Cross Compiling for QNX +----------------------- + +As the Clang compiler the QNX QCC compile is inherently a cross compiler. +And the :variable:`CMAKE_<LANG>_COMPILER_TARGET` can be set to pass a +value to those supported compilers when compiling: .. code-block:: cmake @@ -167,12 +191,28 @@ Or, for QCC: set(CMAKE_CXX_COMPILER QCC) set(CMAKE_CXX_COMPILER_TARGET ${arch}) +Cross Compiling for Windows CE +------------------------------ -Similarly, some compilers do not ship their own supplementary utilities -such as linkers, but provide a way to specify the location of the external -toolchain which will be used by the compiler driver. The -:variable:`CMAKE_<LANG>_COMPILER_EXTERNAL_TOOLCHAIN` variable can be set in a -toolchain file to pass the path to the compiler driver. +Cross compiling for Windows CE requires the corresponding SDK being installed on +your system. These SDKs are usually installed under: `C:\\Program Files (x86)\\Windows CE Tools\\SDKs` + +The :variable:`CMAKE_GENERATOR_PLATFORM` tells the generator which SDK to use. +Further :variable:`CMAKE_SYSTEM_VERSION` tells the generator what version of Windows CE to use. +Currently version 8.0 (Windows Embedded Compact 2013) is supported out of the box. Other versions +my require to set :variable:`CMAKE_GENERATOR_TOOLSET` to the correct value. + +A toolchain file for Windows CE may look like this: + +.. code-block:: cmake + + set(CMAKE_SYSTEM_NAME WindowsCE) + + set(CMAKE_SYSTEM_VERSION 8.0) + set(CMAKE_SYSTEM_PROCESSOR arm) + + set(CMAKE_GENERATOR_TOOLSET CE800) # Can be omitted for 8.0 + set(CMAKE_GENERATOR_PLATFORM SDK_AM335X_SK_WEC2013_V310) The :variable:`CMAKE_CROSSCOMPILING` variable is set to true when CMake is cross-compiling. -- 1.7.10.4 -- 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-developers