Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
G
gflags
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
gflags
Commits
8d93bca2
Commit
8d93bca2
authored
Mar 17, 2014
by
Andreas Schuh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor CMake coding style change of version_numbers function.
parent
0d9486f9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
utils.cmake
cmake/utils.cmake
+16
-16
No files found.
cmake/utils.cmake
View file @
8d93bca2
...
...
@@ -2,33 +2,33 @@
# ----------------------------------------------------------------------------
## Extract version numbers from version string.
function
(
version_numbers
VERSION MAJOR MINOR PATCH
)
if
(
VERSION
MATCHES
"([0-9]+)(
\\
.[0-9]+)?(
\\
.[0-9]+)?(rc[1-9][0-9]*|[a-z]+)?"
)
function
(
version_numbers
version major minor patch
)
if
(
version
MATCHES
"([0-9]+)(
\\
.[0-9]+)?(
\\
.[0-9]+)?(rc[1-9][0-9]*|[a-z]+)?"
)
if
(
CMAKE_MATCH_1
)
set
(
VERSION_MAJOR
${
CMAKE_MATCH_1
}
)
set
(
_major
${
CMAKE_MATCH_1
}
)
else
()
set
(
VERSION_MAJOR
0
)
set
(
_major
0
)
endif
()
if
(
CMAKE_MATCH_2
)
set
(
VERSION_MINOR
${
CMAKE_MATCH_2
}
)
string
(
REGEX REPLACE
"^
\\
."
""
VERSION_MINOR
"
${
VERSION_MINOR
}
"
)
set
(
_minor
${
CMAKE_MATCH_2
}
)
string
(
REGEX REPLACE
"^
\\
."
""
_minor
"
${
_minor
}
"
)
else
()
set
(
VERSION_MINOR
0
)
set
(
_minor
0
)
endif
()
if
(
CMAKE_MATCH_3
)
set
(
VERSION_PATCH
${
CMAKE_MATCH_3
}
)
string
(
REGEX REPLACE
"^
\\
."
""
VERSION_PATCH
"
${
VERSION_PATCH
}
"
)
set
(
_patch
${
CMAKE_MATCH_3
}
)
string
(
REGEX REPLACE
"^
\\
."
""
_patch
"
${
_patch
}
"
)
else
()
set
(
VERSION_PATCH
0
)
set
(
_patch
0
)
endif
()
else
()
set
(
VERSION_MAJOR
0
)
set
(
VERSION_MINOR
0
)
set
(
VERSION_PATCH
0
)
set
(
_major
0
)
set
(
_minor
0
)
set
(
_patch
0
)
endif
()
set
(
"
${
MAJOR
}
"
"
${
VERSION_MAJOR
}
"
PARENT_SCOPE
)
set
(
"
${
MINOR
}
"
"
${
VERSION_MINOR
}
"
PARENT_SCOPE
)
set
(
"
${
PATCH
}
"
"
${
VERSION_PATCH
}
"
PARENT_SCOPE
)
set
(
"
${
major
}
"
"
${
_major
}
"
PARENT_SCOPE
)
set
(
"
${
minor
}
"
"
${
_minor
}
"
PARENT_SCOPE
)
set
(
"
${
patch
}
"
"
${
_patch
}
"
PARENT_SCOPE
)
endfunction
()
# ----------------------------------------------------------------------------
...
...
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