<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 10, 2013 at 4:01 PM, Yngve Inntjore Levinsen <span dir="ltr"><<a href="mailto:yngve.levinsen@gmail.com" target="_blank">yngve.levinsen@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 bgcolor="#FFFFFF" text="#000000">
<div>If you set the CMAKE_Fortran_MODULE_DIRECTORY variable, then all
module files by default will be built into this folder. In our
case we set this to ${CMAKE_BINARY_DIR}/fortran. Since nothing
else is in this folder, you have a fairly good control over where
your mod files are if you want to install them afterwards... <br>
<br>
I haven't really tried to install these myself, but I would
imagine it should simply be<br>
install(DIRECTORY ${CMAKE_BINARY_DIR}/fortran DESTINATION
include/fortran/project)<br>
(or wherever you want the module files relative to the install
prefix.. Is there a correct place for them?)<br>
<br>
Hope this helps you along somewhat.</div></div></blockquote><div><br></div><div style>Yes, thanks! What I ended up doing is:</div><div style><br></div><div style>set(CMAKE_Fortran_MODULE_DIRECTORY $(CMAKE_BINARY_DIR}/mod_files)</div>
<div style>install(DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/ DESTINATION include)</div><div style><br></div><div style>With the trailing '/' on the DIRECTORY value, the mod_files directory is not copied to the include directory but only the things it contains. Is there a reason I shouldn't be using the CMAKE_Fortran_MODULE_DIRECTORY variable directly in the install command?</div>
</div></div></div>