diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index dee654465..75b189286 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -74,8 +74,7 @@ define_opt(USE_GEN "Enable generic tracer module" OFF) define_opt(USE_AGE "Enable age tracer module" OFF) define_opt(ICM_PH "Enable pH module in ICM" OFF) define_opt(USE_DVD "Enable DVD module" OFF) - - +define_opt(BLD_STANDALONE "Standalone build mode" ON) if(NOT DEFINED TVD_LIM) message(WARNING "TVD_LIM must be provided, either in the cache. It must be one of SB, VL, MM or OS for Superbee, Van Leer, Minmod, or Osher. Default is VL") @@ -120,39 +119,41 @@ endif (CMAKE_C_FLAGS) include_directories(${MPI_C_INCLUDE_PATH}) ########### NetCDF Dependency is handled here because so many libraries use it ############## -message(STATUS "\n### Configuring NetCDF ") -#set(NetCDF_DIR "/usr/local/dms/pkg/netcdf/4.1.3-intel12.0-parallel") -if( NOT DEFINED NetCDF_DIR AND DEFINED NETCDF_DIR) - message(WARNING "Note the mixed case of NetCDF_DIR if you put it in your cache. This CMake variable is mixed case, different from the typical environment NETCDF_DIR. Proceeding anyway.") - set(NetCDF_C_DIR ${NETCDF_C_DIR}) -endif() - -if( NOT DEFINED NetCDF_C_DIR AND ($ENV{NETCDF_C_DIR} MATCHES ".+") ) - message(STATUS "Using NETCDF_C_DIR location from environment.") - set(NetCDF_C_DIR $ENV{NETCDF_C_DIR}) -endif() - -if( NOT DEFINED NetCDF_FORTRAN_DIR AND ($ENV{NETCDF_FORTRAN_DIR} MATCHES ".+") ) - message(STATUS "Using NETCDF_FORTRAN_DIR location from environment.") - set(NetCDF_FORTRAN_DIR $ENV{NETCDF_FORTRAN_DIR}) +if (BLD_STANDALONE) + message(STATUS "\n### Configuring NetCDF ") + #set(NetCDF_DIR "/usr/local/dms/pkg/netcdf/4.1.3-intel12.0-parallel") + if( NOT DEFINED NetCDF_DIR AND DEFINED NETCDF_DIR) + message(WARNING "Note the mixed case of NetCDF_DIR if you put it in your cache. This CMake variable is mixed case, different from the typical environment NETCDF_DIR. Proceeding anyway.") + set(NetCDF_C_DIR ${NETCDF_C_DIR}) + endif() + + if( NOT DEFINED NetCDF_C_DIR AND ($ENV{NETCDF_C_DIR} MATCHES ".+") ) + message(STATUS "Using NETCDF_C_DIR location from environment.") + set(NetCDF_C_DIR $ENV{NETCDF_C_DIR}) + endif() + + if( NOT DEFINED NetCDF_FORTRAN_DIR AND ($ENV{NETCDF_FORTRAN_DIR} MATCHES ".+") ) + message(STATUS "Using NETCDF_FORTRAN_DIR location from environment.") + set(NetCDF_FORTRAN_DIR $ENV{NETCDF_FORTRAN_DIR}) + endif() + + find_package(NetCDF REQUIRED COMPONENTS ${comp_lang_list}) + if(NetCDF_NEEDS_HDF5) + set( HDF5_USE_STATIC_LIBRARIES 1 ) + find_package(HDF5 COMPONENTS C REQUIRED) + # link_directories is bad cmake form, and was used because I would have had to add a lot to 2.6 to get the magic + # these next couple lines can be removed if we uniformly require cmake 2.8 + set( HDF_LIB_NAMES "hdf5_hl;hdf5;z" ) + link_directories( ${HDF5_LIBRARY_DIRS} ) + if(HDF5_FOUND) + message(STATUS "HDF5 found") + endif(HDF5_FOUND) + endif(NetCDF_NEEDS_HDF5) + include_directories( ${NetCDF_INCLUDE_DIRS} ) + + set (NetCDFLIBS ${NetCDF_LIBRARIES} ${HDF_LIB_NAMES}) endif() -find_package(NetCDF REQUIRED COMPONENTS ${comp_lang_list}) -if(NetCDF_NEEDS_HDF5) - set( HDF5_USE_STATIC_LIBRARIES 1 ) - find_package(HDF5 COMPONENTS C REQUIRED) - # link_directories is bad cmake form, and was used because I would have had to add a lot to 2.6 to get the magic - # these next couple lines can be removed if we uniformly require cmake 2.8 - set( HDF_LIB_NAMES "hdf5_hl;hdf5;z" ) - link_directories( ${HDF5_LIBRARY_DIRS} ) - if(HDF5_FOUND) - message(STATUS "HDF5 found") - endif(HDF5_FOUND) -endif(NetCDF_NEEDS_HDF5) -include_directories( ${NetCDF_INCLUDE_DIRS} ) - -set (NetCDFLIBS ${NetCDF_LIBRARIES} ${HDF_LIB_NAMES}) - # this might help to use old or pre-compiled GOTM versions: #if (USE_GOTM) # if (NOT DEFINED GOTM_DIR) @@ -171,25 +172,23 @@ set (NetCDFLIBS ${NetCDF_LIBRARIES} ${HDF_LIB_NAMES}) ########### Put each type of output (exe, libraries, modules) in the normal places ### This file is untested for compilers with no output module directory option -message(STATUS "\n### Assigning output directories for binaries (bin), modules (include) and libraries (lib)") -if( CMAKE_Fortran_MODDIR_FLAG) +if (BLD_STANDALONE) + message(STATUS "\n### Assigning output directories for binaries (bin), modules (include) and libraries (lib)") + if( CMAKE_Fortran_MODDIR_FLAG) SET( CMAKE_Fortran_MODULE_DIRECTORY ${PROJECT_BINARY_DIR}/include CACHE PATH "Output location for include files and fortran modules") - include_directories("${CMAKE_Fortran_MODULE_DIRECTORY}") -endif(CMAKE_Fortran_MODDIR_FLAG) - -set ( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin - CACHE PATH "Output Directory for executables." - ) + include_directories("${CMAKE_Fortran_MODULE_DIRECTORY}") + endif(CMAKE_Fortran_MODDIR_FLAG) -set ( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib - CACHE PATH "Output Directory for all static libraries." - ) + set ( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin + CACHE PATH "Output Directory for executables.") -set ( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib - CACHE PATH "Output Directory for all shared libraries." - ) + set ( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib + CACHE PATH "Output Directory for all static libraries.") + set ( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib + CACHE PATH "Output Directory for all shared libraries.") +endif() ########### Process libraries ###### message(STATUS "\n### Adding enabled libraries to project") ###### @@ -344,19 +343,18 @@ endif(GOTM_BASE) endif(USE_GOTM) ######## Main executable ####### -message(STATUS "\n### Configuring Driver") -add_subdirectory( Driver ) - -get_property(all_define_options GLOBAL PROPERTY DEFINE-LIST) -message(STATUS "All defines: ${all_define_options}") -# Now that the list of global options are accumulated, apply it on all the directories -foreach (moddir ${schismmoddirs} "Driver") - set_property( DIRECTORY ${moddir} APPEND PROPERTY COMPILE_DEFINITIONS ${all_define_options} ${all_use_mod_defs}) -endforeach() - - +if (BLD_STANDALONE) + message(STATUS "\n### Configuring Driver") + add_subdirectory( Driver ) + + get_property(all_define_options GLOBAL PROPERTY DEFINE-LIST) + message(STATUS "All defines: ${all_define_options}") + # Now that the list of global options are accumulated, apply it on all the directories + foreach (moddir ${schismmoddirs} "Driver") + set_property( DIRECTORY ${moddir} APPEND PROPERTY COMPILE_DEFINITIONS ${all_define_options} ${all_use_mod_defs}) + endforeach() +endif() ######## Utilities ######## message(STATUS "\n### Configuring Utilities") add_subdirectory( Utility ) - diff --git a/src/Utility/CMakeLists.txt b/src/Utility/CMakeLists.txt index daca4fd73..a640b30af 100644 --- a/src/Utility/CMakeLists.txt +++ b/src/Utility/CMakeLists.txt @@ -1,19 +1,11 @@ - add_custom_target(utility) -add_subdirectory( UtilLib) -add_subdirectory( Combining_Scripts ) -add_subdirectory( Post-Processing-Fortran ) -add_subdirectory( Pre-Processing ) -add_subdirectory( Tides ) -add_subdirectory( OneWayNestScripts ) -add_subdirectory( Particle_Tracking ) -add_subdirectory( Gen_Hotstart ) -add_subdirectory( Grid_Scripts) - -add_dependencies(utility utillib) - - -# Currently a link problem with NCOM -# add_subdirectory( NCOM ) -#add_subdirectory( ArcGIS ) +add_subdirectory(UtilLib) +add_subdirectory(Combining_Scripts) +add_subdirectory(Post-Processing-Fortran) +add_subdirectory(Pre-Processing) +add_subdirectory(Tides) +add_subdirectory(OneWayNestScripts) +add_subdirectory(Particle_Tracking) +add_subdirectory(Gen_Hotstart) +add_subdirectory(Grid_Scripts) diff --git a/src/Utility/Combining_Scripts/CMakeLists.txt b/src/Utility/Combining_Scripts/CMakeLists.txt index 916c6f695..bba856211 100644 --- a/src/Utility/Combining_Scripts/CMakeLists.txt +++ b/src/Utility/Combining_Scripts/CMakeLists.txt @@ -1,15 +1,16 @@ message(STATUS "In /Utility NetCDF_LIBS ${NetCDFLIBS}") add_definitions(${C_PREPROCESS_FLAG}) -add_executable( combine_gr3 combine_gr3.f90 ) -#add_executable( combine_outHA combine_outHA.f90 ) -add_executable( combine_hotstart7 combine_hotstart7.f90 ) -##add_executable( combine_output10 combine_output10.f90 netcdf_var_names.f90) -add_executable( combine_output11 combine_output11.f90 netcdf_var_names.f90) -target_link_libraries (combine_hotstart7 utillib ${NetCDFLIBS} ${HDF5_LIBRARIES}) -##target_link_libraries (combine_output10 utillib ${NetCDFLIBS} ${HDF5_LIBRARIES} ) -target_link_libraries (combine_output11 utillib ${NetCDFLIBS} ${HDF5_LIBRARIES} ) +add_executable(combine_gr3 combine_gr3.f90) +add_executable(combine_hotstart7 combine_hotstart7.f90) +add_executable(combine_output11 combine_output11.f90 netcdf_var_names.f90) +target_link_libraries(combine_hotstart7 utillib ${NetCDFLIBS} ${HDF5_LIBRARIES}) +target_link_libraries(combine_output11 utillib ${NetCDFLIBS} ${HDF5_LIBRARIES}) -add_dependencies(utility combine_gr3 combine_hotstart7 combine_output11) +target_include_directories(combine_hotstart7 PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../UtilLib) +target_include_directories(combine_output11 PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../UtilLib) +add_dependencies(combine_gr3 utillib) +add_dependencies(combine_hotstart7 utillib) +add_dependencies(combine_output11 utillib) diff --git a/src/Utility/Gen_Hotstart/CMakeLists.txt b/src/Utility/Gen_Hotstart/CMakeLists.txt index 9c7844d6d..e96106335 100644 --- a/src/Utility/Gen_Hotstart/CMakeLists.txt +++ b/src/Utility/Gen_Hotstart/CMakeLists.txt @@ -1,19 +1,17 @@ message(STATUS "In Utility/Gen_Hotstart") -add_executable( convert_hotstart_nc convert_hotstart_nc.f90 ) +# set list of files +set(gen_hotstart_file_list + convert_hotstart_nc.f90 + gen_hot_3Dth_from_hycom.f90 + gen_hot_from_hycom.f90 + gen_3Dth_from_hycom.f90) -# Removed from cmake because it contains huge arrays and kind of forces mcmodel=medium and doesn't -# necessarily compile gracefully even with that. Below are some flags to add these things on a -# file specific basis, but that isn't working yet. -add_executable( gen_hot_3Dth_from_hycom gen_hot_3Dth_from_hycom.f90) -add_executable( gen_hot_from_hycom gen_hot_from_hycom.f90) -add_executable( gen_3Dth_from_hycom gen_3Dth_from_hycom.f90) -# target_compile_options(gen_hot_3Dth_from_hycom PRIVATE "-O2 -CB -mcmodel=medium") -# target_link_options(gen_hot_3Dth_from_hycom PRIVATE "-mcmodel=medium -CB") - -target_link_libraries (convert_hotstart_nc utillib ${NetCDFLIBS} ${HDF5_LIBRARIES} ) -target_link_libraries (gen_hot_3Dth_from_hycom utillib ${NetCDFLIBS} ${HDF5_LIBRARIES} ) -target_link_libraries (gen_hot_from_hycom utillib ${NetCDFLIBS} ${HDF5_LIBRARIES} ) -target_link_libraries (gen_3Dth_from_hycom utillib ${NetCDFLIBS} ${HDF5_LIBRARIES} ) - -add_dependencies(utility convert_hotstart_nc gen_hot_3Dth_from_hycom gen_hot_from_hycom gen_3Dth_from_hycom) +# define executables and their dependencies +foreach(f ${gen_hotstart_file_list}) + get_filename_component(fwe ${f} NAME_WE) + add_executable(${fwe} ${f}) + target_include_directories(${fwe} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../UtilLib) + target_link_libraries(${fwe} utillib ${NetCDFLIBS} ${HDF5_LIBRARIES}) + add_dependencies(${fwe} utillib) +endforeach() diff --git a/src/Utility/Grid_Scripts/CMakeLists.txt b/src/Utility/Grid_Scripts/CMakeLists.txt index 4c4583227..82525dcac 100644 --- a/src/Utility/Grid_Scripts/CMakeLists.txt +++ b/src/Utility/Grid_Scripts/CMakeLists.txt @@ -1,18 +1,17 @@ message(STATUS "In Utility/Grid_Scripts") -add_executable( cpp_bp cpp_bp.f90) -add_executable( cpp cpp.f90) -add_executable( arctic_stereo arctic_stereo.f90) -add_executable( grid_spring grid_spring.f90) -add_executable( grid_subsampler grid_subsampler.f) -add_executable( interpolate_depth_structured2 interpolate_depth_structured2.f90) -add_executable( interpolate_unstructured interpolate_unstructured.f90) -add_executable( periodic_grid periodic_grid.f90) -add_executable( gen_boundary_global gen_boundary_global.f90) -add_executable( check_lonlat_grid check_lonlat_grid.f90) -add_executable( mergegrid5 mergegrid5.f90) - -target_link_libraries (mergegrid5 utillib) -#mpi_wrap( combine_output6 combine_output5 combine_output4 ) -#add_dependencies(utility cpp_bp cpp grid_spring grid_subsampler interpolate_unstructured periodic_grid gen_boundary_global check_lonlat_grid mergegrid5) +add_executable(cpp_bp cpp_bp.f90) +add_executable(cpp cpp.f90) +add_executable(arctic_stereo arctic_stereo.f90) +add_executable(grid_spring grid_spring.f90) +add_executable(grid_subsampler grid_subsampler.f) +add_executable(interpolate_depth_structured2 interpolate_depth_structured2.f90) +add_executable(interpolate_unstructured interpolate_unstructured.f90) +add_executable(periodic_grid periodic_grid.f90) +add_executable(gen_boundary_global gen_boundary_global.f90) +add_executable(check_lonlat_grid check_lonlat_grid.f90) +add_executable(mergegrid5 mergegrid5.f90) +target_link_libraries(mergegrid5 utillib) +target_include_directories(mergegrid5 PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../UtilLib) +add_dependencies(mergegrid5 utillib) diff --git a/src/Utility/OneWayNestScripts/CMakeLists.txt b/src/Utility/OneWayNestScripts/CMakeLists.txt index e1c74f686..2b859b1fe 100644 --- a/src/Utility/OneWayNestScripts/CMakeLists.txt +++ b/src/Utility/OneWayNestScripts/CMakeLists.txt @@ -1,10 +1,14 @@ - -add_executable(interpolate_variables7 interpolate_variables7.f90 ) +add_executable(interpolate_variables7 interpolate_variables7.f90) add_executable(timeint_3Dth2 timeint_3Dth2.f90) +add_executable(interpolate_variables8 interpolate_variables8.f90) + +add_dependencies(interpolate_variables7 utillib) +add_dependencies(timeint_3Dth2 utillib) +add_dependencies(interpolate_variables8 utillib) + +target_link_libraries(interpolate_variables8 utillib ${NetCDFLIBS} ${HDF5_LIBRARIES}) +target_include_directories(interpolate_variables8 PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../UtilLib) -add_dependencies(utility interpolate_variables7 timeint_3Dth2) -target_link_libraries(interpolate_variables7 utillib ${NetCDFLIBS} ${HDF5_LIBRARIES} ) +target_link_libraries(interpolate_variables7 utillib ${NetCDFLIBS} ${HDF5_LIBRARIES}) +target_include_directories(interpolate_variables7 PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../UtilLib) -add_executable(interpolate_variables8 interpolate_variables8.f90 ) -add_dependencies(utility interpolate_variables8 timeint_3Dth2) -target_link_libraries(interpolate_variables8 utillib ${NetCDFLIBS} ${HDF5_LIBRARIES} ) diff --git a/src/Utility/Particle_Tracking/CMakeLists.txt b/src/Utility/Particle_Tracking/CMakeLists.txt index 64b3590c7..9c1a50c5e 100644 --- a/src/Utility/Particle_Tracking/CMakeLists.txt +++ b/src/Utility/Particle_Tracking/CMakeLists.txt @@ -3,6 +3,6 @@ add_executable(ptrack4 ptrack4.f90) add_dependencies(utility ptrack3 ptrack4) target_link_libraries(ptrack3 utillib ${NetCDFLIBS} ${HDF5_LIBRARIES}) +target_include_directories(ptrack3 PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../UtilLib) target_link_libraries(ptrack4 utillib ${NetCDFLIBS} ${HDF5_LIBRARIES}) - - +target_include_directories(ptrack4 PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../UtilLib) diff --git a/src/Utility/Post-Processing-Fortran/CMakeLists.txt b/src/Utility/Post-Processing-Fortran/CMakeLists.txt index fce9f9bb7..32260cdfb 100644 --- a/src/Utility/Post-Processing-Fortran/CMakeLists.txt +++ b/src/Utility/Post-Processing-Fortran/CMakeLists.txt @@ -1,35 +1,27 @@ - add_definitions(${C_PREPROCESS_FLAG}) -add_executable( compute_alongchannel_vel compute_alongchannel_vel.f90) -add_executable( compute_average3 compute_average3.f90) -add_executable( compute_fluxes_ns compute_fluxes_ns.f90) -add_executable( extract_subregion2 extract_subregion2.f90) -add_executable( read_output8_allnodes read_output8_allnodes.f90) -add_executable( read_output9_transect read_output9_transect.f90) -add_executable( read_output9_xyt read_output9_xyt.f90) -add_executable( read_output9_xyz read_output9_xyz.f90) -add_executable( read_output9_xyzt read_output9_xyzt.f90) -add_executable( read_output10_allnodes read_output10_allnodes.f90) -add_executable( read_output10_xyz read_output10_xyz.f90) -add_executable( read_output10_transect read_output10_transect.f90) -add_executable( read_output10_xyt read_output10_xyt.f90) -add_executable( read_output10_xyzt read_output10_xyzt.f90) - - -target_link_libraries (compute_alongchannel_vel utillib ${NetCDFLIBS} ${HDF5_LIBRARIES} ) -target_link_libraries (compute_average3 utillib ${NetCDFLIBS} ${HDF5_LIBRARIES} ) -target_link_libraries (compute_fluxes_ns utillib ${NetCDFLIBS} ${HDF5_LIBRARIES}) -target_link_libraries (extract_subregion2 utillib ${NetCDFLIBS} ${HDF5_LIBRARIES}) -target_link_libraries (read_output8_allnodes utillib ${NetCDFLIBS} ${HDF5_LIBRARIES}) -target_link_libraries (read_output9_transect utillib ${NetCDFLIBS} ${HDF5_LIBRARIES}) -target_link_libraries (read_output9_xyt utillib ${NetCDFLIBS} ${HDF5_LIBRARIES}) -target_link_libraries (read_output9_xyz utillib ${NetCDFLIBS} ${HDF5_LIBRARIES}) -target_link_libraries (read_output9_xyzt utillib ${NetCDFLIBS} ${HDF5_LIBRARIES}) -target_link_libraries (read_output10_allnodes utillib ${NetCDFLIBS} ${HDF5_LIBRARIES}) -target_link_libraries (read_output10_xyz utillib ${NetCDFLIBS} ${HDF5_LIBRARIES}) -target_link_libraries (read_output10_xyt utillib ${NetCDFLIBS} ${HDF5_LIBRARIES}) -target_link_libraries (read_output10_xyzt utillib ${NetCDFLIBS} ${HDF5_LIBRARIES}) -target_link_libraries (read_output10_transect utillib ${NetCDFLIBS} ${HDF5_LIBRARIES}) -add_dependencies(utility compute_alongchannel_vel compute_average3 compute_fluxes_ns extract_subregion2 read_output8_allnodes read_output9_transect read_output9_xyt read_output9_xyz read_output9_xyzt read_output10_xyz) +# set list of files +set(post_processing_files + compute_alongchannel_vel.f90 + compute_average3.f90 + compute_fluxes_ns.f90 + extract_subregion2.f90 + read_output8_allnodes.f90 + read_output9_transect.f90 + read_output9_xyt.f90 + read_output9_xyz.f90 + read_output9_xyzt.f90 + read_output10_allnodes.f90 + read_output10_xyz.f90 + read_output10_transect.f90 + read_output10_xyt.f90 + read_output10_xyzt.f90) +# define executables, their dependencies and libraries that will be used in linking +foreach(f ${post_processing_files}) + get_filename_component(fwe ${f} NAME_WE) + add_executable(${fwe} ${f}) + target_link_libraries(${fwe} utillib ${NetCDFLIBS} ${HDF5_LIBRARIES}) + target_include_directories(${fwe} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../UtilLib) + add_dependencies(${fwe} utillib) +endforeach() diff --git a/src/Utility/Pre-Processing/CMakeLists.txt b/src/Utility/Pre-Processing/CMakeLists.txt index c456026e3..5848b0079 100644 --- a/src/Utility/Pre-Processing/CMakeLists.txt +++ b/src/Utility/Pre-Processing/CMakeLists.txt @@ -22,13 +22,43 @@ add_executable( manning manning.f90) add_executable( split_quads_wwm split_quads_wwm.f90) add_executable( viz_source viz_source.f90 ) -#target_link_libraries (create_dummy_zcor utillib ) -target_link_libraries (convert_3Dth_nc utillib ${NetCDFLIBS} ${HDF5_LIBRARIES}) -target_link_libraries (convert_nudge_nc utillib ${NetCDFLIBS} ${HDF5_LIBRARIES}) -target_link_libraries (gen_vqs_1 utillib ) -target_link_libraries (gen_vqs_2 utillib ) -target_link_libraries (gen_vqs_2masters utillib ) -target_link_libraries (gen_nudge_from_hycom utillib ${NetCDFLIBS} ${HDF5_LIBRARIES}) +# set list of files +set(utility_list + check_openbnd.f90 + convert_3Dth_nc.f90 + convert_nudge_nc.f90 + edit_vgrid.f90 + change_vgrid.f90 + fix_bad_quads.f90 + find_small_elem.f90 + gen_hdif.f90 + gen_nudge.f90 + gen_nudge2.f90 + gen_nudge_from_hycom.f90 + gen_slope_filter.f90 + gen_slope_filter2.f90 + gen_source.f90 + gen_vqs_1.f90 + gen_vqs_2.f90 + gen_vqs_2masters.f90 + list_bnd_pt.f90 + manning.f90 + split_quads_wwm.f90 + viz_source.f90 + viz_source_sink.f90) add_dependencies(utility check_openbnd convert_3Dth_nc convert_nudge_nc fix_bad_quads find_small_elem gen_hdif gen_vqs_1 gen_vqs_2 gen_vqs_2masters gen_nudge gen_nudge2 gen_nudge_from_hycom gen_slope_filter gen_slope_filter2 gen_source list_bnd_pt manning split_quads_wwm viz_source ) +# add extra libraries for linking +target_link_libraries(convert_3Dth_nc utillib ${NetCDFLIBS} ${HDF5_LIBRARIES}) +target_link_libraries(convert_nudge_nc utillib ${NetCDFLIBS} ${HDF5_LIBRARIES}) +target_link_libraries(gen_vqs_1 utillib) +target_link_libraries(gen_vqs_2 utillib) +target_link_libraries(gen_vqs_2masters utillib) +target_link_libraries(gen_nudge_from_hycom utillib ${NetCDFLIBS} ${HDF5_LIBRARIES}) + +# add include directories for linking +target_include_directories(gen_vqs_1 PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../UtilLib) +target_include_directories(gen_vqs_2 PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../UtilLib) +target_include_directories(gen_vqs_2masters PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../UtilLib) +target_include_directories(gen_nudge_from_hycom PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../UtilLib) diff --git a/src/Utility/Tides/CMakeLists.txt b/src/Utility/Tides/CMakeLists.txt index 4868da39d..118be88f9 100644 --- a/src/Utility/Tides/CMakeLists.txt +++ b/src/Utility/Tides/CMakeLists.txt @@ -1,6 +1,2 @@ -add_executable( gen_fg gen_fg.f90 ) - -#target_link_libraries (combine_hotstart7 utillib ${NetCDFLIBS} ${HDF5_LIBRARIES}) - -add_dependencies(utility gen_fg) - +add_executable(gen_fg gen_fg.f90) +add_dependencies(gen_fg utillib) diff --git a/src/Utility/UtilLib/CMakeLists.txt b/src/Utility/UtilLib/CMakeLists.txt index baf15adf8..1810f1cbf 100644 --- a/src/Utility/UtilLib/CMakeLists.txt +++ b/src/Utility/UtilLib/CMakeLists.txt @@ -1,9 +1,2 @@ ##### Create library and add to the list of compiled libraries - add_library(utillib schism_geometry.f90 compute_zcor.f90 extract_mod.f90 extract_mod2.f90 stripesearch_unstr.f90 argparse.f90 pt_in_poly_test.f90 interpolate_unstructured_module.f90) - - -add_dependencies(utility utillib) - - -