Skip to content

Commit 8c20571

Browse files
committed
Merge branch 'release/3.2.0'
2 parents 183390c + 9f3857e commit 8c20571

File tree

459 files changed

+9326
-3026
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

459 files changed

+9326
-3026
lines changed
Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
1-
**Bug Report**
2-
3-
- What is the issue you have?
4-
5-
- Please describe the steps to reproduce the issue. Can you provide a small but working code example?
6-
7-
- What is the expected behavior?
8-
9-
- And what is the actual behavior instead?
10-
11-
- Which compiler and operating system are you using? Is it a [supported compiler](https://github.com/nlohmann/json#supported-compilers)?
12-
13-
- Did you use a released version of the library or the version from the `develop` branch?
14-
15-
- If you experience a compilation error: can you [compile and run the unit tests](https://github.com/nlohmann/json#execute-unit-tests)?
16-
17-
18-
**Feature Request**
19-
20-
- Describe the feature in as much detail as possible.
21-
22-
- Include sample usage where appropriate.
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
5+
---
6+
7+
- What is the issue you have?
8+
9+
- Please describe the steps to reproduce the issue. Can you provide a small but working code example?
10+
11+
- What is the expected behavior?
12+
13+
- And what is the actual behavior instead?
14+
15+
- Which compiler and operating system are you using? Is it a [supported compiler](https://github.com/nlohmann/json#supported-compilers)?
16+
17+
- Did you use a released version of the library or the version from the `develop` branch?
18+
19+
- If you experience a compilation error: can you [compile and run the unit tests](https://github.com/nlohmann/json#execute-unit-tests)?
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
5+
---
6+
7+
- Describe the feature in as much detail as possible.
8+
9+
- Include sample usage where appropriate.

.travis.yml

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,12 @@ matrix:
155155
- os: osx
156156
osx_image: xcode9.2
157157

158+
- os: osx
159+
osx_image: xcode9.3
160+
161+
- os: osx
162+
osx_image: xcode9.4
163+
158164
# Linux / GCC
159165

160166
- os: linux
@@ -189,15 +195,23 @@ matrix:
189195
sources: ['ubuntu-toolchain-r-test']
190196
packages: ['g++-7', 'ninja-build']
191197

198+
- os: linux
199+
compiler: gcc
200+
env: COMPILER=g++-8
201+
addons:
202+
apt:
203+
sources: ['ubuntu-toolchain-r-test']
204+
packages: ['g++-8', 'ninja-build']
205+
192206
- os: linux
193207
compiler: gcc
194208
env:
195-
- COMPILER=g++-7
209+
- COMPILER=g++-8
196210
- CXXFLAGS=-std=c++17
197211
addons:
198212
apt:
199213
sources: ['ubuntu-toolchain-r-test']
200-
packages: ['g++-7', 'ninja-build']
214+
packages: ['g++-8', 'ninja-build']
201215

202216
# Linux / Clang
203217

@@ -257,15 +271,23 @@ matrix:
257271
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-5.0']
258272
packages: ['g++-6', 'clang-5.0', 'ninja-build']
259273

274+
- os: linux
275+
compiler: clang
276+
env: COMPILER=clang++-6.0
277+
addons:
278+
apt:
279+
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-6.0']
280+
packages: ['g++-6', 'clang-6.0', 'ninja-build']
281+
260282
- os: linux
261283
compiler: clang
262284
env:
263-
- COMPILER=clang++-5.0
285+
- COMPILER=clang++-6.0
264286
- CXXFLAGS=-std=c++1z
265287
addons:
266288
apt:
267-
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-5.0']
268-
packages: ['g++-6', 'clang-5.0', 'ninja-build']
289+
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-6.0']
290+
packages: ['g++-6', 'clang-6.0', 'ninja-build']
269291

270292
################
271293
# build script #
@@ -277,6 +299,7 @@ script:
277299
if [[ (-x $(which brew)) ]]; then
278300
brew update
279301
brew install cmake ninja
302+
brew upgrade cmake
280303
cmake --version
281304
fi
282305

CMakeLists.txt

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
cmake_minimum_required(VERSION 3.0.0)
1+
cmake_minimum_required(VERSION 3.8)
22

33
##
44
## PROJECT
55
## name and version
66
##
7-
project(nlohmann_json VERSION 3.1.2 LANGUAGES CXX)
7+
project(nlohmann_json VERSION 3.2.0 LANGUAGES CXX)
88

99
##
1010
## INCLUDE
@@ -22,13 +22,15 @@ option(JSON_MultipleHeaders "Use non-amalgamated version of the library." OFF)
2222
## CONFIGURATION
2323
##
2424
set(NLOHMANN_JSON_TARGET_NAME ${PROJECT_NAME})
25-
set(NLOHMANN_JSON_CONFIG_INSTALL_DIR "lib/cmake/${PROJECT_NAME}")
25+
set(NLOHMANN_JSON_CONFIG_INSTALL_DIR "lib/cmake/${PROJECT_NAME}"
26+
CACHE INTERNAL "")
2627
set(NLOHMANN_JSON_INCLUDE_INSTALL_DIR "include")
2728
set(NLOHMANN_JSON_TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets")
2829
set(NLOHMANN_JSON_CMAKE_CONFIG_TEMPLATE "cmake/config.cmake.in")
29-
set(NLOHMANN_JSON_CMAKE_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}/cmake_config")
30+
set(NLOHMANN_JSON_CMAKE_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}")
3031
set(NLOHMANN_JSON_CMAKE_VERSION_CONFIG_FILE "${NLOHMANN_JSON_CMAKE_CONFIG_DIR}/${PROJECT_NAME}ConfigVersion.cmake")
3132
set(NLOHMANN_JSON_CMAKE_PROJECT_CONFIG_FILE "${NLOHMANN_JSON_CMAKE_CONFIG_DIR}/${PROJECT_NAME}Config.cmake")
33+
set(NLOHMANN_JSON_CMAKE_PROJECT_TARGETS_FILE "${NLOHMANN_JSON_CMAKE_CONFIG_DIR}/${PROJECT_NAME}Targets.cmake")
3234

3335
if (JSON_MultipleHeaders)
3436
set(NLOHMANN_JSON_INCLUDE_BUILD_DIR "${PROJECT_SOURCE_DIR}/include/")
@@ -43,6 +45,8 @@ endif()
4345
## create target and add include path
4446
##
4547
add_library(${NLOHMANN_JSON_TARGET_NAME} INTERFACE)
48+
add_library(${PROJECT_NAME}::${NLOHMANN_JSON_TARGET_NAME} ALIAS ${NLOHMANN_JSON_TARGET_NAME})
49+
target_compile_features(${NLOHMANN_JSON_TARGET_NAME} INTERFACE cxx_std_11)
4650

4751
target_include_directories(
4852
${NLOHMANN_JSON_TARGET_NAME}
@@ -51,8 +55,8 @@ target_include_directories(
5155
$<INSTALL_INTERFACE:include>
5256
)
5357

54-
## add debug view defintion file for msvc (natvis) [cmake <= 3.2.2 does not support export of source files]
55-
if (MSVC AND CMAKE_VERSION VERSION_GREATER "3.2.2")
58+
## add debug view definition file for msvc (natvis)
59+
if (MSVC)
5660
set(NLOHMANN_ADD_NATVIS TRUE)
5761
set(NLOHMANN_NATVIS_FILE "nlohmann_json.natvis")
5862
target_sources(
@@ -62,7 +66,7 @@ if (MSVC AND CMAKE_VERSION VERSION_GREATER "3.2.2")
6266
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/${NLOHMANN_NATVIS_FILE}>
6367
)
6468
endif()
65-
69+
6670
##
6771
## TESTS
6872
## create and configure the unit test target
@@ -102,12 +106,18 @@ if (NLOHMANN_ADD_NATVIS)
102106
DESTINATION .
103107
)
104108
endif()
109+
export(
110+
TARGETS ${NLOHMANN_JSON_TARGET_NAME}
111+
NAMESPACE ${PROJECT_NAME}::
112+
FILE ${NLOHMANN_JSON_CMAKE_PROJECT_TARGETS_FILE}
113+
)
105114
install(
106115
TARGETS ${NLOHMANN_JSON_TARGET_NAME}
107116
EXPORT ${NLOHMANN_JSON_TARGETS_EXPORT_NAME}
108117
INCLUDES DESTINATION ${NLOHMANN_JSON_INCLUDE_INSTALL_DIR}
109118
)
110119
install(
111120
EXPORT ${NLOHMANN_JSON_TARGETS_EXPORT_NAME}
121+
NAMESPACE ${PROJECT_NAME}::
112122
DESTINATION ${NLOHMANN_JSON_CONFIG_INSTALL_DIR}
113123
)

0 commit comments

Comments
 (0)