From e9519db3d296c096cd266bf3f5712e92915f2f3f Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Fri, 24 Jan 2020 17:05:38 +0100 Subject: CMake Build: add build support with CMake Change-Id: I9ec73226ba0309f244038708cb85d2ae9f3aab30 Reviewed-by: Ulf Hermann --- CMakeLists.txt | 9 +++++++++ app/CMakeLists.txt | 27 +++++++++++++++++++++++++++ tests/CMakeLists.txt | 2 ++ tests/auto/CMakeLists.txt | 5 +++++ tests/auto/addresscache/CMakeLists.txt | 4 ++++ tests/auto/elfmap/CMakeLists.txt | 4 ++++ tests/auto/kallsyms/CMakeLists.txt | 4 ++++ tests/auto/perfdata/CMakeLists.txt | 8 ++++++++ tests/auto/perfstdin/CMakeLists.txt | 4 ++++ tests/manual/CMakeLists.txt | 1 + tests/manual/perf2text/CMakeLists.txt | 8 ++++++++ 11 files changed, 76 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 app/CMakeLists.txt create mode 100644 tests/CMakeLists.txt create mode 100644 tests/auto/CMakeLists.txt create mode 100644 tests/auto/addresscache/CMakeLists.txt create mode 100644 tests/auto/elfmap/CMakeLists.txt create mode 100644 tests/auto/kallsyms/CMakeLists.txt create mode 100644 tests/auto/perfdata/CMakeLists.txt create mode 100644 tests/auto/perfstdin/CMakeLists.txt create mode 100644 tests/manual/CMakeLists.txt create mode 100644 tests/manual/perf2text/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..8be664e --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,9 @@ +find_package(elfutils) + +if (NOT elfutils_FOUND) + message(STATUS "PerfParser is disabled. Set ELFUTILS_INSTALL_DIR to enable it.") + return() +endif() + +add_subdirectory(app) +add_subdirectory(tests) diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt new file mode 100644 index 0000000..ee9397c --- /dev/null +++ b/app/CMakeLists.txt @@ -0,0 +1,27 @@ +add_qtc_library(perfparser_lib STATIC + ALLOW_ASCII_CASTS + DEPENDS Qt5::Network + PUBLIC_DEPENDS elfutils::dw elfutils::elf + PUBLIC_INCLUDES ./ + SOURCES + perfaddresscache.cpp + perfattributes.cpp perfattributes.h + perfheader.cpp perfheader.h + perffilesection.cpp perffilesection.h + perffeatures.cpp perffeatures.h + perfdata.cpp perfdata.h + perfunwind.cpp perfunwind.h + perfregisterinfo.cpp perfregisterinfo.h + perfstdin.cpp perfstdin.h + perfsymboltable.cpp perfsymboltable.h + perfelfmap.cpp perfelfmap.h + perfkallsyms.cpp perfkallsyms.h + perftracingdata.cpp perftracingdata.h +) + +add_qtc_executable(perfparser + DEPENDS + perfparser_lib + SOURCES + main.cpp +) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 0000000..ec45685 --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory(auto) +add_subdirectory(manual) diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt new file mode 100644 index 0000000..8608d7f --- /dev/null +++ b/tests/auto/CMakeLists.txt @@ -0,0 +1,5 @@ +add_subdirectory(addresscache) +add_subdirectory(elfmap) +add_subdirectory(kallsyms) +add_subdirectory(perfdata) +add_subdirectory(perfstdin) diff --git a/tests/auto/addresscache/CMakeLists.txt b/tests/auto/addresscache/CMakeLists.txt new file mode 100644 index 0000000..adf33f2 --- /dev/null +++ b/tests/auto/addresscache/CMakeLists.txt @@ -0,0 +1,4 @@ +add_qtc_test(tst_addresscache + DEPENDS Qt5::Core Qt5::Test perfparser_lib + SOURCES tst_addresscache.cpp +) diff --git a/tests/auto/elfmap/CMakeLists.txt b/tests/auto/elfmap/CMakeLists.txt new file mode 100644 index 0000000..86ae296 --- /dev/null +++ b/tests/auto/elfmap/CMakeLists.txt @@ -0,0 +1,4 @@ +add_qtc_test(tst_elfmap + DEPENDS Qt5::Core Qt5::Test perfparser_lib + SOURCES tst_elfmap.cpp +) diff --git a/tests/auto/kallsyms/CMakeLists.txt b/tests/auto/kallsyms/CMakeLists.txt new file mode 100644 index 0000000..5b42a07 --- /dev/null +++ b/tests/auto/kallsyms/CMakeLists.txt @@ -0,0 +1,4 @@ +add_qtc_test(tst_kallsyms + DEPENDS Qt5::Core Qt5::Test perfparser_lib + SOURCES tst_kallsyms.cpp +) diff --git a/tests/auto/perfdata/CMakeLists.txt b/tests/auto/perfdata/CMakeLists.txt new file mode 100644 index 0000000..70a0e8f --- /dev/null +++ b/tests/auto/perfdata/CMakeLists.txt @@ -0,0 +1,8 @@ +add_qtc_test(tst_perfdata + DEPENDS Qt5::Core Qt5::Test perfparser_lib + INCLUDES ../shared + SOURCES + ../shared/perfparsertestclient.cpp + perfdata.qrc + tst_perfdata.cpp +) diff --git a/tests/auto/perfstdin/CMakeLists.txt b/tests/auto/perfstdin/CMakeLists.txt new file mode 100644 index 0000000..86e3a13 --- /dev/null +++ b/tests/auto/perfstdin/CMakeLists.txt @@ -0,0 +1,4 @@ +add_qtc_test(tst_perfstdin + DEPENDS Qt5::Core Qt5::Test perfparser_lib + SOURCES tst_perfstdin.cpp +) diff --git a/tests/manual/CMakeLists.txt b/tests/manual/CMakeLists.txt new file mode 100644 index 0000000..2de0169 --- /dev/null +++ b/tests/manual/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(perf2text) diff --git a/tests/manual/perf2text/CMakeLists.txt b/tests/manual/perf2text/CMakeLists.txt new file mode 100644 index 0000000..59b5ddd --- /dev/null +++ b/tests/manual/perf2text/CMakeLists.txt @@ -0,0 +1,8 @@ +add_qtc_executable(perf2text + DEFINES MANUAL_TEST + DEPENDS perfparser_lib + INCLUDES ../../auto/shared/ + SOURCES + ../../auto/shared/perfparsertestclient.cpp + perf2text.cpp +) -- cgit v1.2.3