[cmake-developers] [CMake 0016065]: Building CUDA files fails when compile definitions contains parenthesis

Mantis Bug Tracker mantis at public.kitware.com
Thu Apr 14 19:57:07 EDT 2016


The following issue has been SUBMITTED. 
====================================================================== 
https://cmake.org/Bug/view.php?id=16065 
====================================================================== 
Reported By:                Guillaume Dumont
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   16065
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2016-04-14 19:57 EDT
Last Modified:              2016-04-14 19:57 EDT
====================================================================== 
Summary:                    Building CUDA files fails when compile definitions
contains parenthesis
Description: 
When calling cuda_wrap_srcs with the OPTIONS argument or when adding compile
definitions via add_definitions the build fails when the definitions contain
parentheses. For example,

add_definitions("-DFOO_BAR_EXPORT=declspec\(dllimport\)")

generates:

set(nvcc_flags -DFOO_BAR_EXPORT=declspec(dllimport))

which makes the build fail. When the parentheses are escaped like so:

add_definitions("-DFOO_BAR_EXPORT=declspec\\\(dllimport\\\)")

we get:

set(nvcc_flags -DFOO_BAR_EXPORT=declspec\(dllimport\))

and everything is fine.

This is similar to issue: https://cmake.org/Bug/view.php?id=15919

Maybe a similar fix can be applied?
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2016-04-14 19:57 Guillaume DumontNew Issue                                    
======================================================================



More information about the cmake-developers mailing list