cutter/src/CMakeLists.txt

71 lines
2.2 KiB
CMake
Raw Normal View History

2017-03-30 16:58:57 +00:00
cmake_minimum_required(VERSION 3.1)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(DisallowInSource)
2017-09-25 12:55:41 +00:00
project(cutter VERSION 1.0.0)
2017-03-30 16:58:57 +00:00
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
2017-03-30 16:58:57 +00:00
set(CMAKE_AUTORCC ON)
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
2017-09-25 12:55:41 +00:00
set(IAITO_WIN32_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../cutter_win32")
2017-03-31 14:52:26 +00:00
list(APPEND CMAKE_PREFIX_PATH "${IAITO_WIN32_DIR}")
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()
find_package(Radare2 REQUIRED)
2017-04-25 21:49:10 +00:00
include_directories(${RADARE2_INCLUDE_DIRS})
link_directories(${RADARE2_LIBRARY_DIRS})
2017-04-25 21:49:10 +00:00
2017-04-28 14:18:43 +00:00
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
2017-05-06 10:46:28 +00:00
add_definitions(-Wall -Wextra)
2017-04-28 14:18:43 +00:00
endif()
2017-03-31 11:28:27 +00:00
2017-09-25 12:55:41 +00:00
# Parse cutter.pro to get filenames
include(QMakeProParse)
2017-09-25 12:55:41 +00:00
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cutter.pro"
"${CMAKE_CURRENT_BINARY_DIR}/cutter.pro"
COPYONLY) # trigger reconfigure if cutter.pro changes
parse_qmake_pro("${CMAKE_CURRENT_BINARY_DIR}/cutter.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})
2017-09-25 12:55:41 +00:00
message(STATUS "sources from cutter.pro: ${SOURCE_FILES}")
message(STATUS "headers from cutter.pro: ${HEADER_FILES}")
message(STATUS "forms from cutter.pro: ${UI_FILES}")
message(STATUS "resources from cutter.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-09-25 12:55:41 +00:00
message(STATUS "Building Cutter version ${IAITO_VERSION_FULL}")
2017-03-30 16:58:57 +00:00
add_definitions("-DAPP_VERSION=\"${IAITO_VERSION_FULL}\"")
2017-09-25 12:55:41 +00:00
add_executable(cutter ${UI_FILES} ${QRC_FILES} ${SOURCE_FILES} ${HEADER_FILES})
qt5_use_modules(cutter Core Widgets Gui WebEngine WebEngineWidgets)
target_link_libraries(cutter ${RADARE2_LIBRARIES})
2017-04-25 21:49:10 +00:00