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-12-16 17:57:41 +00:00
|
|
|
set(IMHEX_VERSION "1.12.1")
|
2021-04-17 13:46:26 +00:00
|
|
|
project(imhex VERSION ${IMHEX_VERSION})
|
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()
|
2021-12-17 07:38:25 +00:00
|
|
|
detectBadClone()
|
2021-07-31 15:10:19 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
|
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-05-29 19:52:18 +00:00
|
|
|
windows
|
2021-10-16 09:37:29 +00:00
|
|
|
# example_cpp
|
|
|
|
# example_rust
|
2021-01-22 22:27:01 +00:00
|
|
|
)
|
2020-12-28 19:03: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-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-09-23 20:56:49 +00:00
|
|
|
include_directories(include)
|
2020-11-10 14:26:38 +00:00
|
|
|
|
2021-09-11 12:41:18 +00:00
|
|
|
enable_testing()
|
2021-12-14 19:17:09 +00:00
|
|
|
add_subdirectory(tests EXCLUDE_FROM_ALL)
|
2021-09-11 12:41:18 +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
|
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
|
2020-11-28 20:55:52 +00:00
|
|
|
|
2021-04-20 19:46:48 +00:00
|
|
|
source/init/splash_window.cpp
|
|
|
|
source/init/tasks.cpp
|
|
|
|
|
|
|
|
source/helpers/plugin_manager.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)
|
2020-12-18 18:40:14 +00:00
|
|
|
|
2021-01-06 18:19:01 +00:00
|
|
|
if (WIN32)
|
2021-12-08 13:25:20 +00:00
|
|
|
target_link_libraries(imhex PUBLIC dl libimhex wsock32 ws2_32 Dwmapi.lib)
|
2021-04-12 18:36:16 +00:00
|
|
|
else ()
|
2021-12-08 13:25:20 +00:00
|
|
|
target_link_libraries(imhex PUBLIC dl libimhex pthread)
|
2021-04-12 18:36:16 +00:00
|
|
|
endif ()
|
2020-12-09 18:49:56 +00:00
|
|
|
|
2021-02-26 12:35:19 +00:00
|
|
|
createPackage()
|