Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
spdlog
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
spdlog
Commits
0955ea5b
Unverified
Commit
0955ea5b
authored
Dec 17, 2018
by
Gabi Melman
Committed by
GitHub
Dec 17, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #945 from cneumann/fix-external-fmt
Fix handling of external fmt lib
parents
57e21934
084bc72d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
7 deletions
+26
-7
CMakeLists.txt
CMakeLists.txt
+19
-7
Config.cmake.in
cmake/Config.cmake.in
+7
-0
No files found.
CMakeLists.txt
View file @
0955ea5b
...
...
@@ -53,7 +53,11 @@ endif()
option
(
SPDLOG_BUILD_EXAMPLES
"Build examples"
${
SPDLOG_MASTER_PROJECT
}
)
option
(
SPDLOG_BUILD_BENCH
"Build benchmarks"
${
SPDLOG_MASTER_PROJECT
}
)
option
(
SPDLOG_BUILD_TESTS
"Build tests"
${
SPDLOG_MASTER_PROJECT
}
)
option
(
SPDLOG_FMT_EXTERNAL
"Use external fmt library instead of bundled"
OFF
)
if
(
SPDLOG_FMT_EXTERNAL
)
find_package
(
fmt REQUIRED CONFIG
)
endif
()
target_include_directories
(
spdlog
...
...
@@ -62,6 +66,11 @@ target_include_directories(
"$<INSTALL_INTERFACE:
${
CMAKE_INSTALL_INCLUDEDIR
}
>"
)
if
(
SPDLOG_FMT_EXTERNAL
)
target_compile_definitions
(
spdlog INTERFACE SPDLOG_FMT_EXTERNAL
)
target_link_libraries
(
spdlog INTERFACE fmt::fmt
)
endif
()
set
(
HEADER_BASE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/include"
)
if
(
SPDLOG_BUILD_EXAMPLES
)
...
...
@@ -85,7 +94,8 @@ set(config_install_dir "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
set
(
include_install_dir
"
${
CMAKE_INSTALL_INCLUDEDIR
}
"
)
set
(
pkgconfig_install_dir
"
${
CMAKE_INSTALL_LIBDIR
}
/pkgconfig"
)
set
(
version_config
"
${
CMAKE_BINARY_DIR
}
/
${
PROJECT_NAME
}
ConfigVersion.cmake"
)
set
(
project_config
"
${
PROJECT_NAME
}
Config.cmake"
)
set
(
project_config
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
PROJECT_NAME
}
Config.cmake"
)
set
(
targets_config
"
${
PROJECT_NAME
}
Targets.cmake"
)
set
(
pkg_config
"
${
CMAKE_BINARY_DIR
}
/
${
PROJECT_NAME
}
.pc"
)
set
(
targets_export_name
"
${
PROJECT_NAME
}
Targets"
)
set
(
namespace
"
${
PROJECT_NAME
}
::"
)
...
...
@@ -98,6 +108,8 @@ write_basic_package_version_file(
# configure pkg config file
configure_file
(
"cmake/spdlog.pc.in"
"
${
pkg_config
}
"
@ONLY
)
# configure spdlogConfig.cmake file
configure_file
(
"cmake/Config.cmake.in"
"
${
project_config
}
"
@ONLY
)
# install targets
install
(
...
...
@@ -111,9 +123,9 @@ install(
DESTINATION
"
${
include_install_dir
}
"
)
# install project version file
# install project
config and
version file
install
(
FILES
"
${
version_config
}
"
FILES
"
${
project_config
}
"
"
${
version_config
}
"
DESTINATION
"
${
config_install_dir
}
"
)
...
...
@@ -123,19 +135,19 @@ install(
DESTINATION
"
${
pkgconfig_install_dir
}
"
)
# install
project
config file
# install
targets
config file
install
(
EXPORT
"
${
targets_export_name
}
"
NAMESPACE
"
${
namespace
}
"
DESTINATION
"
${
config_install_dir
}
"
FILE
${
project
_config
}
FILE
${
targets
_config
}
)
# export build directory
config
file
# export build directory
targets
file
export
(
EXPORT
${
targets_export_name
}
NAMESPACE
"
${
namespace
}
"
FILE
${
project
_config
}
FILE
${
targets
_config
}
)
# register project in CMake user registry
...
...
cmake/Config.cmake.in
View file @
0955ea5b
...
...
@@ -21,4 +21,11 @@
# * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
# *************************************************************************/
set(SPDLOG_FMT_EXTERNAL @SPDLOG_FMT_EXTERNAL@)
include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake")
if(SPDLOG_FMT_EXTERNAL)
include(CMakeFindDependencyMacro)
find_dependency(fmt CONFIG)
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