X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=cli%2FCMakeLists.txt;h=299c3985a3284c120f8b33bf83df16fa77c98d92;hb=b9c20609ce007c6e07562df57b8a5d845061b9e4;hp=fc52527dfc91996a5a48a607edba38907a336a1a;hpb=c987ebd2ccdaf84a2f983ea6681dd032c0672525;p=apitrace diff --git a/cli/CMakeLists.txt b/cli/CMakeLists.txt index fc52527..299c398 100644 --- a/cli/CMakeLists.txt +++ b/cli/CMakeLists.txt @@ -1,7 +1,56 @@ +# 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_sed.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 () + +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)