Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
fuchsia.googlesource.com-third_party-gflags
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fuchsia-mirror
fuchsia.googlesource.com-third_party-gflags
Commits
2ec91bff
Commit
2ec91bff
authored
11 years ago
by
Andreas Schuh
Browse files
Options
Downloads
Patches
Plain Diff
Move definition of configure_sources CMake function to utils module.
parent
ffbc1cea
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+0
-13
0 additions, 13 deletions
CMakeLists.txt
cmake/utils.cmake
+17
-10
17 additions, 10 deletions
cmake/utils.cmake
with
17 additions
and
23 deletions
CMakeLists.txt
+
0
−
13
View file @
2ec91bff
...
...
@@ -114,19 +114,6 @@ else ()
set
(
__ATTRIBUTE__UNUSED
)
endif
()
function
(
configure_sources out
)
set
(
tmp
)
foreach
(
src IN LISTS ARGN
)
if
(
src MATCHES
".h$"
AND EXISTS
"
${
PROJECT_SOURCE_DIR
}
/src/
${
src
}
.in"
)
configure_file
(
"
${
PROJECT_SOURCE_DIR
}
/src/
${
src
}
.in"
"
${
PROJECT_BINARY_DIR
}
/include/
${
GFLAGS_NAMESPACE
}
/
${
src
}
"
@ONLY
)
list
(
APPEND tmp
"
${
PROJECT_BINARY_DIR
}
/include/
${
GFLAGS_NAMESPACE
}
/
${
src
}
"
)
else
()
list
(
APPEND tmp
"
${
PROJECT_SOURCE_DIR
}
/src/
${
src
}
"
)
endif
()
endforeach
()
set
(
${
out
}
"
${
tmp
}
"
PARENT_SCOPE
)
endfunction
()
configure_sources
(
PUBLIC_HDRS
${
PUBLIC_HDRS
}
)
configure_sources
(
PRIVATE_HDRS
${
PRIVATE_HDRS
}
)
configure_sources
(
GFLAGS_SRCS
${
GFLAGS_SRCS
}
)
...
...
This diff is collapsed.
Click to expand it.
cmake/utils.cmake
+
17
−
10
View file @
2ec91bff
## @file utils.cmake
# @brief Utility CMake functions.
## Utility CMake functions.
# ----------------------------------------------------------------------------
## @brief Extract version numbers from version string.
#
# @param [in] VERSION Version string in the format "MAJOR[.MINOR[.PATCH]]".
# @param [out] MAJOR Major version number if given or 0.
# @param [out] MINOR Minor version number if given or 0.
# @param [out] PATCH Patch number if given or 0.
#
# @returns See @c [out] parameters.
## 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]+)?"
)
if
(
CMAKE_MATCH_1
)
...
...
@@ -38,3 +30,18 @@ function (version_numbers VERSION MAJOR MINOR PATCH)
set
(
"
${
MINOR
}
"
"
${
VERSION_MINOR
}
"
PARENT_SCOPE
)
set
(
"
${
PATCH
}
"
"
${
VERSION_PATCH
}
"
PARENT_SCOPE
)
endfunction
()
# ----------------------------------------------------------------------------
## Configure source files with .in suffix
function
(
configure_sources out
)
set
(
tmp
)
foreach
(
src IN LISTS ARGN
)
if
(
src MATCHES
".h$"
AND EXISTS
"
${
PROJECT_SOURCE_DIR
}
/src/
${
src
}
.in"
)
configure_file
(
"
${
PROJECT_SOURCE_DIR
}
/src/
${
src
}
.in"
"
${
PROJECT_BINARY_DIR
}
/include/
${
GFLAGS_NAMESPACE
}
/
${
src
}
"
@ONLY
)
list
(
APPEND tmp
"
${
PROJECT_BINARY_DIR
}
/include/
${
GFLAGS_NAMESPACE
}
/
${
src
}
"
)
else
()
list
(
APPEND tmp
"
${
PROJECT_SOURCE_DIR
}
/src/
${
src
}
"
)
endif
()
endforeach
()
set
(
${
out
}
"
${
tmp
}
"
PARENT_SCOPE
)
endfunction
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment