orocos-toolchain / ocl

Orocos Component Library
Other
16 stars 33 forks source link

Avoiding Apple's readline in favor of Homebrew's #12

Closed marcoesposito1988 closed 9 years ago

marcoesposito1988 commented 10 years ago

The readline/editline implementation provided by Apple is completely broken and makes compilation impossible. As a consequence, it is better to interrupt building and show a clear error message.

This means that it must be handled as a special case: just prefixing Homebrew's paths would allow CMake to continue searching in the standard Unix locations, hence finding the broken readline.

Fixes issue #8

smits commented 10 years ago

What would happen if you also have a macports version of readline installed? Why are you not using the CMAKE_PREFIX_PATH variable to add Homebrews path to the search path?

marcoesposito1988 commented 10 years ago

I don't have macports installed, so I don't know what the path would be. But if a volunteer could write it next to the homebrew one once this patch is merged, that would be awesome.

Adding CMAKE_PREFIX_PATH wouldn't stop CMake from finding the system readline, so the user would be overwhelmed with compilation errors that wouldn't make sense if you don't know that the Apple readline is obsolete, and he should google them. This way, if homebrew's (and eventually macports') version isn't found we can stop the compilation and write a clear error message, stating that another version of readline MUST be installed.

smits commented 9 years ago

AFAIK, if the CMAKE_PREFIX_PATH is set correctly, CMake will prefer the one from the CMAKE_PREFIX_PATH instead of the system installed one, see the cmake find_libray/find_path documentation: http://www.cmake.org/cmake/help/v2.8.8/cmake.html#command:find_library where the search order is clearly explained.

So either you did not set the CMAKE_PREFIX_PATH correctly (for homebrew I would suspect setting it to -DCMAKE_PREFIX_PATH=/usr/local should suffice.

If this really does not work we could disable looking for system paths in the case of APPLE, which is a nicer solution than including some "random" homebrew path: NO_CMAKE_SYSTEM_PATH

marcoesposito1988 commented 9 years ago

At the time I made this pull request, this was the only package giving this problem, so I assumed there was nothing wrong with my configuration.

I am closing the pull request, since I managed to compile from scratch on Yosemite without incurring in this problem.

Thanks anyway for the discussion!