Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
T.J. Corona
CMB-SuperBuild
Commits
663ce9e0
Commit
663ce9e0
authored
Feb 06, 2019
by
T.J. Corona
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fetch versions for smtk/cmb master from gitlab
parent
ede0b3db
Pipeline
#129522
running with stage
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
2 deletions
+60
-2
CMakeLists.txt
CMakeLists.txt
+10
-2
cmake/cmbVersion.cmake
cmake/cmbVersion.cmake
+21
-0
cmake/smtkVersion.cmake
cmake/smtkVersion.cmake
+29
-0
No files found.
CMakeLists.txt
View file @
663ce9e0
...
...
@@ -11,8 +11,12 @@ macro (superbuild_setup_variables)
if
(
cmb_SOURCE_SELECTION STREQUAL
"git"
)
# Assuming master; just use the latest version, but let the user set their
# own version in case it is actually a branch from some other version.
set
(
CMB_VERSION_DEFAULT
"
6.0.0
"
set
(
CMB_VERSION_DEFAULT
"
<FETCH_FROM_GIT>
"
CACHE STRING
"The default version of CMB to use if it cannot be detected"
)
if
(
CMB_VERSION_DEFAULT STREQUAL
"<FETCH_FROM_GIT>"
)
include
(
cmbVersion
)
set
(
CMB_VERSION_DEFAULT
"
${
cmb_version_major
}
.
${
cmb_version_minor
}
.
${
cmb_version_patch
}
"
)
endif
()
mark_as_advanced
(
CMB_VERSION_DEFAULT
)
set
(
cmb_default_version
"
${
CMB_VERSION_DEFAULT
}
"
)
elseif
(
cmb_SOURCE_SELECTION STREQUAL
"source"
)
...
...
@@ -29,8 +33,12 @@ macro (superbuild_setup_variables)
if
(
smtk_SOURCE_SELECTION STREQUAL
"git"
OR smtk_SOURCE_SELECTION STREQUAL
"from_cmb"
)
# Assuming master; just use the latest version, but let the user set their
# own version in case it is actually a branch from some other version.
set
(
SMTK_VERSION_DEFAULT
"
3.0.0
"
set
(
SMTK_VERSION_DEFAULT
"
<FETCH_FROM_GIT>
"
CACHE STRING
"The default version of SMTK to use if it cannot be detected"
)
if
(
SMTK_VERSION_DEFAULT STREQUAL
"<FETCH_FROM_GIT>"
)
include
(
smtkVersion
)
set
(
SMTK_VERSION_DEFAULT
"
${
smtk_version_major
}
.
${
smtk_version_minor
}
.
${
smtk_version_patch
}
"
)
endif
()
mark_as_advanced
(
SMTK_VERSION_DEFAULT
)
set
(
smtk_default_version
"
${
SMTK_VERSION_DEFAULT
}
"
)
elseif
(
smtk_SOURCE_SELECTION STREQUAL
"source"
)
...
...
cmake/cmbVersion.cmake
0 → 100644
View file @
663ce9e0
# Download SMTK's master branch version.txt
file
(
DOWNLOAD https://gitlab.kitware.com/cmb/cmb/raw/master/version.txt
${
CMAKE_CURRENT_BINARY_DIR
}${
CMAKE_FILES_DIRECTORY
}
/cmbVersion.txt STATUS status
)
list
(
GET status 0 error_code
)
if
(
error_code
)
message
(
FATAL_ERROR
"Could not access the version file for CMB"
)
endif
()
file
(
STRINGS
${
CMAKE_CURRENT_BINARY_DIR
}${
CMAKE_FILES_DIRECTORY
}
/cmbVersion.txt version_string
)
string
(
REGEX MATCH
"([0-9]+)
\\
.([0-9]+)
\\
.([0-9]+)[-]*(.*)"
version_matches
"
${
version_string
}
"
)
set
(
cmb_version_major
${
CMAKE_MATCH_1
}
)
set
(
cmb_version_minor
${
CMAKE_MATCH_2
}
)
set
(
cmb_version_patch
"
${
CMAKE_MATCH_3
}
"
)
# Do we just have a patch version or are there extra stuff?
if
(
CMAKE_MATCH_4
)
set
(
cmb_version_patch
"
${
CMAKE_MATCH_3
}
-
${
CMAKE_MATCH_4
}
"
)
endif
()
set
(
cmb_version
"
${
cmb_version_major
}
.
${
cmb_version_minor
}
"
)
cmake/smtkVersion.cmake
0 → 100644
View file @
663ce9e0
# Download SMTK's master branch version.txt
file
(
DOWNLOAD https://gitlab.kitware.com/cmb/smtk/raw/master/version.txt
${
CMAKE_CURRENT_BINARY_DIR
}${
CMAKE_FILES_DIRECTORY
}
/smtkVersion.txt STATUS status
)
list
(
GET status 0 error_code
)
if
(
error_code
)
message
(
FATAL_ERROR
"Could not access the version file for SMTK"
)
endif
()
file
(
STRINGS
${
CMAKE_CURRENT_BINARY_DIR
}${
CMAKE_FILES_DIRECTORY
}
/smtkVersion.txt version_string
)
string
(
REGEX MATCH
"([0-9]+)
\\
.([0-9]+)
\\
.([0-9]+)[-]*(.*)"
version_matches
"
${
version_string
}
"
)
set
(
smtk_version_major
${
CMAKE_MATCH_1
}
)
set
(
smtk_version_minor
${
CMAKE_MATCH_2
}
)
set
(
smtk_version
"
${
smtk_version_major
}
.
${
smtk_version_minor
}
"
)
if
(
CMAKE_MATCH_3
)
set
(
smtk_version_patch
${
CMAKE_MATCH_3
}
)
set
(
smtk_version
"
${
smtk_version
}
.
${
smtk_version_patch
}
"
)
else
()
set
(
smtk_version_patch 0
)
endif
()
# To be thorough, we should split the label into "-prerelease+metadata"
# and, if prerelease is specified, use it in determining precedence
# according to semantic versioning rules at http://semver.org/ .
# For now, just make the information available as a label:
if
(
CMAKE_MATCH_4
)
set
(
smtk_version_label
"
${
CMAKE_MATCH_4
}
"
)
endif
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment