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
107fe0a1
Commit
107fe0a1
authored
May 18, 2019
by
David Zemon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure header_only library works by adding another example exe
parent
b021be29
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
CMakeLists.txt
example/CMakeLists.txt
+12
-3
No files found.
example/CMakeLists.txt
View file @
107fe0a1
...
@@ -36,14 +36,22 @@ endif()
...
@@ -36,14 +36,22 @@ endif()
find_package
(
Threads REQUIRED
)
find_package
(
Threads REQUIRED
)
# Example of using pre-compiled library
add_executable
(
example example.cpp
)
add_executable
(
example example.cpp
)
target_link_libraries
(
example spdlog::spdlog Threads::Threads
)
if
(
CMAKE_SYSTEM_NAME STREQUAL
"Android"
)
if
(
CMAKE_SYSTEM_NAME STREQUAL
"Android"
)
find_library
(
log-lib log
)
find_library
(
log-lib log
)
target_link_libraries
(
example spdlog::spdlog Threads::Threads log
)
target_link_libraries
(
example log
)
else
()
target_link_libraries
(
example spdlog::spdlog Threads::Threads
)
endif
()
endif
()
# Example of using header-only library
add_executable
(
example_header_only example.cpp
)
get_target_property
(
SPDLOG_INCLUDE_DIRS spdlog::spdlog INTERFACE_INCLUDE_DIRECTORIES
)
target_include_directories
(
example_header_only PRIVATE
${
SPDLOG_INCLUDE_DIRS
}
)
target_link_libraries
(
example_header_only Threads::Threads
)
if
(
CMAKE_SYSTEM_NAME STREQUAL
"Android"
)
target_link_libraries
(
example_header_only log
)
endif
()
add_executable
(
multisink multisink.cpp
)
add_executable
(
multisink multisink.cpp
)
target_link_libraries
(
multisink spdlog::spdlog Threads::Threads
)
target_link_libraries
(
multisink spdlog::spdlog Threads::Threads
)
...
@@ -52,3 +60,4 @@ file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/logs")
...
@@ -52,3 +60,4 @@ file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/logs")
enable_testing
()
enable_testing
()
add_test
(
NAME example COMMAND example
)
add_test
(
NAME example COMMAND example
)
add_test
(
NAME example_header_only COMMAND example
)
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