from now on the library should be developed using the 2 headers in doctest/parts/ and doctest/doctest.h gets generated from them!
updated docs
diff --git a/scripts/common.cmake b/scripts/common.cmake
index b7fd72c..2216e09 100644
--- a/scripts/common.cmake
+++ b/scripts/common.cmake
@@ -142,3 +142,32 @@
add_compiler_flags(/WX)
add_compiler_flags(/W4) # /Wall is too aggressive - even the standard C headers give thousands of errors...
endif()
+
+# add a custom target that assembles the single header when any of the parts are touched
+
+set(cat_cmd "cat")
+set(doctest_include_folder "${CURRENT_LIST_DIR_CACHED}/../doctest/")
+set(doctest_parts_folder "${CURRENT_LIST_DIR_CACHED}/../doctest/parts/")
+if(WIN32)
+ set(cat_cmd "type")
+ STRING(REGEX REPLACE "/" "\\\\" doctest_include_folder ${doctest_include_folder})
+ STRING(REGEX REPLACE "/" "\\\\" doctest_parts_folder ${doctest_parts_folder})
+endif()
+
+add_custom_command(
+ OUTPUT ${doctest_include_folder}doctest.h
+ DEPENDS
+ ${doctest_parts_folder}doctest_fwd.h
+ ${doctest_parts_folder}doctest_impl.h
+ COMMAND echo // ====================================================================== > ${doctest_include_folder}doctest.h
+ COMMAND echo // == DO NOT MODIFY THIS FILE BY HAND - IT IS AUTO GENERATED BY CMAKE! == >> ${doctest_include_folder}doctest.h
+ COMMAND echo // ====================================================================== >> ${doctest_include_folder}doctest.h
+ COMMAND
+ ${cat_cmd}
+ ${doctest_parts_folder}doctest_fwd.h
+ ${doctest_parts_folder}doctest_impl.h
+ >>
+ ${doctest_include_folder}doctest.h
+ COMMENT "assembling the single header")
+
+add_custom_target(assemble_single_header ALL DEPENDS ${doctest_include_folder}doctest.h)