[CMake] INCLUDE_DIRECTORIES and UNIX style separated environment variables

blinkeye gentoo at blinkeye.ch
Thu Sep 20 15:11:10 EDT 2007


On 09/20/2007 09:00 PM,  Bill Hoffman wrote:
> BlinkEye wrote:
>>>     
>> Thanks for the reply, but this doesn't work neither.
>>
>> I wonder if I'm the only one who ran into what appears to be a very basic issue.
>>   
> Basically, you are using cmake incorrectly.  You should not be using 
> environment variables in a cmake
> project directly.  You should only use them for place for FIND_* to look 
> for things.   You should
> not depend on having the environment set before running cmake.  You are 
> asking for trouble with
> builds.   For example:
> 
> 1/ setenv .... ; cmake ;   make
> 2  cvs update
> 3 start a new shell and forget the setenv
> 4. make  (this runs cmake because a file changed in the cvs update) , it 
> creates new makefiles that
> don't work.
> 
> CMake should be used to cache variables that store locations of include 
> and library paths that
> were discovered by cmake.
> 
> -Bill
> 
Hmm, I see, good point.

The thing is that I started to use it like this since I have 64bit and 
32bit systems and couldn't figure out how to distinct that for the 
CMakeLists.txt, because depending on the ARCH libs and includes are 
differently. But it's true, using the env is error prone.


More information about the CMake mailing list