[CMake] how to use CMAKE_INCLUDE_PATH and CMAKE_LIBRARY_PATH?

cjacker jzhuang at redflag-linux.com
Thu Jul 19 00:00:34 EDT 2007


Can you help to explain the rule of cmake variable usage(not env var)?

which condition shall we use ${}.
and
which condition shall we use VARIABLE name directly.

I found that:
most time we use variable like this ${VARNAME}

but in IF command
we should use it like IF(VARNAME).


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