Bladeren bron

Added cppcheck and doxygen build targets

Thomas Buck 10 jaren geleden
bovenliggende
commit
d4f8fe41ac
3 gewijzigde bestanden met toevoegingen van 31 en 12 verwijderingen
  1. 21
    6
      CMakeLists.txt
  2. 5
    5
      Doxyfile.in
  3. 5
    1
      README.md

+ 21
- 6
CMakeLists.txt Bestand weergeven

@@ -61,9 +61,24 @@ add_custom_target (checkConfig echo "Checking cppcheck config..."
61 61
 
62 62
 #################################################################
63 63
 
64
-#docLocal:
65
-#	sed -i '' 's/HAVE_DOT               = YES/HAVE_DOT               = NO/g' Doxyfile
66
-#	doxygen
67
-#	cp -R doc/html/* ../apache/
68
-#	rm -rf doc
69
-#	sed -i '' 's/HAVE_DOT               = NO/HAVE_DOT               = YES/g' Doxyfile
64
+# Generate Doxygen Documentation
65
+find_package (Doxygen)
66
+if (DOXYGEN_FOUND)
67
+    # Configure the Template Doxyfile for our specific project
68
+    configure_file(Doxyfile.in 
69
+        ${PROJECT_BINARY_DIR}/Doxyfile  @ONLY IMMEDIATE)
70
+    # Add a custom target to run Doxygen when ever the project is built
71
+    add_custom_target (doc
72
+  	    COMMAND ${DOXYGEN_EXECUTABLE} ${PROJECT_BINARY_DIR}/Doxyfile
73
+  		SOURCES ${PROJECT_BINARY_DIR}/Doxyfile)
74
+    # Add custom target to create local documentation without graphs
75
+    add_custom_target (docLocal
76
+        COMMAND sed -i '' "s/HAVE_DOT               = YES/HAVE_DOT               = NO/g" Doxyfile
77
+        COMMAND ${DOXYGEN_EXECUTABLE} ${PROJECT_BINARY_DIR}/Doxyfile
78
+        COMMAND cp -R doc/html/* ${PROJECT_SOURCE_DIR}/../apache/
79
+        COMMAND sed -i '' "s/HAVE_DOT               = NO/HAVE_DOT               = YES/g" Doxyfile
80
+        SOURCES ${PROJECT_BINARY_DIR}/Doxyfile)
81
+endif(DOXYGEN_FOUND)
82
+
83
+# Clean doc files
84
+set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "doc")

Doxyfile → Doxyfile.in Bestand weergeven

@@ -38,7 +38,7 @@ PROJECT_NAME           = OpenRaider
38 38
 # could be handy for archiving the generated documentation or if some version
39 39
 # control system is used.
40 40
 
41
-PROJECT_NUMBER         = 0.1.2-dev
41
+PROJECT_NUMBER         = @OpenRaider_VERSION_MAJOR@.@OpenRaider_VERSION_MINOR@.@OpenRaider_VERSION_MICRO@-dev
42 42
 
43 43
 # Using the PROJECT_BRIEF tag one can provide an optional one line description
44 44
 # for a project that appears at the top of each page and should give viewer a
@@ -58,7 +58,7 @@ PROJECT_LOGO           =
58 58
 # entered, it will be relative to the location where doxygen was started. If
59 59
 # left blank the current directory will be used.
60 60
 
61
-OUTPUT_DIRECTORY       = doc
61
+OUTPUT_DIRECTORY       = @PROJECT_BINARY_DIR@/doc
62 62
 
63 63
 # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub-
64 64
 # directories (in 2 levels) under the output directory of each output format and
@@ -142,7 +142,7 @@ FULL_PATH_NAMES        = YES
142 142
 # will be relative from the directory where doxygen is started.
143 143
 # This tag requires that the tag FULL_PATH_NAMES is set to YES.
144 144
 
145
-STRIP_FROM_PATH        = 
145
+STRIP_FROM_PATH        = @PROJECT_SOURCE_DIR@
146 146
 
147 147
 # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
148 148
 # path mentioned in the documentation of a class, which tells the reader which
@@ -733,7 +733,7 @@ WARN_LOGFILE           =
733 733
 # spaces.
734 734
 # Note: If this tag is empty the current directory is searched.
735 735
 
736
-INPUT                  = 
736
+INPUT                  = @PROJECT_SOURCE_DIR@/include @PROJECT_SOURCE_DIR@/src @PROJECT_SOURCE_DIR@/test
737 737
 
738 738
 # This tag can be used to specify the character encoding of the source files
739 739
 # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
@@ -2223,7 +2223,7 @@ INTERACTIVE_SVG        = YES
2223 2223
 # found. If left blank, it is assumed the dot tool can be found in the path.
2224 2224
 # This tag requires that the tag HAVE_DOT is set to YES.
2225 2225
 
2226
-DOT_PATH               = 
2226
+DOT_PATH               = @DOXYGEN_DOT_PATH@
2227 2227
 
2228 2228
 # The DOTFILE_DIRS tag can be used to specify one or more directories that
2229 2229
 # contain dot files that are included in the documentation (see the \dotfile

+ 5
- 1
README.md Bestand weergeven

@@ -67,7 +67,11 @@ Do a standard cmake build and then run the resulting executable:
67 67
 
68 68
 On Mac OS X, running `make install` will produce a distributable OpenRaider.app bundle.
69 69
 
70
-To build all Unit Tests, run `make tests`, to run most of them use `make testRun`. To run a TombRaider level loader regression test, use `make testReg`. The results will be put into log files in your build folder. `make clean` will remove them.
70
+To build all Unit Tests, run `make tests`, to run most of them use `make testRun`.
71
+To run a TombRaider level loader regression test, use `make testReg`. The results will be put into log files in your build folder.
72
+You can run a static analysis with cppcheck using `make check`, `make checkFull` or `make checkConfig`.
73
+A Doxygen API documentation can be created with `make doc`. `make docLocal` will not create additional graphs for the documentation and tries to copy the result into a directory called apache on the parent level of the OpenRaider project directory.
74
+`make clean` should remove all intermediary files.
71 75
 
72 76
 ## Usage
73 77
 

Laden…
Annuleren
Opslaan