1
0
mirror of synced 2024-11-24 07:40:17 +01:00

build: Make external plugins build again

This commit is contained in:
WerWolv 2024-02-24 15:06:10 +01:00
parent 9d02379583
commit b2edb0441a
6 changed files with 85 additions and 71 deletions

View File

@ -738,7 +738,7 @@ function(generateSDKDirectory)
endif()
install(DIRECTORY ${CMAKE_SOURCE_DIR}/lib/libimhex DESTINATION "${SDK_PATH}/lib" PATTERN "**/source/*" EXCLUDE)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/lib/external DESTINATION "${SDK_PATH}/lib" PATTERN "**/source/*" EXCLUDE)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/lib/external DESTINATION "${SDK_PATH}/lib")
install(DIRECTORY ${CMAKE_SOURCE_DIR}/lib/third_party/imgui DESTINATION "${SDK_PATH}/lib/third_party" PATTERN "**/source/*" EXCLUDE)
if (NOT USE_SYSTEM_FMT)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/lib/third_party/fmt DESTINATION "${SDK_PATH}/lib/third_party")

View File

@ -4,14 +4,17 @@ project(imgui_color_text_editor)
set(CMAKE_CXX_STANDARD 17)
add_library(imgui_color_text_editor OBJECT
source/TextEditor.cpp
)
if (NOT IMHEX_EXTERNAL_PLUGIN_BUILD)
add_library(imgui_color_text_editor OBJECT
source/TextEditor.cpp
)
target_include_directories(imgui_color_text_editor PUBLIC
include
)
target_include_directories(imgui_color_text_editor PUBLIC
include
)
target_link_libraries(imgui_color_text_editor PRIVATE imgui_includes)
endif()
target_include_directories(imgui_all_includes INTERFACE include)
target_link_libraries(imgui_color_text_editor PRIVATE imgui_includes)

View File

@ -4,37 +4,40 @@ project(imgui_custom)
set(CMAKE_CXX_STANDARD 17)
add_library(imgui_custom OBJECT
source/imgui_impl_opengl3.cpp
source/imgui_impl_glfw.cpp
)
if (NOT IMHEX_EXTERNAL_PLUGIN_BUILD)
add_library(imgui_custom OBJECT
source/imgui_impl_opengl3.cpp
source/imgui_impl_glfw.cpp
)
target_include_directories(imgui_custom PUBLIC
include
)
target_include_directories(imgui_custom PUBLIC
include
)
target_link_libraries(imgui_custom PRIVATE imgui_includes)
target_include_directories(imgui_all_includes INTERFACE include)
target_link_libraries(imgui_custom PRIVATE imgui_includes)
find_package(OpenGL REQUIRED)
find_package(Freetype REQUIRED)
find_package(OpenGL REQUIRED)
find_package(Freetype REQUIRED)
find_package(GLFW QUIET)
if (NOT GLFW_FOUND OR "${GLFW_LIBRARIES}" STREQUAL "")
find_package(glfw3 QUIET)
set(GLFW_INCLUDE_DIRS ${glfw3_INCLUDE_DIRS})
set(GLFW_LIBRARIES ${glfw3_LIBRARIES})
find_package(GLFW QUIET)
if (NOT GLFW_FOUND OR "${GLFW_LIBRARIES}" STREQUAL "")
find_package(glfw3 QUIET)
set(GLFW_INCLUDE_DIRS ${glfw3_INCLUDE_DIRS})
set(GLFW_LIBRARIES ${glfw3_LIBRARIES})
if (NOT glfw3_FOUND OR "${GLFW_LIBRARIES}" STREQUAL "")
find_package(PkgConfig REQUIRED)
pkg_search_module(GLFW REQUIRED glfw3)
if (NOT glfw3_FOUND OR "${GLFW_LIBRARIES}" STREQUAL "")
find_package(PkgConfig REQUIRED)
pkg_search_module(GLFW REQUIRED glfw3)
endif ()
endif()
if ("${GLFW_LIBRARIES}" MATCHES ".+dll")
set(GLFW_LIBRARIES "glfw3")
endif ()
target_include_directories(imgui_custom PUBLIC ${FREETYPE_INCLUDE_DIRS} ${OpenGL_INCLUDE_DIRS})
target_link_directories(imgui_custom PUBLIC ${FREETYPE_LIBRARY_DIRS} ${OpenGL_LIBRARY_DIRS})
target_link_libraries(imgui_custom PUBLIC ${GLFW_LIBRARIES} ${OPENGL_LIBRARIES})
endif()
if ("${GLFW_LIBRARIES}" MATCHES ".+dll")
set(GLFW_LIBRARIES "glfw3")
endif ()
target_include_directories(imgui_custom PUBLIC ${FREETYPE_INCLUDE_DIRS} ${OpenGL_INCLUDE_DIRS})
target_link_directories(imgui_custom PUBLIC ${FREETYPE_LIBRARY_DIRS} ${OpenGL_LIBRARY_DIRS})
target_link_libraries(imgui_custom PUBLIC ${GLFW_LIBRARIES} ${OPENGL_LIBRARIES})
target_include_directories(imgui_all_includes INTERFACE include)

