From 6a09a5253ece0477e79e2c536b0a705777a2c370 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20M=C3=BCller?= Date: Mon, 10 Apr 2017 20:01:50 +0200 Subject: [PATCH] Expose cppast version string via macro --- src/CMakeLists.txt | 3 ++- tool/main.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 119dc90..ba8290e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -100,7 +100,8 @@ target_link_libraries(cppast PUBLIC type_safe _cppast_tiny_process _cppast_libcl target_compile_definitions(cppast PUBLIC CPPAST_LIBCLANG_SYSTEM_INCLUDE_DIR="${LIBCLANG_SYSTEM_INCLUDE_DIR}" CPPAST_CLANG_BINARY="${CLANG_BINARY}" - CPPAST_CLANG_VERSION_STRING="${LLVM_VERSION}") + CPPAST_CLANG_VERSION_STRING="${LLVM_VERSION}" + CPPAST_VERSION_STRING="${cppast_VERSION}") if(CPPAST_ENABLE_ASSERTIONS) target_compile_definitions(cppast PUBLIC CPPAST_ENABLE_ASSERTIONS) endif() diff --git a/tool/main.cpp b/tool/main.cpp index 9365123..af2b3ce 100644 --- a/tool/main.cpp +++ b/tool/main.cpp @@ -218,7 +218,7 @@ int main(int argc, char* argv[]) print_help(options); else if (options.count("version")) { - std::cout << "cppast version 0.0\n"; + std::cout << "cppast version " << CPPAST_VERSION_STRING << "\n"; std::cout << "Copyright (C) Jonathan Müller 2017 \n"; std::cout << '\n'; std::cout << "Using libclang version " << CPPAST_CLANG_VERSION_STRING << '\n';