Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Commit 8e4a70a

Browse files
committed
Getting ROSSIO git version
1 parent e90f779 commit 8e4a70a

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
io-config.h

CMakeLists.txt

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## From https://github.com/rpavlik/cmake-modules
2+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
3+
14
PROJECT(ROSSIO)
25

36
SET(rossio_srcs io.h)
@@ -9,6 +12,14 @@ ELSE(USE_MPI_IO)
912
SET(rossio_srcs ${rossio_srcs} io-posix.c)
1013
ENDIF(USE_MPI_IO)
1114

15+
## Print ROSSIO Git Hash
16+
INCLUDE(GetGitRevisionDescription)
17+
GET_GIT_HEAD_REVISION(GIT_REFSPEC_IO GIT_SHA1_IO)
18+
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/io-config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/io-config.h @ONLY)
19+
SET(rossio_srcs ${rossio_srcs} io-config.h)
20+
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/io-config.h.in PROPERTIES GENERATED FALSE)
21+
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/io-config.h PROPERTIES GENERATED TRUE)
22+
1223
ADD_LIBRARY(ROSSIO ${rossio_srcs})
1324

1425
# find ross.h

io-config.h.in

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#define ROSSIO_VERSION "@GIT_SHA1_IO@"

io.h

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//Decemeber 13, 2013
44

55
#include "ross.h"
6+
#include "io-config.h"
67

78
extern int g_io_number_of_partitions;
89
extern int g_io_number_of_files;

0 commit comments

Comments
 (0)