[CMake] Test if ENV${VAR} is set

Bogdan Cristea cristeab at gmail.com
Fri Sep 14 16:17:37 EDT 2012


On Friday 14 September 2012 16:13:16 Davis Ford wrote:
> if("$ENV{FOO_HOME}" MATCHES "")
>    message("You must set FOO_HOME")
>    return()
> endif()

Try something like this

if(NOT ENV{FOO_HOME})
message("etc")
endif()

-- 
Bogdan 


More information about the CMake mailing list