fix cmake install directory (for real this time)

* Rename 'develop' folder to 'include/nlohmann'
* Rename 'src' folder to 'single_include/nlohmann'
* Use <nlohmann/*> headers in sources and tests
* Change amalgamate config file
This commit is contained in:
Théo DELRIEU 2018-01-29 11:21:11 +01:00
parent 9958dde3da
commit 14cd019861
No known key found for this signature in database
GPG key ID: 7D6E00D1DF01DEAF
73 changed files with 226 additions and 224 deletions

View file

@ -101,6 +101,7 @@ foreach(file ${files})
target_compile_definitions(${testcase} PRIVATE CATCH_CONFIG_FAST_COMPILE)
target_include_directories(${testcase} PRIVATE "thirdparty/catch")
target_include_directories(${testcase} PRIVATE ${NLOHMANN_JSON_INCLUDE_BUILD_DIR})
target_link_libraries(${testcase} ${NLOHMANN_JSON_TARGET_NAME})
if(NOT MSVC)

View file

@ -4,7 +4,7 @@
# additional flags
CXXFLAGS += -std=c++11 -Wall -Wextra -pedantic -Wcast-align -Wcast-qual -Wno-ctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wmissing-declarations -Wmissing-include-dirs -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-overflow=5 -Wswitch -Wundef -Wno-unused -Wnon-virtual-dtor -Wreorder -Wdeprecated -Wno-float-equal
CPPFLAGS += -I ../src -I . -I thirdparty/catch -DCATCH_CONFIG_FAST_COMPILE
CPPFLAGS += -I ../single_include -I . -I thirdparty/catch -DCATCH_CONFIG_FAST_COMPILE
SOURCES = src/unit.cpp \
src/unit-algorithms.cpp \
@ -60,11 +60,11 @@ clean:
# single test file
##############################################################################
json_unit: $(OBJECTS) ../src/json.hpp thirdparty/catch/catch.hpp
json_unit: $(OBJECTS) ../single_include/nlohmann/json.hpp thirdparty/catch/catch.hpp
@echo "[CXXLD] $@"
@$(CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJECTS) -o $@
%.o: %.cpp ../src/json.hpp thirdparty/catch/catch.hpp
%.o: %.cpp ../single_include/nlohmann/json.hpp thirdparty/catch/catch.hpp
@echo "[CXX] $@"
@$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< -o $@
@ -73,7 +73,7 @@ json_unit: $(OBJECTS) ../src/json.hpp thirdparty/catch/catch.hpp
# individual test cases
##############################################################################
test-%: src/unit-%.o src/unit.o ../src/json.hpp thirdparty/catch/catch.hpp
test-%: src/unit-%.o src/unit.o ../single_include/nlohmann/json.hpp thirdparty/catch/catch.hpp
@echo "[CXXLD] $@"
@$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $< src/unit.o -o $@

View file

@ -20,7 +20,7 @@ Licensed under the MIT License <http://opensource.org/licenses/MIT>.
#include <iostream>
#include <sstream>
#include <json.hpp>
#include <nlohmann/json.hpp>
using json = nlohmann::json;

View file

@ -21,7 +21,7 @@ Licensed under the MIT License <http://opensource.org/licenses/MIT>.
#include <iostream>
#include <sstream>
#include <json.hpp>
#include <nlohmann/json.hpp>
using json = nlohmann::json;

View file

@ -20,7 +20,7 @@ Licensed under the MIT License <http://opensource.org/licenses/MIT>.
#include <iostream>
#include <sstream>
#include <json.hpp>
#include <nlohmann/json.hpp>
using json = nlohmann::json;

View file

@ -20,7 +20,7 @@ Licensed under the MIT License <http://opensource.org/licenses/MIT>.
#include <iostream>
#include <sstream>
#include <json.hpp>
#include <nlohmann/json.hpp>
using json = nlohmann::json;

View file

@ -28,7 +28,7 @@ SOFTWARE.
#include "catch.hpp"
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;
TEST_CASE("algorithms")

View file

@ -29,7 +29,7 @@ SOFTWARE.
#include "catch.hpp"
#define private public
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;
// special test case to check if memory is leaked if constructor throws

View file

@ -28,7 +28,7 @@ SOFTWARE.
#include "catch.hpp"
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;
TEST_CASE("capacity")

View file

@ -28,7 +28,7 @@ SOFTWARE.
#include "catch.hpp"
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;
#include <fstream>

View file

@ -29,7 +29,7 @@ SOFTWARE.
#include "catch.hpp"
#define private public
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;
TEST_CASE("const_iterator class")

View file

@ -29,7 +29,7 @@ SOFTWARE.
#include "catch.hpp"
#define private public
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;
TEST_CASE("iterator class")

View file

@ -29,7 +29,7 @@ SOFTWARE.
#include "catch.hpp"
#define private public
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;
// shortcut to scan a string literal

View file

@ -29,7 +29,7 @@ SOFTWARE.
#include "catch.hpp"
#define private public
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;
#include <valarray>

View file

@ -28,7 +28,7 @@ SOFTWARE.
#include "catch.hpp"
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;
// helper function to check std::less<json::value_t>

View file

@ -28,7 +28,7 @@ SOFTWARE.
#include "catch.hpp"
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;
TEST_CASE("concepts")

View file

@ -29,7 +29,7 @@ SOFTWARE.
#include "catch.hpp"
#define private public
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;
#include <deque>

View file

@ -28,7 +28,7 @@ SOFTWARE.
#include "catch.hpp"
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;
TEST_CASE("other constructors and destructor")

View file

@ -29,7 +29,7 @@ SOFTWARE.
#include "catch.hpp"
#define private public
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;
void check_escaped(const char* original, const char* escaped = "", const bool ensure_ascii = false);

View file

@ -29,7 +29,7 @@ SOFTWARE.
#include "catch.hpp"
#define private public
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;
#include <deque>

View file

@ -28,7 +28,7 @@ SOFTWARE.
#include "catch.hpp"
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;
#include <iostream>

View file

@ -28,7 +28,7 @@ SOFTWARE.
#include "catch.hpp"
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;
TEST_CASE("element access 1")

View file

@ -28,7 +28,7 @@ SOFTWARE.
#include "catch.hpp"
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;
TEST_CASE("element access 2")

View file

@ -29,7 +29,7 @@ SOFTWARE.
#include "catch.hpp"
#include <fstream>
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;
TEST_CASE("object inspection")
@ -316,8 +316,8 @@ TEST_CASE("object inspection")
SECTION("round trips")
{
for (const auto& s :
{"3.141592653589793", "1000000000000000010E5"
})
{"3.141592653589793", "1000000000000000010E5"
})
{
json j1 = json::parse(s);
std::string s1 = j1.dump();

View file

@ -28,7 +28,7 @@ SOFTWARE.
#include "catch.hpp"
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;
TEST_CASE("iterator_wrapper")

View file

@ -29,7 +29,7 @@ SOFTWARE.
#include "catch.hpp"
#define private public
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;
TEST_CASE("iterators 1")

View file

@ -28,7 +28,7 @@ SOFTWARE.
#include "catch.hpp"
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;
TEST_CASE("iterators 2")

View file

@ -28,7 +28,7 @@ SOFTWARE.
#include "catch.hpp"
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;
#include <fstream>

View file

@ -29,7 +29,7 @@ SOFTWARE.
#include "catch.hpp"
#define private public
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;
TEST_CASE("JSON pointers")

View file

@ -28,7 +28,7 @@ SOFTWARE.
#include "catch.hpp"
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;
TEST_CASE("JSON Merge Patch")

View file

@ -28,7 +28,7 @@ SOFTWARE.
#include "catch.hpp"
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;
TEST_CASE("version information")

View file

@ -28,7 +28,7 @@ SOFTWARE.
#include "catch.hpp"
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;
TEST_CASE("modifiers")

View file

@ -28,7 +28,7 @@ SOFTWARE.
#include "catch.hpp"
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;
#include <fstream>

View file

@ -27,7 +27,7 @@ SOFTWARE.
*/
#include "catch.hpp"
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;

