Help/manual: Avoid long lines in code blocks

Update the wording of some examples to avoid long lines in code blocks.
Otherwise the formatted documentation can exceed certain column width
limitations.
This commit is contained in:
Brad King 2014-10-22 16:43:05 -04:00
parent 4fdacedc27
commit 80b19a7127
4 changed files with 21 additions and 6 deletions

View File

@ -276,10 +276,13 @@ properties:
.. code-block:: cmake .. code-block:: cmake
add_library(foo INTERFACE) add_library(foo INTERFACE)
set(with_variadics ${CMAKE_CURRENT_SOURCE_DIR}/with_variadics)
set(no_variadics ${CMAKE_CURRENT_SOURCE_DIR}/no_variadics)
target_link_libraries(foo target_link_libraries(foo
INTERFACE INTERFACE
"$<$<COMPILE_FEATURES:cxx_variadic_templates>:${CMAKE_CURRENT_SOURCE_DIR}/with_variadics>" "$<$<COMPILE_FEATURES:cxx_variadic_templates>:${with_variadics}>"
"$<$<NOT:$<COMPILE_FEATURES:cxx_variadic_templates>>:${CMAKE_CURRENT_SOURCE_DIR}/no_variadics>") "$<$<NOT:$<COMPILE_FEATURES:cxx_variadic_templates>>:${no_variadics}>"
)
Consuming code then simply links to the ``foo`` target as usual and uses Consuming code then simply links to the ``foo`` target as usual and uses
the feature-appropriate include directory the feature-appropriate include directory

View File

@ -1005,7 +1005,8 @@ projects that do not require a high enough CMake version.
.. code-block:: cmake .. code-block:: cmake
if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 3.0.0) if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 3.0.0)
message(AUTHOR_WARNING "Your project should require at least CMake 3.0.0 to use FindFoo.cmake") message(AUTHOR_WARNING
"Your project should require at least CMake 3.0.0 to use FindFoo.cmake")
endif() endif()
Now the actual libraries and so on have to be found. The code here will Now the actual libraries and so on have to be found. The code here will

View File

@ -38,6 +38,8 @@ create conditional output::
expands to ``DEBUG_MODE`` when the ``Debug`` configuration is used, and expands to ``DEBUG_MODE`` when the ``Debug`` configuration is used, and
otherwise expands to nothing. otherwise expands to nothing.
Available logical expressions are:
``$<0:...>`` ``$<0:...>``
Empty string (ignores ``...``) Empty string (ignores ``...``)
``$<1:...>`` ``$<1:...>``
@ -111,6 +113,8 @@ expands to ``OLD_COMPILER`` if the
:variable:`CMAKE_CXX_COMPILER_VERSION <CMAKE_<LANG>_COMPILER_VERSION>` is less :variable:`CMAKE_CXX_COMPILER_VERSION <CMAKE_<LANG>_COMPILER_VERSION>` is less
than 4.2.0. than 4.2.0.
Available informational expressions are:
``$<CONFIGURATION>`` ``$<CONFIGURATION>``
Configuration name. Deprecated. Use ``CONFIG`` instead. Configuration name. Deprecated. Use ``CONFIG`` instead.
``$<CONFIG>`` ``$<CONFIG>``
@ -185,7 +189,13 @@ property with each entry preceeded by ``-I``. Note that a more-complete use
in this situation would require first checking if the INCLUDE_DIRECTORIES in this situation would require first checking if the INCLUDE_DIRECTORIES
property is non-empty:: property is non-empty::
$<$<BOOL:$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>>:-I$<JOIN:$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>, -I>> $<$<BOOL:${prop}>:-I$<JOIN:${prop}, -I>>
where ``${prop}`` refers to a helper variable::
set(prop "$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>")
Available output expressions are:
``$<JOIN:list,...>`` ``$<JOIN:list,...>``
Joins the list with the content of ``...`` Joins the list with the content of ``...``

View File

@ -115,8 +115,9 @@ as:
set(CMAKE_SYSROOT /home/devel/rasp-pi-rootfs) set(CMAKE_SYSROOT /home/devel/rasp-pi-rootfs)
set(CMAKE_STAGING_PREFIX /home/devel/stage) set(CMAKE_STAGING_PREFIX /home/devel/stage)
set(CMAKE_C_COMPILER /home/devel/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-gcc) set(tools /home/devel/gcc-4.7-linaro-rpi-gnueabihf)
set(CMAKE_CXX_COMPILER /home/devel/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-g++) set(CMAKE_C_COMPILER ${tools}/bin/arm-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER ${tools}/bin/arm-linux-gnueabihf-g++)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)