Repository: bulletphysics/bullet3

Issue:
Unresolved externals in clew.c
```
src/Bullet3OpenCL/CMakeFiles/Bullet3OpenCL_clew.dir/__/clew/clew.o: In function `clewExit':
/usr/local/src/matthew/work-mit/bullet/src/clew/clew.c:120: undefined reference to `dlclose'
src/Bullet3OpenCL/CMakeFiles/Bullet3OpenCL_clew.dir/__/clew/clew.o: In function `clewInit':
/usr/local/src/matthew/work-mit/bullet/src/clew/clew.c:136: undefined reference to `dlopen'
/usr/local/src/matthew/work-mit/bullet/src/clew/clew.c:157: undefined reference to `dlsym'
/usr/local/src/matthew/work-mit/bullet/src/clew/clew.c:158: undefined reference to `dlsym'
/usr/local/src/matthew/work-mit/bullet/src/clew/clew.c:159: undefined reference to `dlsym'
/usr/local/src/matthew/work-mit/bullet/src/clew/clew.c:160: undefined reference to `dlsym'
/usr/local/src/matthew/work-mit/bullet/src/clew/clew.c:161: undefined reference to `dlsym'
src/Bullet3OpenCL/CMakeFiles/Bullet3OpenCL_clew.dir/__/clew/clew.o:/usr/local/src/matthew/work-mit/bullet/src/clew/clew.c:162: more undefined references to `dlsym' follow
src/Bullet3OpenCL/CMakeFiles/Bullet3OpenCL_clew.dir/__/clew/clew.o: In function `clewInit':
/usr/local/src/matthew/work-mit/bullet/src/clew/clew.c:150: undefined reference to `dlclose'
collect2: error: ld returned 1 exit status
```

...it's using libdl but not linking to it.



Discussion:

Patch:
diff --git a/src/Bullet3OpenCL/CMakeLists.txt b/src/Bullet3OpenCL/CMakeLists.txt
index e604a903fa..45df06ff68 100644
--- a/src/Bullet3OpenCL/CMakeLists.txt
+++ b/src/Bullet3OpenCL/CMakeLists.txt
@@ -45,7 +45,7 @@ ADD_LIBRARY(Bullet3OpenCL_clew ${Bullet3OpenCL_clew_SRCS} ${Bullet3OpenCL_clew_H
 SET_TARGET_PROPERTIES(Bullet3OpenCL_clew PROPERTIES VERSION ${BULLET_VERSION})
 SET_TARGET_PROPERTIES(Bullet3OpenCL_clew PROPERTIES SOVERSION ${BULLET_VERSION})
 IF (BUILD_SHARED_LIBS)
-  TARGET_LINK_LIBRARIES(Bullet3OpenCL_clew LinearMath Bullet3Dynamics)
+  TARGET_LINK_LIBRARIES(Bullet3OpenCL_clew LinearMath Bullet3Dynamics ${CMAKE_DL_LIBS})
 ENDIF (BUILD_SHARED_LIBS)