Skip to content
Browse files

* CMakeLists.txt: added astyle support

* design/CMakeLists.txt: revised astyle target
  • Loading branch information...
1 parent f38bf76 commit 498022782ca0a6fd54b4f3e4634fb01e4fa99d5b Thomas Pröger committed Apr 8, 2011
Showing with 37 additions and 23 deletions.
  1. +3 −0 CMakeLists.txt
  2. +34 −23 design/CMakeLists.txt
View
3 CMakeLists.txt
@@ -148,6 +148,9 @@ add_subdirectory(lib)
# build the ISIS applications
add_subdirectory(apps)
+# configure coding style tools
+add_subdirectory(design)
+
# build the ISIS tools.
if(ISIS_BUILD_TOOLS)
add_subdirectory(tools)
View
57 design/CMakeLists.txt
@@ -1,32 +1,43 @@
-cmake_minimum_required(VERSION 2.6)
-
-###############################################################################
-# the design subdirectory
-###############################################################################
-
-OPTION(${CMAKE_PROJECT_NAME}_USE_ASTYLE
+############################################################
+# The ISIS project
+#
+# CMake configuration file of the ISIS code style tools
+#
+# Author: Thomas Proeger <thomasproeger@googlemail.com>
+# Date: Fri, 08 Apr 2011 11:35:35 +0200
+#
+############################################################
+
+############################################################
+# optional components
+############################################################
+option(ISIS_USE_ASTYLE
"Create a make target for the Artistic Style code formatter" OFF)
-IF (${CMAKE_PROJECT_NAME}_USE_ASTYLE)
- FIND_FILE(ASTYLE astyle
- PATHS /usr/bin /usr/local/bin
- DOC "The Artistic Style code formatter.")
-
- IF(NOT ASTYLE)
- MESSAGE(FATAL ERROR"astyle executable not found. Please enter the full path to the Artistic Style code formatter tool.")
- ENDIF(NOT ASTYLE)
-
- MESSAGE(STATUS "Using Artistic Style: ${ASTYLE}")
- EXECUTE_PROCESS(COMMAND ${ASTYLE} "--version"
+############################################################
+# create astyle target
+############################################################
+if (ISIS_USE_ASTYLE)
+
+ # find astyle and configuration options
+ find_file(ASTYLE astyle
+ PATHS /usr/bin /usr/local/bin
+ DOC "The Artistic Style code formatter.")
+
+ if(NOT ASTYLE)
+ message(FATAL ERROR
+ "astyle executable not found. Please enter the full path to the Artistic Style code formatter tool.")
+ endif(NOT ASTYLE)
+
+ message(STATUS "Using Artistic Style: ${ASTYLE}")
+ execute_process(COMMAND ${ASTYLE} "--version"
ERROR_VARIABLE ASTYLE_VERSION
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
- MESSAGE(STATUS ${ASTYLE_VERSION})
+ message(STATUS ${ASTYLE_VERSION})
# create a target
- ADD_CUSTOM_TARGET(astyle
+ add_custom_target(astyle
"design/apply_astyle.sh" ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
-ENDIF (${CMAKE_PROJECT_NAME}_USE_ASTYLE)
-
-
+endif (ISIS_USE_ASTYLE)

0 comments on commit 4980227

Please sign in to comment.
Something went wrong with that request. Please try again.