Skip to content

Use namespaced CMake variables. Deprecated old values - #2070

Merged
umar456 merged 1 commit into
arrayfire:masterfrom
umar456:deprecate_vars
Feb 26, 2018
Merged

umar456 merged 1 commit into
arrayfire:masterfrom
umar456:deprecate_vars

Conversation

@umar456

@umar456 umar456 commented Feb 26, 2018 •

Copy link
Copy Markdown
Member

This commit deprecates the old CMake variables in favor of variables with AF_ prefix to avoid name conflicts with user code. If the old variables are used a warning is displayed and the new variable is set to the value. The old variable is unset to avoid showing the warning again.

@9prady9

9prady9 commented Feb 26, 2018

Copy link
Copy Markdown
Member

@umar456 Why are the below tests failing with this change? They don't fail anywhere usually.

gloh_nonfree_opencl
sift_nonfree_opencl

function(af_deprecate var newvar)
if(DEFINED ${var})
message(DEPRECATION "Variable ${var} is deprecated. Use ${newvar} instead.")
get_property(doc CACHE ${newvar} PROPERTY HELPSTRING)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is this doc defined ? Is it predefined ? I didn't find any reference to it in root cmake script or here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its the variable where the get_property command stores the HELPSTRING for the ${newvar} variable.

@9prady9

9prady9 commented Feb 26, 2018

Copy link
Copy Markdown
Member

Changes look good.

This commit deprecates the old CMake variables in favor of variables
that are namespaced with the AF_ prefix to avoid name conflicts with
user code. If the old variables are used a warning is displayed and
the new variable is set to the value. The old variable is unset to
avoid showing the warning again.
@umar456
umar456 merged commit e4e35df into arrayfire:master Feb 26, 2018
@mlloreda mlloreda added this to the v3.6.0 milestone Feb 26, 2018
@umar456
umar456 deleted the deprecate_vars branch May 2, 2018 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants