Hi,
when i was trying to build MG 3.7.1 on FreeBSD I ran into an odd error. libdl.so was not found. I've learned that on FreeBSD the functionality of libdl is offered by libc. So linking against libdl.so is Linux specific. CMake knows if it should link against libdl.so or not by using the variable: ${CMAKE_DL_LIBS} Please have a look on my patch and test it. I had no time to try it myself on Linux (MacOSX nor Windoze). I guess it should work on all platforms.
Btw. MegaGlest 3.7.1 is in the FreeBSD ports tree available. See:
http://www.freshports.org/search.php?query=megaglest--- ./source/shared_lib/CMakeLists.txt.orig 2012-11-25 00:19:10.000000000 +0000
+++ ./source/shared_lib/CMakeLists.txt 2012-11-25 00:12:01.000000000 +0000
@@ -124,7 +124,7 @@
FIND_PACKAGE(LUA REQUIRED)
INCLUDE_DIRECTORIES(${LUA_INCLUDE_DIR})
IF(UNIX)
- SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${LUA_LIBRARIES} "libdl.so")
+ SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${LUA_LIBRARIES} ${CMAKE_DL_LIBS})
ENDIF()
# ENDIF()