On 3/31/19 5:10 PM, Zaak Beekman wrote:
> What's the best approach for handling cross-platform (i.e., MSVS, Mac,
>  Linux) installation of Fortran module files associated with
> libraries?

The `install(DIRECTORY)` approach is the current recommendation.

> problems and drawbacks remain:
> 
> 1. With IDEs like MSVS, I always seem to end up getting an additional
> directory installed under ${CMAKE_INSTALL_INCLUDE_DIR} with the name
> of the build configuration (e.g., `debug`)

Do those directories contain the `.mod` files or are they extra?
In the latter case, use `install(DIRECTORY)`'s options for excluding
content by pattern or regex.

> 2. Utility/test modules may have generic names (e.g. assertions.mod)
> that probably should not get installed and will very likely lead to
> name  clashes with consuming projects

Set the per-target Fortran_MODULE_DIRECTORY property to keep private
modules out of the installed directory.

> 3. Lack of standard definition of module file format and Fortran ABI
> makes portability dicey, at least until ISO_Fortran_BINDING is widely
> available and adopted

That seems orthogonal.  It's a reason to not install them at all.

> It would be great if there were a target property that could be
> queried for associated module and submodule files.

We don't have that information at CMake time.  The set of files is
not discovered until the build, and there is no one place that has
the full set.

-Brad
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

Reply via email to