The answer turns out to be quite simple: cmake needs to be told to link with the DL libs, using ${CMAKE_DL_LIBS}
.
So, for any target that links with a library that uses dlopen, etc, invoke:
target_link_libraries(MY_TARGET LIB1 LIB2 ... LIBN ${CMAKE_DL_LIBS})
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…