Mac OS build errors
I've just spent about two hours getting this to compile on macOS Sonoma on an M1 MacBook Pro.
A few things I had to change:
brew install poppler-qt5 rather than just poppler
Had to edit the qmake file in pdf_extract to manually add the correct include directories, as well as bump the c++ version up to CONFIG += c++17 otherwise I was getting compilation errors with the current brew poppler-qt5 bottle.
Had to edit the qmake file in kicad to add QT += core.
By default, the built app crashes with macdeployqt uconfig_gui.app -libpath=./ because of the requirement for code signing.
I had to self-sign with sudo codesign -s - --deep --force --verbose uconfig_gui.app.
Then, the poppler dylib wasn't included by default, so I had to manually copy it in with cp /opt/homebrew/Cellar/poppler-qt5/24.11.0/lib/libpoppler.143.dylib uconfig_gui.app/Contents/Frameworks.
I would try again on a fresh Mac VM and submit a PR, but I'm in the middle of a schematic capture deadline - hope this gives some kind of guidance to someone else with the same issue!
Thank you, this worked for me!
This was super helpful! I had to make additional changes (or perhaps I'm just too much of a noob lol) on my Mac running 15.3 Sequoia.
I made the following changes in pdf_extract.pro:
INCLUDEPATH += /usr/local/include
INCLUDEPATH += /opt/homebrew/opt/poppler-qt5/include
INCLUDEPATH += /opt/homebrew/opt/poppler-qt5/include/poppler
LIBS += -L/opt/homebrew/opt/poppler-qt5/lib
LIBS += -L/opt/homebrew/opt/poppler/lib
LIBS += -lpoppler-qt5 -lpoppler
Self-signing worked perfectly for me, however, I had to copy libQt5Widgets*, libQt5Core*, and libQt5Gui* into uconfig_gui.app/Contents/Frameworks.
Afterwards, I used install_name_tool to fix the library paths:
install_name_tool -change @rpath/libQt5Widgets.5.dylib @executable_path/../Frameworks/libQt5Widgets.5.dylib uconfig_gui.app/Contents/MacOS/uconfig_gui
install_name_tool -id "@rpath/libQt5Gui.5.dylib" uconfig_gui.app/Contents/Frameworks/libQt5Gui.5.dylib
install_name_tool -id "@rpath/libQt5Core.5.dylib" uconfig_gui.app/Contents/Frameworks/libQt5Core.5.dylib
install_name_tool -id "@rpath/libQt5Widgets.5.dylib" uconfig_gui.app/Contents/Frameworks/libQt5Widgets.5.dylib
install_name_tool -add_rpath "@executable_path/../Frameworks" uconfig_gui.app/Contents/MacOS/uconfig_gui
install_name_tool -change @rpath/libQt5Gui.5.dylib @executable_path/../Frameworks/libQt5Gui.5.dylib uconfig_gui.app/Contents/MacOS/uconfig_gui
install_name_tool -change @rpath/libQt5Core.5.dylib @executable_path/../Frameworks/libQt5Core.5.dylib uconfig_gui.app/Contents/MacOS/uconfig_gui
install_name_tool -change @rpath/libQt5Widgets.5.dylib @executable_path/../Frameworks/libQt5Widgets.5.dylib uconfig_gui.app/Contents/MacOS/uconfig_gui
This might be extremely hacky as I honestly have very little clue of what I'm doing... but everything ran just fine after making these updates! Hopefully I can save others some of the headache I had to go through. And if anyone has a better way forward and/or can make a new PR, I would greatly appreciate it!!
I had similiar problem, but on Arch linux:
make[1]: Entering directory '/tmp/makepkg/build/uconfig-git/src/uconfig/build/pdf_extract' g++ -c -pipe -march=native -mtune=native -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -flto=auto -O3 -std=gnu++11 -flto -fno-fat-lto-objects -Wall -Wextra -D_REENTRANT -fPIC -DKICAD_EXPORT=Q_DECL_IMPORT -DDATASHEET_EXTRACTOR_EXPORT_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_XML_LIB -DQT_CORE_LIB -I../../src/pdf_extract -I. -I../../src -I../../../uconfig -I/usr/include/poppler/qt5 -I/usr/include/poppler -I/usr/include/qt -I/usr/include/qt/QtWidgets -I/usr/include/qt/QtGui -I/usr/include/qt/QtXml -I/usr/include/qt/QtCore -I. -I/usr/lib/qt/mkspecs/linux-g++ -o datasheet.o ../../src/pdf_extract/datasheet.cpp In file included from ../../src/pdf_extract/datasheet.cpp:29: /usr/include/poppler/qt5/poppler-form.h:913:6: error: ‘optional’ in namespace ‘std’ does not name a template type 913 | std::optional<CryptoSignBackend> POPPLER_QT5_EXPORT activeCryptoSignBackend(); | ^~~~~~~~ /usr/include/poppler/qt5/poppler-form.h:913:1: note: ‘std::optional’ is only available from C++17 onwards 913 | std::optional<CryptoSignBackend> POPPLER_QT5_EXPORT activeCryptoSignBackend(); | ^~~ make[1]: *** [Makefile:1138: datasheet.o] Error 1
Solved just by changing CONFIG += c++11 to CONFIG += c++17 in file src/pdf_extract/pdf_extract.pro