| 1 |
# Copyright (c) 2019-2025 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 |
|
| 15 |
cmake_minimum_required(VERSION 3.5.0...3.31.3) |
| 16 |
|
| 17 |
project(fibonacci CXX) |
| 18 |
|
| 19 |
include(../../common/cmake/common.cmake) |
| 20 |
|
| 21 |
set_common_project_settings(tbb) |
| 22 |
|
| 23 |
add_executable(fibonacci fibonacci.cpp) |
| 24 |
target_link_libraries(fibonacci |
| 25 |
TBB::tbb |
| 26 |
Threads::Threads |
| 27 |
$<$<PLATFORM_ID:Linux>:rt>) # Link "rt" library on Linux |
| 28 |
target_compile_options(fibonacci PRIVATE ${TBB_CXX_STD_FLAG}) |
| 29 |
|
| 30 |
set(EXECUTABLE "$<TARGET_FILE:fibonacci>") |
| 31 |
set(ARGS "") |
| 32 |
|
| 33 |
add_execution_target(run_fibonacci fibonacci ${EXECUTABLE} "${ARGS}") |