11<!-- This is auto-generated file. -->
22* Source code: [ cmake/modules/FindDTrace.cmake] ( https://github.com/petk/php-build-system/blob/master/cmake/cmake/modules/FindDTrace.cmake )
33
4- # FindDtrace
4+ # FindDTrace
55
66Find DTrace.
77
8+ Module defines the following ` IMPORTED ` target(s):
9+
10+ * ` DTrace::DTrace ` - The package library, if found.
11+
812## Result variables
913
1014* ` DTrace_FOUND ` - Whether DTrace library is found.
@@ -13,34 +17,51 @@ Find DTrace.
1317
1418* ` DTrace_INCLUDE_DIR ` - Directory containing DTrace library headers.
1519* ` DTrace_EXECUTABLE ` - Path to the DTrace command-line utility.
16- * ` HAVE_DTRACE ` - Whether DTrace support is enabled.
1720
1821## Functions provided by this module
1922
2023Module defines the following function to initialize the DTrace support.
2124
2225``` cmake
2326dtrace_target(
24- TARGET <target-name>
27+ <target-name>
2528 INPUT <input>
2629 HEADER <header>
2730 SOURCES <source>...
2831 [INCLUDES <includes>...]
2932)
3033```
3134
32- * ` TARGET ` - Target name to append the generated DTrace probe definition object
33- file.
34- * ` INPUT ` - Name of the file with DTrace probe descriptions.
35- * ` HEADER ` - Name of the DTrace probe header file.
36- * ` SOURCES ` - A list of project source files to build DTrace object.
35+ Generates DTrace header ` <header> ` and creates ` INTERFACE ` library
36+ ` <target-name> ` with probe definition object file added as INTERFACE source.
37+
38+ * ` <target-name> ` - DTrace INTERFACE library with the generated DTrace probe
39+ definition object file.
40+ * ` INPUT ` - Name of the file with DTrace probe descriptions. Relative path is
41+ interpreted as being relative to the current source directory.
42+ * ` HEADER ` - Name of the DTrace probe header file to be generated. Relative path
43+ is interpreted as being relative to the current binary directory.
44+ * ` SOURCES ` - A list of source files to build DTrace object. Relative paths are
45+ interpreted as being relative to the current source directory.
3746* ` INCLUDES ` - A list of include directories for appending to DTrace object.
3847
3948## Basic usage
4049
4150``` cmake
4251# CMakeLists.txt
52+
4353find_package(DTrace)
54+
55+ dtrace_target(
56+ foo_dtrace
57+ INPUT foo_dtrace.d
58+ HEADER foo_dtrace_generated.h
59+ SOURCES foo.c ...
60+ )
61+ target_link_libraries(foo PRIVATE DTrace::DTrace)
62+
63+ add_executable(bar)
64+ target_link_libraries(bar PRIVATE foo_dtrace)
4465```
4566
4667## Customizing search locations
0 commit comments