From 92b3c2dcff3e85ad3d455f6ab845d9a97d3b525b Mon Sep 17 00:00:00 2001 From: Aqua-sama <aqua@iserlohn-fortress.net> Date: Mon, 7 Dec 2020 12:22:15 +0200 Subject: Rewrite meson build scripts into cmakelists --- src/cmd/CMakeLists.txt | 5 +++++ src/cmd/cmd.hpp | 4 ++-- src/cmd/meson.build | 2 -- 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 src/cmd/CMakeLists.txt delete mode 100644 src/cmd/meson.build (limited to 'src/cmd') diff --git a/src/cmd/CMakeLists.txt b/src/cmd/CMakeLists.txt new file mode 100644 index 0000000..31563c9 --- /dev/null +++ b/src/cmd/CMakeLists.txt @@ -0,0 +1,5 @@ +add_executable(cmd_test test.cpp) +target_link_libraries(cmd_test PRIVATE autogen Qt5::Core) +target_sanitize(cmd_test) + +add_test(NAME cmd_parser COMMAND cmd_test) \ No newline at end of file diff --git a/src/cmd/cmd.hpp b/src/cmd/cmd.hpp index 37bb3ce..1aad060 100644 --- a/src/cmd/cmd.hpp +++ b/src/cmd/cmd.hpp @@ -24,7 +24,7 @@ using map = std::unordered_map<std::string, subcommand_fn<T>>; // a helper function to join the keys of a command_map into a string template <typename T> -[[nodiscard]] inline QString join_keys(const map<T> &map, const QString sep = ", ") +[[nodiscard]] inline QString join_keys(const map<T> &map, const QString &sep = ", ") { QString k; for(auto it = map.cbegin(); it != map.cend(); ++it) { @@ -59,7 +59,7 @@ template <typename T> parser.process(app); if(parser.isSet(build)) { - std::cout << app.applicationName().toStdString() << " " << poi_Version << std::endl; + std::cout << app.applicationName().toStdString() << " " << POI_VERSION << std::endl; exit(0); } diff --git a/src/cmd/meson.build b/src/cmd/meson.build deleted file mode 100644 index 466647f..0000000 --- a/src/cmd/meson.build +++ /dev/null @@ -1,2 +0,0 @@ -test('command line parser', executable('cmd_test', ['test.cpp', version_h], dependencies: [ dep_qt5 ])) - -- cgit v1.2.1