@@ -30,10 +30,10 @@ file(STRINGS ".VERSION" first_line
30
30
LIMIT_COUNT 1
31
31
)
32
32
33
- string (REGEX MATCH "[0-9]+\\ .[0-9]+\\ .[0-9]+"
33
+ string (REGEX MATCH "[0-9]+\\ .[0-9]+\\ .[0-9]+(-rc[0-9]+)? "
34
34
OpenCoarraysVersion "${first_line} " )
35
35
36
- if ((NOT (OpenCoarraysVersion MATCHES "[0-9]+\\ .[0-9]+\\ .[0-9]+" )) AND (EXISTS "${CMAKE_SOURCE_DIR} /.git" ))
36
+ if ((NOT (OpenCoarraysVersion MATCHES "[0-9]+\\ .[0-9]+\\ .[0-9]+(-rc[0-9]+)? " )) AND (EXISTS "${CMAKE_SOURCE_DIR} /.git" ))
37
37
message ( STATUS "Build from git repository detected" )
38
38
find_package (Git)
39
39
if (GIT_FOUND)
@@ -42,7 +42,7 @@ if((NOT (OpenCoarraysVersion MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")) AND (EXISTS "$
42
42
RESULT_VARIABLE git_status
43
43
OUTPUT_VARIABLE git_output
44
44
OUTPUT_STRIP_TRAILING_WHITESPACE)
45
- if ((git_status STREQUAL "0" ) AND (git_output MATCHES "[0-9]+\\ .[0-9]+\\ .[0-9]+" ))
45
+ if ((git_status STREQUAL "0" ) AND (git_output MATCHES "[0-9]+\\ .[0-9]+\\ .[0-9]+(-rc[0-9]+)? " ))
46
46
set (OpenCoarraysVersion "${git_output} " )
47
47
endif ()
48
48
execute_process (COMMAND "${GIT_EXECUTABLE} " describe --always
@@ -64,18 +64,21 @@ if((NOT (OpenCoarraysVersion MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")) AND (EXISTS "$
64
64
endif ()
65
65
endif ()
66
66
67
- if (NOT (OpenCoarraysVersion MATCHES "[0-9]+\\ .[0-9]+\\ .[0-9]+" ))
67
+ if (NOT (OpenCoarraysVersion MATCHES "[0-9]+\\ .[0-9]+\\ .[0-9]+(-rc[0-9]+)? " ))
68
68
message ( WARNING "Could not extract version from git, falling back on .VERSION, line 3." )
69
69
file (STRINGS ".VERSION" OpenCoarraysVersion
70
- REGEX "[0-9]+\\ .[0-9]+\\ .[0-9]+"
70
+ REGEX "[0-9]+\\ .[0-9]+\\ .[0-9]+(-rc[0-9]+)? "
71
71
)
72
72
endif ()
73
73
74
74
if (NOT full_git_describe)
75
75
set (full_git_describe ${OpenCoarraysVersion} )
76
76
endif ()
77
77
78
- project (opencoarrays VERSION "${OpenCoarraysVersion} " LANGUAGES C Fortran)
78
+ string (REGEX REPLACE "-rc[0-9]+$"
79
+ ".0" OPENCOARRAYS_CMAKE_PROJECT_VERSION
80
+ "${OpenCoarraysVersion} " )
81
+ project (opencoarrays VERSION "${OPENCOARRAYS_CMAKE_PROJECT_VERSION} " LANGUAGES C Fortran)
79
82
message ( STATUS "Building OpenCoarrays version: ${full_git_describe} " )
80
83
set (OpenCoarrays_dist_string "OpenCoarrays-${full_git_describe} " )
81
84
@@ -819,5 +822,7 @@ set(TRAVIS_SCRIPTS
819
822
test -script.InstallScript.sh
820
823
test -script.cmake.sh)
821
824
foreach (SCRIPT ${TRAVIS_SCRIPTS} )
822
- lint_script("${CMAKE_SOURCE_DIR} /developer-scripts/travis" ${SCRIPT} )
825
+ if (EXISTS "${CMAKE_SOURCE_DIR} /developer-scripts/travis/${SCRIPT} " )
826
+ lint_script("${CMAKE_SOURCE_DIR} /developer-scripts/travis" ${SCRIPT} )
827
+ endif ()
823
828
endforeach ()
0 commit comments