From d8220097ab7908fe84dab2511cedc30d4753a39d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Kov=C3=A1cs?= Date: Sat, 4 Jan 2025 14:51:20 +0100 Subject: [PATCH] Finalize GitHub action --- .github/workflows/build.yml | 4 ++-- CMakeLists.txt | 17 ++++++----------- qt/CMakeLists.txt | 14 +++++++++++++- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6c7e861..c630e3d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 8a54a78..28e22d0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) @@ -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\") " diff --git a/qt/CMakeLists.txt b/qt/CMakeLists.txt index 5ee604b..850628f 100644 --- a/qt/CMakeLists.txt +++ b/qt/CMakeLists.txt @@ -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}) @@ -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 @@ -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: