Debian Codegraph @

cmake/tribits/core/package_arch/TribitsConfigureTiming.cmake

raw
1 # @HEADER
2 # *****************************************************************************
3 # TriBITS: Tribal Build, Integrate, and Test System
4 #
5 # Copyright 2013-2016 NTESS and the TriBITS contributors.
6 # SPDX-License-Identifier: BSD-3-Clause
7 # *****************************************************************************
8 # @HEADER
9
10
11 include(TimingUtils)
12
13
14 # Optionally start CMake code configure timing
15 #
16 function(tribits_config_code_start_timer START_TIMER_SECONDS_VAR_OUT)
17 if (${PROJECT_NAME}_ENABLE_CONFIGURE_TIMING)
18 timer_get_raw_seconds(START_TIMER_SECONDS)
19 set(${START_TIMER_SECONDS_VAR_OUT} ${START_TIMER_SECONDS} PARENT_SCOPE)
20 endif()
21 endfunction()
22
23
24 # Optionally stop CMake code configure timing
25 #
26 function(tribits_config_code_stop_timer START_TIMER_SECONDS_VAR_IN
27 TIMER_STR
28 )
29 if (${PROJECT_NAME}_ENABLE_CONFIGURE_TIMING)
30 timer_get_raw_seconds(TIMER_STOP_SECONDS)
31 timer_print_rel_time(${${START_TIMER_SECONDS_VAR_IN}}
32 ${TIMER_STOP_SECONDS}
33 "${TIMER_STR}")
34 endif()
35 endfunction()
36
37
38 # Optionally start CMake code **package** configure timing
39 #
40 function(tribits_package_config_code_start_timer START_TIMER_SECONDS_VAR_OUT)
41 if (${PROJECT_NAME}_ENABLE_CONFIGURE_TIMING
42 AND
43 ( ${PROJECT_NAME}_ENABLE_PACKAGE_CONFIGURE_TIMING
44 OR ${TRIBITS_PACKAGE}_PACKAGE_CONFIGURE_TIMING )
45 )
46 timer_get_raw_seconds(START_TIMER_SECONDS)
47 set(${START_TIMER_SECONDS_VAR_OUT} ${START_TIMER_SECONDS} PARENT_SCOPE)
48 endif()
49 endfunction()
50
51
52 # Optionally stop CMake code **package** configure timing
53 #
54 function(tribits_package_config_code_stop_timer START_TIMER_SECONDS_VAR_IN
55 TIMER_STR
56 )
57 if (${PROJECT_NAME}_ENABLE_CONFIGURE_TIMING
58 AND
59 ( ${PROJECT_NAME}_ENABLE_PACKAGE_CONFIGURE_TIMING
60 OR ${TRIBITS_PACKAGE}_PACKAGE_CONFIGURE_TIMING )
61 )
62 timer_get_raw_seconds(TIMER_STOP_SECONDS)
63 timer_print_rel_time(${${START_TIMER_SECONDS_VAR_IN}}
64 ${TIMER_STOP_SECONDS}
65 "${TIMER_STR}")
66 endif()
67 endfunction()