mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-23 20:14:05 +00:00
cmake: updates
* add USE_SYSTEM_FMT & USE_SYSTEM_TOML * switch back to libeb
This commit is contained in:
parent
4b8c87a30d
commit
0c75d4f399
4
.github/workflows/cmake build check.yml
vendored
4
.github/workflows/cmake build check.yml
vendored
|
@ -53,7 +53,7 @@ jobs:
|
|||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
||||
submodules: true
|
||||
submodules: false
|
||||
|
||||
- name: Run build-wrapper
|
||||
run: |
|
||||
|
@ -106,7 +106,7 @@ jobs:
|
|||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
||||
submodules: true
|
||||
submodules: false
|
||||
- name: install dependencies
|
||||
run: |
|
||||
brew install pcre2 harfbuzz freetype
|
||||
|
|
|
@ -8,6 +8,9 @@ option(WITH_EPWING_SUPPORT "Enable epwing support" ON)
|
|||
option(WITH_XAPIAN "enable Xapian support" ON)
|
||||
option(WITH_ZIM "enable zim support" ON)
|
||||
|
||||
# options for linux packaging
|
||||
option(USE_SYSTEM_FMT "use system fmt instead of bundled one" OFF)
|
||||
option(USE_SYSTEM_TOML "use system toml++ instead of bundled one" OFF)
|
||||
|
||||
include(FeatureSummary)
|
||||
|
||||
|
@ -79,11 +82,14 @@ target_sources(${GOLDENDICT} PRIVATE
|
|||
resources.qrc
|
||||
src/scripts/scripts.qrc
|
||||
src/stylesheets/css.qrc
|
||||
thirdparty/fmt/format.cc
|
||||
${ALL_SOURCE_FILES}
|
||||
${MACOS_SOURCE_FILES}
|
||||
${QSINGLEAPP_SOURCE_FILES})
|
||||
|
||||
if (NOT USE_SYSTEM_FMT)
|
||||
target_sources(${GOLDENDICT} PRIVATE thirdparty/fmt/format.cc)
|
||||
endif ()
|
||||
|
||||
### Common parts amount all platforms
|
||||
|
||||
# Note: used as c++ string thus need surrounding " "
|
||||
|
@ -108,9 +114,16 @@ target_include_directories(${GOLDENDICT} PRIVATE
|
|||
${PROJECT_SOURCE_DIR}/src/dict
|
||||
${PROJECT_SOURCE_DIR}/src/ui
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/tomlplusplus
|
||||
${PROJECT_SOURCE_DIR}/thirdparty/fmt/include
|
||||
)
|
||||
|
||||
if (NOT USE_SYSTEM_TOML)
|
||||
target_include_directories(${GOLDENDICT} PRIVATE ${PROJECT_SOURCE_DIR}/thirdparty/tomlplusplus)
|
||||
endif ()
|
||||
|
||||
if (NOT USE_SYSTEM_FMT)
|
||||
target_include_directories(${GOLDENDICT} PRIVATE ${PROJECT_SOURCE_DIR}/thirdparty/fmt/include)
|
||||
endif ()
|
||||
|
||||
#### Compile definitions
|
||||
|
||||
target_compile_definitions(${GOLDENDICT} PUBLIC
|
||||
|
@ -135,9 +148,7 @@ if (WITH_XAPIAN)
|
|||
endif ()
|
||||
|
||||
if (WITH_ZIM)
|
||||
target_compile_definitions(${GOLDENDICT} PUBLIC
|
||||
MAKE_ZIM_SUPPORT
|
||||
)
|
||||
target_compile_definitions(${GOLDENDICT} PUBLIC MAKE_ZIM_SUPPORT)
|
||||
endif ()
|
||||
|
||||
#### libraries linking && includes for Win or Unix
|
||||
|
|
|
@ -44,10 +44,9 @@ pkg_check_modules(PKGCONFIG_DEPS IMPORTED_TARGET
|
|||
)
|
||||
|
||||
target_link_libraries(${GOLDENDICT} PRIVATE
|
||||
# pkg-config packages need manually link
|
||||
PkgConfig::PKGCONFIG_DEPS
|
||||
BZip2::BZip2
|
||||
ZLIB::ZLIB #hidden requirement of dsl_details.cc and more?
|
||||
ZLIB::ZLIB
|
||||
Iconv::Iconv
|
||||
)
|
||||
|
||||
|
@ -67,13 +66,21 @@ if (WITH_XAPIAN)
|
|||
endif ()
|
||||
|
||||
if (WITH_EPWING_SUPPORT)
|
||||
add_subdirectory(thirdparty/eb EXCLUDE_FROM_ALL)
|
||||
target_link_libraries(${GOLDENDICT} PRIVATE eb)
|
||||
find_library(EB_LIBRARY eb REQUIRED)
|
||||
target_link_libraries(${GOLDENDICT} PRIVATE ${EB_LIBRARY})
|
||||
endif ()
|
||||
|
||||
if (WITH_ZIM)
|
||||
pkg_check_modules(ZIM REQUIRED IMPORTED_TARGET
|
||||
libzim
|
||||
)
|
||||
pkg_check_modules(ZIM REQUIRED IMPORTED_TARGET libzim)
|
||||
target_link_libraries(${GOLDENDICT} PRIVATE PkgConfig::ZIM)
|
||||
endif ()
|
||||
|
||||
if (USE_SYSTEM_FMT)
|
||||
find_package(fmt)
|
||||
target_link_libraries(${GOLDENDICT} PRIVATE fmt::fmt)
|
||||
endif ()
|
||||
|
||||
if (USE_SYSTEM_TOML)
|
||||
find_package(tomlplusplus)
|
||||
target_link_libraries(${GOLDENDICT} PRIVATE tomlplusplus::tomlplusplus)
|
||||
endif ()
|
|
@ -412,7 +412,7 @@ HEADERS += \
|
|||
src/wordfinder.hh \
|
||||
src/wordlist.hh \
|
||||
src/zipfile.hh \
|
||||
thirdparty/tomlplusplus/toml.hpp
|
||||
thirdparty/tomlplusplus/toml++/toml.h
|
||||
|
||||
FORMS += $$files(src/ui/*.ui)
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "metadata.hh"
|
||||
#include "toml.hpp"
|
||||
#include "toml++/toml.h"
|
||||
#include <QDebug>
|
||||
#include <QFile>
|
||||
|
||||
|
|
Loading…
Reference in a new issue