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
5743adc4
Commit
5743adc4
authored
May 29, 2019
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CMake use extract version from version.h
parent
76fc166e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
2 deletions
+28
-2
CMakeLists.txt
CMakeLists.txt
+11
-2
version.cmake
cmake/version.cmake
+17
-0
No files found.
CMakeLists.txt
View file @
5743adc4
...
@@ -2,8 +2,17 @@
...
@@ -2,8 +2,17 @@
# Distributed under the MIT License (http://opensource.org/licenses/MIT)
# Distributed under the MIT License (http://opensource.org/licenses/MIT)
cmake_minimum_required
(
VERSION 3.1
)
cmake_minimum_required
(
VERSION 3.1
)
project
(
spdlog VERSION 1.3.1 LANGUAGES CXX
)
#---------------------------------------------------------------------------------------
# Start spdlog project
#---------------------------------------------------------------------------------------
include
(
cmake/version.cmake
)
project
(
spdlog VERSION
${
SPDLOG_VERSION
}
LANGUAGES CXX
)
message
(
STATUS
"Build spdlog:
${
SPDLOG_VERSION
}
"
)
include
(
GNUInstallDirs
)
include
(
GNUInstallDirs
)
include
(
cmake/ide.cmake
)
#---------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------
# Set default build to release
# Set default build to release
...
@@ -40,12 +49,12 @@ option(SPDLOG_FMT_EXTERNAL "Use external fmt library instead of bundled" OFF)
...
@@ -40,12 +49,12 @@ option(SPDLOG_FMT_EXTERNAL "Use external fmt library instead of bundled" OFF)
message
(
STATUS
"Build type: "
${
CMAKE_BUILD_TYPE
}
)
message
(
STATUS
"Build type: "
${
CMAKE_BUILD_TYPE
}
)
find_package
(
Threads REQUIRED
)
find_package
(
Threads REQUIRED
)
#---------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------
# Static library version
# Static library version
#---------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------
include
(
cmake/ide.cmake
)
add_library
(
spdlog STATIC src/spdlog.cpp
${
SPDLOG_ALL_HEADERS
}
)
add_library
(
spdlog STATIC src/spdlog.cpp
${
SPDLOG_ALL_HEADERS
}
)
add_library
(
spdlog::spdlog ALIAS spdlog
)
add_library
(
spdlog::spdlog ALIAS spdlog
)
...
...
cmake/version.cmake
0 → 100644
View file @
5743adc4
#---------------------------------------------------------------------------------------
# Get spdlog version from include/spdlog/version.h
#---------------------------------------------------------------------------------------
file
(
READ
"
${
CMAKE_CURRENT_LIST_DIR
}
/../include/spdlog/version.h"
SPDLOG_VERSION_FILE
)
string
(
REGEX MATCH
"SPDLOG_VER_MAJOR ([0-9]+)"
_
"
${
SPDLOG_VERSION_FILE
}
"
)
set
(
ver_major
${
CMAKE_MATCH_1
}
)
string
(
REGEX MATCH
"SPDLOG_VER_MINOR ([0-9]+)"
_
"
${
SPDLOG_VERSION_FILE
}
"
)
set
(
ver_minor
${
CMAKE_MATCH_1
}
)
string
(
REGEX MATCH
"SPDLOG_VER_PATCH ([0-9]+)"
_
"
${
SPDLOG_VERSION_FILE
}
"
)
set
(
ver_patch
${
CMAKE_MATCH_1
}
)
if
(
NOT ver_major OR NOT ver_minor OR NOT ver_patch
)
message
(
FATAL_ERROR
"Could not extract valid version from spdlog/version.h"
)
endif
()
set
(
SPDLOG_VERSION
"
${
ver_major
}
.
${
ver_minor
}
.
${
ver_patch
}
"
)
\ No newline at end of file
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