View File

@ -4,29 +4,31 @@ project(imgui_imgui)
set(CMAKE_CXX_STANDARD 17)
add_library(imgui_imgui OBJECT
source/imgui.cpp
source/imgui_demo.cpp
source/imgui_draw.cpp
source/imgui_tables.cpp
source/imgui_widgets.cpp
if (NOT IMHEX_EXTERNAL_PLUGIN_BUILD)
add_library(imgui_imgui OBJECT
source/imgui.cpp
source/imgui_demo.cpp
source/imgui_draw.cpp
source/imgui_tables.cpp
source/imgui_widgets.cpp
source/misc/freetype/imgui_freetype.cpp
)
source/misc/freetype/imgui_freetype.cpp
)
target_include_directories(imgui_imgui PUBLIC
include
include/misc/freetype
)
target_include_directories(imgui_imgui PUBLIC
include
include/misc/freetype
)
target_compile_options(imgui_imgui PRIVATE -Wno-unknown-warning-option)
find_package(Freetype REQUIRED)
target_include_directories(imgui_imgui PUBLIC ${FREETYPE_INCLUDE_DIRS})
target_link_directories(imgui_imgui PUBLIC ${FREETYPE_LIBRARY_DIRS})
target_link_libraries(imgui_imgui PUBLIC ${FREETYPE_LIBRARIES})
endif()
add_library(imgui_includes INTERFACE)
target_include_directories(imgui_includes INTERFACE include)
target_include_directories(imgui_all_includes INTERFACE include include/misc/freetype)
target_compile_options(imgui_imgui PRIVATE -Wno-unknown-warning-option)
find_package(Freetype REQUIRED)
target_include_directories(imgui_imgui PUBLIC ${FREETYPE_INCLUDE_DIRS})
target_link_directories(imgui_imgui PUBLIC ${FREETYPE_LIBRARY_DIRS})
target_link_libraries(imgui_imgui PUBLIC ${FREETYPE_LIBRARIES})
target_include_directories(imgui_all_includes INTERFACE include include/misc/freetype)

View File

@ -4,13 +4,16 @@ project(imgui_imnodes)
set(CMAKE_CXX_STANDARD 17)
add_library(imgui_imnodes OBJECT
source/imnodes.cpp
)
if (NOT IMHEX_EXTERNAL_PLUGIN_BUILD)
add_library(imgui_imnodes OBJECT
source/imnodes.cpp
)
target_include_directories(imgui_imnodes PUBLIC
include
)
target_include_directories(imgui_imnodes PUBLIC
include
)
target_link_libraries(imgui_imnodes PRIVATE imgui_includes)
endif()
target_link_libraries(imgui_imnodes PRIVATE imgui_includes)
target_include_directories(imgui_all_includes INTERFACE include)

View File

@ -4,15 +4,18 @@ project(imgui_implot)
set(CMAKE_CXX_STANDARD 17)
add_library(imgui_implot OBJECT
source/implot.cpp
source/implot_items.cpp
source/implot_demo.cpp
)
if (NOT IMHEX_EXTERNAL_PLUGIN_BUILD)
add_library(imgui_implot OBJECT
source/implot.cpp
source/implot_items.cpp
source/implot_demo.cpp
)
target_include_directories(imgui_implot PUBLIC
include
)
target_include_directories(imgui_implot PUBLIC
include
)
target_link_libraries(imgui_implot PRIVATE imgui_includes)
endif()
target_link_libraries(imgui_implot PRIVATE imgui_includes)
target_include_directories(imgui_all_includes INTERFACE include)