[CMake] how to use CMAKE_INCLUDE_PATH and CMAKE_LIBRARY_PATH?

cjacker jzhuang at redflag-linux.com
Wed Jul 18 23:22:26 EDT 2007


cmake-2.4.6.

I had search it anywhere.
somebody said these are environment variable
in some CMakeLists.txt
I also find something like this:
set(CMAKE_INCLUDE_PATH /include)
This seems like a cmake variable not a environment variable.

Also, I did not find this variable in kdebase of KDE4.

Anyboy can help to explain how to use CMAKE_INCLUDE_PATH?

I search the CMAKE Sourcecode, it seems only useful in FIND_PATH command.

but how to use it?

I do it in bash like this:
export CMAKE_INCLUDE_PATH=/usr/include/hello

FIND_PATH(myPath hello.h ${CMAKE_INCLUDE_PATH})

it just did not works.

if we use it like $ENV{CMAKE_INCLUDE_PATH}, it is a normal environment
variable.

We can define anyname like this.


also, if we must explicitly use this variable in CMakeLists.txt, how can
we handle things like --extra-include-dir?

I already search the maillist of cmake, please do not redirect me to
other post here. It did not works.



More information about the CMake mailing list