Skip to content

Commit 7e2e6f1

Browse files
committed
feat: add version header generation support
1 parent e7509f2 commit 7e2e6f1

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ project(Iceberg
2828
DESCRIPTION "Iceberg C++ Project"
2929
LANGUAGES CXX)
3030

31+
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/iceberg/version.h.in"
32+
"${CMAKE_BINARY_DIR}/src/iceberg/version.h")
33+
3134
set(CMAKE_CXX_STANDARD 23)
3235
set(CMAKE_CXX_STANDARD_REQUIRED ON)
3336
set(CMAKE_CXX_EXTENSIONS OFF)

src/iceberg/version.h.in

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
#pragma once
21+
22+
#define ICEBERG_VERSION_MAJOR @PROJECT_VERSION_MAJOR@
23+
#define ICEBERG_VERSION_MINOR @PROJECT_VERSION_MINOR@
24+
#define ICEBERG_VERSION_PATCH @PROJECT_VERSION_PATCH@
25+
26+
#define ICEBERG_VERSION_STRING "@PROJECT_VERSION@"
27+
28+
#define ICEBERG_PROJECT_NAME "@PROJECT_NAME@"

0 commit comments

Comments
 (0)