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
cf2bf488
Commit
cf2bf488
authored
Oct 04, 2019
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CmakeLists.txt: Fixed package config generation
parent
5c02fc47
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
8 deletions
+16
-8
CMakeLists.txt
CMakeLists.txt
+11
-6
spdlog.pc.in
cmake/spdlog.pc.in
+5
-2
No files found.
CMakeLists.txt
View file @
cf2bf488
...
...
@@ -87,8 +87,6 @@ set(SPDLOG_SRCS
src/file_sinks.cpp
src/async.cpp
)
set
(
SPDLOG_CFLAGS
"
${
PROJECT_NAME
}
"
)
if
(
SPDLOG_BUILD_SHARED
)
if
(
WIN32
)
message
(
FATAL_ERROR
"spdlog shared lib is not yet supported under windows"
)
...
...
@@ -129,14 +127,13 @@ if(SPDLOG_FMT_EXTERNAL)
if
(
NOT TARGET fmt::fmt
)
find_package
(
fmt REQUIRED
)
endif
()
set
(
SPDLOG_CFLAGS
"
${
SPDLOG_CFLAGS
}
-DSPDLOG_FMT_EXTERNAL"
)
target_compile_definitions
(
spdlog PUBLIC SPDLOG_FMT_EXTERNAL
)
target_link_libraries
(
spdlog PUBLIC fmt::fmt
)
target_compile_definitions
(
spdlog_header_only INTERFACE SPDLOG_FMT_EXTERNAL
)
target_link_libraries
(
spdlog_header_only INTERFACE fmt::fmt
)
set
(
PKG_CONFIG_REQUIRES fmt
)
# add dependecy to pkg-config
endif
()
if
(
SPDLOG_WCHAR_SUPPORT
)
...
...
@@ -204,11 +201,17 @@ if (SPDLOG_INSTALL)
endif
()
#---------------------------------------------------------------------------------------
#
Package and version files
#
Install pkg-config file
#---------------------------------------------------------------------------------------
get_target_property
(
PKG_CONFIG_DEFINES spdlog INTERFACE_COMPILE_DEFINITIONS
)
string
(
REPLACE
";"
" -D"
PKG_CONFIG_DEFINES
"
${
PKG_CONFIG_DEFINES
}
"
)
string
(
PREPEND PKG_CONFIG_DEFINES
"-D"
)
configure_file
(
"cmake/
${
PROJECT_NAME
}
.pc.in"
"
${
pkg_config
}
"
@ONLY
)
install
(
FILES
"
${
pkg_config
}
"
DESTINATION
"
${
pkgconfig_install_dir
}
"
)
#---------------------------------------------------------------------------------------
# Install CMake config files
#---------------------------------------------------------------------------------------
install
(
EXPORT spdlog
DESTINATION
${
export_dest_dir
}
NAMESPACE spdlog::
...
...
@@ -216,6 +219,7 @@ if (SPDLOG_INSTALL)
include
(
CMakePackageConfigHelpers
)
configure_file
(
"
${
project_config_in
}
"
"
${
project_config_out
}
"
@ONLY
)
write_basic_package_version_file
(
"
${
version_config_file
}
"
COMPATIBILITY SameMajorVersion
)
install
(
FILES
"
${
project_config_out
}
"
...
...
@@ -227,3 +231,4 @@ if (SPDLOG_INSTALL)
include
(
cmake/spdlogCPack.cmake
)
endif
()
cmake/spdlog.pc.in
View file @
cf2bf488
...
...
@@ -7,5 +7,8 @@ Name: lib@PROJECT_NAME@
Description: Fast C++ logging library.
URL: https://github.com/gabime/@PROJECT_NAME@
Version: @SPDLOG_VERSION@
CFlags: -I${includedir}/@SPDLOG_CFLAGS@
Libs: -L${libdir}/@PROJECT_NAME@ -l@PROJECT_NAME@
CFlags: -I${includedir} @PKG_CONFIG_DEFINES@
Libs: -L${libdir} -lspdlog
Libs.private: -lpthread
Requires: @PKG_CONFIG_REQUIRES@
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