--- examples/CMakeLists.txt.orig	2022-11-18 19:47:51 UTC
+++ examples/CMakeLists.txt
@@ -37,8 +37,8 @@ set(EXAMPLE_overload   overload       cpp)
 set(EXAMPLE_author     author         cpp)
 set(EXAMPLE_par        par            cpp)
 set(EXAMPLE_overload   overload       cpp)
-set(EXAMPLE_example    example        cpp)
-set(EXAMPLE_include    include        cpp)
+set(EXAMPLE_example    example        cpp        example_test)
+set(EXAMPLE_include    include        cpp        include_test)
 set(EXAMPLE_qtstyle    qtstyle        cpp)
 set(EXAMPLE_jdstyle    jdstyle        cpp)
 set(EXAMPLE_autolink   autolink       cpp)
@@ -69,14 +69,18 @@ foreach (f_inp  ${BASIC_EXAMPLES})
 	set(f_dep "")
 	if (${f_len} GREATER 2)
 	  list(GET  ${f_inp} 2 f_dep)
-	  set(f_dep "${PROJECT_BINARY_DIR}/html/examples/${f_dep}/html/index.html")
+	  if (${f_dep} MATCHES _test$)
+	    set(f_dep "${CMAKE_CURRENT_BINARY_DIR}/${f_dep}.${f_ext}")
+	  else()
+	    set(f_dep "${PROJECT_BINARY_DIR}/html/examples/${f_dep}/html/index.html")
+	  endif()
 	endif()
     add_custom_command(
         COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/html/examples/${f}
         COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/latex/examples/${f}
-        COMMAND ${CMAKE_COMMAND} -E env PROJECT_BINARY_DIR=${PROJECT_BINARY_DIR} ${EXECUTABLE_OUTPUT_PATH}/doxygen ${f}.cfg
+        COMMAND ${CMAKE_COMMAND} -E env PROJECT_BINARY_DIR=${PROJECT_BINARY_DIR} ${EXECUTABLE_OUTPUT_PATH}/doxygen ${CMAKE_CURRENT_BINARY_DIR}/${f}.cfg
         COMMAND ${PYTHON_EXECUTABLE}  ${TOP}/examples/strip_example.py  < ${PROJECT_BINARY_DIR}/latex/examples/${f}/latex/refman.tex > ${PROJECT_BINARY_DIR}/latex/examples/${f}/latex/refman_doc.tex
-	DEPENDS doxygen ${f}.${f_ext} ${f}.cfg ${TOP}/examples/strip_example.py ${f_dep}
+	DEPENDS doxygen ${CMAKE_CURRENT_BINARY_DIR}/${f}.${f_ext} ${CMAKE_CURRENT_BINARY_DIR}/${f}.cfg ${TOP}/examples/strip_example.py ${f_dep} ${CMAKE_CURRENT_BINARY_DIR}/baseexample.cfg
 	OUTPUT ${PROJECT_BINARY_DIR}/html/examples/${f}/html/index.html ${PROJECT_BINARY_DIR}/latex/examples/${f}/latex/refman_doc.tex
     )
     set(EXAMPLES_RES ${EXAMPLES_RES} "" ${PROJECT_BINARY_DIR}/html/examples/${f}/html/index.html)
@@ -93,9 +97,9 @@ if (DOT)
   add_custom_command(
         COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/html/examples/diagrams
         COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/latex/examples/diagrams
-        COMMAND ${CMAKE_COMMAND} -E env PROJECT_BINARY_DIR=${PROJECT_BINARY_DIR} ${EXECUTABLE_OUTPUT_PATH}/doxygen diagrams.cfg
+        COMMAND ${CMAKE_COMMAND} -E env PROJECT_BINARY_DIR=${PROJECT_BINARY_DIR} ${EXECUTABLE_OUTPUT_PATH}/doxygen ${CMAKE_CURRENT_BINARY_DIR}/diagrams.cfg
         COMMAND ${PYTHON_EXECUTABLE}  ${TOP}/examples/strip_example.py  < ${PROJECT_BINARY_DIR}/latex/examples/diagrams/latex/refman.tex > ${PROJECT_BINARY_DIR}/latex/examples/diagrams/latex/refman_doc.tex
-	DEPENDS doxygen diagrams_a.h diagrams_b.h diagrams_c.h diagrams_d.h diagrams_e.h diagrams.cfg ${TOP}/examples/strip_example.py
+	DEPENDS doxygen ${CMAKE_CURRENT_BINARY_DIR}/diagrams_a.h ${CMAKE_CURRENT_BINARY_DIR}/diagrams_b.h ${CMAKE_CURRENT_BINARY_DIR}/diagrams_c.h ${CMAKE_CURRENT_BINARY_DIR}/diagrams_d.h ${CMAKE_CURRENT_BINARY_DIR}/diagrams_e.h ${CMAKE_CURRENT_BINARY_DIR}/diagrams.cfg ${TOP}/examples/strip_example.py ${CMAKE_CURRENT_BINARY_DIR}/baseexample.cfg
 	OUTPUT ${PROJECT_BINARY_DIR}/html/examples/diagrams/html/index.html ${PROJECT_BINARY_DIR}/latex/examples/diagrams/latex/refman_doc.tex
   )
 endif(DOT)
