Skip to content

Commit

Permalink
Finalize GitHub action
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoltán Kovács authored and Zoltán Kovács committed Jan 4, 2025
1 parent 3f08b8d commit d822009
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,10 @@ jobs:
cd sword-1.9.0
./configure
make
sudo make install || true
sudo make install
- name: Build bibref
run: |
mkdir build
cd build
cmake ..
make install || true
sudo make install
17 changes: 6 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost CONFIG COMPONENTS system filesystem)

if(APPLE) # sword may be difficult to locate and readline seems to have trouble on MacOS
find_library(sword NAMES sword
HINTS "/usr/local/lib" "${CMAKE_SOURCE_DIR}/sword-1.9.0/lib/.libs"
"${CMAKE_SOURCE_DIR}/../sword-1.9.0/lib/.libs"
)
if(APPLE) # readline seems to have trouble on MacOS
else()
# One needs readline >= 8.0 to make this work:
pkg_check_modules (readline REQUIRED readline)
Expand Down Expand Up @@ -63,15 +59,14 @@ SET_SOURCE_FILES_PROPERTIES(
GENERATED true
)

target_link_libraries(bibref
${sword_LIBRARIES} ${Boost_LIBRARIES} ${readline_LIBRARIES}
)

if(APPLE)
set(sword_LIBRARIES_folder "-L/usr/local/lib") # this is hardcoded (via configure/make install), FIXME
endif()

target_link_libraries(bibref
-L/usr/local/lib # for sword, it is assumed to be here (via configure/make install)
${sword_LIBRARIES} ${sword_LIBRARIES_folder} ${Boost_LIBRARIES} ${readline_LIBRARIES}
)
endif()


install(
CODE " set(ENV{SWORD_PATH} \"$ENV{HOME}/.sword\") "
Expand Down
14 changes: 13 additions & 1 deletion qt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,15 @@ if(MINGW)
find_package(BZip2 REQUIRED)
endif(MINGW)

if(APPLE) # sword may be difficult to locate and readline seems to have trouble on MacOS
find_library(sword NAMES sword
HINTS "/usr/local/lib" "${CMAKE_SOURCE_DIR}/sword-1.9.0/lib/.libs"
"${CMAKE_SOURCE_DIR}/../sword-1.9.0/lib/.libs"
)
else()
# One needs readline >= 8.0 to make this work:
pkg_check_modules (readline REQUIRED readline)
endif()

include_directories(${sword_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${readline_INCLUDE_DIRS} ${gvc_INCLUDE_DIRS})

Expand Down Expand Up @@ -91,6 +99,10 @@ if(MINGW)
SET(EXTRA_LIBS -lgvplugin_dot_layout -lgvplugin_rsvg -lgvplugin_core -lgvplugin_pango)
endif(MINGW)

if(APPLE)
set(sword_LIBRARIES_folder "-L/usr/local/lib") # this is hardcoded (via configure/make install), FIXME
endif()

target_link_libraries(bibref-qt PRIVATE
Qt6::Core
Qt6::Gui
Expand All @@ -99,7 +111,7 @@ target_link_libraries(bibref-qt PRIVATE
Qt6::SvgWidgets
${sword_LIBRARIES} ${Boost_LIBRARIES} ${readline_LIBRARIES}
${ICU_LIBRARIES} ${LIBLZMA_LIBRARIES} ${ZLIB_LIBRARIES} ${BZIP2_LIBRARIES}
${gvc_LIBRARIES} ${EXTRA_LIBS}
${gvc_LIBRARIES} ${EXTRA_LIBS} ${sword_LIBRARIES_folder}
)

# If not set, XDG_DATA_HOME is set to $HOME:
Expand Down

0 comments on commit d822009

Please sign in to comment.