mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-21 19:48:16 +08:00
Support dynamic library. (#225)
- Let the global `BUILD_SHARED_LIBS` dictates whether the library should be built statically or dynamically. The cmake's default is statically. - Add library version and symlink. This lead to the following install tree. . ├── include │ └── ftxui │ ├── component [...] │ ├── dom [...] │ ├── screen [...] │ └── util [...] └── lib ├── cmake │ └── ftxui │ ├── ftxui-config.cmake │ ├── ftxui-config-version.cmake │ └── ftxui-config-version-noconfig.cmake ├── ftxui-component.so -> ftxui-component.so.0.10.369 ├── ftxui-component.so.0.10.369 ├── ftxui-dom.so -> ftxui-dom.so.0.10.369 ├── ftxui-dom.so.0.10.369 ├── ftxui-screen.so -> ftxui-screen.so.0.10.369 └── ftxui-screen.so.0.10.369 Fixed: https://github.com/ArthurSonzogni/FTXUI/issues/223
This commit is contained in:
@@ -24,7 +24,7 @@ else()
|
||||
${FTXUI_MICROSOFT_TERMINAL_FALLBACK_HELP_TEXT} OFF)
|
||||
endif()
|
||||
|
||||
add_library(screen STATIC
|
||||
add_library(screen
|
||||
src/ftxui/screen/box.cpp
|
||||
src/ftxui/screen/color.cpp
|
||||
src/ftxui/screen/color_info.cpp
|
||||
@@ -38,7 +38,7 @@ add_library(screen STATIC
|
||||
include/ftxui/screen/string.hpp
|
||||
)
|
||||
|
||||
add_library(dom STATIC
|
||||
add_library(dom
|
||||
include/ftxui/dom/elements.hpp
|
||||
include/ftxui/dom/node.hpp
|
||||
include/ftxui/dom/requirement.hpp
|
||||
@@ -75,7 +75,7 @@ add_library(dom STATIC
|
||||
src/ftxui/dom/vbox.cpp
|
||||
)
|
||||
|
||||
add_library(component STATIC
|
||||
add_library(component
|
||||
include/ftxui/component/captured_mouse.hpp
|
||||
include/ftxui/component/component.hpp
|
||||
include/ftxui/component/component_base.hpp
|
||||
@@ -111,9 +111,13 @@ target_link_libraries(dom
|
||||
find_package(Threads)
|
||||
target_link_libraries(component
|
||||
PUBLIC dom
|
||||
PRIVATE Threads::Threads
|
||||
PUBLIC Threads::Threads
|
||||
)
|
||||
|
||||
set_target_properties(screen PROPERTIES VERSION ${PROJECT_VERSION})
|
||||
set_target_properties(dom PROPERTIES VERSION ${PROJECT_VERSION})
|
||||
set_target_properties(component PROPERTIES VERSION ${PROJECT_VERSION})
|
||||
|
||||
include(cmake/ftxui_set_options.cmake)
|
||||
ftxui_set_options(screen)
|
||||
ftxui_set_options(dom)
|
||||
@@ -138,4 +142,3 @@ if(FTXUI_ENABLE_INSTALL)
|
||||
include(cmake/ftxui_install.cmake)
|
||||
include(cmake/ftxui_package.cmake)
|
||||
endif()
|
||||
|
||||
|
Reference in New Issue
Block a user