2020-11-10 14:26:38 +00:00
|
|
|
cmake_minimum_required(VERSION 3.16)
|
2020-12-18 20:44:13 +00:00
|
|
|
|
2021-01-22 22:27:01 +00:00
|
|
|
# Updating the version here will update it throughout ImHex as well
|
2021-02-18 16:11:50 +00:00
|
|
|
project(imhex VERSION 1.7.0)
|
2020-11-10 14:26:38 +00:00
|
|
|
|
2021-01-22 22:27:01 +00:00
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
2021-01-22 22:33:13 +00:00
|
|
|
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
|
2021-01-22 22:27:01 +00:00
|
|
|
include("${CMAKE_SOURCE_DIR}/cmake/build_helpers.cmake")
|
|
|
|
setDefaultBuiltTypeIfUnset()
|
2020-12-29 21:50:11 +00:00
|
|
|
|
2021-01-22 22:27:01 +00:00
|
|
|
# List plugin names here. Project name must match folder name
|
|
|
|
set(PLUGINS
|
|
|
|
builtin
|
2021-02-19 16:37:02 +00:00
|
|
|
# example
|
2021-01-22 22:27:01 +00:00
|
|
|
)
|
2020-12-28 19:03:50 +00:00
|
|
|
|
2021-01-22 22:27:01 +00:00
|
|
|
# List extra magic databases to compile here
|
|
|
|
set(MAGICDBS
|
2021-01-25 14:09:30 +00:00
|
|
|
magic_dbs/nintendo_magic
|
2021-01-22 22:27:01 +00:00
|
|
|
)
|
2020-12-18 20:44:13 +00:00
|
|
|
|
2021-01-22 22:27:01 +00:00
|
|
|
findLibraries()
|
2020-12-05 11:46:50 +00:00
|
|
|
|
2021-01-26 23:00:20 +00:00
|
|
|
detectOS()
|
|
|
|
detectArch()
|
|
|
|
|
2021-01-22 22:27:01 +00:00
|
|
|
# Add bundled dependencies
|
2021-01-06 18:19:01 +00:00
|
|
|
add_subdirectory(external/llvm)
|
2021-02-26 12:35:19 +00:00
|
|
|
add_subdirectory(external/yara)
|
2021-01-22 21:44:45 +00:00
|
|
|
add_subdirectory(plugins/libimhex)
|
2021-01-12 15:50:15 +00:00
|
|
|
|
2020-12-21 11:38:50 +00:00
|
|
|
# Add include directories
|
2021-02-02 22:11:23 +00:00
|
|
|
include_directories(include ${MBEDTLS_INCLUDE_DIRS} ${CAPSTONE_INCLUDE_DIRS} ${MAGIC_INCLUDE_DIRS} ${Python_INCLUDE_DIRS})
|
2020-11-10 14:26:38 +00:00
|
|
|
|
2021-01-22 22:27:01 +00:00
|
|
|
addVersionDefines()
|
|
|
|
configurePackageCreation()
|
2020-12-28 19:03:50 +00:00
|
|
|
|
2020-12-28 22:37:51 +00:00
|
|
|
add_executable(imhex ${application_type}
|
2020-11-10 14:26:38 +00:00
|
|
|
source/main.cpp
|
|
|
|
source/window.cpp
|
2020-11-28 20:55:52 +00:00
|
|
|
|
|
|
|
source/helpers/patches.cpp
|
2020-11-29 23:03:12 +00:00
|
|
|
source/helpers/project_file_handler.cpp
|
2020-12-01 01:21:40 +00:00
|
|
|
source/helpers/loader_script_handler.cpp
|
2020-12-22 17:10:01 +00:00
|
|
|
source/helpers/plugin_handler.cpp
|
2021-02-14 00:11:55 +00:00
|
|
|
source/helpers/encoding_file.cpp
|
2020-11-10 14:26:38 +00:00
|
|
|
|
2020-11-27 08:09:48 +00:00
|
|
|
source/providers/file_provider.cpp
|
2020-11-11 08:18:35 +00:00
|
|
|
|
2020-11-10 20:31:04 +00:00
|
|
|
source/views/view_hexeditor.cpp
|
|
|
|
source/views/view_pattern.cpp
|
|
|
|
source/views/view_pattern_data.cpp
|
2020-11-10 23:13:09 +00:00
|
|
|
source/views/view_hashes.cpp
|
2020-11-12 08:38:52 +00:00
|
|
|
source/views/view_information.cpp
|
2020-11-14 20:16:03 +00:00
|
|
|
source/views/view_help.cpp
|
2020-11-14 23:46:38 +00:00
|
|
|
source/views/view_tools.cpp
|
2020-11-15 00:42:43 +00:00
|
|
|
source/views/view_strings.cpp
|
2020-11-20 23:12:58 +00:00
|
|
|
source/views/view_data_inspector.cpp
|
2020-11-22 22:07:50 +00:00
|
|
|
source/views/view_disassembler.cpp
|
2020-11-27 23:33:26 +00:00
|
|
|
source/views/view_bookmarks.cpp
|
2020-11-29 01:06:41 +00:00
|
|
|
source/views/view_patches.cpp
|
2020-12-16 21:43:07 +00:00
|
|
|
source/views/view_command_palette.cpp
|
2021-01-11 19:31:40 +00:00
|
|
|
source/views/view_settings.cpp
|
2021-01-30 21:39:06 +00:00
|
|
|
source/views/view_data_processor.cpp
|
2021-02-26 12:35:19 +00:00
|
|
|
source/views/view_yara.cpp
|
2020-11-10 20:31:04 +00:00
|
|
|
|
2020-12-28 19:03:50 +00:00
|
|
|
${imhex_icon}
|
2020-11-10 14:26:38 +00:00
|
|
|
)
|
|
|
|
|
2020-12-21 10:24:27 +00:00
|
|
|
set_target_properties(imhex PROPERTIES CXX_VISIBILITY_PRESET hidden)
|
2021-02-07 21:57:34 +00:00
|
|
|
target_link_directories(imhex PRIVATE ${CAPSTONE_LIBRARY_DIRS} ${MAGIC_LIBRARY_DIRS})
|
2020-12-18 18:40:14 +00:00
|
|
|
|
2021-01-06 18:19:01 +00:00
|
|
|
if (WIN32)
|
2021-02-26 12:35:19 +00:00
|
|
|
target_link_libraries(imhex libdl.a libmagic.a libgnurx.a libtre.a libintl.a libiconv.a libshlwapi.a libcapstone.a LLVMDemangle libimhex ${Python_LIBRARIES} wsock32 ws2_32 libyara)
|
2021-01-06 18:19:01 +00:00
|
|
|
elseif (UNIX)
|
2021-02-26 12:35:19 +00:00
|
|
|
target_link_libraries(imhex magic ${CMAKE_DL_LIBS} capstone LLVMDemangle libimhex ${Python_LIBRARIES} dl pthread libyara)
|
2021-01-06 18:19:01 +00:00
|
|
|
endif()
|
2020-12-09 18:49:56 +00:00
|
|
|
|
2021-02-26 12:35:19 +00:00
|
|
|
createPackage()
|