Make TriBITS senstivie to XSDK_ENABLE_<LANG>
instead of just setting it based on ${PROJECT_NAME}_ENABLE_<LANG>
#121
Labels
XSDK_ENABLE_<LANG>
instead of just setting it based on ${PROJECT_NAME}_ENABLE_<LANG>
#121
Currently, TriBITS just sets:
before it includes
XSDKDefaults.cmake
. However, it seems that from this discussion and it is implied in this specification, that users expect to be able to setXSDK_ENABLE_<LANG>=[ON|OFF]
at configure time and have that respected.But if we want TriBITS to be sensitive to the value
XSDK_ENABLE_<LANG>
set by the user (and not just overwrite it), then we have a problem. The issue is that ifXSDK_ENABLE_<LANG>
and${PROJECT_NAME}_ENABLE_<LANG>
are both set, but disagree, then what should happen? (This is a problem with duplicated variables in CMake. These are just global variables that can be set in a variety of ways in a variety of places and it is hard to address inconsistencies like this. So I might need some advice on the best way to handle this.)Note that the general policy in TriBITS is that when an enable and a disable are inconsistent, then disables trump enables. If we follow this policy in this case, then if
XSDK_ENABLE_<LANG>=OFF
or${PROJECT_NAME}_ENABLE_<LANG>=OFF
are set, then<LANG>
will be disabled (and if the other isON
, then aNOTE
will be printed stating what happened.) The downside is that if someone setsXSDK_ENABLE_<LANG>=ON
, but somewhere elseTrilinos_ENABLE_<LANG>=OFF
is set, then<LANG>
will be off. That might make some people crazy. But if they just grep the CMake STDOUT they will see thatXSDK_ENABLE_<LANG>
got set to false and why.The text was updated successfully, but these errors were encountered: