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
2ec91bff
Commit
2ec91bff
authored
Jul 31, 2013
by
Andreas Schuh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move definition of configure_sources CMake function to utils module.
parent
ffbc1cea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
23 deletions
+17
-23
CMakeLists.txt
CMakeLists.txt
+0
-13
utils.cmake
cmake/utils.cmake
+17
-10
No files found.
CMakeLists.txt
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
}
)
...
...
cmake/utils.cmake
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
()
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