I have following statement in my main CMakefile.txt:
add_definitions( -DAPP_ROLE_IS_QT )
In another CMakefile.txt that sits in a sub-dir, I need to check whether "APP_ROLE_IS_QT
" has been defined or not, and do things accordingly:
if( DEFINED APP_ROLE_IS_QT )
message( STATUS "It exitsts." )
# do something ...
else()
message( STATUS "It doesn't!!" )
# do something else...
endif()
But it does NOT work, I always get "It doesn't!!";
CMAKE VERSION 3.16