summaryrefslogtreecommitdiffstats
path: root/Utilities
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2011-09-13 18:32:52 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2011-09-13 18:32:52 (GMT)
commita0ec7a00d5fe1a8b65329545f24080af581705be (patch)
tree4ac9e9a2cc3c14e836bc3a00506ca965e32d1a86 /Utilities
parentc7021203de8a3632d7f33bc812b41e88f5bc86f9 (diff)
parent3a0d63242d959871b8f047e7f7ee1531f113f436 (diff)
downloadCMake-a0ec7a00d5fe1a8b65329545f24080af581705be.zip
CMake-a0ec7a00d5fe1a8b65329545f24080af581705be.tar.gz
CMake-a0ec7a00d5fe1a8b65329545f24080af581705be.tar.bz2
Merge topic 'add-kwstyle-test'
3a0d632 KWStyle Test: Activate by default if KWStyle is found 91704ef Tests: Add a KWStyle test, equivalent to the make StyleCheck target
Diffstat (limited to 'Utilities')
-rw-r--r--Utilities/KWStyle/CMakeLists.txt28
1 files changed, 22 insertions, 6 deletions
diff --git a/Utilities/KWStyle/CMakeLists.txt b/Utilities/KWStyle/CMakeLists.txt
index 4803ffa..5b0c84e 100644
--- a/Utilities/KWStyle/CMakeLists.txt
+++ b/Utilities/KWStyle/CMakeLists.txt
@@ -12,17 +12,34 @@
#-----------------------------------------------------------------------------
# CMake uses KWStyle for checking the coding style
-OPTION(CMAKE_USE_KWSTYLE "Run KWStyle in order to check for violations of the coding standard." OFF)
-MARK_AS_ADVANCED(CMAKE_USE_KWSTYLE)
-IF(CMAKE_USE_KWSTYLE)
- FIND_PROGRAM(KWSTYLE_EXECUTABLE
+# Search for a built-from-source KWStyle under Dashboards/Support on a typical
+# dashboard machines:
+#
+SET(home "$ENV{HOME}")
+IF(NOT home)
+ STRING(REPLACE "\\" "/" home "$ENV{USERPROFILE}")
+ENDIF()
+
+FIND_PROGRAM(KWSTYLE_EXECUTABLE
NAMES KWStyle
PATHS
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Kitware Inc.\\KWStyle 1.0.0]/bin"
+ "${home}/Dashboards/Support/KWStyle/bin"
)
- MARK_AS_ADVANCED(KWSTYLE_EXECUTABLE)
+MARK_AS_ADVANCED(KWSTYLE_EXECUTABLE)
+
+SET(CMAKE_USE_KWSTYLE_DEFAULT OFF)
+IF(KWSTYLE_EXECUTABLE)
+ SET(CMAKE_USE_KWSTYLE_DEFAULT ON)
+ENDIF()
+OPTION(CMAKE_USE_KWSTYLE
+ "Add StyleCheck target and KWStyle test: run KWStyle to check for coding standard violations."
+ ${CMAKE_USE_KWSTYLE_DEFAULT})
+MARK_AS_ADVANCED(CMAKE_USE_KWSTYLE)
+
+IF(CMAKE_USE_KWSTYLE)
OPTION(KWSTYLE_USE_VIM_FORMAT "Set KWStyle to generate errors with a VIM-compatible format." OFF)
OPTION(KWSTYLE_USE_MSVC_FORMAT "Set KWStyle to generate errors with a VisualStudio-compatible format." OFF)
MARK_AS_ADVANCED(KWSTYLE_USE_VIM_FORMAT)
@@ -59,4 +76,3 @@ IF(CMAKE_USE_KWSTYLE)
ADD_CUSTOM_TARGET(StyleCheck DEPENDS ${CMake_BINARY_DIR}/KWStyleReport.txt)
ENDIF(CMAKE_USE_KWSTYLE)
-