Fix for DA
[u/mrichter/AliRoot.git] / cmake / FindRuleChecker.cmake
CommitLineData
6db31708 1# AliRoot Build System Module to find and configure IRST ALICE Coding Coventions RuleChecker
2#
3# Author: Johny Jose (johny.jose@cern.ch)
4# Port of previous Makefile build to cmake
5
6cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
7
8find_program(RULECHECKER_SRCML NAMES src2srcml)
9message(STATUS "Check for src2srcml: ${RULECHECKER_SRCML}")
10find_package(Java)
11message(STATUS "Check for Java: ${JAVA_RUNTIME}")
12
13set(IRST_INSTALLDIR $ENV{IRST_INSTALLDIR})
14if(NOT IRST_INSTALLDIR)
15 if(ALICE)
16 message(STATUS "Setting IRST_INSTALLDIR to ${ALICE}/local/IRST")
17 set(IRST_INSTALLDIR ${ALICE}/local/ALICENewRuleChecker)
18 endif(ALICE)
19endif(NOT IRST_INSTALLDIR)
20
21if(IRST_INSTALLDIR)
22 find_file(RULECHECKER_JAR NAMES NewRuleChecker.jar PATHS ${IRST_INSTALLDIR})
23 find_file(RULECHECKER_RULES NAMES AliceCodingConventions.xml PATHS ${IRST_INSTALLDIR})
24 if(RULECHECKER_JAR AND RULECHECKER_RULES AND RULECHECKER_SRCML AND JAVA_RUNTIME)
25 set(RULECHECKER_FOUND TRUE)
26 message(STATUS "RuleChecker found on the system")
27 else()
28 message(STATUS "RuleChecker not found on this system")
29 endif(RULECHECKER_JAR AND RULECHECKER_RULES AND RULECHECKER_SRCML AND JAVA_RUNTIME)
30else()
31 message(STATUS "RuleChecker not found on this system")
32endif(IRST_INSTALLDIR)
33