-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
49 lines (35 loc) · 1.14 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
cmake_minimum_required(VERSION 3.4.3)
enable_testing()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# require at least gcc 4.9 !!
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)
message(FATAL_ERROR "GCC version must be at least 4.9!")
endif()
endif()
if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
project(CMSCodeChecker)
# find clang + llvm
find_package(Clang REQUIRED)
if( LLVM_FOUND )
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
include(AddLLVM)
# set the compiler flags to match llvm
include(HandleLLVMOptions)
endif()
# Make sure that our source directory is on the current cmake module path so that
# we can include cmake files from this directory.
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
# include Clang macros (unfortunately they are not part of the cmake installation)
include(AddClang)
# add include directories
include_directories(${LLVM_INCLUDE_DIRS})
set(LLVM_LINK_COMPONENTS
Support
)
# the main executable
add_subdirectory(tool)
# the specific cms checker code
add_subdirectory(cms)
# for testing
add_subdirectory(test)
endif()