reorganized code

parent b67e00b9
......@@ -68,18 +68,26 @@ if(BUILD_TESTING AND JSON_BuildTests)
add_subdirectory(test)
endif()
ExternalProject_Add(amalgamate
GIT_REPOSITORY "https://github.com/theodelrieu/Amalgamate"
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}"
)
##
## AMALGAMATION
## create a single header file
##
option(JSON_Amalgamate "Build and use amalgamation" OFF)
# There is no way to tell amalgamate to force-write the output file even if it already exists...
add_custom_target(single_header ALL rm -f "${CMAKE_SOURCE_DIR}/single_header/json.hpp"
COMMENT "Amalgamating json.hpp..."
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/${NLOHMANN_JSON_SOURCE_DIR}
DEPENDS amalgamate
COMMAND "${CMAKE_BINARY_DIR}/bin/amalgamate" -w '*.hpp' -i . json.hpp "${CMAKE_SOURCE_DIR}/single_header/json.hpp"
)
if(JSON_Amalgamate)
ExternalProject_Add(amalgamate
GIT_REPOSITORY "https://github.com/theodelrieu/Amalgamate"
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}"
)
# There is no way to tell amalgamate to force-write the output file even if it already exists...
add_custom_target(single_header ALL rm -f "${CMAKE_SOURCE_DIR}/${NLOHMANN_JSON_SOURCE_DIR}/json.hpp"
COMMENT "Amalgamating json.hpp..."
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/develop
DEPENDS amalgamate
COMMAND "${CMAKE_BINARY_DIR}/bin/amalgamate" -w '*.hpp' -i . json.hpp "${CMAKE_SOURCE_DIR}/${NLOHMANN_JSON_SOURCE_DIR}/json.hpp"
)
endif()
##
## INSTALL
......
.PHONY: pretty clean ChangeLog.md
SRCDIR = ./src
DEVDIR = ./develop
SRCS = $(SRCDIR)/json.hpp \
$(SRCDIR)/json_fwd.hpp \
$(SRCDIR)/detail/macro_scope.hpp \
$(SRCDIR)/detail/macro_unscope.hpp \
$(SRCDIR)/detail/meta.hpp \
$(SRCDIR)/detail/exceptions.hpp \
$(SRCDIR)/detail/value_t.hpp \
$(SRCDIR)/detail/conversions/from_json.hpp \
$(SRCDIR)/detail/conversions/to_json.hpp \
$(SRCDIR)/detail/parsing/input_adapters.hpp \
$(SRCDIR)/detail/parsing/lexer.hpp \
$(SRCDIR)/detail/parsing/parser.hpp \
$(SRCDIR)/detail/iterators/primitive_iterator.hpp \
$(SRCDIR)/detail/iterators/internal_iterator.hpp \
$(SRCDIR)/detail/iterators/iter_impl.hpp \
$(SRCDIR)/detail/iterators/iteration_proxy.hpp \
$(SRCDIR)/detail/iterators/json_reverse_iterator.hpp \
$(SRCDIR)/detail/parsing/output_adapters.hpp \
$(SRCDIR)/detail/parsing/binary_reader.hpp \
$(SRCDIR)/detail/parsing/binary_writer.hpp \
$(SRCDIR)/detail/serializer.hpp \
$(SRCDIR)/detail/json_ref.hpp \
$(SRCDIR)/adl_serializer.hpp
$(DEVDIR)/json_fwd.hpp \
$(DEVDIR)/detail/macro_scope.hpp \
$(DEVDIR)/detail/macro_unscope.hpp \
$(DEVDIR)/detail/meta.hpp \
$(DEVDIR)/detail/exceptions.hpp \
$(DEVDIR)/detail/value_t.hpp \
$(DEVDIR)/detail/conversions/from_json.hpp \
$(DEVDIR)/detail/conversions/to_json.hpp \
$(DEVDIR)/detail/parsing/input_adapters.hpp \
$(DEVDIR)/detail/parsing/lexer.hpp \
$(DEVDIR)/detail/parsing/parser.hpp \
$(DEVDIR)/detail/iterators/primitive_iterator.hpp \
$(DEVDIR)/detail/iterators/internal_iterator.hpp \
$(DEVDIR)/detail/iterators/iter_impl.hpp \
$(DEVDIR)/detail/iterators/iteration_proxy.hpp \
$(DEVDIR)/detail/iterators/json_reverse_iterator.hpp \
$(DEVDIR)/detail/parsing/output_adapters.hpp \
$(DEVDIR)/detail/parsing/binary_reader.hpp \
$(DEVDIR)/detail/parsing/binary_writer.hpp \
$(DEVDIR)/detail/serializer.hpp \
$(DEVDIR)/detail/json_ref.hpp \
$(DEVDIR)/adl_serializer.hpp
UNAME = $(shell uname)
CXX=clang++
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment