Commit 0784ad1 1 parent fa631bc commit 0784ad1 Copy full SHA for 0784ad1
File tree 1 file changed +4
-4
lines changed
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)
76
76
endforeach ()
77
77
78
78
#===== NetCDF =====
79
- pkg_check_modules(NetCDF REQUIRED netcdf)
79
+ pkg_check_modules(NetCDF REQUIRED IMPORTED_TARGET netcdf)
80
80
81
81
#===== NetCDF-Fortran =====
82
- pkg_check_modules(NetCDF_Fortran REQUIRED netcdf-fortran)
82
+ pkg_check_modules(NetCDF_Fortran REQUIRED IMPORTED_TARGET netcdf-fortran)
83
83
add_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} )
85
85
86
86
add_dependencies (cprnc genf90)
87
87
88
88
# Always use -fPIC
89
89
set_property (TARGET cprnc PROPERTY POSITION_INDEPENDENT_CODE ON )
90
90
target_link_libraries (cprnc
91
- PUBLIC ${NetCDF_Fortran_LIBRARIES} ${NetCDF_LIBRARIES} )
91
+ PUBLIC PkgConfig::NetCDF_Fortran PkgConfig::NetCDF )
92
92
93
93
# We do not want cprnc injecting ctests into parent projects
94
94
if (CPRNC_STANDALONE)
You can’t perform that action at this time.
0 commit comments