Skip to content
Snippets Groups Projects
Commit 904d333c authored by Lionel GUEZ's avatar Lionel GUEZ
Browse files

Update to commit 1270b6a from cmake repository

parent 8f9cbcf7
No related branches found
No related tags found
No related merge requests found
list(APPEND CMAKE_MESSAGE_CONTEXT FindNetCDF_Fortran)
if (NOT TARGET NetCDF_Fortran::NetCDF_Fortran)
if (NOT TARGET NetCDF_Fortran::netcdff)
find_package(PkgConfig REQUIRED)
pkg_check_modules(NetCDF_Fortran REQUIRED IMPORTED_TARGET GLOBAL
pkg_check_modules(netcdff REQUIRED IMPORTED_TARGET GLOBAL
netcdf-fortran)
pkg_get_variable(netcdf_fortran_pcfiledir netcdf-fortran pcfiledir)
message(VERBOSE "Location of .pc file: ${netcdf_fortran_pcfiledir}")
message(VERBOSE
"NetCDF-Fortran include directories: ${NetCDF_Fortran_INCLUDE_DIRS}")
"NetCDF-Fortran include directories: ${netcdff_INCLUDE_DIRS}")
message(VERBOSE "NetCDF-Fortran libraries: ${NetCDF_Fortran_LINK_LIBRARIES}")
message(VERBOSE "NetCDF-Fortran libraries: ${netcdff_LINK_LIBRARIES}")
if(PKG_CONFIG_VERSION_STRING VERSION_LESS "0.29.2"
OR PKG_CONFIG_VERSION_STRING VERSION_GREATER "1.1")
......@@ -24,15 +24,15 @@ if (NOT TARGET NetCDF_Fortran::NetCDF_Fortran)
# Version > 1.1 means we are using pkgconf from pkgconf.org
pkg_get_variable(pkg_netcdf_fortran_includedir netcdf-fortran includedir)
target_include_directories(PkgConfig::NetCDF_Fortran INTERFACE
target_include_directories(PkgConfig::netcdff INTERFACE
${pkg_netcdf_fortran_includedir})
message(VERBOSE
"pkg_netcdf_fortran_includedir: ${pkg_netcdf_fortran_includedir}")
endif()
target_link_libraries(PkgConfig::NetCDF_Fortran INTERFACE NetCDF::NetCDF)
add_library(NetCDF_Fortran::NetCDF_Fortran ALIAS PkgConfig::NetCDF_Fortran)
target_link_libraries(PkgConfig::netcdff INTERFACE NetCDF::NetCDF)
add_library(NetCDF_Fortran::netcdff ALIAS PkgConfig::netcdff)
endif()
list(POP_BACK CMAKE_MESSAGE_CONTEXT)
......@@ -12,7 +12,7 @@ add_executable(inst_eddies inst_eddies.f90
target_link_libraries(inst_eddies PRIVATE contour_531 geometry
NetCDF95::netcdf95 shapelib_03 numer_rec_95 nr_util jumble
NetCDF_Fortran::NetCDF_Fortran)
NetCDF_Fortran::netcdff)
configure_file(inst_eddies_in.py inst_eddies.py @ONLY)
execute_process(COMMAND chmod -w ${CMAKE_CURRENT_BINARY_DIR}/inst_eddies.py)
......
......@@ -9,7 +9,7 @@ add_executable(test_get_1_outerm good_contour.f90
${PROJECT_SOURCE_DIR}/Common/shpc_close.f90)
target_link_libraries(test_get_1_outerm geometry NetCDF95::netcdf95 shapelib_03
contour_531 nr_util jumble NetCDF_Fortran::NetCDF_Fortran)
contour_531 nr_util jumble NetCDF_Fortran::netcdff)
# test_set_all_outerm
......@@ -24,7 +24,7 @@ add_executable(test_set_all_outerm
target_link_libraries(test_set_all_outerm PRIVATE geometry
NetCDF95::netcdf95 numer_rec_95 shapelib_03 contour_531 jumble
nr_util NetCDF_Fortran::NetCDF_Fortran)
nr_util NetCDF_Fortran::netcdff)
# test_good_contour
......@@ -33,7 +33,7 @@ add_executable(test_good_contour good_contour.f90
target_link_libraries(test_good_contour PRIVATE geometry
NetCDF95::netcdf95 shapelib_03 contour_531 jumble nr_util
NetCDF_Fortran::NetCDF_Fortran)
NetCDF_Fortran::netcdff)
# test_inside_4
......@@ -48,7 +48,7 @@ add_executable(test_mean_speed mean_speed.f90
${CMAKE_CURRENT_LIST_DIR}/test_mean_speed.f90)
target_link_libraries(test_mean_speed numer_rec_95 NetCDF95::netcdf95
shapelib_03 contour_531 nr_util NetCDF_Fortran::NetCDF_Fortran gpc_f jumble)
shapelib_03 contour_531 nr_util NetCDF_Fortran::netcdff gpc_f jumble)
# test_max_speed_contour_ssh
......@@ -59,7 +59,7 @@ add_executable(test_max_speed_contour_ssh
target_link_libraries(test_max_speed_contour_ssh PRIVATE fortranGIS
NetCDF95::netcdf95 contour_531 jumble nr_util
NetCDF_Fortran::NetCDF_Fortran)
NetCDF_Fortran::netcdff)
# test_nearby_extr
......@@ -82,7 +82,7 @@ add_executable(test_local_extrema local_extrema.f90
${PROJECT_SOURCE_DIR}/Tests/write_extr_map.f90)
target_link_libraries(test_local_extrema NetCDF95::netcdf95 nr_util
jumble NetCDF_Fortran::NetCDF_Fortran)
jumble NetCDF_Fortran::netcdff)
# test_set_max_speed
......@@ -100,4 +100,4 @@ add_executable(test_set_max_speed
target_link_libraries(test_set_max_speed geometry numer_rec_95
NetCDF95::netcdf95 shapelib_03 contour_531 jumble nr_util
NetCDF_Fortran::NetCDF_Fortran gpc_f)
NetCDF_Fortran::netcdff gpc_f)
......@@ -31,7 +31,7 @@ add_executable(test_read_snapshot
target_link_libraries(test_read_snapshot NetCDF95::netcdf95
shapelib_03 contour_531 gpc_f nr_util jumble
NetCDF_Fortran::NetCDF_Fortran)
NetCDF_Fortran::netcdff)
# test_spher_polygon_area
......@@ -82,7 +82,7 @@ add_executable(test_send_recv
target_link_libraries(test_send_recv PRIVATE MPI::MPI_Fortran
shapelib_03 ezmpi nr_util contour_531 gpc_f NetCDF95::netcdf95
jumble NetCDF_Fortran::NetCDF_Fortran)
jumble NetCDF_Fortran::netcdff)
# test_get_dispatch_snap
......@@ -102,4 +102,4 @@ add_executable(test_get_dispatch_snap
target_link_libraries(test_get_dispatch_snap shapelib_03 jumble
contour_531 ezmpi NetCDF95::netcdf95 gpc_f nr_util
NetCDF_Fortran::NetCDF_Fortran MPI::MPI_Fortran)
NetCDF_Fortran::netcdff MPI::MPI_Fortran)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment