Skip to content

Commit

Permalink
more changes suggested by hammpie
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Dec 4, 2024
1 parent fa631bc commit 0784ad1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,19 @@ foreach (SRC_FILE IN LISTS CPRNC_GenF90_SRCS)
endforeach ()

#===== NetCDF =====
pkg_check_modules(NetCDF REQUIRED netcdf)
pkg_check_modules(NetCDF REQUIRED IMPORTED_TARGET netcdf)

#===== NetCDF-Fortran =====
pkg_check_modules(NetCDF_Fortran REQUIRED netcdf-fortran)
pkg_check_modules(NetCDF_Fortran REQUIRED IMPORTED_TARGET netcdf-fortran)
add_executable (cprnc ${CPRNC_Fortran_SRCS} ${CPRNC_GenF90_SRCS})
target_include_directories(cprnc PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${NetCDF_Fortran_INCLUDE_DIRS})
target_include_directories(cprnc PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

add_dependencies (cprnc genf90)

# Always use -fPIC
set_property(TARGET cprnc PROPERTY POSITION_INDEPENDENT_CODE ON)
target_link_libraries (cprnc
PUBLIC ${NetCDF_Fortran_LIBRARIES} ${NetCDF_LIBRARIES})
PUBLIC PkgConfig::NetCDF_Fortran PkgConfig::NetCDF)

# We do not want cprnc injecting ctests into parent projects
if (CPRNC_STANDALONE)
Expand Down

0 comments on commit 0784ad1

Please sign in to comment.