]> git.cworth.org Git - apitrace/blob - cli/CMakeLists.txt
3165f7da662abf4bf8007f50ea474f8d3bb626de
[apitrace] / cli / CMakeLists.txt
1 # Expose the binary/install directories to source
2 #
3 # TODO: Use the same directory layout, for both build and install directories,
4 # so that binaries can find each other using just relative paths.
5 #
6 add_definitions(
7     -DAPITRACE_PROGRAMS_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}/bin"
8     -DAPITRACE_SCRIPTS_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}/${SCRIPTS_INSTALL_DIR}"
9     -DAPITRACE_WRAPPERS_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}/${WRAPPER_INSTALL_DIR}"
10 )
11
12 add_executable (apitrace
13     cli_main.cpp
14     cli_diff.cpp
15     cli_diff_state.cpp
16     cli_diff_images.cpp
17     cli_dump.cpp
18     cli_dump_images.cpp
19     cli_pager.cpp
20     cli_pickle.cpp
21     cli_repack.cpp
22     cli_retrace.cpp
23     cli_trace.cpp
24     cli_trim.cpp
25     cli_resources.cpp
26     trace_analyzer.cpp
27     trim_callset.cpp
28 )
29
30 target_link_libraries (apitrace
31     common
32     ${ZLIB_LIBRARIES}
33     ${SNAPPY_LIBRARIES}
34     ${GETOPT_LIBRARIES}
35 )
36
37 if (NOT CMAKE_CROSSCOMPILING)
38     set_target_properties (apitrace PROPERTIES
39         # On debug builds tell where the source is so that scripts can be found
40         COMPILE_DEFINITIONS_DEBUG APITRACE_SOURCE_DIR="${CMAKE_SOURCE_DIR}"
41     )
42 endif ()
43
44 install (TARGETS apitrace RUNTIME DESTINATION bin)