Why do I have to do

if( ${M__ANDROID__} EQUAL 1 OR ${M__ANDROID__} STREQUAL "ON")
endif( ${M__ANDROID__} EQUAL 1 OR ${M__ANDROID__} STREQUAL "ON")

in a macro like...
----------------------

set( __ANDROID__ 1 )

macro( test __ANDROID__ )

  if( ${__ANDROID__} EQUAL 1 OR ${__ANDROID__} STREQUAL "ON")
    message( "Included..... " )
  endif( ${__ANDROID__} EQUAL 1 OR ${__ANDROID__} STREQUAL "ON")

  if( __ANDROID__ )
    message( "ALWAYS Included ${__ANDROID__}" )
  endif( __ANDROID__ )

endmacro( test )

test( __ANDROID__ )
test( ${__ANDROID__} )
test( OFF )

----------
Output

Included.....
ALWAYS Included __ANDROID__
Included.....
ALWAYS Included 1
ALWAYS Included OFF
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

Reply via email to