ImHex/CMakeLists.txt

108 lines
3.1 KiB
CMake
Raw Normal View History

cmake_minimum_required(VERSION 3.16)
2021-01-22 22:27:01 +00:00
# Updating the version here will update it throughout ImHex as well
2021-05-24 17:09:53 +00:00
set(IMHEX_VERSION "1.8.1")
project(imhex VERSION ${IMHEX_VERSION})
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()
2021-07-31 15:10:19 +00:00
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
2021-01-22 22:27:01 +00:00
# List plugin names here. Project name must match folder name
set(PLUGINS
builtin
windows
# example
2021-01-22 22:27:01 +00:00
)
2021-01-22 22:27:01 +00:00
# List extra magic databases to compile here
set(MAGICDBS
magic_dbs/nintendo_magic
2021-01-22 22:27:01 +00:00
)
2021-01-22 22:27:01 +00:00
findLibraries()
detectOS()
detectArch()
if (NOT USE_SYSTEM_LLVM)
add_subdirectory(external/llvm)
else()
find_package(LLVM REQUIRED Demangle)
endif()
if (NOT USE_SYSTEM_YARA)
add_subdirectory(external/yara)
else()
find_package(PkgConfig REQUIRED)
pkg_check_modules(YARA REQUIRED IMPORTED_TARGET yara)
endif()
2021-01-22 22:27:01 +00:00
# Add bundled dependencies
add_subdirectory(plugins/libimhex)
2021-01-12 15:50:15 +00:00
# Add include directories
include_directories(include ${MBEDTLS_INCLUDE_DIRS} ${CAPSTONE_INCLUDE_DIRS} ${MAGIC_INCLUDE_DIRS} ${Python_INCLUDE_DIRS})
if (USE_SYSTEM_LLVM)
include_directories(include ${LLVM_INCLUDE_DIRS})
endif()
if (USE_SYSTEM_YARA)
include_directories(include ${YARA_INCLUDE_DIRS})
endif()
2021-01-22 22:27:01 +00:00
addVersionDefines()
configurePackageCreation()
add_executable(imhex ${application_type}
source/main.cpp
2021-08-18 20:36:46 +00:00
source/window/window.cpp
source/window/win_window.cpp
source/window/macos_window.cpp
source/window/linux_window.cpp
source/init/splash_window.cpp
source/init/tasks.cpp
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
source/helpers/plugin_manager.cpp
source/helpers/encoding_file.cpp
source/providers/file_provider.cpp
2020-11-10 20:31:04 +00:00
source/views/view_hexeditor.cpp
source/views/view_pattern_editor.cpp
2020-11-10 20:31:04 +00:00
source/views/view_pattern_data.cpp
source/views/view_hashes.cpp
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
source/views/view_disassembler.cpp
source/views/view_bookmarks.cpp
2020-11-29 01:06:41 +00:00
source/views/view_patches.cpp
source/views/view_command_palette.cpp
source/views/view_settings.cpp
source/views/view_data_processor.cpp
source/views/view_yara.cpp
2021-06-25 23:18:33 +00:00
source/views/view_constants.cpp
source/views/view_store.cpp
2020-11-10 20:31:04 +00:00
${imhex_icon}
)
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})
if (WIN32)
2021-09-06 14:15:05 +00:00
target_link_libraries(imhex ${CMAKE_DL_LIBS} capstone LLVMDemangle libimhex ${Python_LIBRARIES} wsock32 ws2_32 libyara Dwmapi.lib dl)
else ()
2021-09-06 14:15:05 +00:00
target_link_libraries(imhex ${CMAKE_DL_LIBS} capstone LLVMDemangle libimhex ${Python_LIBRARIES} dl pthread libyara)
endif ()
2020-12-09 18:49:56 +00:00
createPackage()