
# The list of all source files that are required to build the library
set(LIB_SRCS
  arrays.f90
  diagnostics.f90
  exports.f90
  filenames.f90
  gasmix.f90
  geometry.f90
  indices.f90
  math_utilities.f90
  other_consts.f90
  pressure_resistance_flow.f90
  solve.f90
  ventilation.f90
)

# Create an object library so we can use the objects in two different libraries
add_library(aether_obj OBJECT ${LIB_SRCS})
set_target_properties(aether_obj PROPERTIES
  Fortran_MODULE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Modules"
  POSITION_INDEPENDENT_CODE TRUE)

if (MSVC)
  # Visual Studio requires a dummy file as it will not build a library from only objects.
  set(dummy_file "${CMAKE_CURRENT_BINARY_DIR}/dummy.f90")
  file(WRITE ${dummy_file} "module dummy
implicit none
contains
end module dummy\n")
endif ()

# Create the aether fortran library
add_library(aether $<TARGET_OBJECTS:aether_obj> ${dummy_file})

set_target_properties(aether PROPERTIES
  Fortran_VISIBILITY_PRESET hidden
  C_VISIBILITY_PRESET hidden
  VISIBILITY_INLINES_HIDDEN 1)



# The list of all source files that are required to build the library
set(LIB_SRCS
  arrays.f90
  capillaryflow.f90
  diagnostics.f90
  exports.f90
  filenames.f90
  gasmix.f90
  geometry.f90
  indices.f90
  math_utilities.f90
  other_consts.f90
  pressure_resistance_flow.f90
  solve.f90
  ventilation.f90
)

# Create an object library so we can use the objects in two different libraries
add_library(aether_obj OBJECT ${LIB_SRCS})
set_target_properties(aether_obj PROPERTIES
  Fortran_MODULE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Modules"
  POSITION_INDEPENDENT_CODE TRUE)

if (MSVC)
  # Visual Studio requires a dummy file as it will not build a library from only objects.
  set(dummy_file "${CMAKE_CURRENT_BINARY_DIR}/dummy.f90")
  file(WRITE ${dummy_file} "module dummy
implicit none
contains
end module dummy\n")
endif ()

# Create the aether fortran library
add_library(aether $<TARGET_OBJECTS:aether_obj> ${dummy_file})

set_target_properties(aether PROPERTIES
  Fortran_VISIBILITY_PRESET hidden
  C_VISIBILITY_PRESET hidden
  VISIBILITY_INLINES_HIDDEN 1)


Add capillaryflow.f90 into list of files for aether library.
Add capillaryflow.f90 into list of files for aether library.
