Skip to content

Commit c52d120

Browse files
committed
Use the version specified in CMakeLists.txt
Signed-off-by: Kunlin Yu <yukunlin@syriusrobotics.com>
1 parent 7aa550d commit c52d120

3 files changed

Lines changed: 12 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ project(cql2cpp
55
HOMEPAGE_URL "https://github.com/IndoorSpatial/cql2cpp"
66
LANGUAGES CXX
77
)
8+
add_definitions(-DVERSION="${PROJECT_VERSION}")
89

910
find_package(GTest REQUIRED)
1011
find_package(geos REQUIRED)

include/cql2cpp/cql2cpp.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
#include "global_yylex.h"
2424
#include "tree_dot.h"
2525

26+
#ifndef VERSION
27+
#define VERSION "0.0.0"
28+
#endif
29+
2630
namespace cql2cpp {
2731

2832
template <typename FeatureType>
@@ -113,6 +117,8 @@ class Cql2Cpp {
113117
return true;
114118
}
115119

120+
static std::string version() { return VERSION; }
121+
116122
private:
117123
static bool Parse(const std::string& cql2_query, AstNodePtr* root,
118124
std::string* error_msg) {

src/main.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121

2222
#include <fstream>
2323

24+
#ifndef VERSION
25+
#define VERSION "0.0.0"
26+
#endif
27+
2428
DEFINE_string(query, "", "cql2 query string");
2529
DEFINE_string(geojson, "",
2630
"geojson data set with multiple features in one feature "
@@ -35,7 +39,7 @@ int main(int argc, char** argv) {
3539
gflags::SetUsageMessage(
3640
"Usage: cql2 -query=\"city='Toronto'\" "
3741
"-geojson=\"path/to/feature_collection.geojson\" -index=0");
38-
gflags::SetVersionString("0.1.0");
42+
gflags::SetVersionString(VERSION);
3943
gflags::ParseCommandLineFlags(&argc, &argv, true);
4044

4145
google::InitGoogleLogging(argv[0]);

0 commit comments

Comments
 (0)