Changeset: 8b0240ac7b48 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/8b0240ac7b48
Modified Files:
        .hgignore
        CMakeLists.txt
        cmake/monetdb-custom-targets.cmake
        cmake/monetdb-findpackages.cmake
Branch: Aug2024
Log Message:

add ctags/cscope rules (enabled if available and if -DSTRICT=ON)


diffs (74 lines):

diff --git a/.hgignore b/.hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -44,6 +44,7 @@ GPATH
 GRTAGS
 TAGS
 tags
+cscope.*
 *.pyo
 *.rej
 *.orig
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -118,8 +118,14 @@ if(WIN32)
     ${CMAKE_CURRENT_BINARY_DIR}/unistd.h)
 endif()
 
-add_library(monetdb_config_header
-  INTERFACE)
+add_library(monetdb_config_header INTERFACE)
+
+if (CTAGS_PATH)
+  add_dependencies(monetdb_config_header tags)
+endif()
+if (CSCOPE_PATH)
+  add_dependencies(monetdb_config_header cscope)
+endif()
 
 target_include_directories(monetdb_config_header
   INTERFACE
diff --git a/cmake/monetdb-custom-targets.cmake 
b/cmake/monetdb-custom-targets.cmake
--- a/cmake/monetdb-custom-targets.cmake
+++ b/cmake/monetdb-custom-targets.cmake
@@ -97,3 +97,20 @@ else()
     COMMAND
     ${CMAKE_COMMAND} -E echo 'Target not available because \"candle\" was not 
found.')
 endif()
+
+if(CTAGS_PATH)
+add_custom_target(tags
+  COMMAND ${CTAGS_PATH} -R --kinds-C=+pLl --fields=+iaS --exclude=*.js
+        ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
+        COMMAND ln -sf ${CMAKE_CURRENT_BINARY_DIR}/tags 
${CMAKE_CURRENT_SOURCE_DIR}
+  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
+endif()
+
+if(CSCOPE_PATH)
+add_custom_target(cscope
+  COMMAND ${CSCOPE_PATH} -bcqR -s${CMAKE_CURRENT_SOURCE_DIR}
+        COMMAND ln -sf ${CMAKE_CURRENT_BINARY_DIR}/cscope.out 
${CMAKE_CURRENT_SOURCE_DIR}/
+        COMMAND ln -sf ${CMAKE_CURRENT_BINARY_DIR}/cscope.in.out 
${CMAKE_CURRENT_SOURCE_DIR}/
+        COMMAND ln -sf ${CMAKE_CURRENT_BINARY_DIR}/cscope.po.out 
${CMAKE_CURRENT_SOURCE_DIR}/
+  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
+endif()
diff --git a/cmake/monetdb-findpackages.cmake b/cmake/monetdb-findpackages.cmake
--- a/cmake/monetdb-findpackages.cmake
+++ b/cmake/monetdb-findpackages.cmake
@@ -137,3 +137,15 @@ find_package(Reprepro)
 find_package(Semodule)
 find_package(Awk)
 find_package(Candle)
+
+if(STRICT)
+  find_program(CTAGS_PATH ctags)
+  if(CTAGS_PATH)
+    message(STATUS "Found ctags: ${CTAGS_PATH}")
+  endif(CTAGS_PATH)
+  find_program(CSCOPE_PATH cscope)
+  if(CSCOPE_PATH)
+    message(STATUS "Found cscope: ${CSCOPE_PATH}")
+  endif(CSCOPE_PATH)
+endif(STRICT)
+
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to