X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=cli%2FCMakeLists.txt;h=689374dc5333ade934d45ea2a398e57d7182cec5;hb=ec8f5a61f393e75e4c3e3e22f84c773af66810e9;hp=36a9d2620969296f9d99374311c9a059f61ea1f0;hpb=ca0c40fa6d5764b3f2ba7cafc7ba1c291e466005;p=apitrace diff --git a/cli/CMakeLists.txt b/cli/CMakeLists.txt index 36a9d26..689374d 100644 --- a/cli/CMakeLists.txt +++ b/cli/CMakeLists.txt @@ -1,9 +1,43 @@ +# Expose the binary/install directories to source +# +# TODO: Use the same directory layout, for both build and install directories, +# so that binaries can find each other using just relative paths. +# +add_definitions( + -DAPITRACE_PROGRAMS_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}/bin" + -DAPITRACE_SCRIPTS_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}/${SCRIPTS_INSTALL_DIR}" + -DAPITRACE_WRAPPERS_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}/${WRAPPER_INSTALL_DIR}" +) + add_executable (apitrace cli_main.cpp cli_diff.cpp cli_diff_state.cpp + cli_diff_images.cpp cli_dump.cpp + cli_dump_images.cpp + cli_pager.cpp + cli_pickle.cpp + cli_repack.cpp + cli_retrace.cpp cli_trace.cpp + cli_trim.cpp + cli_resources.cpp + trace_analyzer.cpp ) +target_link_libraries (apitrace + common + ${ZLIB_LIBRARIES} + ${SNAPPY_LIBRARIES} + ${GETOPT_LIBRARIES} +) + +if (NOT CMAKE_CROSSCOMPILING) + set_target_properties (apitrace PROPERTIES + # On debug builds tell where the source is so that scripts can be found + COMPILE_DEFINITIONS_DEBUG APITRACE_SOURCE_DIR="${CMAKE_SOURCE_DIR}" + ) +endif () + install (TARGETS apitrace RUNTIME DESTINATION bin)