View file

@ -28,7 +28,7 @@ SOFTWARE.
#include "catch.hpp"
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;
TEST_CASE("pointer access")

View file

@ -28,7 +28,7 @@ SOFTWARE.
#include "catch.hpp"
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;
#include <deque>

View file

@ -28,7 +28,7 @@ SOFTWARE.
#include "catch.hpp"
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;
TEST_CASE("reference access")

View file

@ -29,7 +29,7 @@ SOFTWARE.
#include "catch.hpp"
#define private public
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;
#include <fstream>

View file

@ -28,7 +28,7 @@ SOFTWARE.
#include "catch.hpp"
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;
TEST_CASE("serialization")

View file

@ -28,7 +28,7 @@ SOFTWARE.
#include "catch.hpp"
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;
#include <fstream>

View file

@ -32,7 +32,7 @@ SOFTWARE.
#include "catch.hpp"
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::detail::dtoa_impl::reinterpret_bits;
static float make_float(uint32_t sign_bit, uint32_t biased_exponent, uint32_t significand)

View file

@ -28,7 +28,7 @@ SOFTWARE.
#include "catch.hpp"
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;
#include <fstream>

View file

@ -28,7 +28,7 @@ SOFTWARE.
#include "catch.hpp"
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;

View file

@ -29,7 +29,7 @@ SOFTWARE.
#include "catch.hpp"
#define private public
#include "json.hpp"
#include <nlohmann/json.hpp>
using nlohmann::json;
#include <fstream>