Skip to content

Commit

Permalink
make boost::filesystem optional
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj committed Nov 12, 2024
1 parent ba9ffac commit df0dfa3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ option(ENABLE_COVERAGE "Build the project with gcov support (Need ENABLE_TEST=On
set(GCOV_TOOL "gcov" CACHE STRING "Path to gcov tool used by coverage.")
option(ENABLE_DOC "Build doxygen" Off)
option(ENABLE_DATA "Build data" On)
option(ENABLE_TOOLS "Build tools" On)

#########################################
# Dependency
Expand All @@ -34,7 +35,7 @@ pkg_check_modules(ZSTD REQUIRED IMPORTED_TARGET "libzstd")
find_package(Fcitx5Utils REQUIRED)
include("${FCITX_INSTALL_CMAKECONFIG_DIR}/Fcitx5Utils/Fcitx5CompilerSettings.cmake")

find_package(Boost 1.61 REQUIRED COMPONENTS iostreams filesystem)
find_package(Boost 1.61 REQUIRED COMPONENTS iostreams OPTIONAL_COMPONENTS filesystem)
set(LIBIME_INSTALL_PKGDATADIR "${CMAKE_INSTALL_FULL_DATADIR}/libime")
set(LIBIME_INSTALL_LIBDATADIR "${CMAKE_INSTALL_FULL_LIBDIR}/libime")

Expand All @@ -56,7 +57,10 @@ if(ENABLE_TEST)
endif()

add_subdirectory(src)
add_subdirectory(tools)

if (ENABLE_TOOLS)
add_subdirectory(tools)
endif()

if (ENABLE_DATA)
add_subdirectory(data)
Expand Down
2 changes: 2 additions & 0 deletions tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ target_link_libraries(libime_tabledict LibIME::Table)
install(TARGETS libime_tabledict DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT tools)
add_executable(LibIME::tabledict ALIAS libime_tabledict)

if (NOT APPLE)
add_executable(libime_migrate_fcitx4_table libime_migrate_fcitx4_table.cpp)
target_link_libraries(libime_migrate_fcitx4_table LibIME::Table Boost::iostreams Boost::filesystem)
install(TARGETS libime_migrate_fcitx4_table DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT tools)
Expand All @@ -33,3 +34,4 @@ add_executable(libime_migrate_fcitx4_pinyin libime_migrate_fcitx4_pinyin.cpp)
target_link_libraries(libime_migrate_fcitx4_pinyin LibIME::Pinyin Boost::iostreams Boost::filesystem)
install(TARGETS libime_migrate_fcitx4_pinyin DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT tools)
add_executable(LibIME::migrate_fcitx4_pinyin ALIAS libime_migrate_fcitx4_pinyin)
endif()

0 comments on commit df0dfa3

Please sign in to comment.