<div dir="ltr"><div><div>Hi Doron,<br><br></div>it would be helpful if you provided the error you're getting from add_library(), and also showed the exact CMake code you used.<br><br></div>Petr<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 25, 2015 at 1:57 PM, Doron Klepach <span dir="ltr"><<a href="mailto:klepachd@gmail.com" target="_blank">klepachd@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div>Hello there,<br><br></div>I am new to CMake and I am trying to convert a project to work with CMake.<br><br></div>As a part of the process I need to create a DLL from a FORTRAN code.<br><br></div>Here are some details:<br></div>*The code works on Visual Studio and creates the DLL as required.<br><br></div>*The main subroutine looks like this:<br><br><span style="color:rgb(0,0,255)">subroutine sub1(var1,var2 ...)<br><br>!DEC$ ATTRIBUTES DLLEXPORT      :: sub1<br><br>...<br><br></span></div><span style="color:rgb(0,0,255)">ens subroutine sub1</span><br><br></div>* I looked at the CMake command<br><pre><span style="color:rgb(0,0,255)"><span>add</span>_<span>library</span>(<name> [STATIC | SHARED | MODULE]
            [EXCLUDE_FROM_ALL]
            source1 [source2 ...])</span><br></pre><pre><font><span style="font-family:arial,helvetica,sans-serif">and tried the SHARED option, but that did not work, giving an error.<br><br></span></font></pre><pre><font><span style="font-family:arial,helvetica,sans-serif">* I looked at several sources for help, including <br><a href="http://www.kitware.com/blog/home/post/231" target="_blank">http://www.kitware.com/blog/home/post/231</a><br></span></font></pre><pre><font><span style="font-family:arial,helvetica,sans-serif">but I was not able to figure out how to create the DLL (the link to the example is not working)<br><br></span></font></pre><pre><font><span style="font-family:arial,helvetica,sans-serif">I would appreciate a simple example that shows how to do this.<br><br></span></font></pre><pre><font><span style="font-family:arial,helvetica,sans-serif">Thank you for your help,<br></span></font></pre><pre><font><span style="font-family:arial,helvetica,sans-serif">Doron<br></span></font></pre><br></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>