##// END OF EJS Templates
Merge pull request 142 from SCIQLOP-Initialisation develop...
Merge pull request 142 from SCIQLOP-Initialisation develop Develop

File last commit:

r14:5bce99742c6f
r103:0e87458642fc merge
Show More
sciqlop_code_analysis.cmake
44 lines | 1.5 KiB | text/x-cmake | CMakeLexer
/ cmake / sciqlop_code_analysis.cmake
Initialisation de l'archi cmake
r0 #
# sciqlop_code_analysis.cmake
mperrinel
Initialisation de la configuration Linux
r14 # Launch code source analysis with CLANGANALYZER. Can be activated with the
# ENABLE_ANALYSIS option.
Initialisation de l'archi cmake
r0 #
# The following CACHE variables are available:
mperrinel
Initialisation de la configuration Linux
r14 # * CLANGANALYZER_EXTRA_ARGS: extra arguments for CLANGANALYZER;
# * CLANGANALYZER_OUTPUT: path to the xml report of CLANGANALYZER.
Initialisation de l'archi cmake
r0 #
# The following variables are used (must be set by the cmake file calling this
# one):
# * ANALYSIS_INPUT_DIRS: directories to analyze;
# * ANALYSIS_EXCLUDE_DIRS: directories to exclude from the analysis.
#
#
mperrinel
Initialisation de la configuration Linux
r14 # Analyze the source code with CLANGANALYZER
Initialisation de l'archi cmake
r0 #
mperrinel
Initialisation de la configuration Linux
r14 OPTION (ENABLE_ANALYSIS "Analyze the source code with clang_analyze" ON)
IF (ENABLE_ANALYSIS)
Initialisation de l'archi cmake
r0
mperrinel
Initialisation de la configuration Linux
r14 # Make sure CLANGANALYZER has been found, otherwise the source code can't be
Initialisation de l'archi cmake
r0 # analyzed
mperrinel
Initialisation de la configuration Linux
r14 IF (CLANGANALYZER_FOUND)
Initialisation de l'archi cmake
r0
mperrinel
Initialisation de la configuration Linux
r14 SET (CLANGANALYZER_OUTPUT "${CMAKE_BINARY_DIR}/clang-analyzer-ouput"
CACHE STRING "Output file for the CLANGANALYZER report")
MARK_AS_ADVANCED (CLANGANALYZER_OUTPUT)
Initialisation de l'archi cmake
r0
mperrinel
Initialisation de la configuration Linux
r14 SET (CLANGANALYZER_EXTRA_ARGS -o ${CLANGANALYZER_OUTPUT}
CACHE STRING "Extra arguments for CLANGANALYZER")
MARK_AS_ADVANCED (CLANGANALYZER_EXTRA_ARGS)
Initialisation de l'archi cmake
r0
mperrinel
Initialisation de la configuration Linux
r14 # Add the analyze target to launch CLANGANALYZER
Initialisation de l'archi cmake
r0 ADD_CUSTOM_TARGET (analyze
COMMAND
mperrinel
Initialisation de la configuration Linux
r14 sh ${CMAKE_CURRENT_SOURCE_DIR}/analyzer/launch-clang-analyzer-linux.sh
Initialisation de l'archi cmake
r0 )
mperrinel
Initialisation de la configuration Linux
r14 ELSE (CLANGANALYZER_FOUND)
MESSAGE (STATUS "The source code won't be analyzed - CLANGANALYZER not found")
ENDIF (CLANGANALYZER_FOUND)
ENDIF (ENABLE_ANALYSIS)