This repository has been archived by the owner on Feb 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathCMakeLists.txt
75 lines (56 loc) · 2.42 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Copyright (C) 2017, Cyberhaven
# All rights reserved.
#
# Licensed under the Cyberhaven Research License Agreement.
cmake_minimum_required(VERSION 3.4.3)
project(LIBS2ECORE)
set(LIBS2ECORE_VERSION_MAJOR 2)
set(LIBS2ECORE_VERSION_MINOR 0)
set(LIBS2ECORE_VERSION_PATCH 0)
set(LIBS2ECORE_PACKAGE_VERSION
"${LIBS2ECORE_VERSION_MAJOR}.${LIBS2ECORE_VERSION_MINOR}.${LIBS2ECORE_VERSION_PATCH}")
include(CMakePackageConfigHelpers)
set(CMAKE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Version.cmake")
write_basic_package_version_file(${CMAKE_VERSION_FILE}
VERSION ${LIBS2ECORE_PACKAGE_VERSION}
COMPATIBILITY AnyNewerVersion)
set(CMAKE_CONFIG_FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake")
set(LIBS2ECORE_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/include")
set(LIBS2ECORE_LIBRARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/src")
configure_file(LIBS2ECOREConfig.cmake.in ${CMAKE_CONFIG_FILE} @ONLY)
find_package(PkgConfig REQUIRED)
pkg_check_modules(GLIB_PKG glib-2.0)
include_directories(${GLIB_PKG_INCLUDE_DIRS})
##### LLVM #####
find_package(LLVM REQUIRED)
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
add_definitions(${LLVM_DEFINITIONS})
include_directories("include" ${LLVM_INCLUDE_DIRS})
llvm_map_components_to_libnames(LLVM_LIBS core)
set(LLVM_CONFIG "${LLVM_TOOLS_BINARY_DIR}/llvm-config"
CACHE PATH "Path to llvm-config")
execute_process(COMMAND ${LLVM_CONFIG} "--cxxflags"
RESULT_VARIABLE LLVM_CONFIG_RESULT
OUTPUT_VARIABLE LLVM_CXXFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE)
##################
find_package(LIBQ REQUIRED)
message(STATUS "Found libq ${LIBQ_PACKAGE_VERSION}")
find_package(LIBCPU REQUIRED)
message(STATUS "Found libcpu ${LIBCPU_PACKAGE_VERSION}")
find_package(LIBTCG REQUIRED)
message(STATUS "Found libtcg ${LIBTCG_PACKAGE_VERSION}")
find_package(FSIGCXX REQUIRED)
message(STATUS "Found fsigc++ ${FSIGCXX_PACKAGE_VERSION}")
find_package(KLEE REQUIRED)
message(STATUS "Found klee ${KLEE_PACKAGE_VERSION}")
include_directories(${GLIB_PKG_INCLUDE_DIRS}
${LIBQ_INCLUDE_DIR}
${LIBTCG_INCLUDE_DIR}
${LIBCPU_INCLUDE_DIR}
${FSIGCXX_INCLUDE_DIR}
${LIBS2ECORE_INCLUDE_DIR}
${KLEE_INCLUDE_DIR}
${LUA_DIR}
${S2EGUEST_INCLUDE_DIR})
add_subdirectory(src)