The following code prints nothing
CHECK_INCLUDE_FILE_CXX(glog/logging.h GLOG_INCLUDE)
IF(GLOG_INCLUDE)
MESSAGE("YY")
ENDIF(GLOG_INCLUDE)
But I have the following environment variable set:
export CPLUS_INCLUDE_PATH=/usr/local/include
And, “ls /usr/local/include/glog/logging.h” returns the file.
I tried using
include_directories( "/usr/local/include" )
but GLOG_INCLUDE remains undefined after (logging.h remains not found.)
Take a look at the CheckIncludeFileCXX.cmake. It should be in a directory in your cmake installation (I have it in /usr/share/cmake-2.8/Modules).
This file states:
So you can try setting this variable before caling the command, like this: