Skip to content

Commit bf388b5

Browse files
authored
Merge pull request #32 from cse-sim/version-fix
Revert "cmake file corrections"
2 parents e822cd1 + 4939603 commit bf388b5

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

cmake/CSEVersion.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,16 @@ if (NOT ${git_build_exit_status} MATCHES "0")
6363
set(GIT_BUILD "unknown-build-number")
6464
endif()
6565

66-
if(NOT ${GIT_BUILD} MATCHES "0")
66+
if(NOT ${GIT_BUILD} MATCHES "^0$")
6767
set(CSEVRSN_META "+${GIT_BRANCH}.${GIT_SHA}.${GIT_BUILD}")
6868
else()
6969
set(CSEVRSN_META "")
7070
endif()
7171

72+
message("Building CSE ${CSEVRSN_MAJOR}.${CSEVRSN_MINOR}.${CSEVRSN_PATCH}${CSEVRSN_META}")
73+
7274
configure_file(
7375
"${PROJECT_SOURCE_DIR}/src/csevrsn.h.in"
7476
"${PROJECT_SOURCE_DIR}/src/csevrsn.h"
7577
)
78+

src/CMakeLists.txt

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
add_subdirectory(RCDEF)
33

44
# Run C Preprocessor on *.DEF files
5+
set(defs
6+
CNDTYPES.DEF
7+
CNUNITS.DEF
8+
DTLIMS.DEF
9+
CNFIELDS.DEF
10+
CNRECS.DEF
11+
)
12+
513
macro(c_preprocess file)
614
add_custom_command(
715
OUTPUT "${file}.i"
@@ -10,11 +18,10 @@ macro(c_preprocess file)
1018
)
1119
endmacro()
1220

13-
c_preprocess(cndtypes)
14-
c_preprocess(cnunits)
15-
c_preprocess(dtlims)
16-
c_preprocess(cnfields)
17-
c_preprocess(cnrecs)
21+
foreach(defFile ${defs})
22+
string(REGEX REPLACE "^(\\w).DEF$" "\\1" file "${defFile}")
23+
c_preprocess(${file})
24+
endforeach()
1825

1926
# Run RCDEF
2027
add_custom_command(
@@ -220,6 +227,7 @@ set(libs
220227

221228
source_group("Source Files" FILES ${source})
222229
source_group("Header Files" FILES ${headers})
230+
source_group("Def Files" FILES ${defs})
223231

224232
target_link_libraries(CSE ${libs})
225233

0 commit comments

Comments
 (0)