diff --git a/CMakeLists.txt b/CMakeLists.txt index 2948363106..c917219194 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1642,6 +1642,9 @@ endforeach() if(NC_LIBS) string(REPLACE ";" " " NC_LIBS "${NC_LIBS}") + string(REGEX REPLACE " -l[^ :]*::" " -l" NC_LIBS " ${NC_LIBS}") + string(REPLACE " -lHDF5" " -lhdf5" NC_LIBS "${NC_LIBS}") + string(REPLACE " -llibcurl" " -lcurl" NC_LIBS "${NC_LIBS}") endif() string(REPLACE ";" " " LINKFLAGS "${LINKFLAGS}")