Hi, Me and a work friend ran into the same problem a few days ago. May I suggest to the admins to add a little note in the IF doc about this common mistake ?
Regards, -- Mehdi On Fri, Feb 22, 2008 at 4:08 PM, Fernando Cacciola < [EMAIL PROTECTED]> wrote: > Sylvain Benner wrote: > >> Now, why didn't > >> > >> if ( $ENV{SOME_ENV_VAR} ) > >> > >> work? > >> > > > > Because $ENV{SOME_ENV_VAR} has the same behavior as ${SOME_ENV_VAR}, it > > evaluates a variable. The only difference is that ${} is a CMake > > variable and $ENV{} is an operating system environment variable. > > > > OK, now I think about it, this expected. > > > I assume that IF statement only scan for CMake variables so you must do > > like you did: turn the environment variable into a CMake variable to > > make the conditional statement work. > > > > > I just realized that I haven't really understood IF until now: it doesn't > take a value as argument (like the IF of any other language I ever came > across), but a variable. > > Best > > > -- > Fernando Cacciola > SciSoft > http://fcacciola.50webs.com > http://groups.google.com/group/cppba > > > > _______________________________________________ > CMake mailing list > CMake@cmake.org > http://www.cmake.org/mailman/listinfo/cmake >
_______________________________________________ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake