Skip to content

Commit

Permalink
Add F3D_PLUGINS_INSTALL_DIR
Browse files Browse the repository at this point in the history
  • Loading branch information
topazus authored and mwestphal committed May 23, 2023
1 parent da82acd commit 768743a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ endif()

# plugins
option(F3D_PLUGINS_STATIC_BUILD "Make all plugins static (embedded into libf3d) and automatically loaded by F3D" ON)
set(F3D_PLUGINS_INSTALL_DIR "Plugins install directory"
CACHE PATH "${CMAKE_INSTALL_LIBDIR}/f3d")
mark_as_advanced(F3D_PLUGINS_STATIC_BUILD)
if (F3D_MACOS_BUNDLE AND NOT F3D_PLUGINS_STATIC_BUILD)
message(FATAL_ERROR "Building a macOS Bundle do not support loading plugins dynamically")
Expand Down
2 changes: 2 additions & 0 deletions cmake/f3dConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# f3d_BINDINGS_PYTHON Will be enabled if F3D was built with python bindings
# f3d_BINDINGS_JAVA Will be enabled if F3D was built with java bindings
# f3d_CONFIG_DIR Path to F3D configuration directory, can be absolute or relative
# f3d_PLUGINS_INSTALL_DIR Path to F3D plugins install directory, can be absolute or relative

@PACKAGE_INIT@

Expand All @@ -22,6 +23,7 @@ set(f3d_MODULE_RAYTRACING "@F3D_MODULE_RAYTRACING@")
set(f3d_BINDINGS_PYTHON "@F3D_BINDINGS_PYTHON@")
set(f3d_BINDINGS_JAVA "@F3D_BINDINGS_JAVA@")
set(f3d_CONFIG_DIR "@f3d_config_dir@")
set(f3d_PLUGINS_INSTALL_DIR "@F3D_PLUGINS_INSTALL_DIR@")

# Provide a f3d_embed_file method for embedding image into source code
include("${CMAKE_CURRENT_LIST_DIR}/f3dEmbed.cmake")
Expand Down
6 changes: 3 additions & 3 deletions cmake/f3dPlugin.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,9 @@ macro(f3d_plugin_build)
if(NOT F3D_PLUGIN_IS_STATIC OR NOT BUILD_SHARED_LIBS)
install(TARGETS f3d-plugin-${F3D_PLUGIN_NAME}
EXPORT ${export_name}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT plugin
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT plugin
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT plugin)
ARCHIVE DESTINATION ${F3D_PLUGINS_INSTALL_DIR} COMPONENT plugin
RUNTIME DESTINATION ${F3D_PLUGINS_INSTALL_DIR} COMPONENT plugin
LIBRARY DESTINATION ${F3D_PLUGINS_INSTALL_DIR} COMPONENT plugin)
endif()

# Install configurations folders
Expand Down

0 comments on commit 768743a

Please sign in to comment.