Skip to content

Commit

Permalink
Try to do the right thing for linking netCDF::netcdf
Browse files Browse the repository at this point in the history
  • Loading branch information
dschwoerer committed Oct 21, 2024
1 parent 1fbc499 commit c1eea01
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -794,8 +794,15 @@ foreach (flag ${CONFIG_LDFLAGS_LIST})
# message("${flag} is a file")
set(_CONFIG_LDFLAGS "${_CONFIG_LDFLAGS} ${flag}")
else()
message("Fixing ${flag} to -l${flag}")
set(_CONFIG_LDFLAGS "${_CONFIG_LDFLAGS} -l${flag}")
string(FIND "${flag}" "::" hascolcol)
if (${hascolcol} EQUAL -1)
message("Fixing ${flag} to -l${flag}")
set(_CONFIG_LDFLAGS "${_CONFIG_LDFLAGS} -l${flag}")
else()
string(REGEX MATCH "[^:]*$" flag2 "${flag}")
message("Fixing ${flag} to -l${flag2}")
set(_CONFIG_LDFLAGS "${_CONFIG_LDFLAGS} -l${flag2}")
endif()
endif()
endif()
endforeach()
Expand Down

0 comments on commit c1eea01

Please sign in to comment.