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
Mono prevents a compilation of libimage on OSX #79
Comments
For the issue, I'm working in progress in this branch: https://github.com/opentoonz/opentoonz/tree/fix-cmake-osx |
I've got a fix for the libtiff issue on #85 - make sure the tiff path is at the beginning of the include list. |
I think that's easy way. But we'll have to take care of the order of include paths among (future) fixes. 2nd option: Offering custom FindJPEG.cmake and FindPNG.cmake can exclude unexpected path (such as Mono) 3rd option: We'll get thirdparty/tiff-4.0.3(customized) distinguishable much clearly from other libtiff. Which option is better for us? |
oh, Mono's libpng is old(1.2.47), and it's not proper version! |
I don't think excluding "unexpected" paths in general is a good idea. Taking jpeg and tiff from mono is fine if it works and if not, cmake find modules usually allow you to hint at where you want to find it if you have a load of different versions around. Your modification to FindTIFF.cmake is probably a good move though. In summary, I think this is only really a problem when you have a custom modified library like this. In summary I don't think we should be trying to get too magical with this. |
@roentgen your PNG change, for example, stops it finding the system PNG on OSX (and probably on other platforms, e.g linux) which is maybe not what we want here. |
@mich181189 could you let me see the error?
It looks that find_package()'s config mode does not work for me. In the module mode, I wrote the small test to share the case,
find_package() will fails despite existing /usr/local/Cellar/libpng/1.6.13 and /usr/local/include/libpng16.
It looks like ok, found "/Library/Frameworks/Mono.framework/Headers/opt/local/include". |
ok, making all controllable is not easy way. |
Closing in favor of PR #85. Please leave future comments about editing the pull request there. |
I tried PR #85 to merge. |
|
According to the cmake docs, PNG_PATH set as an environment variable should do the trick. See https://cmake.org/cmake/help/v3.0/command/find_package.html for the search order used. |
Good to be able to share the problem. |
Is this still an issue or can it be closed? |
I updated the build for Mac OS. It should work now- I ran into the same issue and (think) I fixed it. I'm going to close this. If it is still an issue, we can reopen or create a new issue. |
I'm still having this problem and the workaround in #151 does not seem to fix it. |
Mono.framework causes CMake to produce an incorrect build due to libpng and libjpeg. CMake has this funny parameter called CMAKE_FIND_FRAMEWORK which is set by default to FIRST. This means that CMake will first look for files first in all framework directories, and only then in regular include directories. Funnily enough Mono.framework contains the headers for libjpeg and libpng. So, CMake finds the headers in Mono, but the library in the regular install location, e.g. /usr/local/lib and therefore a version mismatch happens. Mono is a known menace (for some time brew doctor warned if Mono is installed that builds may fail). You can see this behavior if you create a CMakeLists.txt file with the single line find_package(JPEG), run cmake . and take a look at the paths in the generated CMakeCache.txt file. The fix that definitively worked for me was to check out the project manually, add set(CMAKE_FIND_FRAMEWORK LAST) to CMakeLists.txt before the find_package calls and then run luarocks make. This way CMake found the headers in the right folder. |
find_package() uses to look for libpng/libjpeg may look Mono.framework/Headers/ out.
Mono.framework/Headers has png.h and tiffio.h on the directory, this cause an ijection of priority path for tiffio.h since it needs dedicate libtiff for it.
Environment: OSX installed Mono framework
The text was updated successfully, but these errors were encountered: