Whitespace cleanup
[frida/frida.git] / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.8.9)
2 PROJECT(frida)
3
4 set(CMAKE_VERBOSE_MAKEFILE on)
5
6 set(CMAKE_AUTOMOC ON)
7 set(CMAKE_INCLUDE_CURRENT_DIR ON)
8
9 find_package(Qt5Widgets)
10 find_package(Qt5 CONFIG REQUIRED Widgets Gui)
11 find_package(PkgConfig)
12 pkg_check_modules(LOG4CXX REQUIRED liblog4cxx)
13 pkg_check_modules(GUILE REQUIRED guile-2.0)
14
15 #add_compile_options(${LOG4CXX_CFLAGS})
16 add_definitions(${LOG4CXX_CFLAGS})
17 add_definitions(${GUILE_CFLAGS})
18
19 find_program(LLVM_CONFIG llvm-config-3.5)
20
21 if(NOT LLVM_CONFIG)
22 message(FATAL_ERROR "LLVM not found")
23 endif()
24
25 execute_process(COMMAND ${LLVM_CONFIG} --cxxflags OUTPUT_VARIABLE LLVM_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
26 execute_process(COMMAND ${LLVM_CONFIG} --ldflags OUTPUT_VARIABLE LLVM_LDFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
27 execute_process(COMMAND ${LLVM_CONFIG} --libs OUTPUT_VARIABLE LLVM_LIBS OUTPUT_STRIP_TRAILING_WHITESPACE)
28 execute_process(COMMAND ${LLVM_CONFIG} --system-libs OUTPUT_VARIABLE LLVM_SYSTEM_LIBS OUTPUT_STRIP_TRAILING_WHITESPACE)
29
30 string(REPLACE -O2 "" LLVM_CFLAGS ${LLVM_CFLAGS})
31 string(REPLACE -fno-exceptions "" LLVM_CFLAGS ${LLVM_CFLAGS})
32
33 separate_arguments(LLVM_CFLAGS)
34 add_definitions(${LLVM_CFLAGS})
35 add_definitions(-std=c++11 -Wall)
36 add_definitions(-DQT_NO_KEYWORDS)
37
38 separate_arguments(LLVM_LDFLAGS)
39 separate_arguments(LLVM_LIBS)
40
41 set(CMAKE_CXX_COMPILER "clang++")
42
43 SET(frida_SOURCES
44 src/main.cxx
45 src/core/InformationManager.cxx
46 src/gui/Mainwindow.cxx
47 src/gui/widgets/BasicBlockWidget.cxx
48 src/gui/widgets/CFGScene.cxx
49 src/gui/widgets/ScriptingDock.cxx
50 src/disassembler/Disassembler.cxx
51 src/disassembler/llvm/LLVMDisassembler.cxx
52 )
53 SET(frida_HEADERS
54 src/include_llvm.hxx
55 src/core/InformationManager.hxx
56 src/gui/qt.hxx
57 src/gui/Mainwindow.hxx
58 src/gui/widgets/BasicBlockWidget.hxx
59 src/gui/widgets/CFGScene.hxx
60 src/gui/widgets/ScriptingDock.hxx
61 src/disassembler/llvm/LLVMDisassembler.hxx
62 src/disassembler/Disassembler.hxx
63 )
64
65 ADD_EXECUTABLE(frida ${frida_SOURCES} ${frida_HEADERS_MOC})
66 #ADD_LIBRARY(llvm SHARED )
67
68 ADD_DEFINITIONS(${QT_DEFINITIONS})
69
70 qt5_use_modules(frida Widgets)
71 INCLUDE_DIRECTORIES("src")
72
73 TARGET_LINK_LIBRARIES(frida ${QT_LIBRARIES} ${LLVM_LDFLAGS} -lLLVM-3.5 ${LLVM_SYSTEM_LIBS} ${LOG4CXX_LDFLAGS} ${GUILE_LDFLAGS})