File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -76,19 +76,19 @@ foreach (SRC_FILE IN LISTS CPRNC_GenF90_SRCS)
7676endforeach ()
7777
7878#===== NetCDF =====
79- pkg_check_modules(NetCDF REQUIRED netcdf)
79+ pkg_check_modules(NetCDF REQUIRED IMPORTED_TARGET netcdf)
8080
8181#===== NetCDF-Fortran =====
82- pkg_check_modules(NetCDF_Fortran REQUIRED netcdf-fortran)
82+ pkg_check_modules(NetCDF_Fortran REQUIRED IMPORTED_TARGET netcdf-fortran)
8383add_executable (cprnc ${CPRNC_Fortran_SRCS} ${CPRNC_GenF90_SRCS} )
84- target_include_directories (cprnc PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${NetCDF_Fortran_INCLUDE_DIRS} )
84+ target_include_directories (cprnc PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} )
8585
8686add_dependencies (cprnc genf90)
8787
8888# Always use -fPIC
8989set_property (TARGET cprnc PROPERTY POSITION_INDEPENDENT_CODE ON )
9090target_link_libraries (cprnc
91- PUBLIC ${NetCDF_Fortran_LIBRARIES} ${NetCDF_LIBRARIES} )
91+ PUBLIC PkgConfig::NetCDF_Fortran PkgConfig::NetCDF )
9292
9393# We do not want cprnc injecting ctests into parent projects
9494if (CPRNC_STANDALONE)
You can’t perform that action at this time.
0 commit comments