Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSX build fails to find png.hpp #10

Open
flyingclimber opened this issue Sep 5, 2020 · 2 comments
Open

OSX build fails to find png.hpp #10

flyingclimber opened this issue Sep 5, 2020 · 2 comments

Comments

@flyingclimber
Copy link

flyingclimber commented Sep 5, 2020

Build is failing to find

"png++/png.hpp"
even though it is installed in
/usr/local/Cellar/png++/0.2.10/include/png++/png.hpp

I tried to edit

chrgfx/CMakeLists.txt
to manually add the source dirs but not luck.

The actual build failure is

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++   -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -o CMakeFiles/cmTC_26f9a.dir/PNGPP_H.cpp.o -c /Users/[..]/chrgfx/build/CMakeFiles/CheckIncludeFiles/PNGPP_H.cpp -I /usr/local/Cellar/png++/0.2.10/include/

... fatal error: 'png++/png.hpp' file not found

and compiles fine if I add the two source dirs with "-I"

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++   -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -o /tmp/PNGPP_H.cpp.o -c /Users/[..]/chrgfx/build/CMakeFiles/CheckIncludeFiles/PNGPP_H.cpp -I /usr/local/Cellar/png++/0.2.10/include -I /usr/local/Cellar/libpng/1.6.37/include/

But I don't know how to make CMAKE aware of these.

This seems to only affect OSX. Linux works great. Thank you!

@drojaazu
Copy link
Owner

drojaazu commented Sep 5, 2020

First of all, I appreciate you even giving the code a try! Thank you!
As for the issue, I don't have a Max/OSX myself, but googling around a bit, I've found this: https://cmake.org/pipermail/cmake/2016-November/064613.html

If I'm reading this correctly Homebrew packages should be symlinked to one of the standard lib directories (i.e. /usr/local/lib etc). I'm not familiar with the system, so I don't know if that's something the end user always has to do or if it's something the package installer should have done.

In Linux, there's also the LD_LIBRARY_PATH environment variable which specifies directories to search for libraries. Not sure if it's present in OSX, but it may be worth a shot.

@flyingclimber
Copy link
Author

You're most welcome! This project is exactly what I've been looking for and saves me a ton of time in writing it myself. I'll take another pass and hopefully report back with a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants