2020-11-10 15:26:38 +01:00
|
|
|
cmake_minimum_required(VERSION 3.16)
|
2020-12-18 21:44:13 +01:00
|
|
|
|
2021-01-22 23:27:01 +01:00
|
|
|
# Updating the version here will update it throughout ImHex as well
|
2021-11-28 21:34:17 +01:00
|
|
|
set(IMHEX_VERSION "1.11.1")
|
2021-04-17 15:46:26 +02:00
|
|
|
project(imhex VERSION ${IMHEX_VERSION})
|
2020-11-10 15:26:38 +01:00
|
|
|
|
2021-01-22 23:27:01 +01:00
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
2021-01-22 23:33:13 +01:00
|
|
|
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
|
2021-01-22 23:27:01 +01:00
|
|
|
include("${CMAKE_SOURCE_DIR}/cmake/build_helpers.cmake")
|
|
|
|
setDefaultBuiltTypeIfUnset()
|
2021-07-31 17:10:19 +02:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
|
2020-12-29 22:50:11 +01:00
|
|
|
|
2021-01-22 23:27:01 +01:00
|
|
|
# List plugin names here. Project name must match folder name
|
|
|
|
set(PLUGINS
|
|
|
|
builtin
|
2021-05-29 21:52:18 +02:00
|
|
|
windows
|
2021-10-16 11:37:29 +02:00
|
|
|
# example_cpp
|
|
|
|
# example_rust
|
2021-01-22 23:27:01 +01:00
|
|
|
)
|
2020-12-28 20:03:50 +01:00
|
|
|
|
2021-01-22 23:27:01 +01:00
|
|
|
findLibraries()
|
2020-12-05 12:46:50 +01:00
|
|
|
|
2021-01-27 00:00:20 +01:00
|
|
|
detectOS()
|
|
|
|
detectArch()
|
|
|
|
|
2021-01-22 23:27:01 +01:00
|
|
|
# Add bundled dependencies
|
2021-01-22 22:44:45 +01:00
|
|
|
add_subdirectory(plugins/libimhex)
|
2021-01-12 16:50:15 +01:00
|
|
|
|
2020-12-21 12:38:50 +01:00
|
|
|
# Add include directories
|
2021-09-23 22:56:49 +02:00
|
|
|
include_directories(include)
|
2020-11-10 15:26:38 +01:00
|
|
|
|
2021-09-11 14:41:18 +02:00
|
|
|
enable_testing()
|
|
|
|
add_subdirectory(tests)
|
|
|
|
|
2021-01-22 23:27:01 +01:00
|
|
|
addVersionDefines()
|
|
|
|
configurePackageCreation()
|
2020-12-28 20:03:50 +01:00
|
|
|
|
2020-12-28 23:37:51 +01:00
|
|
|
add_executable(imhex ${application_type}
|
2020-11-10 15:26:38 +01:00
|
|
|
source/main.cpp
|
2021-08-18 22:36:46 +02:00
|
|
|
|
|
|
|
source/window/window.cpp
|
|
|
|
source/window/win_window.cpp
|
|
|
|
source/window/macos_window.cpp
|
|
|
|
source/window/linux_window.cpp
|
2020-11-28 21:55:52 +01:00
|
|
|
|
2021-04-20 21:46:48 +02:00
|
|
|
source/init/splash_window.cpp
|
|
|
|
source/init/tasks.cpp
|
|
|
|
|
2020-11-28 21:55:52 +01:00
|
|
|
source/helpers/patches.cpp
|
2020-11-30 00:03:12 +01:00
|
|
|
source/helpers/project_file_handler.cpp
|
2020-12-01 02:21:40 +01:00
|
|
|
source/helpers/loader_script_handler.cpp
|
2021-04-20 21:46:48 +02:00
|
|
|
source/helpers/plugin_manager.cpp
|
2021-02-14 01:11:55 +01:00
|
|
|
source/helpers/encoding_file.cpp
|
2020-11-10 15:26:38 +01:00
|
|
|
|
2020-11-27 09:09:48 +01:00
|
|
|
source/providers/file_provider.cpp
|
2020-11-11 09:18:35 +01:00
|
|
|
|
2020-11-10 21:31:04 +01:00
|
|
|
source/views/view_hexeditor.cpp
|
2021-08-28 21:51:33 +02:00
|
|
|
source/views/view_pattern_editor.cpp
|
2020-11-10 21:31:04 +01:00
|
|
|
source/views/view_pattern_data.cpp
|
2020-11-11 00:13:09 +01:00
|
|
|
source/views/view_hashes.cpp
|
2020-11-12 09:38:52 +01:00
|
|
|
source/views/view_information.cpp
|
2020-11-14 21:16:03 +01:00
|
|
|
source/views/view_help.cpp
|
2020-11-15 00:46:38 +01:00
|
|
|
source/views/view_tools.cpp
|
2020-11-15 01:42:43 +01:00
|
|
|
source/views/view_strings.cpp
|
2020-11-21 00:12:58 +01:00
|
|
|
source/views/view_data_inspector.cpp
|
2020-11-22 23:07:50 +01:00
|
|
|
source/views/view_disassembler.cpp
|
2020-11-28 00:33:26 +01:00
|
|
|
source/views/view_bookmarks.cpp
|
2020-11-29 02:06:41 +01:00
|
|
|
source/views/view_patches.cpp
|
2020-12-16 22:43:07 +01:00
|
|
|
source/views/view_command_palette.cpp
|
2021-01-11 20:31:40 +01:00
|
|
|
source/views/view_settings.cpp
|
2021-01-30 22:39:06 +01:00
|
|
|
source/views/view_data_processor.cpp
|
2021-02-26 13:35:19 +01:00
|
|
|
source/views/view_yara.cpp
|
2021-06-26 01:18:33 +02:00
|
|
|
source/views/view_constants.cpp
|
2021-09-03 02:34:40 +02:00
|
|
|
source/views/view_store.cpp
|
2021-09-21 19:54:13 +02:00
|
|
|
source/views/view_diff.cpp
|
2020-11-10 21:31:04 +01:00
|
|
|
|
2020-12-28 20:03:50 +01:00
|
|
|
${imhex_icon}
|
2020-11-10 15:26:38 +01:00
|
|
|
)
|
|
|
|
|
2020-12-21 11:24:27 +01:00
|
|
|
set_target_properties(imhex PROPERTIES CXX_VISIBILITY_PRESET hidden)
|
2020-12-18 19:40:14 +01:00
|
|
|
|
2021-01-06 19:19:01 +01:00
|
|
|
if (WIN32)
|
2021-09-23 22:56:49 +02:00
|
|
|
target_link_libraries(imhex dl libimhex wsock32 ws2_32 Dwmapi.lib)
|
2021-04-12 20:36:16 +02:00
|
|
|
else ()
|
2021-09-23 22:56:49 +02:00
|
|
|
target_link_libraries(imhex dl libimhex pthread)
|
2021-04-12 20:36:16 +02:00
|
|
|
endif ()
|
2020-12-09 19:49:56 +01:00
|
|
|
|
2021-02-26 13:35:19 +01:00
|
|
|
createPackage()
|