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
30d045d0
Commit
30d045d0
authored
Mar 27, 2014
by
Andreas Schuh
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'google/feature/#80-configurable-include-path' into develop
parents
4aa1984c
aff8ef82
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
9 deletions
+18
-9
CMakeLists.txt
CMakeLists.txt
+12
-3
utils.cmake
cmake/utils.cmake
+6
-6
No files found.
CMakeLists.txt
View file @
30d045d0
...
...
@@ -24,7 +24,15 @@ version_numbers (
# ----------------------------------------------------------------------------
# options
set
(
GFLAGS_NAMESPACE
"
${
PACKAGE_NAME
}
"
CACHE STRING
"C++ namespace identifier of gflags library."
)
set
(
GFLAGS_NAMESPACE
"
${
PACKAGE_NAME
}
"
CACHE STRING
"C++ namespace identifier of gflags library."
)
set
(
GFLAGS_INCLUDE_DIR
"
${
PACKAGE_NAME
}
"
CACHE STRING
"Include subdirectory of gflags header files."
)
if
(
IS_ABSOLUTE GFLAGS_INCLUDE_DIR
)
message
(
FATAL_ERROR
"GFLAGS_INCLUDE_DIR must be a path relative to CMAKE_INSTALL_PREFIX/include"
)
endif
()
if
(
GFLAGS_INCLUDE_DIR MATCHES
"^
\\
.
\\
.[/
\\
]"
)
message
(
FATAL_ERROR
"GFLAGS_INCLUDE_DIR must not start with parent directory reference (../)"
)
endif
()
option
(
BUILD_SHARED_LIBS
"Request build of shared libraries."
OFF
)
option
(
BUILD_STATIC_LIBS
"Request build of static libraries (default if BUILD_SHARED_LIBS is OFF)."
OFF
)
...
...
@@ -38,6 +46,7 @@ option (INSTALL_HEADERS "Request packaging of headers and other devel
mark_as_advanced
(
CLEAR CMAKE_INSTALL_PREFIX
)
mark_as_advanced
(
CMAKE_CONFIGURATION_TYPES
GFLAGS_NAMESPACE
GFLAGS_INCLUDE_DIR
BUILD_STATIC_LIBS
BUILD_NC_TESTS
INSTALL_HEADERS
)
...
...
@@ -212,7 +221,7 @@ configure_sources (GFLAGS_SRCS ${GFLAGS_SRCS})
include_directories
(
"
${
PROJECT_SOURCE_DIR
}
/src"
)
include_directories
(
"
${
PROJECT_BINARY_DIR
}
/include"
)
include_directories
(
"
${
PROJECT_BINARY_DIR
}
/include/
${
GFLAGS_
NAMESPACE
}
"
)
include_directories
(
"
${
PROJECT_BINARY_DIR
}
/include/
${
GFLAGS_
INCLUDE_DIR
}
"
)
# ----------------------------------------------------------------------------
# output directories
...
...
@@ -282,7 +291,7 @@ configure_file (cmake/version.cmake.in "${PROJECT_BINARY_DIR}/${PACKAGE_NAME}-co
install
(
TARGETS
${
TARGETS
}
DESTINATION
${
LIBRARY_INSTALL_DIR
}
EXPORT gflags-lib
)
if
(
INSTALL_HEADERS
)
install
(
FILES
${
PUBLIC_HDRS
}
DESTINATION
${
INCLUDE_INSTALL_DIR
}
/
${
GFLAGS_
NAMESPACE
}
)
install
(
FILES
${
PUBLIC_HDRS
}
DESTINATION
${
INCLUDE_INSTALL_DIR
}
/
${
GFLAGS_
INCLUDE_DIR
}
)
install
(
FILES
"
${
PROJECT_BINARY_DIR
}
/
${
PACKAGE_NAME
}
-config-install.cmake"
RENAME
${
PACKAGE_NAME
}
-config.cmake
...
...
cmake/utils.cmake
View file @
30d045d0
...
...
@@ -47,11 +47,11 @@ function (configure_headers out)
set
(
tmp
)
foreach
(
src IN LISTS ARGN
)
if
(
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
}
"
)
configure_file
(
"
${
PROJECT_SOURCE_DIR
}
/src/
${
src
}
.in"
"
${
PROJECT_BINARY_DIR
}
/include/
${
GFLAGS_
INCLUDE_DIR
}
/
${
src
}
"
@ONLY
)
list
(
APPEND tmp
"
${
PROJECT_BINARY_DIR
}
/include/
${
GFLAGS_
INCLUDE_DIR
}
/
${
src
}
"
)
else
()
configure_file
(
"
${
PROJECT_SOURCE_DIR
}
/src/
${
src
}
"
"
${
PROJECT_BINARY_DIR
}
/include/
${
GFLAGS_
NAMESPACE
}
/
${
src
}
"
COPYONLY
)
list
(
APPEND tmp
"
${
PROJECT_BINARY_DIR
}
/include/
${
GFLAGS_
NAMESPACE
}
/
${
src
}
"
)
configure_file
(
"
${
PROJECT_SOURCE_DIR
}
/src/
${
src
}
"
"
${
PROJECT_BINARY_DIR
}
/include/
${
GFLAGS_
INCLUDE_DIR
}
/
${
src
}
"
COPYONLY
)
list
(
APPEND tmp
"
${
PROJECT_BINARY_DIR
}
/include/
${
GFLAGS_
INCLUDE_DIR
}
/
${
src
}
"
)
endif
()
endforeach
()
set
(
${
out
}
"
${
tmp
}
"
PARENT_SCOPE
)
...
...
@@ -63,8 +63,8 @@ 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
}
"
)
configure_file
(
"
${
PROJECT_SOURCE_DIR
}
/src/
${
src
}
.in"
"
${
PROJECT_BINARY_DIR
}
/include/
${
GFLAGS_
INCLUDE_DIR
}
/
${
src
}
"
@ONLY
)
list
(
APPEND tmp
"
${
PROJECT_BINARY_DIR
}
/include/
${
GFLAGS_
INCLUDE_DIR
}
/
${
src
}
"
)
else
()
list
(
APPEND tmp
"
${
PROJECT_SOURCE_DIR
}
/src/
${
src
}
"
)
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