Skip to content

Commit cfd25f4

Browse files
committed
chore: cli now prints library version with --help
1 parent 8135fea commit cfd25f4

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ target_include_directories(
5050
Interpolate
5151
INTERFACE
5252
$<BUILD_INTERFACE:${libInterpolate_SOURCE_DIR}/src>
53-
$<BUILD_INTERFACE:${libInterpolate_BINARY_DIR}/include>
53+
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
5454
$<INSTALL_INTERFACE:include>)
5555
target_compile_definitions(Interpolate
5656
INTERFACE $<$<BOOL:${MSVC}>:_USE_MATH_DEFINES>)
5757
target_compile_features(Interpolate INTERFACE cxx_std_17)
5858

5959
configure_file(
6060
"${CMAKE_CURRENT_SOURCE_DIR}/src/libInterpolate/version.h.in"
61-
"${CMAKE_BINARY_DIR}/include/libInterpolate/version.h"
61+
"${CMAKE_CURRENT_BINARY_DIR}/include/libInterpolate/version.h"
6262
)
6363
target_sources(
6464
Interpolate

applications/interp-cli.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#include <libInterpolate/version.h>
2+
13
#include <algorithm>
24
#include <boost/program_options.hpp>
35
#include <boost/range/adaptor/strided.hpp>
@@ -14,6 +16,7 @@ using namespace std;
1416
namespace po = boost::program_options;
1517

1618
void print_usage(char prog_name[]) {
19+
cout << "version " << libInterpolate_FULL_VERSION << "\n\n";
1720
cout << "usage: " << prog_name
1821
<< " [OPTIONS] interpolation-data-file x-values-file output-file"
1922
<< "\n";

src/libInterpolate/version.h.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#pragma once
22

3-
#define libInterpolate_VERSION "@libInterpolate_FULL_VERSION@"
3+
#define libInterpolate_FULL_VERSION "@libInterpolate_FULL_VERSION@"

0 commit comments

Comments
 (0)