-
Notifications
You must be signed in to change notification settings - Fork 563
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(CMakeList.txt): add plugin build support (#257)
* feat(CMakeList.txt): add plugin build support * chore(CMakeLists.txt): rename macro RIME_EXTRA_MODULES * refactor(plugins/CMakeLists.txt): rename variable plugin_modules * fix: do not embed the list of plugin modules in "extra" group when BUILD_MERGED_PLUGINS=OFF
- Loading branch information
Showing
5 changed files
with
56 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
set(RIME_SOURCE_DIR ${PROJECT_SOURCE_DIR}) | ||
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) | ||
|
||
unset(plugins_objs) | ||
unset(plugins_deps) | ||
unset(plugins_modules) | ||
file(GLOB plugin_files "*") | ||
foreach(file ${plugin_files}) | ||
if (IS_DIRECTORY ${file}) | ||
message(STATUS "Found plugin: ${file}") | ||
unset(plugin_name) | ||
unset(plugin_objs) | ||
unset(plugin_deps) | ||
unset(plugin_modules) | ||
add_subdirectory(${file}) | ||
if(BUILD_MERGED_PLUGINS) | ||
set(plugins_objs ${plugins_objs} ${plugin_objs}) | ||
set(plugins_deps ${plugins_deps} ${plugin_deps}) | ||
set(plugins_modules ${plugins_modules} ${plugin_modules}) | ||
else() | ||
message(STATUS "Plugin ${plugin_name} provides modules: ${plugin_modules}") | ||
add_library(${plugin_name} ${plugin_objs}) | ||
target_link_libraries(${plugin_name} ${plugin_deps}) | ||
if(XCODE_VERSION) | ||
set_target_properties(${plugin_name} PROPERTIES INSTALL_NAME_DIR "@rpath") | ||
endif(XCODE_VERSION) | ||
install(TARGETS ${plugin_name} DESTINATION ${LIB_INSTALL_DIR}) | ||
endif() | ||
endif() | ||
endforeach(file) | ||
|
||
set(rime_plugins_objs ${plugins_objs} PARENT_SCOPE) | ||
set(rime_plugins_deps ${plugins_deps} PARENT_SCOPE) | ||
set(rime_plugins_modules ${plugins_modules} PARENT_SCOPE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters