cmake: Generate trace and debug tags
authorAina Niemetz <aina.niemetz@gmail.com>
Sat, 11 Aug 2018 00:57:15 +0000 (17:57 -0700)
committerMathias Preiner <mathias.preiner@gmail.com>
Sat, 22 Sep 2018 23:30:59 +0000 (16:30 -0700)
CMakeLists.txt
src/base/CMakeLists.txt

index 187f06949a3de33575d790ca4d26987259cc650f..87b281fe1c807bf21ba6b5f1b6b2fa64278f8ad0 100644 (file)
@@ -145,6 +145,7 @@ configure_file(
 
 #-----------------------------------------------------------------------------#
 
+add_subdirectory(src/base)
 add_subdirectory(src/expr)
 add_subdirectory(src/options)
 add_subdirectory(src/theory)
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..cf4e554cc69cf14b5fac2927caae6f8f62ef4afa 100644 (file)
@@ -0,0 +1,72 @@
+set(mktags_script ${CMAKE_CURRENT_LIST_DIR}/mktags)
+set(mktagheaders_script ${CMAKE_CURRENT_LIST_DIR}/mktagheaders)
+file(GLOB_RECURSE source_files ${PROJECT_SOURCE_DIR}/src/*.cpp ${PROJECT_SOURCE_DIR}/src/*.cc ${PROJECT_SOURCE_DIR}/src/*.h ${PROJECT_SOURCE_DIR}/src/*.g)
+string(REPLACE ";" " " source_files_list "${source_files}")
+
+add_custom_target(
+    debug_tags_tmp
+    COMMAND
+      ${mktags_script}
+      "Debug"
+      ${source_files_list}
+      > ${CMAKE_CURRENT_BINARY_DIR}/Debug_tags.tmp
+    DEPENDS mktags
+)
+
+add_custom_target(
+    trace_tags_tmp
+    COMMAND
+      ${mktags_script}
+      "Trace"
+      ${source_files_list}
+      > ${CMAKE_CURRENT_BINARY_DIR}/Trace_tags.tmp
+    DEPENDS mktags
+)
+
+add_custom_target(
+    debug_tags
+    COMMAND
+      diff -q
+      ${CMAKE_CURRENT_BINARY_DIR}/Debug_tags.tmp 
+      ${CMAKE_CURRENT_BINARY_DIR}/Debug_tags
+      &> /dev/null
+      || mv
+      ${CMAKE_CURRENT_BINARY_DIR}/Debug_tags.tmp 
+      ${CMAKE_CURRENT_BINARY_DIR}/Debug_tags
+      || true
+      DEPENDS debug_tags_tmp
+)
+
+add_custom_target(
+    trace_tags
+    COMMAND
+      diff -q
+      ${CMAKE_CURRENT_BINARY_DIR}/Trace_tags.tmp 
+      ${CMAKE_CURRENT_BINARY_DIR}/Trace_tags
+      &> /dev/null
+      || mv
+      ${CMAKE_CURRENT_BINARY_DIR}/Trace_tags.tmp 
+      ${CMAKE_CURRENT_BINARY_DIR}/Trace_tags
+      || true
+      DEPENDS trace_tags_tmp
+)
+
+add_custom_target(
+    debug_tags.h
+    COMMAND
+      ${mktagheaders_script}
+      "Debug_tags"
+      ${CMAKE_CURRENT_BINARY_DIR}/Debug_tags
+      > ${CMAKE_CURRENT_BINARY_DIR}/Debug_tags.h
+      DEPENDS debug_tags
+)
+
+add_custom_target(
+    trace_tags.h
+    COMMAND
+      ${mktagheaders_script}
+      "Trace_tags"
+      ${CMAKE_CURRENT_BINARY_DIR}/Trace_tags
+      > ${CMAKE_CURRENT_BINARY_DIR}/Trace_tags.h
+      DEPENDS trace_tags
+)