xref: /oneTBB/cmake/test_spec.cmake (revision b15aabb3)
1# Copyright (c) 2020-2021 Intel Corporation
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15option(TBB_TEST_SPEC "Generate test specification (Doxygen)" OFF)
16
17if (TBB_TEST_SPEC)
18    find_package(Doxygen REQUIRED)
19
20    set(DOXYGEN_PREDEFINED_MACROS
21      "TBB_USE_EXCEPTIONS \
22      __TBB_RESUMABLE_TASKS \
23      __TBB_HWLOC_PRESENT \
24      __TBB_CPP17_DEDUCTION_GUIDES_PRESENT \
25      __TBB_CPP17_MEMORY_RESOURCE_PRESENT \
26      __TBB_CPP14_GENERIC_LAMBDAS_PRESENT"
27    )
28
29    add_custom_target(
30      test_spec ALL
31      COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
32      COMMENT "Generating test specification with Doxygen"
33      VERBATIM)
34    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
35endif()
36