You don't want those directories in your /etc/paths
file. That files lists the directories where the shell searches for executables.
Try:
$ CFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib" make
$ sudo make install
You might need to add /usr/local/lib
to your DYLD_LIBRARY_PATH
to make sure your executable runs:
$ export DYLD_LIBRARY_PATH=/usr/local/lib:$DYLD_LIBRARY_PATH
(Assuming your DYLD_LIBRARY_PATH
variable doesn't have /usr/local/lib
, and that it's not empty to begin with. If it is empty, you should do export DYLD_LIBRARY_PATH=/usr/local/lib
instead.)
Edit: OK, based on your comments, looks like this should work:
export CMAKE_INCLUDE_PATH=/usr/local/include
export CMAKE_LIBRARY_PATH=/usr/local/lib
See What to do if cmake doesn't find the package although it exists on the system? for more.
Since you're using a GUI version of Cmake, you should do this:
Open "property list editor", click "add child". For "New item", enter CMAKE_INCLUDE_PATH
, for Type, leave it as "String", for Value, enter /usr/local/include
. Then, click "add item" again, and enter CMAKE_LIBRARY_PATH
for "New item", leave type as "String", and for "Value", enter /usr/local/lib
. Then save (File -> Save as) to a file. I suggest filename a.plist
in your Desktop folder. Then open a terminal (Appilcations -> Utilities -> Terminal) and type:
mv ~/Desktop/a.plist ~/.MacOSX/environment.plist
After that, quit Xcode and Cmake gui, and restart. That should work. See this for technical details, and this for more.