How to get cmake to contact homegrown keg libraries only

I have a third-party cmake project that depends on the gnu readline library. So I installed readline on brew install readline . The problem is that readline is keg-only , and cmake tries to link it to libedit , which shadows libreadline , but it lacks some functions.

My question is, how can I make cmake prefer the brew version of this library through the system library?

In addition, since this will be a problem only for osx, it would be great if the solution could be applied via the command line (instead of changing CMakeList.txt).

+8
c ++ homebrew readline cmake
source share

No one has answered this question yet.

See similar questions:

59
Understanding the relationship between homegrown and keg-only

or similar:

530
How to fix homegrown permissions?
346
How do I activate C ++ 11 in CMake?
204
Are memory leaks ever?
59
Understanding the relationship between homegrown and keg-only
47
Keg-only homebrew formula
eighteen
CMake does not find Boost libraries
7
Cmake link to dll / lib
2
How to build boost log v2 with cmake?
one
Why will a homegrown ask me to add the --force option when linking only keg formulas?
0
C ++ Communication error with CMake: LNK1181: Unable to open input file "x.lib"

All Articles