@@ -30,10 +30,10 @@ file(STRINGS ".VERSION" first_line
3030 LIMIT_COUNT 1
3131 )
3232
33- string (REGEX MATCH "[0-9]+\\ .[0-9]+\\ .[0-9]+"
33+ string (REGEX MATCH "[0-9]+\\ .[0-9]+\\ .[0-9]+(-rc[0-9]+)? "
3434 OpenCoarraysVersion "${first_line} " )
3535
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" ))
3737 message ( STATUS "Build from git repository detected" )
3838 find_package (Git)
3939 if (GIT_FOUND)
@@ -42,7 +42,7 @@ if((NOT (OpenCoarraysVersion MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")) AND (EXISTS "$
4242 RESULT_VARIABLE git_status
4343 OUTPUT_VARIABLE git_output
4444 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]+)? " ))
4646 set (OpenCoarraysVersion "${git_output} " )
4747 endif ()
4848 execute_process (COMMAND "${GIT_EXECUTABLE} " describe --always
@@ -64,18 +64,21 @@ if((NOT (OpenCoarraysVersion MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")) AND (EXISTS "$
6464 endif ()
6565endif ()
6666
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]+)? " ))
6868 message ( WARNING "Could not extract version from git, falling back on .VERSION, line 3." )
6969 file (STRINGS ".VERSION" OpenCoarraysVersion
70- REGEX "[0-9]+\\ .[0-9]+\\ .[0-9]+"
70+ REGEX "[0-9]+\\ .[0-9]+\\ .[0-9]+(-rc[0-9]+)? "
7171 )
7272endif ()
7373
7474if (NOT full_git_describe)
7575 set (full_git_describe ${OpenCoarraysVersion} )
7676endif ()
7777
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)
7982message ( STATUS "Building OpenCoarrays version: ${full_git_describe} " )
8083set (OpenCoarrays_dist_string "OpenCoarrays-${full_git_describe} " )
8184
@@ -819,5 +822,7 @@ set(TRAVIS_SCRIPTS
819822 test -script.InstallScript.sh
820823 test -script.cmake.sh)
821824foreach (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 ()
823828endforeach ()
0 commit comments