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
fdecd5b4
Commit
fdecd5b4
authored
Dec 19, 2014
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove FMT_SHARED in favor of BUILD_SHARED_LIBS
parent
a8b17698
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
10 deletions
+46
-10
CMakeLists.txt
CMakeLists.txt
+3
-8
doc/usage.rst
doc/usage.rst
+43
-2
No files found.
CMakeLists.txt
View file @
fdecd5b4
...
@@ -44,11 +44,6 @@ if (CMAKE_GENERATOR MATCHES "Visual Studio")
...
@@ -44,11 +44,6 @@ if (CMAKE_GENERATOR MATCHES "Visual Studio")
${
CMAKE_MAKE_PROGRAM
}
-p:FrameworkPathOverride=
\"
${
netfxpath
}
\"
%*"
)
${
CMAKE_MAKE_PROGRAM
}
-p:FrameworkPathOverride=
\"
${
netfxpath
}
\"
%*"
)
endif
()
endif
()
option
(
FMT_SHARED
"Build shared library instead of static one"
OFF
)
if
(
FMT_SHARED
)
set
(
shared SHARED
)
endif
()
set
(
FMT_SOURCES format.cc format.h
)
set
(
FMT_SOURCES format.cc format.h
)
include
(
CheckSymbolExists
)
include
(
CheckSymbolExists
)
...
@@ -66,7 +61,7 @@ if (CPP11_FLAG)
...
@@ -66,7 +61,7 @@ if (CPP11_FLAG)
set
(
CMAKE_REQUIRED_FLAGS
${
CPP11_FLAG
}
)
set
(
CMAKE_REQUIRED_FLAGS
${
CPP11_FLAG
}
)
endif
()
endif
()
add_library
(
format
${
shared
}
${
FMT_SOURCES
}
)
add_library
(
format
${
FMT_SOURCES
}
)
if
(
CMAKE_COMPILER_IS_GNUCXX
)
if
(
CMAKE_COMPILER_IS_GNUCXX
)
set_target_properties
(
format PROPERTIES COMPILE_FLAGS
set_target_properties
(
format PROPERTIES COMPILE_FLAGS
"-Wall -Wextra -Wshadow -pedantic"
)
"-Wall -Wextra -Wshadow -pedantic"
)
...
@@ -75,7 +70,7 @@ if (CPP11_FLAG AND FMT_EXTRA_TESTS)
...
@@ -75,7 +70,7 @@ if (CPP11_FLAG AND FMT_EXTRA_TESTS)
set_target_properties
(
format PROPERTIES COMPILE_FLAGS
${
CPP11_FLAG
}
)
set_target_properties
(
format PROPERTIES COMPILE_FLAGS
${
CPP11_FLAG
}
)
# Test compilation with default flags.
# Test compilation with default flags.
file
(
GLOB src RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
test/*.cc test/*.h
)
file
(
GLOB src RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
test/*.cc test/*.h
)
add_library
(
testformat
${
FMT_SOURCE_FILES
}
${
src
}
)
add_library
(
testformat
STATIC
${
FMT_SOURCE_FILES
}
${
src
}
)
endif
()
endif
()
add_subdirectory
(
doc
)
add_subdirectory
(
doc
)
...
@@ -87,7 +82,7 @@ include_directories(. gmock)
...
@@ -87,7 +82,7 @@ include_directories(. gmock)
# pre-compiled copy of Google Test (for example, into /usr/local)?"
# pre-compiled copy of Google Test (for example, into /usr/local)?"
# at http://code.google.com/p/googletest/wiki/FAQ for more details.
# at http://code.google.com/p/googletest/wiki/FAQ for more details.
add_library
(
gmock gmock/gmock-gtest-all.cc
)
add_library
(
gmock
STATIC
gmock/gmock-gtest-all.cc
)
find_package
(
Threads
)
find_package
(
Threads
)
target_link_libraries
(
gmock
${
CMAKE_THREAD_LIBS_INIT
}
)
target_link_libraries
(
gmock
${
CMAKE_THREAD_LIBS_INIT
}
)
...
...
doc/usage.rst
View file @
fdecd5b4
...
@@ -2,13 +2,54 @@
...
@@ -2,13 +2,54 @@
Usage
Usage
*****
*****
To use the C++ Format library, add
``format.h`` and ``format.cc`
` from
To use the C++ Format library, add
:file:`format.h` and :file:`format.cc
` from
a `release archive <https://github.com/cppformat/cppformat/releases/latest>`_
a `release archive <https://github.com/cppformat/cppformat/releases/latest>`_
or the `Git repository <https://github.com/cppformat/cppformat>`_ to your project.
or the `Git repository <https://github.com/cppformat/cppformat>`_ to your project.
Alternatively, you can :ref:`build the library with CMake <building>`.
If you are using Visual C++ with precompiled headers, you might need to add
If you are using Visual C++ with precompiled headers, you might need to add
the line ::
the line ::
#include "stdafx.h"
#include "stdafx.h"
before other includes in ``format.cc``.
before other includes in :file:`format.cc`.
.. _building:
Building the library
====================
An included `CMake build script`__ can be used to build the C++ Format
library on a wide range of platforms. CMake is freely available for
download from http://www.cmake.org/download/.
__ https://github.com/cppformat/cppformat/blob/master/CMakeLists.txt
CMake works by generating native makefiles or project files that can
be used in the compiler environment of your choice. The typical
workflow starts with::
mkdir build # Create a directory to hold the build output.
cd build
cmake <path/to/cppformat> # Generate native build scripts.
where :file:`{<path/to/cppformat>}` is a path to the ``cppformat`` repository.
If you are on a \*nix system, you should now see a Makefile in the
current directory. Now you can build C++ Format by running :command:`make`.
Once the library has been built you can invoke :command:`make test` to run
the tests.
If you use Windows and have Vistual Studio installed, a :file:`FORMAT.sln`
file and several :file:`.vcproj` files will be created. You can then build them
using Visual Studio or msbuild.
On Mac OS X with Xcode installed, an :file:`.xcodeproj` file will be generated.
To build a `shared library`__ set the ``BUILD_SHARED_LIBS`` CMake variable to
``TRUE``::
cmake -DBUILD_SHARED_LIBS=TRUE ...
__ http://en.wikipedia.org/wiki/Library_%28computing%29#Shared_libraries
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