[CMake] setting clrsupport VS2010

Swetha Sharma swetha.bsharma at gmail.com
Wed Oct 19 06:08:45 EDT 2016


I am trying to create a managed c++ code , i want to thes clrsupport to be
true from cmake. Below is the script which  i have used

SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/clr")
 STRING(REPLACE "/EHsc" "/EHa" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
 STRING(REPLACE "/RTC1" "" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /clr")

The problem I've found, is that while CMake sets the "Common Language
RunTime Support" option in the C/C++ section of the configuration properties
if "/clr" is in the CXX_FLAGS, it does not set the "Common Language RunTime
Support" in the general configuration properties, and that causes problems
with linking/.NET references.


How do I fix this issue?
-swetha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20161019/ab57b5cb/attachment.html>


More information about the CMake mailing list