Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make TriBITS senstivie to XSDK_ENABLE_<LANG> instead of just setting it based on ${PROJECT_NAME}_ENABLE_<LANG> #121

Open
bartlettroscoe opened this issue May 20, 2016 · 0 comments

Comments

@bartlettroscoe
Copy link
Member

Currently, TriBITS just sets:

    SET(XSDK_ENABLE_C  ${${PROJECT_NAME}_ENABLE_C})
    SET(XSDK_ENABLE_CXX  ${${PROJECT_NAME}_ENABLE_CXX})
    SET(XSDK_ENABLE_Fortran  ${${PROJECT_NAME}_ENABLE_Fortran})

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 set XSDK_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 if XSDK_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 is ON, then a NOTE will be printed stating what happened.) The downside is that if someone sets XSDK_ENABLE_<LANG>=ON, but somewhere else Trilinos_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 that XSDK_ENABLE_<LANG> got set to false and why.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant