Closed SirVer closed 8 years ago
i am also having this error
same here.
I've had success building the examples after fiddling with a few cmake and pkg-config parameters on OSX. Using homebrew installed qt5
here's what I've been using:
$ PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/Cellar/qt5/5.5.1_2/lib/pkgconfig \
CMAKE_PREFIX_PATH=/usr/local/Cellar/qt5/5.5.1_2/lib/cmake \
cargo run --example factorial
Setting those two are somewhat brittle since they're linking to a specific version of Qt, sadly there are many conflicts between versions 4 and 5 so brew doesn't link it by default.
@jxs @evanmeng You're also on OSX, I guess?
@tpickett66 Quoting my pkg-config manpage,
pkg-config retrieves information about packages from special metadata files. These files are named after the package, and has a .pc extension. On most systems, pkg-config looks in /usr/lib/pkgconfig, /usr/share/pkgconfig, /usr/local/lib/pkgconfig and /usr/local/share/pkgconfig for these files. It will additionally look in the colon-separated (on Windows, semicolon-separated) list of directories specified by the PKG_CONFIG_PATH environment variable.
So /usr/local/lib/pkgconfig
in PKG_CONFIG_PATH might not be needed if it's the same way on OSX.
If I understood https://github.com/Homebrew/homebrew/issues/12571 right, this is a more robust way of determining the installed formula's directory than using --prefix
:
$(brew --repository)/Library/LinkedKegs/<formula>
So, for qmlrs, what you need would be something like:
$ PKG_CONFIG_PATH=$(brew --repository)/Library/LinkedKegs/qt5/lib/pkgconfig \
CMAKE_PREFIX_PATH=$(brew --repository)/Library/LinkedKegs/qt5/lib/cmake \
cargo run --example factorial
@tpickett66 Could you please test & investigate this? If something like this works reliably and robust, we should at least add it to the documentation as homebrew build instructions.
@florianjacob, the paths you've suggested are already included on the search paths for pkg-config. The trouble here is that homebrew doesn't link the qt5 package due to the conflicts. I'll poke at it a bit more to see if I can find something more stable.
I've found a stable solution and am adding it to build.rs
Followup on https://github.com/cyndis/qmlrs/issues/14:
This is on MacOS X 10.10.
So far so good. Let's try tests: