X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=cli%2FCMakeLists.txt;h=e2b4d720beed16d6ed12c705dba817cc146a9d3f;hb=2a5696befce6be00fa655b751af5ce2924ea45ae;hp=5df363ab943680dc34a5ee121fa10c40553bc211;hpb=8efbe01f8cbd25ee9a731fd1d61f61337a108195;p=apitrace diff --git a/cli/CMakeLists.txt b/cli/CMakeLists.txt index 5df363a..e2b4d72 100644 --- a/cli/CMakeLists.txt +++ b/cli/CMakeLists.txt @@ -1,3 +1,14 @@ +# 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 @@ -9,17 +20,38 @@ add_executable (apitrace cli_pickle.cpp cli_repack.cpp cli_retrace.cpp + cli_sed.cpp cli_trace.cpp cli_trim.cpp + cli_resources.cpp trace_analyzer.cpp ) target_link_libraries (apitrace common - ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${SNAPPY_LIBRARIES} ${GETOPT_LIBRARIES} + ${LIBBACKTRACE_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 () + +if (MSVC) + # On MSVC builds tell which subdirectory the binaries with be (for each + # configuration) + set_target_properties (apitrace PROPERTIES + COMPILE_DEFINITIONS_DEBUG APITRACE_CONFIGURATION_SUBDIR="Debug" + COMPILE_DEFINITIONS_RELEASE APITRACE_CONFIGURATION_SUBDIR="Release" + COMPILE_DEFINITIONS_MINSIZEREL APITRACE_CONFIGURATION_SUBDIR="MinSizeRel" + COMPILE_DEFINITIONS_RELWITHDEBINFO APITRACE_CONFIGURATION_SUBDIR="RelWithDebInfo" + ) +endif () + + install (TARGETS apitrace RUNTIME DESTINATION bin)