forked from grievejia/andersen
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
41 lines (34 loc) · 1.31 KB
/
CMakeLists.txt
File metadata and controls
41 lines (34 loc) · 1.31 KB
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
cmake_minimum_required(VERSION 2.8.8)
project(andersen)
if(LLVM_CONFIG_BINARY)
execute_process(COMMAND ${LLVM_CONFIG_BINARY} --version
OUTPUT_VARIABLE LLVM_REQUESTED_VERSION)
string(STRIP "${LLVM_REQUESTED_VERSION}" LLVM_REQUESTED_VERSION)
message(STATUS "Requesting LLVM ${LLVM_REQUESTED_VERSION}")
find_package(LLVM "${LLVM_REQUESTED_VERSION}" EXACT REQUIRED CONFIG)
else()
find_package(LLVM REQUIRED CONFIG)
endif()
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
# Set your project compile flags.
# E.g. if using the C++ header files
# you will need to enable C++14 support
# for your compiler.
# Check for C++14 support and set the compilation flag
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14)
if(COMPILER_SUPPORTS_CXX14)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -fno-rtti -fPIC -Wall")
else()
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++14 support. Please use a different C++ compiler.")
endif()
option(BUILD_TESTS "build all unit tests" ON)
include_directories(${LLVM_INCLUDE_DIRS})
add_definitions(${LLVM_DEFINITIONS})
add_subdirectory (lib)
if (BUILD_TESTS)
add_subdirectory (unittest)
endif()
enable_testing ()
add_test (AndersTest ${PROJECT_BINARY_DIR}/unittest/AndersTest)