I'm trying to use a superbuild to tightly control third party libraries for
an application. They will all be statically linked in the end (besides deps
like MPI that are effective system libraries). I have the following code in
the TPL's CMakeLists.txt that I am trying to link into the main application:

```cmake
# Make VTKmofo static library
add_library(vtkmofo STATIC ${VTKmofo_sources})

# Tell CMake where to put vtkmofo .mod files generated with libvtkmofo
set_property(TARGET vtkmofo
  PROPERTY
  Fortran_MODULE_DIRECTORY ${VTKmofo_mod_dir})

# Tell consumers where to find .mod files
target_include_directories(vtkmofo PUBLIC
  $<BUILD_INTERFACE:${VTKmofo_mod_dir}>
  $<INSTALL_INTERFACE:include/vtkmofo/mod>
  )

install(TARGETS vtkmofo DESTINATION lib EXPORT vtkmofo-targets)
install(EXPORT vtkmofo-targets DESTINATION lib/vtkmofo)
install(DIRECTORY "${VTKmofo_mod_dir}" DESTINATION include/vtkmofo) # i.e.,
include/vtkmofo/mod/*.mod
```

In the other main project I have:

```cmake
include("${VTKmofo_ROOT}/lib/vtkmofo/vtkmofo-targets.cmake")
...
target_link_libraries(FrapUtility PUBLIC Math MatLib vars ECI Coolant
vtkmofo)
```

Through transitive properties I would expect that the sources for
FrapUtility (all modern Fortran sources) would get the
`-I.../include/vtkmofo/mod` flag passed during compilation. Am I missing
something?


Thanks,
Zaak

Izaak "Zaak" Beekman

-------------------------------------------------------------------------------

HPC Scientist
ParaTools Inc. <http://www.paratools.com/>
1509 16th St, NW
Washington, DC 20036
mobile: (917) 797-3239
-------------------------------------------------------------------------------
-- 

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