Skip to content

Commit 49100c8

Browse files
Add an include file defining the FETPAPI version
1 parent 46c8d4d commit 49100c8

4 files changed

Lines changed: 47 additions & 2 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/swig/setup.py
44
/swig/swigEtp1_2Include.i
55
/src/macroDefinitions.h
6+
/src/version_config.h
67

78
## Ignore csharp swig generated files
89
/swig/swigGeneratedCsWrapper.cpp

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,15 @@ set (FETPAPI_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
1515

1616
# version mechanism
1717
set (Fetpapi_VERSION_MAJOR 0)
18-
set (Fetpapi_VERSION_MINOR 5)
18+
set (Fetpapi_VERSION_MINOR 6)
1919
set (Fetpapi_VERSION_PATCH 0)
2020
set (Fetpapi_VERSION_TWEAK 0)
2121

2222
set (Fetpapi_VERSION ${Fetpapi_VERSION_MAJOR}.${Fetpapi_VERSION_MINOR}.${Fetpapi_VERSION_PATCH}.${Fetpapi_VERSION_TWEAK})
2323

24+
# Create the version config header file in order for FETPAPI users to know the FETPAPI version at runtime.
25+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/version_config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/src/version_config.h)
26+
2427
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
2528
set (CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/install CACHE PATH "${PROJECT_NAME} install prefix" FORCE)
2629
endif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)

cmake/version_config.h.in

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
#pragma once
20+
21+
/**
22+
* Major change such as an architectural one
23+
*/
24+
#define FETPAPI_VERSION_MAJOR ${Fetpapi_VERSION_MAJOR}
25+
/**
26+
* Minor change which modifies at least one public method/function
27+
*/
28+
#define FETPAPI_VERSION_MINOR ${Fetpapi_VERSION_MINOR}
29+
/**
30+
* Bug fix or developement which does not modify any public method/function
31+
*/
32+
#define FETPAPI_VERSION_PATCH ${Fetpapi_VERSION_PATCH}
33+
/**
34+
* Tweak such as typo which does not change functionality of FETPAPI
35+
*/
36+
#define FETPAPI_VERSION_TWEAK ${Fetpapi_VERSION_TWEAK}
37+
/**
38+
* The FETPAPI version as a string
39+
*/
40+
#define FETPAPI_VERSION_STR "${Fetpapi_VERSION}"

src/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
set(FETPAPI_HEADERS ${CMAKE_CURRENT_LIST_DIR}/macroDefinitions.h )
1+
set(FETPAPI_HEADERS ${CMAKE_CURRENT_LIST_DIR}/macroDefinitions.h
2+
${CMAKE_CURRENT_LIST_DIR}/version_config.h )
23

34
include(${CMAKE_CURRENT_LIST_DIR}/etp/CMakeLists.txt)

0 commit comments

Comments
 (0)