I am trying to compile a c++ project with clang++ and the CXX_FLAGS "-Wall -stdlib=libc++ -std=c++11" on OS X. The project is a CMAKE project and requires cln and ginac to be included. However the compiler cannot find the according headers, when I give include statements like this:
#include <cln/cln.h>
or
#include <ginac/ginac.h>
although both libraries are installed in /usr/local/lib and their include directories (/usr/local/include/cln and /usr/local/include/ginac) exist. I've tried
set(CMAKE_INCLUDE_PATH /usr/local/include/cln:/usr/local/include/ginac )
but it does not show any effect, the error message stays the same:
fatal error: 'ginac/ginac.h' file not found
#include <ginac/ginac.h>
^
Update:
I managed to add compiler flags for verbose, which shows me, that the paths, where clang searches for the required headers are wrong, so the problem seems to resemble down to the question how to change these paths:
#include "..." search starts here:
#include <...> search starts here:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.0/include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks (framework directory)
End of search list.
whereas the required headers are still in /usr/local/include.
Update 2 Adding the CXX_FLAG
-I/usr/local/include
solves the problem - Where can I globally set this as a default?
Adding the CXX_FLAG
-I/usr/local/include
solves the problem.