Add CMakeLists.txt

This commit is contained in:
Florian Märkl 2017-03-30 18:58:57 +02:00
parent 4732953e43
commit 8f81ec244c
2 changed files with 180 additions and 0 deletions

125
src/CMakeLists.txt Normal file
View File

@ -0,0 +1,125 @@
cmake_minimum_required(VERSION 3.1)
project(Iaito VERSION 1.0.0)
set(CMAKE_CXX_STANDARD 11)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
find_package(Qt5 REQUIRED COMPONENTS Core Widgets Gui WebKit WebKitWidgets)
find_package(Radare2 REQUIRED)
include_directories(${RADARE2_INCLUDE_DIRS})
set(SOURCE_FILES
main.cpp
mainwindow.cpp
newfiledialog.cpp
optionsdialog.cpp
highlighter.cpp
qrcore.cpp
createnewdialog.cpp
hexascii_highlighter.cpp
webserverthread.cpp
widgets/pieview.cpp
widgets/sectionswidget.cpp
widgets/codegraphic.cpp
widgets/notepad.cpp
mdhighlighter.cpp
widgets/functionswidget.cpp
dialogs/renamedialog.cpp
dialogs/aboutdialog.cpp
widgets/importswidget.cpp
widgets/symbolswidget.cpp
widgets/relocswidget.cpp
widgets/commentswidget.cpp
widgets/stringswidget.cpp
widgets/flagswidget.cpp
widgets/memwidget/memorywidget.cpp
qrdisasm.cpp
widgets/sdbdock.cpp
analthread.cpp
dialogs/commentsdialog.cpp
widgets/sidebar.cpp
helpers.cpp
widgets/omnibar.cpp
widgets/dashboard.cpp
dialogs/xrefsdialog.cpp
hexhighlighter.cpp)
set(HEADER_FILES
mainwindow.h
newfiledialog.h
optionsdialog.h
highlighter.h
qrcore.h
createnewdialog.h
hexascii_highlighter.h
webserverthread.h
widgets/pieview.h
widgets/sectionswidget.h
widgets/codegraphic.h
widgets/notepad.h
mdhighlighter.h
widgets/functionswidget.h
dialogs/renamedialog.h
dialogs/aboutdialog.h
widgets/importswidget.h
widgets/symbolswidget.h
widgets/relocswidget.h
widgets/commentswidget.h
widgets/stringswidget.h
widgets/flagswidget.h
widgets/memwidget/memorywidget.h
qrdisasm.h
widgets/sdbdock.h
analthread.h
dialogs/commentsdialog.h
widgets/sidebar.h
helpers.h
widgets/omnibar.h
widgets/dashboard.h
dialogs/xrefsdialog.h
widgets/banned.h
hexhighlighter.h)
set(UI_FILES
mainwindow.ui
newfiledialog.ui
optionsdialog.ui
createnewdialog.ui
widgets/notepad.ui
widgets/functionswidget.ui
dialogs/aboutdialog.ui
dialogs/renamedialog.ui
widgets/importswidget.ui
widgets/symbolswidget.ui
widgets/relocswidget.ui
widgets/commentswidget.ui
widgets/stringswidget.ui
widgets/flagswidget.ui
widgets/memwidget/memorywidget.ui
widgets/sdbdock.ui
dialogs/commentsdialog.ui
widgets/sidebar.ui
widgets/dashboard.ui
dialogs/xrefsdialog.ui)
set(QRC_FILES resources.qrc)
set(IAITO_VERSION_SUFFIX "-dev")
set(IAITO_VERSION_FULL "${PROJECT_VERSION}${IAITO_VERSION_SUFFIX}")
message("Building Iaito version ${IAITO_VERSION_FULL}")
add_definitions("-DAPP_VERSION=\"${IAITO_VERSION_FULL}\"")
add_executable(iaito ${UI_FILES} ${QRC_FILES} ${SOURCE_FILES} ${HEADER_FILES})
qt5_use_modules(iaito Core Widgets Gui WebKit WebKitWidgets)
target_link_libraries(iaito ${RADARE2_LIBRARIES})

View File

@ -0,0 +1,55 @@
# - Find Radare2 (libr)
#
# RADARE2_FOUND - True if libr has been found.
# RADARE2_INCLUDE_DIRS - libr Include Directory
# RADARE2_LIBRARIES - List of libraries when using libr.
# RADARE2_LIBRARY_<name> - Path to library r_<name>
find_path(RADARE2_INCLUDE_DIRS
NAMES r_core.h r_bin.h r_util.h
HINTS
/usr/local/include/libr
/usr/include/libr)
set(RADARE2_LIBRARY_NAMES
core
config
cons
io
util
flag
asm
debug
hash
bin
lang
io
anal
parse
bp
egg
reg
search
syscall
socket
fs
magic
crypto)
set(RADARE2_LIBRARIES "")
set(RADARE2_LIBRARIES_VARS "")
foreach(libname ${RADARE2_LIBRARY_NAMES})
find_library(RADARE2_LIBRARY_${libname}
r_${libname}
HINTS
/usr/local/lib
/usr/lib)
list(APPEND RADARE2_LIBRARIES ${RADARE2_LIBRARY_${libname}})
list(APPEND RADARE2_LIBRARIES_VARS "RADARE2_LIBRARY_${libname}")
endforeach()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(RADARE2 REQUIRED_VARS ${RADARE2_LIBRARIES_VARS} RADARE2_INCLUDE_DIRS)
mark_as_advanced(RADARE2_LIBRARIES_VARS)