|
|
@@ -164,20 +164,20 @@ Variable Queries
|
|
|
|
|
|
.. _`Boolean COMPILE_LANGUAGE Generator Expression`:
|
|
|
|
|
|
-``$<COMPILE_LANG_AND_ID:language,compiler_id>``
|
|
|
+``$<COMPILE_LANG_AND_ID:language,compiler_ids>``
|
|
|
``1`` when the language used for compilation unit matches ``language`` and
|
|
|
- the CMake's compiler id of the language compiler matches ``compiler_id``,
|
|
|
- otherwise ``0``. This expression is a short form for the combination of
|
|
|
- ``$<COMPILE_LANGUAGE:language>`` and ``$<LANG_COMPILER_ID:compiler_id>``.
|
|
|
- This expression may be used to specify compile options,
|
|
|
- compile definitions, and include directories for source files of a
|
|
|
+ the CMake's compiler id of the language compiler matches any one of the
|
|
|
+ entries in ``compiler_ids``, otherwise ``0``. This expression is a short form
|
|
|
+ for the combination of ``$<COMPILE_LANGUAGE:language>`` and
|
|
|
+ ``$<LANG_COMPILER_ID:compiler_ids>``. This expression may be used to specify
|
|
|
+ compile options, compile definitions, and include directories for source files of a
|
|
|
particular language and compiler combination in a target. For example:
|
|
|
|
|
|
.. code-block:: cmake
|
|
|
|
|
|
add_executable(myapp main.cpp foo.c bar.cpp zot.cu)
|
|
|
target_compile_definitions(myapp
|
|
|
- PRIVATE $<$<COMPILE_LANG_AND_ID:CXX,Clang>:COMPILING_CXX_WITH_CLANG>
|
|
|
+ PRIVATE $<$<COMPILE_LANG_AND_ID:CXX,AppleClang,Clang>:COMPILING_CXX_WITH_CLANG>
|
|
|
$<$<COMPILE_LANG_AND_ID:CXX,Intel>:COMPILING_CXX_WITH_INTEL>
|
|
|
$<$<COMPILE_LANG_AND_ID:C,Clang>:COMPILING_C_WITH_CLANG>
|
|
|
)
|
|
|
@@ -200,10 +200,10 @@ Variable Queries
|
|
|
$<$<AND:$<COMPILE_LANGUAGE:C>,$<C_COMPILER_ID:Clang>>:COMPILING_C_WITH_CLANG>
|
|
|
)
|
|
|
|
|
|
-``$<COMPILE_LANGUAGE:language>``
|
|
|
- ``1`` when the language used for compilation unit matches ``language``,
|
|
|
- otherwise ``0``. This expression may be used to specify compile options,
|
|
|
- compile definitions, and include directories for source files of a
|
|
|
+``$<COMPILE_LANGUAGE:languages>``
|
|
|
+ ``1`` when the language used for compilation unit matches any of the entries
|
|
|
+ in ``languages``, otherwise ``0``. This expression may be used to specify
|
|
|
+ compile options, compile definitions, and include directories for source files of a
|
|
|
particular language in a target. For example:
|
|
|
|
|
|
.. code-block:: cmake
|
|
|
@@ -217,7 +217,7 @@ Variable Queries
|
|
|
$<$<COMPILE_LANGUAGE:CUDA>:COMPILING_CUDA>
|
|
|
)
|
|
|
target_include_directories(myapp
|
|
|
- PRIVATE $<$<COMPILE_LANGUAGE:CXX>:/opt/foo/cxx_headers>
|
|
|
+ PRIVATE $<$<COMPILE_LANGUAGE:CXX,CUDA>:/opt/foo/headers>
|
|
|
)
|
|
|
|
|
|
This specifies the use of the ``-fno-exceptions`` compile option,
|