diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 6fa2c09..d60e7d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -41,6 +41,20 @@ function(generate_flatbuffers _target) | |||
41 | endforeach(fbs) | 41 | endforeach(fbs) |
42 | endfunction(generate_flatbuffers) | 42 | endfunction(generate_flatbuffers) |
43 | 43 | ||
44 | add_custom_target(analyze) | ||
45 | function(add_clang_static_analysis target) | ||
46 | get_target_property(SRCs ${target} SOURCES) | ||
47 | get_target_property(INCLUDEs ${target} INCLUDE_DIRECTORIES) | ||
48 | add_library(${target}_analyze OBJECT EXCLUDE_FROM_ALL ${SRCs}) | ||
49 | set_target_properties(${target}_analyze PROPERTIES | ||
50 | COMPILE_OPTIONS "--analyze" | ||
51 | EXCLUDE_FROM_DEFAULT_BUILD true | ||
52 | INCLUDE_DIRECTORIES "${INCLUDEs};/work/install/include/KF5/" # Had to hardcode include directory to find KAsync includes | ||
53 | COMPILE_FLAGS "${Qt5Core_EXECUTABLE_COMPILE_FLAGS}" # Necessary to get options such as fPic | ||
54 | ) | ||
55 | add_dependencies(analyze ${target}_analyze) | ||
56 | endfunction() | ||
57 | |||
44 | set(CMAKE_AUTOMOC ON) | 58 | set(CMAKE_AUTOMOC ON) |
45 | add_definitions("-Wall -std=c++0x -g") | 59 | add_definitions("-Wall -std=c++0x -g") |
46 | include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${FLATBUFFERS_INCLUDE_DIR} ${CMAKE_BINARY_DIR}/common) | 60 | include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${FLATBUFFERS_INCLUDE_DIR} ${CMAKE_BINARY_DIR}/common) |