2017-03-30 16:58:57 +00:00
|
|
|
|
|
|
|
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)
|
2017-04-09 18:33:33 +00:00
|
|
|
set(CMAKE_AUTOUIC ON)
|
2017-03-30 16:58:57 +00:00
|
|
|
set(CMAKE_AUTORCC ON)
|
2017-04-12 16:49:01 +00:00
|
|
|
find_package(Qt5 REQUIRED COMPONENTS Core Widgets Gui WebEngine WebEngineWidgets)
|
2017-03-30 16:58:57 +00:00
|
|
|
|
2017-03-31 11:28:27 +00:00
|
|
|
|
|
|
|
if(WIN32)
|
2017-03-31 14:52:26 +00:00
|
|
|
# use radare2 libraries from submodule on windows
|
|
|
|
set(IAITO_WIN32_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../iaito_win32")
|
|
|
|
list(APPEND CMAKE_PREFIX_PATH "${IAITO_WIN32_DIR}")
|
2017-04-01 09:11:39 +00:00
|
|
|
|
|
|
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8) # 64 bit
|
|
|
|
list(APPEND CMAKE_LIBRARY_PATH "${IAITO_WIN32_DIR}/radare2/lib64")
|
|
|
|
else()
|
|
|
|
list(APPEND CMAKE_LIBRARY_PATH "${IAITO_WIN32_DIR}/radare2/lib32")
|
|
|
|
endif()
|
|
|
|
|
2017-03-31 14:52:26 +00:00
|
|
|
set(RADARE2_INCLUDE_DIRS "${IAITO_WIN32_DIR}/radare2/include/libr" "${IAITO_WIN32_DIR}/include")
|
2017-03-31 11:28:27 +00:00
|
|
|
endif()
|
|
|
|
|
2017-04-28 14:18:43 +00:00
|
|
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
|
|
|
|
OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
|
|
|
add_definitions(-Wall)
|
|
|
|
endif()
|
|
|
|
|
2017-03-31 11:28:27 +00:00
|
|
|
|
2017-03-30 16:58:57 +00:00
|
|
|
find_package(Radare2 REQUIRED)
|
|
|
|
include_directories(${RADARE2_INCLUDE_DIRS})
|
|
|
|
|
|
|
|
|
2017-04-12 15:53:40 +00:00
|
|
|
# Parse iaito.pro to get filenames
|
|
|
|
include(QMakeProParse)
|
|
|
|
parse_qmake_pro("${CMAKE_CURRENT_SOURCE_DIR}/iaito.pro" IAITO_PRO)
|
|
|
|
set(SOURCE_FILES ${IAITO_PRO_SOURCES})
|
|
|
|
set(HEADER_FILES ${IAITO_PRO_HEADERS})
|
|
|
|
set(UI_FILES ${IAITO_PRO_FORMS})
|
|
|
|
set(QRC_FILES ${IAITO_PRO_RESOURCES})
|
|
|
|
|
|
|
|
message(STATUS "sources from iaito.pro: ${SOURCE_FILES}")
|
|
|
|
message(STATUS "headers from iaito.pro: ${HEADER_FILES}")
|
|
|
|
message(STATUS "forms from iaito.pro: ${UI_FILES}")
|
|
|
|
message(STATUS "resources from iaito.pro: ${QRC_FILES}")
|
2017-03-30 16:58:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
set(IAITO_VERSION_SUFFIX "-dev")
|
|
|
|
set(IAITO_VERSION_FULL "${PROJECT_VERSION}${IAITO_VERSION_SUFFIX}")
|
2017-04-12 15:53:40 +00:00
|
|
|
message(STATUS "Building Iaito version ${IAITO_VERSION_FULL}")
|
2017-03-30 16:58:57 +00:00
|
|
|
add_definitions("-DAPP_VERSION=\"${IAITO_VERSION_FULL}\"")
|
|
|
|
|
|
|
|
|
|
|
|
add_executable(iaito ${UI_FILES} ${QRC_FILES} ${SOURCE_FILES} ${HEADER_FILES})
|
2017-04-12 16:49:01 +00:00
|
|
|
qt5_use_modules(iaito Core Widgets Gui WebEngine WebEngineWidgets)
|
2017-03-30 16:58:57 +00:00
|
|
|
target_link_libraries(iaito ${RADARE2_LIBRARIES})
|