<div dir="ltr">To enable compiling as/with CLR...<div><br></div><div><div>SET_TARGET_PROPERTIES(bag PROPERTIES <br></div></div><div><div>                  COMPILE_FLAGS  "/CLR" )</div></div><div># need to set unicode characters...</div><div><div><div><span class="" style="white-space:pre"> </span>add_definitions( -D_UNICODE -DUNICODE )</div></div><div><br></div><div>    string( REPLACE "/EHsc" "" CMAKE_CXX_FLAGS_INIT ${CMAKE_CXX_FLAGS_INIT} )</div><div>    string( REPLACE "/EHsc" "" CMAKE_C_FLAGS_INIT ${CMAKE_C_FLAGS_INIT} )</div><div>    string( REPLACE "/EHs" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS_INIT} )</div><div>    string( REPLACE "/EHs" "" CMAKE_C_FLAGS_INIT ${CMAKE_C_FLAGS_INIT} )</div><div>    string( REPLACE "/RTC1" "" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG} )</div><div>    # cannot set CLR for C code anyway; only C++</div><div>    #string( REPLACE "/RTC1" "/CLR" CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG} )</div><div><br></div><div><br></div><div>    set( FORCE_CXX ON )</div></div><div>force_cxx flag also forces compiling C as C++.....<br></div><div><div><br></div><div>set_source_files_properties(${_SOURCES} PROPERTIES LANGUAGE CXX )</div></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 5, 2014 at 1:11 PM, Apoorva Gaddagimath <span dir="ltr"><<a href="mailto:apoorva.gaddagimath@markit.com" target="_blank">apoorva.gaddagimath@markit.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal">Hi everyone,<u></u><u></u></p>
<p class="MsoNormal">I’m trying to add a .NET assembly reference to my CMake project. Various forums on Google suggested to use /clr.
<span style="color:black;background:white">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. Is there a different way to do this or a different approach> Would greatly appreciate any help on this.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black;background:white"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:black;background:white">Thanks</span><b><u></u><u></u></b></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">Apoorva Gaddagimath<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">Software Engineer<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">Markit On Demand<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif""><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">Markit<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif""><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">5718 Central Avenue<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">Boulder, CO 80301<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif""><a href="tel:%2B1%20720-648-4907" value="+17206484907" target="_blank">+1 720-648-4907</a><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif""><a href="mailto:apoorva.gaddagimath@markit.com" target="_blank">apoorva.gaddagimath@markit.com</a><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif""><a href="http://www.markit.com/" target="_blank">www.markit.com</a><u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<br>
<hr>
<font face="Arial" color="Black" size="1"><br>
This e-mail, including accompanying communications and attachments, is strictly confidential and only for the intended recipient. Any retention, use or disclosure not expressly authorised by Markit is prohibited. This email is subject to all waivers and other
 terms at the following link: <a href="http://www.markit.com/en/about/legal/email-disclaimer.page" target="_blank">http://www.markit.com/en/about/legal/email-disclaimer.page</a><br>
<br>
Please visit <a href="http://www.markit.com/en/about/contact/contact-us.page" target="_blank">http://www.markit.com/en/about/contact/contact-us.page</a> for contact information on our offices worldwide.<br>
</font>
</div>

<br>--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a><br></blockquote></div><br></div>