ImHex/CMakeLists.txt

62 lines
1.5 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
2022-01-10 21:16:02 +00:00
set(IMHEX_VERSION "1.13.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")
set(IMHEX_BASE_FOLDER ${CMAKE_CURRENT_SOURCE_DIR})
2021-01-22 22:27:01 +00:00
include("${CMAKE_SOURCE_DIR}/cmake/build_helpers.cmake")
2021-01-22 22:27:01 +00:00
# List plugin names here. Project name must match folder name
set(PLUGINS
builtin
windows
build/plugins: Added initial support for Rust plugins (#327) * build: Added initial support for Rust plugins * github: Install correct rust version * github: Fixed rustup command * github: Fix swapped win/linux commands * github: Install linux rust toolchain on Linux * github: Add rustup parameters to correct command * build: libimhex-rust -> hex * rust-plugins: Disable optimization to export functions correctly * build: Use cdylib instead of dylib * build: Fixed rust building and artifact copying * build: Fixed installing plugins * build: Fix copying and installing on Windows * github: Added windows debugging * github: Use curl instead of wget * github: Added debug on failure * github: Update path variable with rust toolchain path * build/github: Set rust location so cmake can find it * build: Remove leftovers * api: Added rust wrappers for the ImHexAPI * rust: Fixed compile flags with older gcc/clang * build: Enable concepts for cxx.rs * build: Explicitly set compiler for cxx.rs * rust: Added imgui-rs to libimhex-rust * rust: Export functions with double underscore prefix on mac * rust: Export functions adjusted for ABI * Add Rust target folder to gitignore * Add vendored imgui-rs copy * Add Context::current() to vendored imgui-rs * Fix libimhex not exporting cimgui symbols * Simplify plugin export mangling * build: Fixed cimgui linking * build: Only specify --export-all-symbols on Windows * Add context setting to Rust plugins * rust: Cleanup * deps: Update curl Co-authored-by: jam1garner <8260240+jam1garner@users.noreply.github.com>
2021-10-16 09:37:29 +00:00
# example_cpp
# example_rust
2021-01-22 22:27:01 +00:00
)
detectOS()
detectArch()
2021-12-17 08:52:11 +00:00
setDefaultBuiltTypeIfUnset()
detectBadClone()
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)
2021-09-11 12:41:18 +00:00
enable_testing()
add_subdirectory(tests EXCLUDE_FROM_ALL)
2021-09-11 12:41:18 +00:00
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/plugin_manager.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-12-17 08:52:11 +00:00
set_target_properties(imhex PROPERTIES POSITION_INDEPENDENT_CODE ON)
if (WIN32)
target_link_libraries(imhex PUBLIC dl libimhex wsock32 ws2_32 Dwmapi.lib)
else ()
target_link_libraries(imhex PUBLIC dl libimhex pthread)
endif ()
2020-12-09 18:49:56 +00:00
createPackage()