Here are the needed patches for using cmake to compile MG on FreeBSD:
Index: source/glest_map_editor/CMakeLists.txt
===================================================================
--- source/glest_map_editor/CMakeLists.txt (Revision 1583)
+++ source/glest_map_editor/CMakeLists.txt (Arbeitskopie)
@@ -12,6 +12,11 @@
IF(NOT WIN32)
# It was noticed that when using MinGW gcc it is essential that 'core' is mentioned before 'base'.
+ IF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
+ SET(wxWidgets_CONFIG_OPTIONS --prefix=/usr/local)
+ MESSAGE(STATUS "Detected FreeBSD.....")
+ ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
+
FIND_PACKAGE(wxWidgets COMPONENTS core base gl REQUIRED)
# wxWidgets include (this will do all the magic to configure everything)
Index: source/shared_lib/sources/feathery_ftp/ftpTargetPosix.c
===================================================================
--- source/shared_lib/sources/feathery_ftp/ftpTargetPosix.c (Revision 1583)
+++ source/shared_lib/sources/feathery_ftp/ftpTargetPosix.c (Arbeitskopie)
@@ -26,7 +26,11 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
-#include <sys/sendfile.h>
+#ifdef __FreeBSD__
+ #include <sys/uio.h>
+#else
+ #include <sys/sendfile.h>
+#endif
#include <fcntl.h>
#include <sys/socket.h>
#include <netinet/in.h>
Index: mk/cmake/Modules/FindLUA.cmake
===================================================================
--- mk/cmake/Modules/FindLUA.cmake (Revision 1583)
+++ mk/cmake/Modules/FindLUA.cmake (Arbeitskopie)
@@ -13,19 +13,29 @@
# a generic (version-independent) include directory for LUA...
IF(LUA_INCLUDE_DIR AND LUA_LIBRARIES)
- SET(LUA_FIND_QUIETLY TRUE)
+ # SET(LUA_FIND_QUIETLY TRUE)
ENDIF(LUA_INCLUDE_DIR AND LUA_LIBRARIES)
FIND_PATH(LUA_INCLUDE_DIR NAMES lua.hpp
PATHS /usr/include
/usr/include/lua
/usr/include/lua5.1
+ IF(FreeBSD)
+ SET(PATHS "/usr/local/include/lua51")
+ ENDIF()
$ENV{LUA_HOME}
)
FIND_LIBRARY(LUA_LIBRARIES NAMES lua5.1 lua
- PATHS $ENV{LUA_HOME})
+ PATHS
+ IF(FreeBSD)
+ SET(PATHS "/usr/local/lib/lua51")
+ ENDIF()
+ $ENV{LUA_HOME})
+MESSAGE(STATUS "LUA_INC: ${LUA_INCLUDE_DIR}")
+MESSAGE(STATUS "LUA_LIB: ${LUA_LIBRARIES}")
+
IF(LUA_INCLUDE_DIR AND LUA_LIBRARIES)
SET(LUA_FOUND TRUE)
INCLUDE(CheckLibraryExists)
@Core developers
Please review it and apply it to the upstream code, if possible. Many Thx!