--- CMakeLists.txt.orig	2026-01-22 12:37:18 UTC
+++ CMakeLists.txt
@@ -615,7 +615,7 @@ ADD_DEFINITIONS(-DUSE_ARPACK)
 #FortranCInterface_VERIFY(CXX)
 
 # Set up rpaths to point ELMER_INSTALL_LIB_DIR
-IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+IF((${CMAKE_SYSTEM_NAME} MATCHES "Linux") OR (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD"))
   SET(ELMERSOLVER_RPATH_STRING "\$ORIGIN/../${ELMER_INSTALL_LIB_DIR}")
   SET(ELMERLIB_RPATH_STRING "\$ORIGIN/")
 ELSEIF(APPLE)
@@ -689,7 +689,7 @@ ADD_SUBDIRECTORY(fem)
 ADD_SUBDIRECTORY(fhutiter)
 ADD_SUBDIRECTORY(meshgen2d)
 ADD_SUBDIRECTORY(fem)
-ADD_SUBDIRECTORY(mathlibs)
+#ADD_SUBDIRECTORY(mathlibs)
 ADD_SUBDIRECTORY(elmergrid)
 ADD_SUBDIRECTORY(license_texts)
 
