[CMake] how to use CMAKE_INCLUDE_PATH and CMAKE_LIBRARY_PATH?

cjacker jzhuang at redflag-linux.com
Wed Jul 18 23:57:53 EDT 2007


Greate!

Thanks very much, seems works.

But it looks like this environment variable only affect FIND_* command?

There is also some chinese users ask me about this question.

They hope thing works like this:
set the vairable and it works, just like append -I<path> to compiler.




Alan W. Irwin 写道:
> On 2007-07-19 11:22+0800 cjacker wrote:
>
>> I do it in bash like this:
>> export CMAKE_INCLUDE_PATH=/usr/include/hello
>>
>> FIND_PATH(myPath hello.h ${CMAKE_INCLUDE_PATH})
>
> Try this instead:
>
> export CMAKE_INCLUDE_PATH=/usr/include/hello
>
> then in CMake script:
>
> FIND_PATH(myPath hello.h)
>
> In other words, drop the ${CMAKE_INCLUDE_PATH} from FIND_PATH and all 
> should
> be well.
>
> How the CMAKE_INCLUDE_PATH environment variable or equivalent CMake 
> variable
> is used is documented at http://cmake.org/HTML/Documentation.html. That's
> where you find most explicit documentation (or the equivalent "cmake
> --help-full" command. For a summary of useful CMake variables look at
> http://www.cmake.org/Wiki/CMake_Useful_Variables.
>
> HTH
>
> Alan
> __________________________
> Alan W. Irwin
>
> Astronomical research affiliation with Department of Physics and 
> Astronomy,
> University of Victoria (astrowww.phys.uvic.ca).
>
> Programming affiliations with the FreeEOS equation-of-state 
> implementation
> for stellar interiors (freeeos.sf.net); PLplot scientific plotting 
> software
> package (plplot.org); the libLASi project (unifont.org/lasi); the 
> Loads of
> Linux Links project (loll.sf.net); and the Linux Brochure Project
> (lbproject.sf.net).
> __________________________
>
> Linux-powered Science
> __________________________
>
>



More information about the CMake mailing list