On 08/15/2012 04:28 PM, Rolf Eike Beer wrote:
> For the empty variable: it looks like an empty variable and a not existing
> one
> are the same.
They are not the same:
$ cat var.cmake
macro(report)
if(DEFINED A)
message("yes")
else()
message("no")
endif()
endmacro()
set(A "")
report()
set(A)
report()
$ cmake -P var.cmake
yes
no
> Is there a sane way to query this or should I just ignore it anyway?
If mf->GetDefinition() returns NULL then the variable is not set.
If it returns an empty string then the variable is empty.
-Brad
--
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers