Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/kovzol/bibref
Browse files Browse the repository at this point in the history
  • Loading branch information
kovzol committed Jan 6, 2025
2 parents 6245095 + c17de1f commit 2b9feb4
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 6 deletions.
16 changes: 12 additions & 4 deletions qt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,12 @@ SET(PBRST_SRCS

endif(PBRST)

qt_add_executable(bibref-qt
# set the Application icon, the first line is the property added to Info.plist
set(MACOSX_BUNDLE_ICON_FILE bibref-qt.icns)
set(bibref_qt_ICON ${CMAKE_CURRENT_SOURCE_DIR}/logo-Psalm40-256.icns)
set_source_files_properties(${bibref_qt_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")

qt_add_executable(bibref-qt MACOSX_BUNDLE
main.cpp
mainwindow.cpp mainwindow.h
statementwindow.cpp statementwindow.h
Expand All @@ -88,20 +93,23 @@ qt_add_executable(bibref-qt
${PBRST_SRCS}
${QM_FILES}
bibref.qrc
${bibref_qt_ICON}
)

set_target_properties(bibref-qt PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)

if(MINGW)
if(MINGW OR APPLE)
SET(EXTRA_LIBS -lgvplugin_dot_layout -lgvplugin_rsvg -lgvplugin_core -lgvplugin_pango)
endif(MINGW)
endif(MINGW OR APPLE)

if(APPLE)
set(sword_LIBRARIES_folder "-L/usr/local/lib") # this is hardcoded (via configure/make install), FIXME
set(graphviz_LIBRARIES_folder "-L/opt/homebrew/Cellar/graphviz/12.2.1/lib") # temporarily for GitHub, FIXME
set(graphviz_LIBRARIES_folder "-L/opt/homebrew/Cellar/graphviz/12.2.1/lib -L/usr/local/lib/graphviz") # temporarily for GitHub, FIXME
# On macOS, the QT libraries are usually not installed into the system library folders...
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
endif()

target_link_libraries(bibref-qt PRIVATE
Expand Down
36 changes: 36 additions & 0 deletions qt/deploy-mac
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/sh

# Usage: ./deploy-mac [build-dir] [codesign]
# where build-dir is the folder where the executable has already been built (by default, "build/")
# and codesign is the input for performing an optional code signing.

BUILD_DIR="$1"

if [ "$BUILD_DIR" = "" ]; then
BUILD_DIR="build/"
fi

MACDEPLOYQT=$(command -v macdeployqt)
if [ ! -x "$MACDEPLOYQT" ]; then
echo "macdeployqt is not in path."
exit 1
fi

test -d "$BUILD_DIR/bibref-qt.app/" || {
echo "Missing $BUILD_DIR/bibref-qt.app/. Build bibref-qt first."
exit 2
}

test -d bin || {
mkdir bin
cp -R $BUILD_DIR/bibref-qt.app bin
}

mkdir -p "bin/bibref-qt.app/Contents/Resources/statements/"
cp ../statements/SBLGNT/*/* bin/bibref-qt.app/Contents/Resources/statements/
rm -fr bin/bibref-qt.app/Contents/Resources/statements/all
if [ -z "$2" ]; then
$MACDEPLOYQT bin/bibref-qt.app -dmg
else
$MACDEPLOYQT bin/bibref-qt.app -dmg -codesign="$2"
fi
Binary file added qt/logo-Psalm40-256.icns
Binary file not shown.
4 changes: 2 additions & 2 deletions qt/visualizewindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ VisualizeWindow::VisualizeWindow(QWidget *parent, string input)
setCentralWidget(tile);

GVC_t *gvc= gvContext();
#ifdef __MINGW32__
/* This seems to be required on Windows, otherwise the
#if defined(__MINGW32__) || defined(__APPLE__)
/* This seems to be required on Windows and MacOS, otherwise the
* executable will not know anything about the dot format,
* the svg export, and so on.
* Also, in CMake's library settings these 4 dynamic libraries
Expand Down

0 comments on commit 2b9feb4

Please sign in to comment.