46ba46ce9d
* 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>
54 lines
1.3 KiB
CMake
54 lines
1.3 KiB
CMake
cmake_minimum_required(VERSION 3.16)
|
|
project(imgui)
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
find_package(PkgConfig REQUIRED)
|
|
find_package(Freetype REQUIRED)
|
|
pkg_search_module(GLFW REQUIRED glfw3)
|
|
|
|
if (UNIX)
|
|
find_package(OpenGL REQUIRED)
|
|
endif ()
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
|
|
|
|
add_library(imgui OBJECT
|
|
source/imgui.cpp
|
|
source/imgui_demo.cpp
|
|
source/imgui_draw.cpp
|
|
source/imgui_freetype.cpp
|
|
source/imgui_impl_glfw.cpp
|
|
source/imgui_impl_opengl3.cpp
|
|
source/imgui_tables.cpp
|
|
source/imgui_widgets.cpp
|
|
|
|
source/cimgui.cpp
|
|
|
|
source/TextEditor.cpp
|
|
|
|
source/imgui_imhex_extensions.cpp
|
|
|
|
source/imnodes.cpp
|
|
|
|
source/implot.cpp
|
|
source/implot_items.cpp
|
|
source/implot_demo.cpp
|
|
|
|
fonts/fontawesome_font.c
|
|
fonts/codicons_font.c
|
|
fonts/unifont_font.c
|
|
)
|
|
|
|
add_compile_definitions(IMGUI_IMPL_OPENGL_LOADER_GLAD)
|
|
|
|
target_include_directories(imgui PUBLIC include fonts ${CMAKE_CURRENT_SOURCE_DIR} ${FREETYPE_INCLUDE_DIRS} ${GLFW_INCLUDE_DIRS})
|
|
|
|
target_link_directories(imgui PUBLIC ${GLFW_LIBRARY_DIRS})
|
|
|
|
if (WIN32)
|
|
target_link_libraries(imgui PUBLIC Freetype::Freetype glfw3 opengl32.lib)
|
|
elseif (UNIX)
|
|
target_link_libraries(imgui PUBLIC Freetype::Freetype glfw OpenGL::GL)
|
|
endif()
|