Hello,<br><br>I have a CMake project with a few sub-projects to be built as well. In one of the sub projects I want to compile to a shared object. I used the line <br><br>
<style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#808000">add_library</span>(myfiles<span style="color:#c0c0c0"> </span>SHARED<span style="color:#c0c0c0"> </span>myfiles.c<span style="color:#c0c0c0"></span><span style="color:#c0c0c0"></span>)</pre>
<br>in the main project&#39;s CMakeLists.txt I have <br><br>
<style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#808000">SET</span>(CMAKE_C_FLAGS_DEBUG<span style="color:#c0c0c0"> </span><span style="color:#008000">&quot;-g</span><span style="color:#c0c0c0"> </span><span style="color:#008000">-fPIC</span><span style="color:#c0c0c0"> </span><span style="color:#008000">-O0</span><span style="color:#c0c0c0"> </span><span style="color:#008000">-pipe</span><span style="color:#c0c0c0"> </span><span style="color:#008000">-std=c99</span><span style="color:#c0c0c0"> </span><span style="color:#008000">-wOff</span><span style="color:#c0c0c0"></span><span style="color:#008000"></span><span style="color:#c0c0c0"></span><span style="color:#008000"></span><span style="color:#c0c0c0"></span><span style="color:#008000">&quot;</span>)</pre>
<br><br>and yet I am getting an error that &quot;Off is not a file or directory&quot; because the compile line looks like:<br><br>
<style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<p style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,0)">usr/bin/gcc  -g -fPIC -O0 -pipe -std=c99 Off -dynamiclib -Wl,-headerpad_max_install_names   ....</span></p><p style="margin:0px;text-indent:0px"><br><span style="color:rgb(0,0,0)"></span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#000000">so it seems like cmake stripped off the -w from -wOff? Is this a bug? It doesnt seem to be a problem if I change the library to &quot;STATIC&quot; instead of SHARED</span><br>
</p>