]> git.siccegge.de Git - frida/frida.git/blob - CMakeLists.txt
60cbd60dbbecffe255996288b3bd043275988462
[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 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules")
9
10 find_package(Qt5Widgets)
11 find_package(Qt5 CONFIG REQUIRED Widgets Gui)
12 find_package(QuaZip REQUIRED)
13 find_package(LLVM REQUIRED)
14 find_package(PkgConfig)
15 pkg_check_modules(LOG4CXX REQUIRED liblog4cxx)
16 pkg_check_modules(GUILE REQUIRED guile-2.0)
17 FIND_PACKAGE(SWIG REQUIRED)
18 INCLUDE(${SWIG_USE_FILE})
19
20 add_definitions(${LOG4CXX_CFLAGS})
21 add_definitions(${GUILE_CFLAGS})
22
23 add_definitions(${LLVM_CFLAGS})
24 add_definitions(-std=c++11 -Wall -Wextra)
25 add_definitions(-DQT_NO_KEYWORDS)
26
27 separate_arguments(LLVM_LDFLAGS)
28 separate_arguments(LLVM_LIBS)
29
30 INCLUDE_DIRECTORIES("src")
31
32 #####################
33 # Language Bindings #
34 #####################
35
36 SET(CMAKE_SWIG_FLAGS -Linkage passive)
37 #FIND_PACKAGE(PythonLibs)
38 #INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
39 SET_SOURCE_FILES_PROPERTIES(src/bindings/guile/frida.i PROPERTIES CPLUSPLUS ON)
40 SWIG_ADD_MODULE(frida-guile guile src/bindings/guile/frida.i)
41 SWIG_LINK_LIBRARIES(frida-guile ${GUILE_LDFLAGS})
42
43
44 #################
45 # Main Programm #
46 #################
47
48 SET(frida_SOURCES
49 src/core/InformationManager.cxx
50 src/core/BasicBlock.cxx
51 src/core/Function.cxx
52 src/gui/Mainwindow.cxx
53 src/gui/widgets/BasicBlockWidget.cxx
54 src/gui/widgets/CFGScene.cxx
55 src/gui/widgets/ScriptingDock.cxx
56 src/gui/widgets/FunctionWidget.cxx
57 src/gui/dialogs/NewFunctionDialog.cxx
58 src/gui/dialogs/SimpleStringDialog.cxx
59 src/disassembler/Disassembler.cxx
60 src/disassembler/llvm/LLVMDisassembler.cxx
61 )
62 SET(frida_HEADERS
63 src/include_llvm.hxx
64 src/core/InformationManager.hxx
65 src/gui/qt.hxx
66 src/gui/Mainwindow.hxx
67 src/gui/widgets/BasicBlockWidget.hxx
68 src/gui/widgets/CFGScene.hxx
69 src/gui/widgets/ScriptingDock.hxx
70 src/gui/widgets/FunctionWidget.hxx
71 src/gui/dialogs/NewFunctionDialog.hxx
72 src/gui/dialogs/SimpleStringDialog.hxx
73 src/disassembler/llvm/LLVMDisassembler.hxx
74 src/disassembler/Disassembler.hxx
75 )
76
77 ADD_EXECUTABLE(frida src/main.cxx ${frida_SOURCES} ${frida_HEADERS_MOC})
78 #ADD_LIBRARY(llvm SHARED )
79
80 ADD_DEFINITIONS(${QT_DEFINITIONS})
81
82 qt5_use_modules(frida Widgets)
83
84 TARGET_LINK_LIBRARIES(frida
85 ${QT_LIBRARIES}
86 ${LLVM_LDFLAGS}
87 -lLLVM-3.5
88 ${LLVM_SYSTEM_LIBS}
89 ${LOG4CXX_LDFLAGS}
90 ${QUAZIP_LIBRARIES})
91
92
93 ###########
94 # Plugins #
95 ###########
96
97 # GUILE
98
99 set(plugin_guile_SOURCES
100 src/bindings/Interpreter.cxx
101 src/bindings/Guile.cxx)
102
103 set(plugin_guile_HEADERS
104 src/bindings/Interpreter.hxx
105 src/bindings/Guile.hxx)
106
107 add_library(guilePlugin MODULE ${plugin_guile_SOURCES} ${plugin_guile_HEADERS_MOC})
108 qt5_use_modules(guilePlugin Core)
109 target_link_libraries(guilePlugin ${QT_LIBRARIES} ${GUILE_LDFLAGS})
110
111 ##################
112 # TEST Framework #
113 ##################
114
115 set(fridatest_SOURCES
116 src/test.cxx
117 src/core/tests/BasicBlockTest.cxx
118 src/core/tests/FunctionTest.cxx
119 ${frida_SOURCES}
120 )
121
122 add_executable(fridatest ${fridatest_SOURCES})
123
124 qt5_use_modules(fridatest Widgets)
125
126 #ADD_SUBDIRECTORY(/usr/src/gtest gtest)
127 ADD_SUBDIRECTORY(/usr/src/gmock gmock)
128 enable_testing()
129 target_link_libraries(fridatest gmock gtest ${QT_LIBRARIES} ${LLVM_LDFLAGS} -lLLVM-3.5 ${LLVM_SYSTEM_LIBS} ${LOG4CXX_LDFLAGS} ${GUILE_LDFLAGS} ${QUAZIP_LIBRARIES})
130 add_test(NAME fridatest COMMAND fridatest ${CMAKE_SOURCE_DIR})