Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fmt
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
fmt
Commits
52ee516c
Commit
52ee516c
authored
Jan 13, 2016
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #264 from niosHD/improve-find-and-package-support
Improve find and package support
parents
06f3abe2
ef7bbfff
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
14 deletions
+58
-14
.travis.yml
.travis.yml
+8
-0
CMakeLists.txt
CMakeLists.txt
+44
-6
support/cmake/cppformatConfig.cmake.in
support/cmake/cppformatConfig.cmake.in
+4
-0
test/CMakeLists.txt
test/CMakeLists.txt
+2
-8
No files found.
.travis.yml
View file @
52ee516c
...
...
@@ -20,5 +20,13 @@ matrix:
-
os
:
osx
env
:
BUILD=Doc
addons
:
apt
:
sources
:
-
kubuntu-backports
# cmake 2.8.12
# - george-edison55-precise-backports # cmake 3.2.3
packages
:
-
cmake
script
:
-
support/travis-build.py
CMakeLists.txt
View file @
52ee516c
message
(
STATUS
"CMake version:
${
CMAKE_VERSION
}
"
)
cmake_minimum_required
(
VERSION 2.
6
)
cmake_minimum_required
(
VERSION 2.
8.12
)
# Set the default CMAKE_BUILD_TYPE to Release.
# This should be done before the project command since the latter can set
...
...
@@ -142,7 +142,7 @@ endif ()
set_target_properties
(
cppformat PROPERTIES
VERSION
${
CPPFORMAT_VERSION
}
SOVERSION
${
CPACK_PACKAGE_VERSION_MAJOR
}
)
if
(
EXISTS
.gitignore
)
if
(
EXISTS
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/.gitignore"
)
# Get the list of ignored files from .gitignore.
file
(
STRINGS
".gitignore"
lines
)
LIST
(
REMOVE_ITEM lines /doc/html
)
...
...
@@ -156,15 +156,53 @@ if (EXISTS .gitignore)
set
(
CPACK_SOURCE_GENERATOR ZIP
)
set
(
CPACK_SOURCE_IGNORE_FILES
${
ignored_files
}
)
set
(
CPACK_SOURCE_PACKAGE_FILE_NAME cppformat-
${
CPPFORMAT_VERSION
}
)
set
(
CPACK_SOURCE_PACKAGE_FILE_NAME
"cppformat-
${
CPPFORMAT_VERSION
}
"
)
set
(
CPACK_PACKAGE_NAME
"cppformat"
)
set
(
CPACK_RESOURCE_FILE_README
${
FORMAT_SOURCE_DIR
}
/README.rst
)
include
(
CPack
)
endif
()
# Install targets.
if
(
FMT_INSTALL
)
set
(
FMT_LIB_DIR lib CACHE STRING
include
(
CMakePackageConfigHelpers
)
set
(
config_install_dir
"lib/cmake/cppformat"
)
set
(
version_config
"
${
CMAKE_CURRENT_BINARY_DIR
}
/cppformatConfigVersion.cmake"
)
set
(
project_config
"
${
CMAKE_CURRENT_BINARY_DIR
}
/cppformatConfig.cmake"
)
set
(
targets_export_name
"cppformatTargets"
)
set
(
FMT_LIB_DIR
"lib"
CACHE STRING
"Installation directory for libraries, relative to
${
CMAKE_INSTALL_PREFIX
}
."
)
install
(
TARGETS cppformat DESTINATION
${
FMT_LIB_DIR
}
)
install
(
FILES format.h DESTINATION include/cppformat
)
# copy the header into the build directory to mimic the installed tree
configure_file
(
"format.h"
"cppformat/format.h"
COPYONLY
)
# add the include directories for both build and install tree
target_include_directories
(
cppformat PUBLIC
$<BUILD_INTERFACE:
${
CMAKE_CURRENT_BINARY_DIR
}
>
$<INSTALL_INTERFACE:include>
)
# generate the version, config and target files into the build directory
write_basic_package_version_file
(
"
${
version_config
}
"
VERSION
${
CPPFORMAT_VERSION
}
COMPATIBILITY AnyNewerVersion
)
configure_package_config_file
(
"support/cmake/cppformatConfig.cmake.in"
"
${
project_config
}
"
INSTALL_DESTINATION
"
${
config_install_dir
}
"
)
export
(
TARGETS cppformat FILE
"
${
targets_export_name
}
.cmake"
)
# install version, config and target files
install
(
FILES
"
${
project_config
}
"
"
${
version_config
}
"
DESTINATION
"
${
config_install_dir
}
"
)
install
(
EXPORT
"
${
targets_export_name
}
"
DESTINATION
"
${
config_install_dir
}
"
)
# install the library and the include file
install
(
TARGETS cppformat EXPORT
"
${
targets_export_name
}
"
DESTINATION
"
${
FMT_LIB_DIR
}
"
)
install
(
FILES format.h DESTINATION
"include/cppformat"
)
endif
()
support/cmake/cppformatConfig.cmake.in
0 → 100644
View file @
52ee516c
@PACKAGE_INIT@
include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake")
check_required_components("cppformat")
test/CMakeLists.txt
View file @
52ee516c
...
...
@@ -10,12 +10,6 @@ function (target_link_cppformat target)
endif
()
endfunction
()
function
(
fmt_target_include_directories
)
if
(
CMAKE_MAJOR_VERSION VERSION_GREATER 2.8.10
)
target_include_directories
(
${
ARGN
}
)
endif
()
endfunction
()
# We compile Google Test ourselves instead of using pre-compiled libraries.
# See the Google Test FAQ "Why is it not recommended to install a
# pre-compiled copy of Google Test (for example, into /usr/local)?"
...
...
@@ -24,7 +18,7 @@ endfunction ()
add_library
(
gmock STATIC
${
FMT_GMOCK_DIR
}
/gmock-gtest-all.cc
${
FMT_GMOCK_DIR
}
/gmock/gmock.h
${
FMT_GMOCK_DIR
}
/gtest/gtest.h
${
FMT_GMOCK_DIR
}
/gtest/gtest-spi.h
)
fmt_
target_include_directories
(
gmock INTERFACE
${
FMT_GMOCK_DIR
}
)
target_include_directories
(
gmock INTERFACE
${
FMT_GMOCK_DIR
}
)
find_package
(
Threads
)
if
(
Threads_FOUND
)
target_link_libraries
(
gmock
${
CMAKE_THREAD_LIBS_INIT
}
)
...
...
@@ -43,7 +37,7 @@ check_cxx_source_compiles("
check_cxx_source_compiles
(
"
#include <initializer_list>
int main() {}"
FMT_INITIALIZER_LIST
)
if
(
NOT FMT_VARIADIC_TEMPLATES OR NOT FMT_INITIALIZER_LIST
)
add_definitions
(
-DGTEST_LANG_CXX11=0
)
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