[CMake] Can't add /usr/include headers directory when using cmake

Mike Gorchak mike.gorchak.qnx at gmail.com
Thu Jan 16 01:46:49 EST 2014


Hi all,

I'm using QNX and cmake works fine under it, except for one thing. By
default compilation under QNX looks like cross-compilation even if you work
using x86 platform and compiling for x86 platform too.

By default gcc does not has /usr/include directory as default directory for
headers, instead it has /usr/qnx650/target/x86/usr/include directory by
default for system related stuff. Many additional packages are directly
installed to /usr directory and have their headers respectively at /usr/
include.

When I tried to compile fluidsynth it has found libreadline at /usr/include/,
but excluded this directory when it was added directly through
include_directories("/usr/include"). Later I've tried to pass option
CMAKE_REQUIRED_INCLUDES to cmake, but it excludes /usr/include too.

I can see that UnixPaths.cmake module has following lines:

list(APPEND CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES
  /usr/include
  )
list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
  /usr/include
  )

but it seems that this is used only when using macro like
check_include_file() or find_library(), but not for compilation.

How I can add /usr/include to the list of header directories for
compilation?

Thanks in advance!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20140116/b3293e8b/attachment.html>


More information about the CMake mailing list