Browse Source

Merge pull request #630 from jcfr/fix-core-linking-on-freebsd

CTKCore: Generalize test checking if dl library is available.
Jean-Christophe Fillion-Robin 9 years ago
parent
commit
6437d4c5f4
1 changed files with 4 additions and 1 deletions
  1. 4 1
      Libs/Core/CMakeLists.txt

+ 4 - 1
Libs/Core/CMakeLists.txt

@@ -142,7 +142,10 @@ ctkMacroBuildLib(
   )
 
 # Needed for ctkBackTrace
-if(UNIX AND NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
+if(UNIX)
+  # FreeBSD: The same functionality that is in linux's libdl is provided in FreeBSD's libc
+  find_library(HAVE_LIBDL dl)
+  if(HAVE_LIBDL)
   target_link_libraries(${PROJECT_NAME} dl)
 elseif(WIN32 AND NOT MINGW)
   target_link_libraries(${PROJECT_NAME} dbghelp)