Skip to content

Commit 385853f

Browse files
authored
New Package ittapi (#483)
* add package ittnotify * trigger build * fix sha1 * update ittapi version. * fix default version * use cpp-pm repository. * add example usage * fix pr-N
1 parent 4c59352 commit 385853f

File tree

5 files changed

+74
-0
lines changed

5 files changed

+74
-0
lines changed

cmake/configs/default.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ hunter_default_version(ios_sim VERSION 3.1.1)
331331
hunter_default_version(ippicv VERSION 20151201)
332332
hunter_default_version(iroha-ed25519 VERSION 2.0.0)
333333
hunter_default_version(irrXML VERSION 1.2-p0)
334+
hunter_default_version(ittapi VERSION 3.21.2-p0)
334335
hunter_default_version(jaegertracing VERSION 0.4.1)
335336
hunter_default_version(jansson VERSION 2.11.0)
336337
hunter_default_version(jasper VERSION 2.0.32-p0)

cmake/projects/ittapi/hunter.cmake

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copyright (c) 2016-2020, Rahul Sheth, Ruslan Baratov
2+
# All rights reserved.
3+
4+
# !!! DO NOT PLACE HEADER GUARDS HERE !!!
5+
6+
include(hunter_add_version)
7+
include(hunter_cacheable)
8+
include(hunter_download)
9+
include(hunter_pick_scheme)
10+
11+
12+
hunter_add_version(
13+
PACKAGE_NAME
14+
ittapi
15+
VERSION
16+
3.21.2-p0
17+
URL
18+
"https://github.com/cpp-pm/ittapi/archive/v3.21.2-p0.tar.gz"
19+
SHA1
20+
1a2ef8c2b50c42deec85a63a23fd7b7b0fbe75b0
21+
)
22+
23+
hunter_pick_scheme(DEFAULT url_sha1_cmake)
24+
hunter_cacheable(ittapi)
25+
hunter_download(PACKAGE_NAME ittapi)

docs/packages/pkg/ittapi.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.. spelling::
2+
3+
ittapi
4+
5+
.. index::
6+
single: testing ; ittapi
7+
8+
.. _pkg.ittapi:
9+
10+
ittapi
11+
======
12+
13+
- `Official <https://github.com/intel/ittapi>`__
14+
- `Hunterized <https://github.com/cpp-pm/ittapi>`__
15+
- `Example <https://github.com/cpp-pm/hunter/blob/master/examples/ittapi/CMakeLists.txt>`__
16+
- Added by `Raffael Casagrande <https://github.com/craffael>`__ (`pr-483 <https://github.com/cpp-pm/hunter/pull/483>`__)
17+
18+
.. literalinclude:: /../examples/ittapi/CMakeLists.txt
19+
:language: cmake
20+
:start-after: # DOCUMENTATION_START {
21+
:end-before: # DOCUMENTATION_END }

examples/ittapi/CMakeLists.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright (c) 2016-2020, Rahul Sheth, Ruslan Baratov
2+
# All rights reserved.
3+
4+
cmake_minimum_required(VERSION 3.2)
5+
6+
# Emulate HunterGate:
7+
# * https://github.com/hunter-packages/gate
8+
include("../common.cmake")
9+
10+
project(download-ittapi)
11+
12+
# DOCUMENTATION_START {
13+
hunter_add_package(ittapi)
14+
find_package(ittapi CONFIG REQUIRED)
15+
16+
add_executable(boo boo.cpp)
17+
target_link_libraries(boo PUBLIC ittapi::ittnotify)
18+
# DOCUMENTATION_END }

examples/ittapi/boo.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#include <ittnotify.h>
2+
3+
int main() {
4+
// pause data collection:
5+
__itt_pause();
6+
7+
// Start data collection
8+
__itt_resume();
9+
}

0 commit comments

Comments
 (0)