1 cmake_minimum_required(VERSION 3.0.0)
4 set(CMAKE_VERBOSE_MAKEFILE on)
6 set(CMAKE_INCLUDE_CURRENT_DIR ON)
7 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules")
8 include(GNUInstallDirs)
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 find_program(SWIG_EXECUTABLE NAMES swig3.0)
19 INCLUDE(${SWIG_USE_FILE})
21 add_definitions(${LOG4CXX_CFLAGS})
22 add_definitions(${GUILE_CFLAGS})
24 add_definitions(${LLVM_CFLAGS})
25 add_definitions(-std=c++11 -Wall -Wextra)
26 add_definitions(-DQT_NO_KEYWORDS)
28 separate_arguments(LLVM_LDFLAGS)
29 separate_arguments(LLVM_LIBS)
31 INCLUDE_DIRECTORIES("src")
32 include_directories(${CMAKE_CURRENT_BINARY_DIR}/src)
38 SET(CMAKE_SWIG_FLAGS -Linkage passive)
39 if(CMAKE_SIZEOF_VOID_P EQUAL 8)
40 set(CMAKE_SWIG_FLAGS ${CMAKE_SWIG_FLAGS} -DSWIGWORDSIZE64)
42 #FIND_PACKAGE(PythonLibs)
43 #INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
44 SET_SOURCE_FILES_PROPERTIES(src/bindings/guile/frida.i PROPERTIES CPLUSPLUS ON)
45 SWIG_ADD_MODULE(guile-frida-binding guile src/bindings/guile/frida.i)
46 SWIG_LINK_LIBRARIES(guile-frida-binding ${GUILE_LDFLAGS})
47 qt5_use_modules(guile-frida-binding Widgets)
54 src/core/InformationManager.cxx
55 src/core/BasicBlock.cxx
59 src/gui/Mainwindow.cxx
60 src/gui/widgets/BasicBlockWidget.cxx
61 src/gui/widgets/CFGScene.cxx
62 src/gui/widgets/FridaDock.cxx
63 src/gui/widgets/LogDock.cxx
64 src/gui/widgets/LogDockAppender.cxx
65 src/gui/widgets/ScriptingDock.cxx
66 src/gui/widgets/FunctionWidget.cxx
67 src/gui/dialogs/NewFunctionDialog.cxx
68 src/gui/dialogs/SimpleStringDialog.cxx
69 src/disassembler/Disassembler.cxx
70 src/disassembler/llvm/LLVMDisassembler.cxx
74 src/core/InformationManager.hxx
77 src/gui/Mainwindow.hxx
78 src/gui/widgets/BasicBlockWidget.hxx
79 src/gui/widgets/CFGScene.hxx
80 src/gui/widgets/FridaDock.hxx
81 src/gui/widgets/LogDock.hxx
82 src/gui/widgets/LogDockAppender.hxx
83 src/gui/widgets/ScriptingDock.hxx
84 src/gui/widgets/FunctionWidget.hxx
85 src/gui/dialogs/NewFunctionDialog.hxx
86 src/gui/dialogs/SimpleStringDialog.hxx
87 src/disassembler/llvm/LLVMDisassembler.hxx
88 src/disassembler/Disassembler.hxx
91 ADD_EXECUTABLE(frida src/main.cxx ${frida_SOURCES} ${frida_HEADERS_MOC})
94 ADD_DEFINITIONS(${QT_DEFINITIONS})
96 qt5_use_modules(frida Widgets)
98 TARGET_LINK_LIBRARIES(frida
106 configure_file(src/Config.hxx.in src/Config.hxx @ONLY)
114 set(plugin_guile_SOURCES
115 src/bindings/Guile.cxx)
117 set(plugin_guile_HEADERS
118 src/bindings/Interpreter.hxx
119 src/bindings/Guile.hxx)
121 add_library(guilePlugin MODULE ${plugin_guile_SOURCES} ${plugin_guile_HEADERS_MOC})
122 qt5_use_modules(guilePlugin Core Widgets)
123 target_link_libraries(guilePlugin ${QT_LIBRARIES} ${GUILE_LDFLAGS})
129 set(fridatest_SOURCES
131 src/core/tests/BasicBlockTest.cxx
132 src/core/tests/FunctionTest.cxx
133 src/core/tests/CommentTest.cxx
134 src/disassembler/llvm/tests/amd64LinuxDisassemblerTest.cxx
135 src/disassembler/llvm/tests/mipselLinuxDisassemblerTest.cxx
136 src/disassembler/llvm/tests/armelLinuxDisassemblerTest.cxx
137 src/disassembler/llvm/tests/amd64MachODisassemblerTest.cxx
141 add_executable(fridatest ${fridatest_SOURCES})
143 qt5_use_modules(fridatest Widgets)
145 #ADD_SUBDIRECTORY(/usr/src/gtest gtest)
146 ADD_SUBDIRECTORY(/usr/src/gmock gmock)
148 add_test(NAME fridatest COMMAND fridatest ${CMAKE_SOURCE_DIR}/testdata)
149 target_link_libraries(fridatest
159 target_compile_options(fridatest PRIVATE -DCONFIG_TEST)
160 set_property(TEST fridatest
161 APPEND PROPERTY ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_CURRENT_BINARY_DIR})
163 install(TARGETS frida
164 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
166 install(TARGETS guilePlugin
167 DESTINATION ${CMAKE_INSTALL_LIBDIR}/frida/plugins/Interpreter)
169 install(TARGETS guile-frida-binding
170 DESTINATION ${CMAKE_INSTALL_LIBDIR})