Skip to content

Commit

Permalink
COMP: Explicitly include version header where associated macros are used
Browse files Browse the repository at this point in the history
List of files to update were identified using the following script:

```
# Extract macro specific to Slicer version headers
cat CMake/vtkSlicerVersionConfigure.h.in CMake/vtkSlicerVersionConfigureInternal.h.in  | ack "^#define Slicer" | cut -d" " -f2 > /tmp/slicer-version-macros.txt

# Collect source files directly using at least one of the macro define in the version headers
(for macro in $(cat  /tmp/slicer-version-macros.txt); do
    ack $macro -l | ack "\.(cxx|cpp|h|h\.in|txx)$" | ack -v "vtkSlicerVersion";
done) | sort | uniq > /tmp/slicer-file-using-version-macros.txt

# Are these files already including the version header ?
for file in $(cat /tmp/slicer-file-using-version-macros.txt);
do
  echo "$file";
  cat $file | ack  vtkSlicerVersionConfigure > /dev/null && echo "  yes" || echo "  no";
done
```

Co-authored-by: Andras Lasso <lasso@queensu.ca>
Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
  • Loading branch information
3 people committed May 30, 2023
1 parent e00446f commit 8c2143e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions Applications/SlicerApp/Main.cxx
Expand Up @@ -22,6 +22,7 @@
#include "qSlicerApplication.h"
#include "qSlicerApplicationHelper.h"
#include "qSlicerStyle.h"
#include "vtkSlicerVersionConfigure.h" // For Slicer_VERSION_FULL

// SlicerApp includes
#include "qSlicerAppMainWindow.h"
Expand Down
1 change: 1 addition & 0 deletions Base/QTApp/qSlicerApplicationHelper.cxx
Expand Up @@ -40,6 +40,7 @@
#include "qSlicerLoadableModuleFactory.h"
#include "qSlicerModuleFactoryManager.h"
#include "qSlicerModuleManager.h"
#include "vtkSlicerVersionConfigure.h" // For Slicer_MAIN_PROJECT_VERSION_FULL

#ifdef Slicer_USE_PYTHONQT
# include "qSlicerScriptedLoadableModuleFactory.h"
Expand Down
1 change: 1 addition & 0 deletions Base/QTGUI/qSlicerApplication.cxx
Expand Up @@ -38,6 +38,7 @@
#endif

#include "vtkSlicerConfigure.h" // For Slicer_USE_*, Slicer_BUILD_*_SUPPORT
#include <vtkSlicerVersionConfigure.h> // For Slicer_VERSION_FULL

// CTK includes
#include <ctkColorDialog.h>
Expand Down

0 comments on commit 8c2143e

Please sign in to comment.