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
76c53b71
Commit
76c53b71
authored
Mar 24, 2015
by
Andreas Schuh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#104 Set INTERFACE_INCLUDE_DIRECTORIES of (imported) targets
parent
2b8deaa5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
26 deletions
+46
-26
CMakeLists.txt
CMakeLists.txt
+41
-25
config.cmake.in
cmake/config.cmake.in
+4
-0
doc
doc
+1
-1
No files found.
CMakeLists.txt
View file @
76c53b71
...
...
@@ -257,9 +257,12 @@ configure_headers (PUBLIC_HDRS ${PUBLIC_HDRS})
configure_sources
(
PRIVATE_HDRS
${
PRIVATE_HDRS
}
)
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_INCLUDE_DIR
}
"
)
# deprecated declaration of include directories for older CMake versions
if
(
NOT COMMAND target_include_directories
)
include_directories
(
"
${
PROJECT_SOURCE_DIR
}
/src"
)
include_directories
(
"
${
PROJECT_BINARY_DIR
}
/include"
)
include_directories
(
"
${
PROJECT_BINARY_DIR
}
/include/
${
GFLAGS_INCLUDE_DIR
}
"
)
endif
()
# ----------------------------------------------------------------------------
# output directories
...
...
@@ -267,6 +270,29 @@ set (CMAKE_RUNTIME_OUTPUT_DIRECTORY "bin")
set
(
CMAKE_LIBRARY_OUTPUT_DIRECTORY
"lib"
)
set
(
CMAKE_ARCHIVE_OUTPUT_DIRECTORY
"lib"
)
# ----------------------------------------------------------------------------
# installation directories
if
(
OS_WINDOWS
)
set
(
RUNTIME_INSTALL_DIR Bin
)
set
(
LIBRARY_INSTALL_DIR Lib
)
set
(
INCLUDE_INSTALL_DIR Include
)
set
(
CONFIG_INSTALL_DIR CMake
)
else
()
set
(
RUNTIME_INSTALL_DIR bin
)
# The LIB_INSTALL_DIR and LIB_SUFFIX variables are used by the Fedora
# package maintainers. Also package maintainers of other distribution
# packages need to be able to specify the name of the library directory.
if
(
NOT LIB_INSTALL_DIR
)
set
(
LIB_INSTALL_DIR
"lib
${
LIB_SUFFIX
}
"
)
endif
()
set
(
LIBRARY_INSTALL_DIR
"
${
LIB_INSTALL_DIR
}
"
CACHE PATH
"Directory of installed libraries, e.g.,
\"
lib64
\"
"
)
mark_as_advanced
(
LIBRARY_INSTALL_DIR
)
set
(
INCLUDE_INSTALL_DIR include
)
set
(
CONFIG_INSTALL_DIR
${
LIBRARY_INSTALL_DIR
}
/cmake/
${
PACKAGE_NAME
}
)
endif
()
# ----------------------------------------------------------------------------
# add library targets
set
(
TARGETS
)
...
...
@@ -284,6 +310,17 @@ foreach (TYPE IN ITEMS STATIC SHARED)
foreach
(
opts IN ITEMS
""
_nothreads
)
if
(
BUILD_gflags
${
opts
}
_LIB
)
add_library
(
gflags
${
opts
}
-
${
type
}
${
TYPE
}
${
GFLAGS_SRCS
}
${
PRIVATE_HDRS
}
${
PUBLIC_HDRS
}
)
if
(
COMMAND target_include_directories
)
target_include_directories
(
gflags
${
opts
}
-
${
type
}
PUBLIC
"$<BUILD_INTERFACE:
${
PROJECT_BINARY_DIR
}
/include>"
PRIVATE
"
${
PROJECT_SOURCE_DIR
}
/src;
${
PROJECT_BINARY_DIR
}
/include/
${
GFLAGS_INCLUDE_DIR
}
"
)
if
(
INSTALL_HEADERS
)
target_include_directories
(
gflags
${
opts
}
-
${
type
}
PUBLIC
"$<INSTALL_INTERFACE:
${
INCLUDE_INSTALL_DIR
}
>"
)
endif
()
endif
()
if
(
opts MATCHES
"nothreads"
)
set
(
defines
"GFLAGS_IS_A_DLL=
${
GFLAGS_IS_A_DLL
}
;NOTHREADS"
)
else
()
...
...
@@ -312,28 +349,7 @@ foreach (TYPE IN ITEMS STATIC SHARED)
endforeach
()
# ----------------------------------------------------------------------------
# installation
if
(
OS_WINDOWS
)
set
(
RUNTIME_INSTALL_DIR Bin
)
set
(
LIBRARY_INSTALL_DIR Lib
)
set
(
INCLUDE_INSTALL_DIR Include
)
set
(
CONFIG_INSTALL_DIR CMake
)
else
()
set
(
RUNTIME_INSTALL_DIR bin
)
# The LIB_INSTALL_DIR and LIB_SUFFIX variables are used by the Fedora
# package maintainers. Also package maintainers of other distribution
# packages need to be able to specify the name of the library directory.
if
(
NOT LIB_INSTALL_DIR
)
set
(
LIB_INSTALL_DIR
"lib
${
LIB_SUFFIX
}
"
)
endif
()
set
(
LIBRARY_INSTALL_DIR
"
${
LIB_INSTALL_DIR
}
"
CACHE PATH
"Directory of installed libraries, e.g.,
\"
lib64
\"
"
)
mark_as_advanced
(
LIBRARY_INSTALL_DIR
)
set
(
INCLUDE_INSTALL_DIR include
)
set
(
CONFIG_INSTALL_DIR
${
LIBRARY_INSTALL_DIR
}
/cmake/
${
PACKAGE_NAME
}
)
endif
()
# installation rules
file
(
RELATIVE_PATH INSTALL_PREFIX_REL2CONFIG_DIR
"
${
CMAKE_INSTALL_PREFIX
}
/
${
CONFIG_INSTALL_DIR
}
"
"
${
CMAKE_INSTALL_PREFIX
}
"
)
configure_file
(
cmake/config.cmake.in
"
${
PROJECT_BINARY_DIR
}
/
${
PACKAGE_NAME
}
-config-install.cmake"
@ONLY
)
configure_file
(
cmake/version.cmake.in
"
${
PROJECT_BINARY_DIR
}
/
${
PACKAGE_NAME
}
-config-version.cmake"
@ONLY
)
...
...
cmake/config.cmake.in
View file @
76c53b71
...
...
@@ -14,6 +14,10 @@ get_filename_component (CMAKE_CURRENT_LIST_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH
get_filename_component (_INSTALL_PREFIX "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_PREFIX_REL2CONFIG_DIR@" ABSOLUTE)
# include directory
#
# Newer versions of CMake set the INTERFACE_INCLUDE_DIRECTORIES property
# of the imported targets. It is hence not necessary to add this path
# manually to the include search path for targets which link to gflags.
set (@PACKAGE_NAME@_INCLUDE_DIR "${_INSTALL_PREFIX}/@INCLUDE_INSTALL_DIR@")
# gflags library
...
...
doc
@
64cf9f32
Subproject commit
957f0d291c80acbf894eb5dad918798546db9c07
Subproject commit
64cf9f3249edb88fae268b43d13dd2ca211e1da0
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